diff options
author | Thomas Hartmann <thomas.hartmann@qt.io> | 2019-10-17 13:51:57 +0200 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@qt.io> | 2019-10-21 05:52:13 +0000 |
commit | 640044c8f8d7c290558c63c636be7821f9a8a223 (patch) | |
tree | 5ec8d9dba9e5324cc42268c1b4a76a7c6c9dda5b /share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp | |
parent | e7b481bdee9759a3dc5efc3d55400394654fc592 (diff) | |
download | qt-creator-640044c8f8d7c290558c63c636be7821f9a8a223.tar.gz |
QmlDesigner: Implement command for synchronising the selection
This patch implements the command and dispatchers for
synchronising the selection between Qt Creator and the qml2puppet.
Qt5InformationNodeInstanceServer::changeSelection() is called whenever the selection
is changed in Qt Creator.
Qt5InformationNodeInstanceServer::changeSelection() allows to change the
selection from the qml2puppet.
Change-Id: I73a64d8dc2a3f330433f966b42a10229cbbff649
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Diffstat (limited to 'share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp')
-rw-r--r-- | share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp index 2b644b5959..4754181a77 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp @@ -55,6 +55,7 @@ #include "createscenecommand.h" #include "tokencommand.h" #include "removesharedmemorycommand.h" +#include "changeselectioncommand.h" #include "dummycontextobject.h" @@ -147,6 +148,12 @@ bool Qt5InformationNodeInstanceServer::isDirtyRecursiveForParentInstances(QQuick return false; } +/* This method allows changing the selection from the puppet */ +void Qt5InformationNodeInstanceServer::selectInstance(const ServerNodeInstance &instance) +{ + nodeInstanceClient()->selectionChanged(createChangeSelectionCommand({instance})); +} + QObject *Qt5InformationNodeInstanceServer::findRootNodeOf3DViewport( const QList<ServerNodeInstance> &instanceList) const { @@ -358,4 +365,10 @@ void QmlDesigner::Qt5InformationNodeInstanceServer::removeSharedMemory(const Qml ValuesChangedCommand::removeSharedMemorys(command.keyNumbers()); } +void Qt5InformationNodeInstanceServer::changeSelection(const ChangeSelectionCommand &command) +{ + // keep track of selection. + qDebug() << Q_FUNC_INFO << command; +} + } // namespace QmlDesigner |