From 4bba7abacf0a8d8db101b8c05e10e7daa616810c Mon Sep 17 00:00:00 2001 From: Mahmoud Badri Date: Fri, 17 Aug 2018 11:57:31 +0300 Subject: 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 --- src/Authoring/Client/Code/Core/Utility/StudioObjectTypes.cpp | 1 + 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")); -- cgit v1.2.3