summaryrefslogtreecommitdiffstats
path: root/src/Authoring/Studio/Palettes/TimelineGraphicsView/RowMover.cpp
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@qt.io>2019-03-26 13:21:30 +0200
committerTomi Korpipää <tomi.korpipaa@qt.io>2019-03-26 11:43:41 +0000
commit671c2d3dd9b31cc3e62346857f5c22709a5c2fba (patch)
tree634539b97352357ad214541077616e312be4cdb6 /src/Authoring/Studio/Palettes/TimelineGraphicsView/RowMover.cpp
parent6297443c8cdba4cd82d1f74ef89ab99aaf78a98f (diff)
Fix master slide item grouping issuesv2.3.0-rc2
Disallow grouping mixed non-master and master items. If master items are grouped, the resulting group is a master group. Disallow dragging master items under non-master items in some edge cases that still allowed it. Change-Id: Id4e18405526fb5b0f9ed17bc29e758101a19875e Fixes: QT3DS-3224 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.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/RowMover.cpp b/src/Authoring/Studio/Palettes/TimelineGraphicsView/RowMover.cpp
index 3e35a361..437d81dc 100644
--- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/RowMover.cpp
+++ b/src/Authoring/Studio/Palettes/TimelineGraphicsView/RowMover.cpp
@@ -310,15 +310,20 @@ void RowMover::updateTargetRow(const QPointF &scenePos, EStudioObjectType rowTyp
bool srcHasMaster = sourceRowsHasMaster();
if (!rowInsert1->locked() && rowInsert1->isContainer() && !m_sourceRows.contains(rowInsert1)
// prevent insertion a master row under a non-master unless under a component root
- && (!(srcHasMaster && !rowInsert1->isMaster()) || rowInsert1->isComponent())) {
+ && (!(srcHasMaster && !rowInsert1->isMaster()) || rowInsert1->isComponentRoot())) {
depthMax++; // Container: allow insertion as a child
- } else if (rowInsert1->isPropertyOrMaterial() && !rowInsert1->parentRow()->isContainer()) {
- depthMax--; // non-container with properties and/or a material
- } else if (srcHasMaster) {
+ } else {
RowTree *row = rowInsert1->parentRow();
- while (row && !row->isMaster() && !row->isComponent()) {
- depthMax--;
- row = row->parentRow();
+ if (rowInsert1->isPropertyOrMaterial() && !rowInsert1->parentRow()->isContainer()) {
+ depthMax--; // non-container with properties and/or a material
+ if (row)
+ row = row->parentRow();
+ }
+ if (srcHasMaster) {
+ while (row && !row->isMaster() && !row->isComponent()) {
+ depthMax--;
+ row = row->parentRow();
+ }
}
}