diff options
author | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2019-03-29 13:56:20 +0200 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2019-04-02 06:00:08 +0000 |
commit | d341649e1d5741046c3030bb368a5bec0b42085b (patch) | |
tree | e5fd84112a27be890384e103c0e411318d0aae59 /src/Authoring/Studio/Palettes/TimelineGraphicsView/RowMover.cpp | |
parent | d96f2732be3264c019d8523932ff35f714053152 (diff) |
Disallow modifying default material by dragging things on it
Task-number: QT3DS-3245
Change-Id: I0ef73c495522311527fce221fb996bdcd953353e
Reviewed-by: Jere Tuliniemi <jere.tuliniemi@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Diffstat (limited to 'src/Authoring/Studio/Palettes/TimelineGraphicsView/RowMover.cpp')
-rw-r--r-- | src/Authoring/Studio/Palettes/TimelineGraphicsView/RowMover.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/RowMover.cpp b/src/Authoring/Studio/Palettes/TimelineGraphicsView/RowMover.cpp index aba37959..4641753b 100644 --- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/RowMover.cpp +++ b/src/Authoring/Studio/Palettes/TimelineGraphicsView/RowMover.cpp @@ -227,9 +227,10 @@ void RowMover::updateTargetRow(const QPointF &scenePos, EStudioObjectType rowTyp m_insertionTarget->setDnDState(RowTree::DnDState::SP_TARGET); } } else { - if (rowAtMouse->rowType() == OBJTYPE_LAYER - || rowAtMouse->rowType() == OBJTYPE_MATERIAL - || rowAtMouse->rowType() == OBJTYPE_IMAGE) { + if ((rowAtMouse->rowType() == OBJTYPE_LAYER + || rowAtMouse->rowType() == OBJTYPE_MATERIAL + || rowAtMouse->rowType() == OBJTYPE_IMAGE) + && !rowAtMouse->isDefaultMaterial()) { m_insertionTarget->setDnDState(RowTree::DnDState::SP_TARGET); } } @@ -248,7 +249,8 @@ void RowMover::updateTargetRow(const QPointF &scenePos, EStudioObjectType rowTyp if (rowAtMouse) { double y = rowAtMouse->mapFromScene(scenePos).y(); if (y > TimelineConstants::ROW_H * .25 && y < TimelineConstants::ROW_H * .75) { - if (rowAtMouse->rowType() & (OBJTYPE_LAYER | OBJTYPE_MATERIAL | OBJTYPE_IMAGE)) { + if (rowAtMouse->rowType() & (OBJTYPE_LAYER | OBJTYPE_MATERIAL | OBJTYPE_IMAGE) + && !rowAtMouse->isDefaultMaterial()) { m_rowAutoExpand = nullptr; m_autoExpandTimer.stop(); setVisible(false); |