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 /src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.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 'src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp')
-rw-r--r-- | src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp b/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp index e7d60b25d2..c5b98bf325 100644 --- a/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp +++ b/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp @@ -41,6 +41,7 @@ #include <changestatecommand.h> #include <completecomponentcommand.h> #include <changenodesourcecommand.h> +#include <changeselectioncommand.h> #include <informationchangedcommand.h> #include <pixmapchangedcommand.h> @@ -278,6 +279,7 @@ void NodeInstanceServerProxy::dispatchCommand(const QVariant &command, PuppetStr static const int tokenCommandType = QMetaType::type("TokenCommand"); static const int debugOutputCommandType = QMetaType::type("DebugOutputCommand"); static const int puppetAliveCommandType = QMetaType::type("PuppetAliveCommand"); + static const int changeSelectionCommandType = QMetaType::type("ChangeSelectionCommand"); if (m_destructing) return; @@ -299,6 +301,8 @@ void NodeInstanceServerProxy::dispatchCommand(const QVariant &command, PuppetStr nodeInstanceClient()->token(command.value<TokenCommand>()); } else if (command.userType() == debugOutputCommandType) { nodeInstanceClient()->debugOutput(command.value<DebugOutputCommand>()); + } else if (command.userType() == changeSelectionCommandType) { + nodeInstanceClient()->selectionChanged(command.value<ChangeSelectionCommand>()); } else if (command.userType() == puppetAliveCommandType) { puppetAlive(puppetStreamType); } else if (command.userType() == synchronizeCommandType) { @@ -645,6 +649,11 @@ void NodeInstanceServerProxy::removeInstances(const RemoveInstancesCommand &comm writeCommand(QVariant::fromValue(command)); } +void NodeInstanceServerProxy::changeSelection(const ChangeSelectionCommand &command) +{ + writeCommand(QVariant::fromValue(command)); +} + void NodeInstanceServerProxy::removeProperties(const RemovePropertiesCommand &command) { writeCommand(QVariant::fromValue(command)); |