diff options
Diffstat (limited to 'src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/RowManager.cpp')
-rw-r--r-- | src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/RowManager.cpp | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/RowManager.cpp b/src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/RowManager.cpp index 50eff996..70a18560 100644 --- a/src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/RowManager.cpp +++ b/src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/RowManager.cpp @@ -44,6 +44,7 @@ #include "StudioObjectTypes.h" #include "Qt3DSDMStudioSystem.h" #include "ClientDataModelBridge.h" +#include "IDocumentEditor.h" #include <QtWidgets/qgraphicslinearlayout.h> #include <QtCore/qpointer.h> @@ -75,9 +76,8 @@ void RowManager::removeAllRows() clearSelection(); // delete rows - RowTree *row_i; for (int i = m_layoutTree->count() - 1; i >= 1; --i) { - row_i = static_cast<RowTree *>(m_layoutTree->itemAt(i)->graphicsItem()); + RowTree *row_i = static_cast<RowTree *>(m_layoutTree->itemAt(i)->graphicsItem()); m_layoutTree->removeAt(i); m_layoutTimeline->removeAt(i); delete row_i; // this will also delete the timeline row @@ -219,6 +219,9 @@ void RowManager::selectRow(RowTree *row, bool multiSelect) if (row->locked()) return; + if (multiSelect && row->propertyExpanded()) + return; + if (row->isProperty()) row = row->parentRow(); @@ -234,6 +237,20 @@ void RowManager::selectRow(RowTree *row, bool multiSelect) binding->SetSelected(multiSelect); } +QVector<RowTimelinePropertyGraph *> RowManager::getExpandedPropertyGraphs() const +{ + QVector<RowTimelinePropertyGraph *> graphs; + + // the earliest possible property row index in the layout is 4 + for (int i = 4; i < m_layoutTree->count(); ++i) { + RowTree *row_i = static_cast<RowTree *>(m_layoutTree->itemAt(i)->graphicsItem()); + if (row_i->propertyExpanded()) + graphs.append(row_i->rowTimeline()->propertyGraph()); + } + + return graphs; +} + // Call this to update row selection UI status void RowManager::setRowSelection(RowTree *row, bool selected) { @@ -275,15 +292,13 @@ void RowManager::updateRulerDuration(bool updateMaxDuration) long maxDuration = 0; // for setting correct size for the view so scrollbars appear correctly if (m_layoutTree->count() > 1) { auto rootRow = static_cast<RowTree *>(m_layoutTree->itemAt(1)->graphicsItem()); - bool isComponent = rootRow->objectType() == OBJTYPE_COMPONENT; - for (int i = 1; i < m_layoutTree->count(); ++i) { + bool insideComponent = rootRow->objectType() == OBJTYPE_COMPONENT; + for (int i = 2; i < m_layoutTree->count(); ++i) { RowTree *row_i = static_cast<RowTree *>(m_layoutTree->itemAt(i)->graphicsItem()); long dur_i = row_i->rowTimeline()->getEndTime(); - if (((isComponent && i != 1) || row_i->objectType() == OBJTYPE_LAYER) - && dur_i > duration) { + if ((insideComponent || row_i->objectType() == OBJTYPE_LAYER) && dur_i > duration) duration = dur_i; - } if (dur_i > maxDuration) maxDuration = dur_i; |