diff options
author | Mahmoud Badri <mahmoud.badri@qt.io> | 2018-08-17 11:57:31 +0300 |
---|---|---|
committer | Mahmoud Badri <mahmoud.badri@qt.io> | 2018-08-17 09:03:03 +0000 |
commit | 4bba7abacf0a8d8db101b8c05e10e7daa616810c (patch) | |
tree | 1e0c7fa191c9eeeaa83257e6d72c236b6fa04529 | |
parent | df642248185e9bca8b71ad0fc33f129551685425 (diff) |
Allow DnD qml streams to the scene
Allow DnD qml streams from the project palette to the scene. The user
can choose to set it as active layer's sub-presentation or stream it to
a new rectangular texture.
Task-number: QT3DS-2092
Change-Id: I64b76a92aef1e1d5b9b6419c03d69348e8a5e2e1
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
-rw-r--r-- | src/Authoring/Client/Code/Core/Utility/StudioObjectTypes.cpp | 1 | ||||
-rw-r--r-- | src/Authoring/Studio/DragAndDrop/SceneDropTarget.cpp | 6 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/Authoring/Client/Code/Core/Utility/StudioObjectTypes.cpp b/src/Authoring/Client/Code/Core/Utility/StudioObjectTypes.cpp index 357adca9..cdd7e2cd 100644 --- a/src/Authoring/Client/Code/Core/Utility/StudioObjectTypes.cpp +++ b/src/Authoring/Client/Code/Core/Utility/StudioObjectTypes.cpp @@ -82,6 +82,7 @@ bool CStudioObjectTypes::AcceptableParent(EStudioObjectType inChild, EStudioObje theAcceptible = (inParent == OBJTYPE_LAYER) || (inParent == OBJTYPE_EFFECT); break; case OBJTYPE_PRESENTATION: + case OBJTYPE_QML_STREAM: theAcceptible = inParent & (OBJTYPE_LAYER | OBJTYPE_SCENE); break; case OBJTYPE_CUSTOMMATERIAL: diff --git a/src/Authoring/Studio/DragAndDrop/SceneDropTarget.cpp b/src/Authoring/Studio/DragAndDrop/SceneDropTarget.cpp index 27dfa927..3bd3b704 100644 --- a/src/Authoring/Studio/DragAndDrop/SceneDropTarget.cpp +++ b/src/Authoring/Studio/DragAndDrop/SceneDropTarget.cpp @@ -94,8 +94,8 @@ bool CSceneViewDropTarget::Accept(CDropSource &inSource) // We have to set this so we can adjust the Target to accept this source. SetDropSourceObjectType(inSource.GetObjectType()); - // always allow DnD presentations on the scene - if (m_DropSourceObjectType == OBJTYPE_PRESENTATION) { + // always allow DnD presentations and qml streams to the scene + if (m_DropSourceObjectType & (OBJTYPE_PRESENTATION | OBJTYPE_QML_STREAM)) { inSource.SetHasValidTarget(true); return true; } @@ -143,7 +143,7 @@ bool CSceneViewDropTarget::Drop(CDropSource &inSource) CDoc *doc = g_StudioApp.GetCore()->GetDoc(); qt3dsdm::Qt3DSDMInstanceHandle instance = GetInstance(); - if (m_DropSourceObjectType == OBJTYPE_PRESENTATION) { + if (m_DropSourceObjectType & (OBJTYPE_PRESENTATION | OBJTYPE_QML_STREAM)) { QMessageBox msgBox; msgBox.setWindowTitle(QObject::tr("Set Sub-presentation")); msgBox.setText(QObject::tr("Set as sub-presentation to")); |