diff --git a/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp b/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp index 3a5d5ea63f7a4f84ec6d87b928d9e7e27195b952..08e63291d53669b1ef49e70ca6e3f22cbeb991b9 100644 --- a/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp +++ b/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp @@ -651,9 +651,11 @@ bool FormEditorView::isMoveToolAvailable() const return true; } -void FormEditorView::stateChanged(const QmlModelState &newQmlModelState, const QmlModelState &oldQmlModelState) +void FormEditorView::actualStateChanged(const ModelNode &node) { - QmlModelView::stateChanged(newQmlModelState, oldQmlModelState); + QmlModelView::actualStateChanged(node); + + QmlModelState newQmlModelState(node); m_formEditorWidget->anchorToolAction()->setEnabled(newQmlModelState.isBaseState()); diff --git a/src/plugins/qmldesigner/components/formeditor/formeditorview.h b/src/plugins/qmldesigner/components/formeditor/formeditorview.h index 7b6bebdc64939233472f1873de0462209631754b..f08ad2c2f6833a35f8d910f073609c6340b1d99b 100644 --- a/src/plugins/qmldesigner/components/formeditor/formeditorview.h +++ b/src/plugins/qmldesigner/components/formeditor/formeditorview.h @@ -118,6 +118,8 @@ public: double spacing() const; void deActivateItemCreator(); + void actualStateChanged(const ModelNode &node); + public slots: void activateItemCreator(const QString &name); @@ -125,7 +127,6 @@ signals: void ItemCreatorDeActivated(); protected: - void stateChanged(const QmlModelState &newQmlModelState, const QmlModelState &oldQmlModelState); void reset(); protected slots: diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp index d494e90878047b3df41a14b3ccedbdfb11d46e79..7e7fad921c9f0b6269e8b403af48637abdcf9605 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp @@ -933,9 +933,11 @@ QWidget *PropertyEditor::widget() return m_stackedWidget; } -void PropertyEditor::stateChanged(const QmlModelState &newQmlModelState, const QmlModelState &oldQmlModelState) + +void PropertyEditor::actualStateChanged(const ModelNode &node) { - QmlModelView::stateChanged(newQmlModelState, oldQmlModelState); + QmlModelView::actualStateChanged(node); + QmlModelState newQmlModelState(node); Q_ASSERT(newQmlModelState.isValid()); if (debug) qDebug() << Q_FUNC_INFO << newQmlModelState.name(); diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.h b/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.h index d626b212463a6e044bbdde26388a1c331c5ed032..02a97954d23a55efb8d76e6b4e9571787ae53bc5 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.h +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.h @@ -111,12 +111,12 @@ public: void scriptFunctionsChanged(const ModelNode &node, const QStringList &scriptFunctionList); void resetView(); + void actualStateChanged(const ModelNode &node); protected: void timerEvent(QTimerEvent *event); void otherPropertyChanged(const QmlObjectNode &, const QString &propertyName); void transformChanged(const QmlObjectNode &qmlObjectNode, const QString &propertyName); - void stateChanged(const QmlModelState &newQmlModelState, const QmlModelState &oldQmlModelState); void setupPane(const QString &typeName); void setValue(const QmlObjectNode &fxObjectNode, const QString &name, const QVariant &value); diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp b/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp index e4cde53158767e4175abd825d3806fa7bef2f17a..277eb33189c5281e9337d4e0448e2a1322ea4871 100644 --- a/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp +++ b/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp @@ -308,14 +308,16 @@ void StatesEditorView::nodeInstancePropertyChanged(const ModelNode &node, const QmlModelView::nodeInstancePropertyChanged(node, propertyName); } -void StatesEditorView::stateChanged(const QmlModelState &newQmlModelState, const QmlModelState &oldQmlModelState) +void StatesEditorView::actualStateChanged(const ModelNode &node) { + QmlModelState newQmlModelState(node); + if (newQmlModelState.isBaseState()) { m_statesEditorWidget->setCurrentStateInternalId(0); } else { m_statesEditorWidget->setCurrentStateInternalId(newQmlModelState.modelNode().internalId()); } - QmlModelView::stateChanged(newQmlModelState, oldQmlModelState); + QmlModelView::actualStateChanged(node); } void StatesEditorView::transformChanged(const QmlObjectNode &qmlObjectNode, const QString &propertyName) diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditorview.h b/src/plugins/qmldesigner/components/stateseditor/stateseditorview.h index 3bfc7bb75cd6cad961d4f5a6d0de56a870d35373..89cd210752c07bd8bf7d3fa556afec8ff1cffdb9 100644 --- a/src/plugins/qmldesigner/components/stateseditor/stateseditorview.h +++ b/src/plugins/qmldesigner/components/stateseditor/stateseditorview.h @@ -67,7 +67,7 @@ public: // QmlModelView - void stateChanged(const QmlModelState &newQmlModelState, const QmlModelState &oldQmlModelState); + void actualStateChanged(const ModelNode &node); void transformChanged(const QmlObjectNode &qmlObjectNode, const QString &propertyName); void parentChanged(const QmlObjectNode &qmlObjectNode); void otherPropertyChanged(const QmlObjectNode &qmlObjectNode, const QString &propertyName); diff --git a/src/plugins/qmldesigner/designercore/include/qmlmodelview.h b/src/plugins/qmldesigner/designercore/include/qmlmodelview.h index d77bfbb6cb3e8396eda8771af54519d5e1ba17a6..ab36aa72111109f0afd360b68fc99bc251352a24 100644 --- a/src/plugins/qmldesigner/designercore/include/qmlmodelview.h +++ b/src/plugins/qmldesigner/designercore/include/qmlmodelview.h @@ -131,7 +131,6 @@ protected: virtual void transformChanged(const QmlObjectNode &qmlObjectNode, const QString &propertyName) ; virtual void parentChanged(const QmlObjectNode &qmlObjectNode); virtual void otherPropertyChanged(const QmlObjectNode &qmlObjectNode, const QString &propertyName); - virtual void stateChanged(const QmlModelState &newQmlModelState, const QmlModelState &oldQmlModelState); void activateState(const QmlModelState &state); diff --git a/src/plugins/qmldesigner/designercore/model/qmlmodelview.cpp b/src/plugins/qmldesigner/designercore/model/qmlmodelview.cpp index 97f1047615fb0469bc3abed7f85936fc589342eb..01b5215905502e70350763d6632609b3b4733aff 100644 --- a/src/plugins/qmldesigner/designercore/model/qmlmodelview.cpp +++ b/src/plugins/qmldesigner/designercore/model/qmlmodelview.cpp @@ -440,16 +440,8 @@ void QmlModelView::rewriterEndTransaction() } -void QmlModelView::actualStateChanged(const ModelNode &node) +void QmlModelView::actualStateChanged(const ModelNode & /*node*/) { - QmlModelState newState(node); - QmlModelState oldState = currentState(); - - if (!newState.isValid()) - newState = baseState(); - - if (newState != oldState) - stateChanged(newState, oldState); } @@ -480,8 +472,5 @@ void QmlModelView::otherPropertyChanged(const QmlObjectNode &/*qmlObjectNode*/, { } -void QmlModelView::stateChanged(const QmlModelState &/*newQmlModelState*/, const QmlModelState &/*oldQmlModelState*/) -{ -} } //QmlDesigner