diff options
author | Kaj Grönholm <kaj.gronholm@qt.io> | 2019-09-17 16:12:37 +0300 |
---|---|---|
committer | Kaj Grönholm <kaj.gronholm@qt.io> | 2019-09-17 21:58:48 +0300 |
commit | 8a2f0083c9bb5f11977cf59d5874e929318bf741 (patch) | |
tree | 17a43b968abf34bb2c5c1867103ce5a0382664be | |
parent | d8d7d7ff21a0d3e823d59edff2813483cdfdfd62 (diff) |
Reset property bindings when closing project
Task-number: QT3DS-3953
Change-Id: Ie4e1936a2b13db59292ced86830f2b2942bec970
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
3 files changed, 11 insertions, 1 deletions
diff --git a/src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/TimelineWidget.cpp b/src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/TimelineWidget.cpp index 4f5e25f1..d05fe12d 100644 --- a/src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/TimelineWidget.cpp +++ b/src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/TimelineWidget.cpp @@ -422,6 +422,13 @@ void TimelineWidget::OnNewPresentation() void TimelineWidget::OnClosingPresentation() { + // Reset bindings for all property rows + for (auto *row : qAsConst(m_handlesMap)) { + const auto childProps = row->childProps(); + for (const auto child : childProps) + child->setPropBinding(nullptr); + } + m_connections.clear(); m_graphicsScene->expandMap().clear(); m_graphicsScene->propGraphHeightMap().clear(); @@ -800,7 +807,6 @@ void TimelineWidget::onPropertyChanged(qt3dsdm::Qt3DSDMInstanceHandle inInstance void TimelineWidget::onAsyncUpdate() { CDoc *doc = g_StudioApp.GetCore()->GetDoc(); - if (m_fullReconstruct) { m_translationManager->Clear(); m_binding = static_cast<Qt3DSDMTimelineItemBinding *>( diff --git a/src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/ui/RowTimelinePropertyGraph.cpp b/src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/ui/RowTimelinePropertyGraph.cpp index 4c8e0752..51c0d299 100644 --- a/src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/ui/RowTimelinePropertyGraph.cpp +++ b/src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/ui/RowTimelinePropertyGraph.cpp @@ -63,6 +63,8 @@ RowTimelinePropertyGraph::RowTimelinePropertyGraph(QObject *parent) void RowTimelinePropertyGraph::paintGraphs(QPainter *painter, const QRectF &rect) { m_propBinding = m_rowTimeline->rowTree()->propBinding(); + if (!m_propBinding) + return; if (rect.height() < ROW_H) // rect height = row height - 1 return; diff --git a/src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/ui/RowTree.cpp b/src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/ui/RowTree.cpp index 4a8723e7..bc9f7a63 100644 --- a/src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/ui/RowTree.cpp +++ b/src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/ui/RowTree.cpp @@ -614,6 +614,8 @@ void RowTree::refreshPropBinding(bool forceSync) void RowTree::setPropBinding(ITimelineItemProperty *binding) { m_PropBinding = binding; + if (!m_PropBinding) + return; // update timeline isColorProperty qt3dsdm::TDataTypePair propType = m_PropBinding->GetType(); |