Commit c2682f9b authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.PropertyEditor: Adding signal selectionToBeChanged



Controls can connect to this signal and commit data to the backend
before the slection changes.
This is required since editingFinished signals are usually triggered to
"late".

Change-Id: I99fa27064473ceee2d1a21b25f64a13370fb4cef
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@digia.com>
parent b5559e73
......@@ -437,6 +437,11 @@ bool PropertyEditorQmlBackend::checkIfUrlExists(const QUrl &url)
return (QFileInfo(fileFromUrl(url)).exists());
}
void PropertyEditorQmlBackend::emitSelectionToBeChanged()
{
m_backendModelNode.emitSelectionToBeChanged();
}
QUrl PropertyEditorQmlBackend::getQmlUrlForModelNode(const ModelNode &modelNode, TypeName &className)
{
if (modelNode.isValid()) {
......
......@@ -74,6 +74,8 @@ public:
static bool checkIfUrlExists(const QUrl &url);
void emitSelectionToBeChanged();
private:
void createPropertyEditorValue(const QmlObjectNode &qmlObjectNode,
const PropertyName &name, const QVariant &value,
......
......@@ -577,6 +577,9 @@ void PropertyEditorView::scriptFunctionsChanged(const ModelNode &/*node*/, const
void PropertyEditorView::select(const ModelNode &node)
{
if (m_qmlBackEndForCurrentType)
m_qmlBackEndForCurrentType->emitSelectionToBeChanged();
if (QmlObjectNode(node).isValid())
m_selectedNode = node;
else
......
......@@ -50,4 +50,9 @@ void QmlModelNodeProxy::registerDeclarativeType()
qmlRegisterType<QmlModelNodeProxy>("HelperWidgets",2,0,"ModelNodeProxy");
}
void QmlModelNodeProxy::emitSelectionToBeChanged()
{
emit selectionToBeChanged();
}
}
......@@ -47,8 +47,11 @@ public:
static void registerDeclarativeType();
void emitSelectionToBeChanged();
signals:
void selectionChanged();
void selectionToBeChanged();
public slots:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment