forked from qt-creator/qt-creator
QmlDesigner: Prevent item hoping for reparenting
Because of the asynchronous nature of the formeditor the item can be between to states. This looks like the item is hoping around. To prevent this a token is sent to the instances and back. For the time frame the painting is disabled. Change-Id: If7e937cba8171248464ad350bb14438c020b25f9 Reviewed-on: http://codereview.qt.nokia.com/1189 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Alessandro Portale <alessandro.portale@nokia.com>
This commit is contained in:
@@ -57,6 +57,7 @@
|
||||
#include "changestatecommand.h"
|
||||
#include "completecomponentcommand.h"
|
||||
#include "synchronizecommand.h"
|
||||
#include "tokencommand.h"
|
||||
|
||||
#include "informationchangedcommand.h"
|
||||
#include "pixmapchangedcommand.h"
|
||||
@@ -133,6 +134,11 @@ void NodeInstanceClientProxy::componentCompleted(const ComponentCompletedCommand
|
||||
writeCommand(QVariant::fromValue(command));
|
||||
}
|
||||
|
||||
void NodeInstanceClientProxy::token(const TokenCommand &command)
|
||||
{
|
||||
writeCommand(QVariant::fromValue(command));
|
||||
}
|
||||
|
||||
void NodeInstanceClientProxy::flush()
|
||||
{
|
||||
}
|
||||
@@ -267,6 +273,10 @@ void NodeInstanceClientProxy::changeNodeSource(const ChangeNodeSourceCommand &co
|
||||
{
|
||||
nodeInstanceServer()->changeNodeSource(command);
|
||||
}
|
||||
void NodeInstanceClientProxy::redirectToken(const TokenCommand &command)
|
||||
{
|
||||
nodeInstanceServer()->token(command);
|
||||
}
|
||||
|
||||
void NodeInstanceClientProxy::dispatchCommand(const QVariant &command)
|
||||
{
|
||||
@@ -285,6 +295,7 @@ void NodeInstanceClientProxy::dispatchCommand(const QVariant &command)
|
||||
static const int completeComponentCommandType = QMetaType::type("CompleteComponentCommand");
|
||||
static const int synchronizeCommandType = QMetaType::type("SynchronizeCommand");
|
||||
static const int changeNodeSourceCommandType = QMetaType::type("ChangeNodeSourceCommand");
|
||||
static const int tokenCommandType = QMetaType::type("TokenCommand");
|
||||
|
||||
if (command.userType() == createInstancesCommandType) {
|
||||
createInstances(command.value<CreateInstancesCommand>());
|
||||
@@ -314,6 +325,8 @@ void NodeInstanceClientProxy::dispatchCommand(const QVariant &command)
|
||||
completeComponent(command.value<CompleteComponentCommand>());
|
||||
else if (command.userType() == changeNodeSourceCommandType)
|
||||
changeNodeSource(command.value<ChangeNodeSourceCommand>());
|
||||
else if (command.userType() == tokenCommandType)
|
||||
redirectToken(command.value<TokenCommand>());
|
||||
else if (command.userType() == synchronizeCommandType) {
|
||||
SynchronizeCommand synchronizeCommand = command.value<SynchronizeCommand>();
|
||||
m_synchronizeId = synchronizeCommand.synchronizeId();
|
||||
|
||||
Reference in New Issue
Block a user