forked from qt-creator/qt-creator
QmlDesigner: Insert a node dragged to 3d edit view into correct scene
Added scene instance id to the drop command. Change-Id: I42df07fec823083454ad5a70ccafa318d05ab224 Fixes: QDS-1594 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -29,14 +29,16 @@
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
Drop3DLibraryItemCommand::Drop3DLibraryItemCommand(const QByteArray &itemData)
|
||||
: m_itemData(itemData)
|
||||
Drop3DLibraryItemCommand::Drop3DLibraryItemCommand(const QByteArray &itemData, qint32 sceneRootId)
|
||||
: m_itemData(itemData),
|
||||
m_sceneRootId(sceneRootId)
|
||||
{
|
||||
}
|
||||
|
||||
QDataStream &operator<<(QDataStream &out, const Drop3DLibraryItemCommand &command)
|
||||
{
|
||||
out << command.itemData();
|
||||
out << command.sceneRootId();
|
||||
|
||||
return out;
|
||||
}
|
||||
@@ -44,13 +46,14 @@ QDataStream &operator<<(QDataStream &out, const Drop3DLibraryItemCommand &comman
|
||||
QDataStream &operator>>(QDataStream &in, Drop3DLibraryItemCommand &command)
|
||||
{
|
||||
in >> command.m_itemData;
|
||||
in >> command.m_sceneRootId;
|
||||
|
||||
return in;
|
||||
}
|
||||
|
||||
bool operator==(const Drop3DLibraryItemCommand &first, const Drop3DLibraryItemCommand &second)
|
||||
{
|
||||
return first.m_itemData == second.m_itemData;
|
||||
return first.m_itemData == second.m_itemData && first.m_sceneRootId == second.m_sceneRootId;
|
||||
}
|
||||
|
||||
} // namespace QmlDesigner
|
||||
|
||||
@@ -41,13 +41,15 @@ class Drop3DLibraryItemCommand
|
||||
const Drop3DLibraryItemCommand &second);
|
||||
|
||||
public:
|
||||
explicit Drop3DLibraryItemCommand(const QByteArray &itemData);
|
||||
explicit Drop3DLibraryItemCommand(const QByteArray &itemData, qint32 sceneRootId);
|
||||
Drop3DLibraryItemCommand() = default;
|
||||
|
||||
QByteArray itemData() const { return m_itemData; }
|
||||
qint32 sceneRootId() const { return m_sceneRootId; }
|
||||
|
||||
private:
|
||||
QByteArray m_itemData;
|
||||
qint32 m_sceneRootId;
|
||||
};
|
||||
|
||||
QDataStream &operator<<(QDataStream &out, const Drop3DLibraryItemCommand &command);
|
||||
|
||||
Reference in New Issue
Block a user