diff options
author | Mahmoud Badri <mahmoud.badri@qt.io> | 2018-08-17 10:19:10 +0300 |
---|---|---|
committer | Mahmoud Badri <mahmoud.badri@qt.io> | 2018-08-17 08:46:28 +0000 |
commit | df642248185e9bca8b71ad0fc33f129551685425 (patch) | |
tree | aaeebf49c84f4edcc0309fdc8745aa502530cab4 /src/Authoring/Studio/Palettes | |
parent | e2ce7421489b0cb92d1d8cc55dac87f71cd818fe (diff) |
Allow DnD qml streams to timeline layer, material and texture rows
- Allow DnD qml streams from the project palette to the timeline layer,
material and texture rows to set sub-presentation for the row according
to its type.
- deleted 1 unused method.
Task-number: QT3DS-2093
Change-Id: I4da1b315da0203cafec02783d3390991f233ecb7
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'src/Authoring/Studio/Palettes')
-rw-r--r-- | src/Authoring/Studio/Palettes/Project/EditPresentationIdDlg.cpp | 14 | ||||
-rw-r--r-- | src/Authoring/Studio/Palettes/TimelineGraphicsView/RowMover.cpp | 6 |
2 files changed, 4 insertions, 16 deletions
diff --git a/src/Authoring/Studio/Palettes/Project/EditPresentationIdDlg.cpp b/src/Authoring/Studio/Palettes/Project/EditPresentationIdDlg.cpp index fc79d5ee..c5a77c17 100644 --- a/src/Authoring/Studio/Palettes/Project/EditPresentationIdDlg.cpp +++ b/src/Authoring/Studio/Palettes/Project/EditPresentationIdDlg.cpp @@ -38,19 +38,7 @@ EditPresentationIdDlg::EditPresentationIdDlg(const QString &src, QWidget *parent { m_ui->setupUi(this); - if (src == g_StudioApp.GetCore()->GetDoc()->getRelativePath()) { - m_presentationId = g_StudioApp.GetCore()->GetDoc()->getPresentationId(); - } else { - auto *sp = std::find_if(g_StudioApp.m_subpresentations.begin(), - g_StudioApp.m_subpresentations.end(), - [&src](const SubPresentationRecord &spr) -> bool { - return spr.m_argsOrSrc == src; - }); - - if (sp != g_StudioApp.m_subpresentations.end()) - m_presentationId = sp->m_id; - } - + m_presentationId = g_StudioApp.GetCore()->getProjectFile().getPresentationId(src); m_ui->lineEditPresentationId->setText(m_presentationId); } diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/RowMover.cpp b/src/Authoring/Studio/Palettes/TimelineGraphicsView/RowMover.cpp index a2c2659b..1046996b 100644 --- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/RowMover.cpp +++ b/src/Authoring/Studio/Palettes/TimelineGraphicsView/RowMover.cpp @@ -193,8 +193,8 @@ bool RowMover::isSourceRowsDescendant(RowTree *row) const // i.e. when dragging from project or basic objects palettes void RowMover::updateTargetRow(const QPointF &scenePos, EStudioObjectType rowType) { - // DnD a presentation from the project panel (to set it as a subpresentation) - if (rowType == OBJTYPE_PRESENTATION) { + // DnD a presentation / Qml stream from the project panel (to set it as a subpresentation) + if (rowType == OBJTYPE_PRESENTATION || rowType == OBJTYPE_QML_STREAM) { if (m_insertionTarget) m_insertionTarget->setDnDState(RowTree::DnDState::None, RowTree::DnDState::SP_TARGET); @@ -206,7 +206,7 @@ void RowMover::updateTargetRow(const QPointF &scenePos, EStudioObjectType rowTyp m_insertType = Q3DStudio::DocumentEditorInsertType::LastChild; if (rowAtMouse->rowType() == OBJTYPE_LAYER || rowAtMouse->rowType() == OBJTYPE_MATERIAL - || rowAtMouse->rowType() == OBJTYPE_IMAGE) { + || rowAtMouse->rowType() == OBJTYPE_IMAGE) { m_insertionTarget->setDnDState(RowTree::DnDState::SP_TARGET); } } |