forked from qt-creator/qt-creator
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:
@@ -27,6 +27,7 @@ HEADERS += $$PWD/changeauxiliarycommand.h
|
|||||||
HEADERS += $$PWD/removesharedmemorycommand.h
|
HEADERS += $$PWD/removesharedmemorycommand.h
|
||||||
HEADERS += $$PWD/puppetalivecommand.h
|
HEADERS += $$PWD/puppetalivecommand.h
|
||||||
HEADERS += $$PWD/changeselectioncommand.h
|
HEADERS += $$PWD/changeselectioncommand.h
|
||||||
|
HEADERS += $$PWD/drop3dlibraryitemcommand.h
|
||||||
|
|
||||||
SOURCES += $$PWD/synchronizecommand.cpp
|
SOURCES += $$PWD/synchronizecommand.cpp
|
||||||
SOURCES += $$PWD/debugoutputcommand.cpp
|
SOURCES += $$PWD/debugoutputcommand.cpp
|
||||||
@@ -55,3 +56,4 @@ SOURCES += $$PWD/changeauxiliarycommand.cpp
|
|||||||
SOURCES += $$PWD/removesharedmemorycommand.cpp
|
SOURCES += $$PWD/removesharedmemorycommand.cpp
|
||||||
SOURCES += $$PWD/puppetalivecommand.cpp
|
SOURCES += $$PWD/puppetalivecommand.cpp
|
||||||
SOURCES += $$PWD/changeselectioncommand.cpp
|
SOURCES += $$PWD/changeselectioncommand.cpp
|
||||||
|
SOURCES += $$PWD/drop3dlibraryitemcommand.cpp
|
||||||
|
@@ -0,0 +1,56 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2019 The Qt Company Ltd.
|
||||||
|
** Contact: https://www.qt.io/licensing/
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator.
|
||||||
|
**
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and The Qt Company. For licensing terms
|
||||||
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
|
** information use the contact form at https://www.qt.io/contact-us.
|
||||||
|
**
|
||||||
|
** GNU General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU
|
||||||
|
** General Public License version 3 as published by the Free Software
|
||||||
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||||
|
** included in the packaging of this file. Please review the following
|
||||||
|
** information to ensure the GNU General Public License requirements will
|
||||||
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "drop3dlibraryitemcommand.h"
|
||||||
|
|
||||||
|
#include <QDataStream>
|
||||||
|
|
||||||
|
namespace QmlDesigner {
|
||||||
|
|
||||||
|
Drop3DLibraryItemCommand::Drop3DLibraryItemCommand(const QByteArray &itemData)
|
||||||
|
: m_itemData(itemData)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
QDataStream &operator<<(QDataStream &out, const Drop3DLibraryItemCommand &command)
|
||||||
|
{
|
||||||
|
out << command.itemData();
|
||||||
|
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
QDataStream &operator>>(QDataStream &in, Drop3DLibraryItemCommand &command)
|
||||||
|
{
|
||||||
|
in >> command.m_itemData;
|
||||||
|
|
||||||
|
return in;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator==(const Drop3DLibraryItemCommand &first, const Drop3DLibraryItemCommand &second)
|
||||||
|
{
|
||||||
|
return first.m_itemData == second.m_itemData;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace QmlDesigner
|
@@ -0,0 +1,59 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2019 The Qt Company Ltd.
|
||||||
|
** Contact: https://www.qt.io/licensing/
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator.
|
||||||
|
**
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and The Qt Company. For licensing terms
|
||||||
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
|
** information use the contact form at https://www.qt.io/contact-us.
|
||||||
|
**
|
||||||
|
** GNU General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU
|
||||||
|
** General Public License version 3 as published by the Free Software
|
||||||
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||||
|
** included in the packaging of this file. Please review the following
|
||||||
|
** information to ensure the GNU General Public License requirements will
|
||||||
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <QVector>
|
||||||
|
#include <QDataStream>
|
||||||
|
#include <QMimeData>
|
||||||
|
|
||||||
|
#include "instancecontainer.h"
|
||||||
|
|
||||||
|
namespace QmlDesigner {
|
||||||
|
|
||||||
|
class Drop3DLibraryItemCommand
|
||||||
|
{
|
||||||
|
friend QDataStream &operator>>(QDataStream &in, Drop3DLibraryItemCommand &command);
|
||||||
|
friend QDebug operator<<(QDebug debug, const Drop3DLibraryItemCommand &command);
|
||||||
|
friend bool operator==(const Drop3DLibraryItemCommand &first,
|
||||||
|
const Drop3DLibraryItemCommand &second);
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit Drop3DLibraryItemCommand(const QByteArray &itemData);
|
||||||
|
Drop3DLibraryItemCommand() = default;
|
||||||
|
|
||||||
|
QByteArray itemData() const { return m_itemData; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
QByteArray m_itemData;
|
||||||
|
};
|
||||||
|
|
||||||
|
QDataStream &operator<<(QDataStream &out, const Drop3DLibraryItemCommand &command);
|
||||||
|
QDataStream &operator>>(QDataStream &in, Drop3DLibraryItemCommand &command);
|
||||||
|
bool operator==(const Drop3DLibraryItemCommand &first, const Drop3DLibraryItemCommand &second);
|
||||||
|
|
||||||
|
} // namespace QmlDesigner
|
||||||
|
|
||||||
|
Q_DECLARE_METATYPE(QmlDesigner::Drop3DLibraryItemCommand)
|
@@ -68,6 +68,7 @@
|
|||||||
#include "debugoutputcommand.h"
|
#include "debugoutputcommand.h"
|
||||||
#include "puppetalivecommand.h"
|
#include "puppetalivecommand.h"
|
||||||
#include "changeselectioncommand.h"
|
#include "changeselectioncommand.h"
|
||||||
|
#include "drop3dlibraryitemcommand.h"
|
||||||
|
|
||||||
namespace QmlDesigner {
|
namespace QmlDesigner {
|
||||||
|
|
||||||
@@ -139,6 +140,7 @@ bool compareCommands(const QVariant &command, const QVariant &controlCommand)
|
|||||||
static const int tokenCommandType = QMetaType::type("TokenCommand");
|
static const int tokenCommandType = QMetaType::type("TokenCommand");
|
||||||
static const int debugOutputCommandType = QMetaType::type("DebugOutputCommand");
|
static const int debugOutputCommandType = QMetaType::type("DebugOutputCommand");
|
||||||
static const int changeSelectionCommandType = QMetaType::type("ChangeSelectionCommand");
|
static const int changeSelectionCommandType = QMetaType::type("ChangeSelectionCommand");
|
||||||
|
static const int drop3DLibraryItemCommandType = QMetaType::type("Drop3DLibraryItemCommand");
|
||||||
|
|
||||||
if (command.userType() == controlCommand.userType()) {
|
if (command.userType() == controlCommand.userType()) {
|
||||||
if (command.userType() == informationChangedCommandType)
|
if (command.userType() == informationChangedCommandType)
|
||||||
@@ -163,6 +165,8 @@ bool compareCommands(const QVariant &command, const QVariant &controlCommand)
|
|||||||
return command.value<DebugOutputCommand>() == controlCommand.value<DebugOutputCommand>();
|
return command.value<DebugOutputCommand>() == controlCommand.value<DebugOutputCommand>();
|
||||||
else if (command.userType() == changeSelectionCommandType)
|
else if (command.userType() == changeSelectionCommandType)
|
||||||
return command.value<ChangeSelectionCommand>() == controlCommand.value<ChangeSelectionCommand>();
|
return command.value<ChangeSelectionCommand>() == controlCommand.value<ChangeSelectionCommand>();
|
||||||
|
else if (command.userType() == drop3DLibraryItemCommandType)
|
||||||
|
return command.value<Drop3DLibraryItemCommand>() == controlCommand.value<Drop3DLibraryItemCommand>();
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@@ -250,6 +254,11 @@ void NodeInstanceClientProxy::selectionChanged(const ChangeSelectionCommand &com
|
|||||||
writeCommand(QVariant::fromValue(command));
|
writeCommand(QVariant::fromValue(command));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NodeInstanceClientProxy::library3DItemDropped(const Drop3DLibraryItemCommand &command)
|
||||||
|
{
|
||||||
|
writeCommand(QVariant::fromValue(command));
|
||||||
|
}
|
||||||
|
|
||||||
void NodeInstanceClientProxy::flush()
|
void NodeInstanceClientProxy::flush()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@@ -57,6 +57,7 @@ class ChangeStateCommand;
|
|||||||
class ChangeNodeSourceCommand;
|
class ChangeNodeSourceCommand;
|
||||||
class EndPuppetCommand;
|
class EndPuppetCommand;
|
||||||
class ChangeSelectionCommand;
|
class ChangeSelectionCommand;
|
||||||
|
class Drop3DLibraryItemCommand;
|
||||||
|
|
||||||
class NodeInstanceClientProxy : public QObject, public NodeInstanceClientInterface
|
class NodeInstanceClientProxy : public QObject, public NodeInstanceClientInterface
|
||||||
{
|
{
|
||||||
@@ -76,6 +77,7 @@ public:
|
|||||||
void debugOutput(const DebugOutputCommand &command) override;
|
void debugOutput(const DebugOutputCommand &command) override;
|
||||||
void puppetAlive(const PuppetAliveCommand &command);
|
void puppetAlive(const PuppetAliveCommand &command);
|
||||||
void selectionChanged(const ChangeSelectionCommand &command) override;
|
void selectionChanged(const ChangeSelectionCommand &command) override;
|
||||||
|
void library3DItemDropped(const Drop3DLibraryItemCommand &command) override;
|
||||||
|
|
||||||
void flush() override;
|
void flush() override;
|
||||||
void synchronizeWithClientProcess() override;
|
void synchronizeWithClientProcess() override;
|
||||||
|
@@ -41,6 +41,7 @@ class RemoveSharedMemoryCommand;
|
|||||||
class DebugOutputCommand;
|
class DebugOutputCommand;
|
||||||
class PuppetAliveCommand;
|
class PuppetAliveCommand;
|
||||||
class ChangeSelectionCommand;
|
class ChangeSelectionCommand;
|
||||||
|
class Drop3DLibraryItemCommand;
|
||||||
|
|
||||||
class NodeInstanceClientInterface
|
class NodeInstanceClientInterface
|
||||||
{
|
{
|
||||||
@@ -55,6 +56,7 @@ public:
|
|||||||
virtual void token(const TokenCommand &command) = 0;
|
virtual void token(const TokenCommand &command) = 0;
|
||||||
virtual void debugOutput(const DebugOutputCommand &command) = 0;
|
virtual void debugOutput(const DebugOutputCommand &command) = 0;
|
||||||
virtual void selectionChanged(const ChangeSelectionCommand &command) = 0;
|
virtual void selectionChanged(const ChangeSelectionCommand &command) = 0;
|
||||||
|
virtual void library3DItemDropped(const Drop3DLibraryItemCommand &command) = 0;
|
||||||
|
|
||||||
virtual void flush() {}
|
virtual void flush() {}
|
||||||
virtual void synchronizeWithClientProcess() {}
|
virtual void synchronizeWithClientProcess() {}
|
||||||
|
@@ -46,6 +46,7 @@
|
|||||||
#include "addimportcontainer.h"
|
#include "addimportcontainer.h"
|
||||||
#include "changenodesourcecommand.h"
|
#include "changenodesourcecommand.h"
|
||||||
#include "changeselectioncommand.h"
|
#include "changeselectioncommand.h"
|
||||||
|
#include "drop3dlibraryitemcommand.h"
|
||||||
|
|
||||||
#include "informationchangedcommand.h"
|
#include "informationchangedcommand.h"
|
||||||
#include "pixmapchangedcommand.h"
|
#include "pixmapchangedcommand.h"
|
||||||
@@ -107,6 +108,9 @@ void NodeInstanceServerInterface::registerCommands()
|
|||||||
qRegisterMetaType<ChangeSelectionCommand>("ChangeSelectionCommand");
|
qRegisterMetaType<ChangeSelectionCommand>("ChangeSelectionCommand");
|
||||||
qRegisterMetaTypeStreamOperators<ChangeSelectionCommand>("ChangeSelectionCommand");
|
qRegisterMetaTypeStreamOperators<ChangeSelectionCommand>("ChangeSelectionCommand");
|
||||||
|
|
||||||
|
qRegisterMetaType<Drop3DLibraryItemCommand>("Drop3DLibraryItemCommand");
|
||||||
|
qRegisterMetaTypeStreamOperators<Drop3DLibraryItemCommand>("Drop3DLibraryItemCommand");
|
||||||
|
|
||||||
qRegisterMetaType<RemovePropertiesCommand>("RemovePropertiesCommand");
|
qRegisterMetaType<RemovePropertiesCommand>("RemovePropertiesCommand");
|
||||||
qRegisterMetaTypeStreamOperators<RemovePropertiesCommand>("RemovePropertiesCommand");
|
qRegisterMetaTypeStreamOperators<RemovePropertiesCommand>("RemovePropertiesCommand");
|
||||||
|
|
||||||
|
@@ -161,6 +161,10 @@ Window {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DropArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
}
|
||||||
|
|
||||||
View3D {
|
View3D {
|
||||||
id: editView
|
id: editView
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
@@ -67,6 +67,7 @@
|
|||||||
#include <tokencommand.h>
|
#include <tokencommand.h>
|
||||||
#include <removesharedmemorycommand.h>
|
#include <removesharedmemorycommand.h>
|
||||||
#include <changeselectioncommand.h>
|
#include <changeselectioncommand.h>
|
||||||
|
#include <drop3dlibraryitemcommand.h>
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QQmlEngine>
|
#include <QQmlEngine>
|
||||||
@@ -1171,6 +1172,11 @@ ChangeSelectionCommand NodeInstanceServer::createChangeSelectionCommand(const QL
|
|||||||
return ChangeSelectionCommand(idVector);
|
return ChangeSelectionCommand(idVector);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Drop3DLibraryItemCommand NodeInstanceServer::createDrop3DLibraryItemCommand(const QByteArray &itemData)
|
||||||
|
{
|
||||||
|
return Drop3DLibraryItemCommand(itemData);
|
||||||
|
}
|
||||||
|
|
||||||
ValuesChangedCommand NodeInstanceServer::createValuesChangedCommand(const QVector<InstancePropertyPair> &propertyList) const
|
ValuesChangedCommand NodeInstanceServer::createValuesChangedCommand(const QVector<InstancePropertyPair> &propertyList) const
|
||||||
{
|
{
|
||||||
QVector<PropertyValueContainer> valueVector;
|
QVector<PropertyValueContainer> valueVector;
|
||||||
|
@@ -70,6 +70,7 @@ class AddImportContainer;
|
|||||||
class MockupTypeContainer;
|
class MockupTypeContainer;
|
||||||
class IdContainer;
|
class IdContainer;
|
||||||
class ChangeSelectionCommand;
|
class ChangeSelectionCommand;
|
||||||
|
class Drop3DLibraryItemCommand;
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
class ChildrenChangeEventFilter;
|
class ChildrenChangeEventFilter;
|
||||||
@@ -180,6 +181,7 @@ protected:
|
|||||||
ChildrenChangedCommand createChildrenChangedCommand(const ServerNodeInstance &parentInstance, const QList<ServerNodeInstance> &instanceList) const;
|
ChildrenChangedCommand createChildrenChangedCommand(const ServerNodeInstance &parentInstance, const QList<ServerNodeInstance> &instanceList) const;
|
||||||
ComponentCompletedCommand createComponentCompletedCommand(const QList<ServerNodeInstance> &instanceList);
|
ComponentCompletedCommand createComponentCompletedCommand(const QList<ServerNodeInstance> &instanceList);
|
||||||
ChangeSelectionCommand createChangeSelectionCommand(const QList<ServerNodeInstance> &instanceList);
|
ChangeSelectionCommand createChangeSelectionCommand(const QList<ServerNodeInstance> &instanceList);
|
||||||
|
Drop3DLibraryItemCommand createDrop3DLibraryItemCommand(const QByteArray &itemData);
|
||||||
|
|
||||||
void addChangedProperty(const InstancePropertyPair &property);
|
void addChangedProperty(const InstancePropertyPair &property);
|
||||||
|
|
||||||
|
@@ -27,6 +27,8 @@
|
|||||||
|
|
||||||
#include <QQuickItem>
|
#include <QQuickItem>
|
||||||
#include <QQuickView>
|
#include <QQuickView>
|
||||||
|
#include <QDropEvent>
|
||||||
|
#include <QMimeData>
|
||||||
|
|
||||||
#include "servernodeinstance.h"
|
#include "servernodeinstance.h"
|
||||||
#include "childrenchangeeventfilter.h"
|
#include "childrenchangeeventfilter.h"
|
||||||
@@ -57,6 +59,7 @@
|
|||||||
#include "removesharedmemorycommand.h"
|
#include "removesharedmemorycommand.h"
|
||||||
#include "changeselectioncommand.h"
|
#include "changeselectioncommand.h"
|
||||||
#include "objectnodeinstance.h"
|
#include "objectnodeinstance.h"
|
||||||
|
#include <drop3dlibraryitemcommand.h>
|
||||||
|
|
||||||
#include "dummycontextobject.h"
|
#include "dummycontextobject.h"
|
||||||
#include "../editor3d/cameracontrolhelper.h"
|
#include "../editor3d/cameracontrolhelper.h"
|
||||||
@@ -79,6 +82,25 @@ static QVariant objectToVariant(QObject *object)
|
|||||||
return QVariant::fromValue(object);
|
return QVariant::fromValue(object);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Qt5InformationNodeInstanceServer::eventFilter(QObject *, QEvent *event)
|
||||||
|
{
|
||||||
|
switch (event->type()) {
|
||||||
|
case QEvent::Drop: {
|
||||||
|
QDropEvent *dropEvent = static_cast<QDropEvent *>(event);
|
||||||
|
QByteArray data = dropEvent->mimeData()->data(
|
||||||
|
QStringLiteral("application/vnd.bauhaus.itemlibraryinfo"));
|
||||||
|
if (!data.isEmpty())
|
||||||
|
nodeInstanceClient()->library3DItemDropped(createDrop3DLibraryItemCommand(data));
|
||||||
|
|
||||||
|
} break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
QObject *Qt5InformationNodeInstanceServer::createEditView3D(QQmlEngine *engine)
|
QObject *Qt5InformationNodeInstanceServer::createEditView3D(QQmlEngine *engine)
|
||||||
{
|
{
|
||||||
auto helper = new QmlDesigner::Internal::CameraControlHelper();
|
auto helper = new QmlDesigner::Internal::CameraControlHelper();
|
||||||
@@ -98,6 +120,7 @@ QObject *Qt5InformationNodeInstanceServer::createEditView3D(QQmlEngine *engine)
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window->installEventFilter(this);
|
||||||
QObject::connect(window, SIGNAL(objectClicked(QVariant)), this, SLOT(objectClicked(QVariant)));
|
QObject::connect(window, SIGNAL(objectClicked(QVariant)), this, SLOT(objectClicked(QVariant)));
|
||||||
QObject::connect(window, SIGNAL(commitObjectProperty(QVariant, QVariant)),
|
QObject::connect(window, SIGNAL(commitObjectProperty(QVariant, QVariant)),
|
||||||
this, SLOT(handleObjectPropertyCommit(QVariant, QVariant)));
|
this, SLOT(handleObjectPropertyCommit(QVariant, QVariant)));
|
||||||
|
@@ -57,6 +57,7 @@ private slots:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
void collectItemChangesAndSendChangeCommands() override;
|
void collectItemChangesAndSendChangeCommands() override;
|
||||||
|
bool eventFilter(QObject *obj, QEvent *event) override;
|
||||||
void sendChildrenChangedCommand(const QList<ServerNodeInstance> &childList);
|
void sendChildrenChangedCommand(const QList<ServerNodeInstance> &childList);
|
||||||
void sendTokenBack();
|
void sendTokenBack();
|
||||||
bool isDirtyRecursiveForNonInstanceItems(QQuickItem *item) const;
|
bool isDirtyRecursiveForNonInstanceItems(QQuickItem *item) const;
|
||||||
|
@@ -139,6 +139,7 @@ extend_qtc_plugin(QmlDesigner
|
|||||||
tokencommand.cpp tokencommand.h
|
tokencommand.cpp tokencommand.h
|
||||||
valueschangedcommand.cpp valueschangedcommand.h
|
valueschangedcommand.cpp valueschangedcommand.h
|
||||||
changeselectioncommand.cpp changeselectioncommand.h
|
changeselectioncommand.cpp changeselectioncommand.h
|
||||||
|
drop3dlibraryitemcommand.cpp drop3dlibraryitemcommand.h
|
||||||
)
|
)
|
||||||
|
|
||||||
extend_qtc_plugin(QmlDesigner
|
extend_qtc_plugin(QmlDesigner
|
||||||
|
@@ -137,6 +137,7 @@ public:
|
|||||||
void sendToken(const QString &token, int number, const QVector<ModelNode> &nodeVector);
|
void sendToken(const QString &token, int number, const QVector<ModelNode> &nodeVector);
|
||||||
|
|
||||||
void selectionChanged(const ChangeSelectionCommand &command) override;
|
void selectionChanged(const ChangeSelectionCommand &command) override;
|
||||||
|
void library3DItemDropped(const Drop3DLibraryItemCommand &command) override;
|
||||||
|
|
||||||
void selectedNodesChanged(const QList<ModelNode> &selectedNodeList,
|
void selectedNodesChanged(const QList<ModelNode> &selectedNodeList,
|
||||||
const QList<ModelNode> &lastSelectedNodeList) override;
|
const QList<ModelNode> &lastSelectedNodeList) override;
|
||||||
|
@@ -42,6 +42,7 @@
|
|||||||
#include <completecomponentcommand.h>
|
#include <completecomponentcommand.h>
|
||||||
#include <changenodesourcecommand.h>
|
#include <changenodesourcecommand.h>
|
||||||
#include <changeselectioncommand.h>
|
#include <changeselectioncommand.h>
|
||||||
|
#include <drop3dlibraryitemcommand.h>
|
||||||
|
|
||||||
#include <informationchangedcommand.h>
|
#include <informationchangedcommand.h>
|
||||||
#include <pixmapchangedcommand.h>
|
#include <pixmapchangedcommand.h>
|
||||||
@@ -281,6 +282,7 @@ void NodeInstanceServerProxy::dispatchCommand(const QVariant &command, PuppetStr
|
|||||||
static const int debugOutputCommandType = QMetaType::type("DebugOutputCommand");
|
static const int debugOutputCommandType = QMetaType::type("DebugOutputCommand");
|
||||||
static const int puppetAliveCommandType = QMetaType::type("PuppetAliveCommand");
|
static const int puppetAliveCommandType = QMetaType::type("PuppetAliveCommand");
|
||||||
static const int changeSelectionCommandType = QMetaType::type("ChangeSelectionCommand");
|
static const int changeSelectionCommandType = QMetaType::type("ChangeSelectionCommand");
|
||||||
|
static const int drop3DLibraryItemCommandType = QMetaType::type("Drop3DLibraryItemCommand");
|
||||||
|
|
||||||
if (m_destructing)
|
if (m_destructing)
|
||||||
return;
|
return;
|
||||||
@@ -306,6 +308,8 @@ void NodeInstanceServerProxy::dispatchCommand(const QVariant &command, PuppetStr
|
|||||||
nodeInstanceClient()->debugOutput(command.value<DebugOutputCommand>());
|
nodeInstanceClient()->debugOutput(command.value<DebugOutputCommand>());
|
||||||
} else if (command.userType() == changeSelectionCommandType) {
|
} else if (command.userType() == changeSelectionCommandType) {
|
||||||
nodeInstanceClient()->selectionChanged(command.value<ChangeSelectionCommand>());
|
nodeInstanceClient()->selectionChanged(command.value<ChangeSelectionCommand>());
|
||||||
|
} else if (command.userType() == drop3DLibraryItemCommandType) {
|
||||||
|
nodeInstanceClient()->library3DItemDropped(command.value<Drop3DLibraryItemCommand>());
|
||||||
} else if (command.userType() == puppetAliveCommandType) {
|
} else if (command.userType() == puppetAliveCommandType) {
|
||||||
puppetAlive(puppetStreamType);
|
puppetAlive(puppetStreamType);
|
||||||
} else if (command.userType() == synchronizeCommandType) {
|
} else if (command.userType() == synchronizeCommandType) {
|
||||||
|
@@ -41,6 +41,7 @@
|
|||||||
#include "qmlstate.h"
|
#include "qmlstate.h"
|
||||||
#include "qmltimeline.h"
|
#include "qmltimeline.h"
|
||||||
#include "qmltimelinekeyframegroup.h"
|
#include "qmltimelinekeyframegroup.h"
|
||||||
|
#include "qmlvisualnode.h"
|
||||||
|
|
||||||
#include "createscenecommand.h"
|
#include "createscenecommand.h"
|
||||||
#include "createinstancescommand.h"
|
#include "createinstancescommand.h"
|
||||||
@@ -52,6 +53,7 @@
|
|||||||
#include "changebindingscommand.h"
|
#include "changebindingscommand.h"
|
||||||
#include "changeidscommand.h"
|
#include "changeidscommand.h"
|
||||||
#include "changeselectioncommand.h"
|
#include "changeselectioncommand.h"
|
||||||
|
#include "drop3dlibraryitemcommand.h"
|
||||||
#include "changenodesourcecommand.h"
|
#include "changenodesourcecommand.h"
|
||||||
#include "removeinstancescommand.h"
|
#include "removeinstancescommand.h"
|
||||||
#include "removepropertiescommand.h"
|
#include "removepropertiescommand.h"
|
||||||
@@ -66,7 +68,6 @@
|
|||||||
#include "tokencommand.h"
|
#include "tokencommand.h"
|
||||||
#include "removesharedmemorycommand.h"
|
#include "removesharedmemorycommand.h"
|
||||||
#include "debugoutputcommand.h"
|
#include "debugoutputcommand.h"
|
||||||
|
|
||||||
#include "nodeinstanceserverproxy.h"
|
#include "nodeinstanceserverproxy.h"
|
||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
@@ -1439,6 +1440,17 @@ void NodeInstanceView::selectionChanged(const ChangeSelectionCommand &command)
|
|||||||
selectModelNode(modelNodeForInternalId(instanceId));
|
selectModelNode(modelNodeForInternalId(instanceId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
void NodeInstanceView::library3DItemDropped(const Drop3DLibraryItemCommand &command)
|
||||||
|
{
|
||||||
|
QDataStream stream(command.itemData());
|
||||||
|
ItemLibraryEntry itemLibraryEntry;
|
||||||
|
stream >> itemLibraryEntry;
|
||||||
|
|
||||||
|
if (itemLibraryEntry.category() != "Qt Quick 3D")
|
||||||
|
return;
|
||||||
|
|
||||||
|
QmlVisualNode::createQmlVisualNode(this, itemLibraryEntry, {});
|
||||||
|
}
|
||||||
|
|
||||||
void NodeInstanceView::selectedNodesChanged(const QList<ModelNode> &selectedNodeList,
|
void NodeInstanceView::selectedNodesChanged(const QList<ModelNode> &selectedNodeList,
|
||||||
const QList<ModelNode> & /*lastSelectedNodeList*/)
|
const QList<ModelNode> & /*lastSelectedNodeList*/)
|
||||||
|
@@ -169,6 +169,8 @@ Project {
|
|||||||
"commands/valueschangedcommand.h",
|
"commands/valueschangedcommand.h",
|
||||||
"commands/changeselectioncommand.cpp",
|
"commands/changeselectioncommand.cpp",
|
||||||
"commands/changeselectioncommand.h",
|
"commands/changeselectioncommand.h",
|
||||||
|
"commands/drop3dlibraryitemcommand.cpp",
|
||||||
|
"commands/drop3dlibraryitemcommand.h",
|
||||||
"container/addimportcontainer.cpp",
|
"container/addimportcontainer.cpp",
|
||||||
"container/addimportcontainer.h",
|
"container/addimportcontainer.h",
|
||||||
"container/idcontainer.cpp",
|
"container/idcontainer.cpp",
|
||||||
|
@@ -45,6 +45,7 @@ extend_qtc_executable(qml2puppet
|
|||||||
synchronizecommand.cpp synchronizecommand.h
|
synchronizecommand.cpp synchronizecommand.h
|
||||||
tokencommand.cpp tokencommand.h
|
tokencommand.cpp tokencommand.h
|
||||||
changeselectioncommand.cpp changeselectioncommand.h
|
changeselectioncommand.cpp changeselectioncommand.h
|
||||||
|
drop3dlibraryitemcommand.cpp drop3dlibraryitemcommand.h
|
||||||
valueschangedcommand.cpp
|
valueschangedcommand.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@@ -95,6 +95,8 @@ QtcTool {
|
|||||||
"commands/valueschangedcommand.h",
|
"commands/valueschangedcommand.h",
|
||||||
"commands/changeselectioncommand.cpp",
|
"commands/changeselectioncommand.cpp",
|
||||||
"commands/changeselectioncommand.h",
|
"commands/changeselectioncommand.h",
|
||||||
|
"commands/drop3dlibraryitemcommand.cpp",
|
||||||
|
"commands/drop3dlibraryitemcommand.h",
|
||||||
"container/addimportcontainer.cpp",
|
"container/addimportcontainer.cpp",
|
||||||
"container/addimportcontainer.h",
|
"container/addimportcontainer.h",
|
||||||
"container/idcontainer.cpp",
|
"container/idcontainer.cpp",
|
||||||
|
Reference in New Issue
Block a user