diff options
author | Thomas Hartmann <thomas.hartmann@qt.io> | 2018-12-11 14:35:40 +0100 |
---|---|---|
committer | Tim Jenssen <tim.jenssen@qt.io> | 2018-12-18 09:15:21 +0000 |
commit | 6be16322123df2f21febe320d04b4804f3e6cdcc (patch) | |
tree | fd68dfd614c13f1aff290032ca36e5fd99ea5e80 /src | |
parent | e3ac997fd41059b68bc922d03c78a6543af75702 (diff) | |
download | qt-creator-6be16322123df2f21febe320d04b4804f3e6cdcc.tar.gz |
QmlDesigner: Set text editor to modified if auxiliaryData is changed
The auxiliaryData is stored in a meta comment when saving.
Therefore the document is modified, once an auxiliaryData is changed.
Change-Id: If27015b7904754bab4e5d4d50939d3d55469cc6b
Reviewed-by: Knud Dollereder <knud.dollereder@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/qmldesigner/designercore/include/rewriterview.h | 2 | ||||
-rw-r--r-- | src/plugins/qmldesigner/designercore/model/rewriterview.cpp | 11 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/plugins/qmldesigner/designercore/include/rewriterview.h b/src/plugins/qmldesigner/designercore/include/rewriterview.h index 51e88892ac..fa2147f9b6 100644 --- a/src/plugins/qmldesigner/designercore/include/rewriterview.h +++ b/src/plugins/qmldesigner/designercore/include/rewriterview.h @@ -109,6 +109,8 @@ public: void reactivateTextMofifierChangeSignals(); void deactivateTextMofifierChangeSignals(); + void auxiliaryDataChanged(const ModelNode &node, const PropertyName &name, const QVariant &data) override; + Internal::ModelNodePositionStorage *positionStorage() const; QList<DocumentMessage> warnings() const; diff --git a/src/plugins/qmldesigner/designercore/model/rewriterview.cpp b/src/plugins/qmldesigner/designercore/model/rewriterview.cpp index 80d9d37484..72f8ff1e3a 100644 --- a/src/plugins/qmldesigner/designercore/model/rewriterview.cpp +++ b/src/plugins/qmldesigner/designercore/model/rewriterview.cpp @@ -387,6 +387,17 @@ void RewriterView::deactivateTextMofifierChangeSignals() textModifier()->deactivateChangeSignals(); } +void RewriterView::auxiliaryDataChanged(const ModelNode &, const PropertyName &name, const QVariant &) +{ + if (name.endsWith("@NodeInstance")) + return; + + if (name.endsWith("@Internal")) + return; + + m_textModifier->textDocument()->setModified(true); +} + void RewriterView::applyModificationGroupChanges() { Q_ASSERT(transactionLevel == 0); |