diff options
author | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2020-02-10 15:32:57 +0200 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2020-02-11 12:13:24 +0000 |
commit | 1d71e6ac17af40a20b1ef3f616b2ae9858ed0eab (patch) | |
tree | 77548f03c626ec77908bd3e47a844d9fe1cd34f4 /share/qtcreator/qml/qmlpuppet/commands | |
parent | 841f5be97eac3b8ad25901217b9420626c03720a (diff) |
QmlDesigner: Store tool state on per-scene basis
Tool state of the scene is linked to qml id of the scene root, so that
tool states are preserved through delete and undo, which causes
generation of new internal ids for instances.
Tool state storage doesn't currently survive changing of scene root
qml id, as tracking that isn't trivial. It's not enough to simply track
id change commands because model repurposes existing nodes when major
graph changes occur, causing unexpected id changes e.g. when
delete/undo is done.
Change-Id: I74d11ce47e86ce5d29796399c4a91b65980b1597
Fixes: QDS-1536
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Diffstat (limited to 'share/qtcreator/qml/qmlpuppet/commands')
-rw-r--r-- | share/qtcreator/qml/qmlpuppet/commands/createscenecommand.cpp | 4 | ||||
-rw-r--r-- | share/qtcreator/qml/qmlpuppet/commands/createscenecommand.h | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/share/qtcreator/qml/qmlpuppet/commands/createscenecommand.cpp b/share/qtcreator/qml/qmlpuppet/commands/createscenecommand.cpp index d35b98ca5d..0c69dc0aa4 100644 --- a/share/qtcreator/qml/qmlpuppet/commands/createscenecommand.cpp +++ b/share/qtcreator/qml/qmlpuppet/commands/createscenecommand.cpp @@ -40,7 +40,7 @@ CreateSceneCommand::CreateSceneCommand(const QVector<InstanceContainer> &instanc const QVector<AddImportContainer> &importVector, const QVector<MockupTypeContainer> &mockupTypeVector, const QUrl &fileUrl, - const QVariantMap &edit3dToolStates) + const QHash<QString, QVariantMap> &edit3dToolStates) : m_instanceVector(instanceContainer), m_reparentInstanceVector(reparentContainer), m_idVector(idVector), @@ -99,7 +99,7 @@ QUrl CreateSceneCommand::fileUrl() const return m_fileUrl; } -QVariantMap CreateSceneCommand::edit3dToolStates() const +QHash<QString, QVariantMap> CreateSceneCommand::edit3dToolStates() const { return m_edit3dToolStates; } diff --git a/share/qtcreator/qml/qmlpuppet/commands/createscenecommand.h b/share/qtcreator/qml/qmlpuppet/commands/createscenecommand.h index 0e8ec629b5..fbfd2d2d5f 100644 --- a/share/qtcreator/qml/qmlpuppet/commands/createscenecommand.h +++ b/share/qtcreator/qml/qmlpuppet/commands/createscenecommand.h @@ -54,7 +54,7 @@ public: const QVector<AddImportContainer> &importVector, const QVector<MockupTypeContainer> &mockupTypeVector, const QUrl &fileUrl, - const QVariantMap &edit3dToolStates); + const QHash<QString, QVariantMap> &edit3dToolStates); QVector<InstanceContainer> instances() const; QVector<ReparentContainer> reparentInstances() const; @@ -65,7 +65,7 @@ public: QVector<AddImportContainer> imports() const; QVector<MockupTypeContainer> mockupTypes() const; QUrl fileUrl() const; - QVariantMap edit3dToolStates() const; + QHash<QString, QVariantMap> edit3dToolStates() const; private: QVector<InstanceContainer> m_instanceVector; @@ -77,7 +77,7 @@ private: QVector<AddImportContainer> m_importVector; QVector<MockupTypeContainer> m_mockupTypeVector; QUrl m_fileUrl; - QVariantMap m_edit3dToolStates; + QHash<QString, QVariantMap> m_edit3dToolStates; }; QDataStream &operator<<(QDataStream &out, const CreateSceneCommand &command); |