Implement DnD 3D objects from the item library to the EditView3D

Proof of concept drag and drop implementation. Basic functionality
working but needs polish.

Task-number: QDS-1132
Change-Id: Ie3b9e80de9a414c4955d6e38daf338045bc1e614
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Mahmoud Badri
2019-11-01 10:51:09 +02:00
parent 1d357f6b33
commit 5df7ad94ec
19 changed files with 194 additions and 1 deletions

View File

@@ -68,6 +68,7 @@
#include "debugoutputcommand.h"
#include "puppetalivecommand.h"
#include "changeselectioncommand.h"
#include "drop3dlibraryitemcommand.h"
namespace QmlDesigner {
@@ -139,6 +140,7 @@ bool compareCommands(const QVariant &command, const QVariant &controlCommand)
static const int tokenCommandType = QMetaType::type("TokenCommand");
static const int debugOutputCommandType = QMetaType::type("DebugOutputCommand");
static const int changeSelectionCommandType = QMetaType::type("ChangeSelectionCommand");
static const int drop3DLibraryItemCommandType = QMetaType::type("Drop3DLibraryItemCommand");
if (command.userType() == controlCommand.userType()) {
if (command.userType() == informationChangedCommandType)
@@ -163,6 +165,8 @@ bool compareCommands(const QVariant &command, const QVariant &controlCommand)
return command.value<DebugOutputCommand>() == controlCommand.value<DebugOutputCommand>();
else if (command.userType() == changeSelectionCommandType)
return command.value<ChangeSelectionCommand>() == controlCommand.value<ChangeSelectionCommand>();
else if (command.userType() == drop3DLibraryItemCommandType)
return command.value<Drop3DLibraryItemCommand>() == controlCommand.value<Drop3DLibraryItemCommand>();
}
return false;
@@ -250,6 +254,11 @@ void NodeInstanceClientProxy::selectionChanged(const ChangeSelectionCommand &com
writeCommand(QVariant::fromValue(command));
}
void NodeInstanceClientProxy::library3DItemDropped(const Drop3DLibraryItemCommand &command)
{
writeCommand(QVariant::fromValue(command));
}
void NodeInstanceClientProxy::flush()
{
}