summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/qmldesigner/components/integration/designdocumentcontroller.cpp5
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/allpropertiesbox.cpp5
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/allpropertiesbox.h4
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp12
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/propertyeditor.h3
5 files changed, 27 insertions, 2 deletions
diff --git a/src/plugins/qmldesigner/components/integration/designdocumentcontroller.cpp b/src/plugins/qmldesigner/components/integration/designdocumentcontroller.cpp
index f9353f19b0..b791acb7ef 100644
--- a/src/plugins/qmldesigner/components/integration/designdocumentcontroller.cpp
+++ b/src/plugins/qmldesigner/components/integration/designdocumentcontroller.cpp
@@ -43,6 +43,7 @@
#include <navigatorview.h>
#include <stateseditorview.h>
#include <formeditorview.h>
+#include <propertyeditor.h>
#include <formeditorwidget.h>
#include <basetexteditmodifier.h>
#include <componenttextmodifier.h>
@@ -199,7 +200,6 @@ void DesignDocumentController::blockModelSync(bool block)
detachNodeInstanceView();
m_d->textModifier->deactivateChangeSignals();
} else {
- attachNodeInstanceView();
QmlModelState state;
//We go back to base state (and back again) to avoid side effects from text editing.
if (m_d->statesEditorView && m_d->statesEditorView->model()) {
@@ -212,6 +212,9 @@ void DesignDocumentController::blockModelSync(bool block)
if (state.isValid() && m_d->statesEditorView)
m_d->statesEditorView->setCurrentState(state);
+ attachNodeInstanceView();
+ if (m_d->allPropertiesBox->view())
+ m_d->allPropertiesBox->view()->resetView();
}
}
}
diff --git a/src/plugins/qmldesigner/components/propertyeditor/allpropertiesbox.cpp b/src/plugins/qmldesigner/components/propertyeditor/allpropertiesbox.cpp
index b7a4e33720..a8ad587674 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/allpropertiesbox.cpp
+++ b/src/plugins/qmldesigner/components/propertyeditor/allpropertiesbox.cpp
@@ -75,6 +75,11 @@ void AllPropertiesBox::setModel(Model* model)
m_d->propertiesEditor->model()->detachView(m_d->propertiesEditor);
}
+PropertyEditor* AllPropertiesBox::view() const
+{
+ return m_d->propertiesEditor;
+}
+
void AllPropertiesBox::showNewLook()
{
setCurrentIndex(m_newLookIndex);
diff --git a/src/plugins/qmldesigner/components/propertyeditor/allpropertiesbox.h b/src/plugins/qmldesigner/components/propertyeditor/allpropertiesbox.h
index a0aa641a2d..bbba6669b1 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/allpropertiesbox.h
+++ b/src/plugins/qmldesigner/components/propertyeditor/allpropertiesbox.h
@@ -40,6 +40,7 @@ namespace QmlDesigner {
class FormWindow;
class Model;
class ModelState;
+class PropertyEditor;
class AllPropertiesBox: public QStackedWidget
{
@@ -54,6 +55,9 @@ public:
void setModel(Model *model);
+ PropertyEditor* view() const;
+
+
private:
private:
diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp
index bd3319acd0..5a34346b29 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp
+++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp
@@ -806,6 +806,9 @@ void PropertyEditor::propertiesRemoved(const QList<AbstractProperty>& propertyLi
if (!m_selectedNode.isValid())
return;
+ if (!QmlObjectNode(m_selectedNode).isValid())
+ return;
+
foreach (const AbstractProperty &property, propertyList) {
ModelNode node(property.parentModelNode());
if (node == m_selectedNode || QmlObjectNode(m_selectedNode).propertyChangeForCurrentState() == node) {
@@ -825,6 +828,9 @@ void PropertyEditor::variantPropertiesChanged(const QList<VariantProperty>& prop
if (!m_selectedNode.isValid())
return;
+ if (!QmlObjectNode(m_selectedNode).isValid())
+ return;
+
foreach (const VariantProperty &property, propertyList) {
ModelNode node(property.parentModelNode());
@@ -844,6 +850,9 @@ void PropertyEditor::bindingPropertiesChanged(const QList<BindingProperty>& prop
if (!m_selectedNode.isValid())
return;
+ if (!QmlObjectNode(m_selectedNode).isValid())
+ return;
+
foreach (const BindingProperty &property, propertyList) {
ModelNode node(property.parentModelNode());
@@ -877,6 +886,9 @@ void PropertyEditor::nodeIdChanged(const ModelNode& node, const QString& newId,
if (!m_selectedNode.isValid())
return;
+ if (!QmlObjectNode(m_selectedNode).isValid())
+ return;
+
if (node == m_selectedNode) {
if (m_currentType) {
diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.h b/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.h
index 04db1f7029..9c4181021b 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.h
+++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.h
@@ -110,6 +110,8 @@ public:
void nodeIdChanged(const ModelNode& node, const QString& newId, const QString& oldId);
void scriptFunctionsChanged(const ModelNode &node, const QStringList &scriptFunctionList);
+ void resetView();
+
protected:
void timerEvent(QTimerEvent *event);
void otherPropertyChanged(const QmlObjectNode &, const QString &propertyName);
@@ -133,7 +135,6 @@ private: //functions
QString locateQmlFile(const QString &relativePath) const;
void select(const ModelNode& node);
- void resetView();
void delayedResetView();