diff options
author | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2020-06-02 12:11:43 +0300 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2020-06-09 12:29:03 +0000 |
commit | 279454a54ba89b354a26598abb311c2b44250428 (patch) | |
tree | c0ce2a671a48f0b06c2b81a071d6504c02197b9c /src/plugins/qmldesigner/components/timelineeditor | |
parent | 5551791077b807689a0d581cfcbf6fc7b6c623a1 (diff) |
QmlDesigner: Keep hasActiveTimeline QML context property up to date
Change hasActiveTimeline QML context property setting to be based on
current timeline change notifications instead of timeline node
creation, as the timeline will not be valid at the time of the node
creation. That also failed to detect timeline deletion.
Also fixed the timeline logic to clear current timeline from model
when the timeline is deleted.
Change-Id: I9191300c964bc624a958003b6aa0d5d9e77ddf9a
Fixes: QDS-2139
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Diffstat (limited to 'src/plugins/qmldesigner/components/timelineeditor')
-rw-r--r-- | src/plugins/qmldesigner/components/timelineeditor/timelineview.cpp | 4 | ||||
-rw-r--r-- | src/plugins/qmldesigner/components/timelineeditor/timelinewidget.cpp | 2 |
2 files changed, 2 insertions, 4 deletions
diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelineview.cpp b/src/plugins/qmldesigner/components/timelineeditor/timelineview.cpp index 61ac1aba59..1ba0d60342 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/timelineview.cpp +++ b/src/plugins/qmldesigner/components/timelineeditor/timelineview.cpp @@ -386,9 +386,7 @@ void TimelineView::setTimelineRecording(bool value) { ModelNode node = widget()->graphicsScene()->currentTimeline(); - QTC_ASSERT(node.isValid(), return ); - - if (value) { + if (value && node.isValid()) { activateTimelineRecording(node); } else { deactivateTimelineRecording(); diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelinewidget.cpp b/src/plugins/qmldesigner/components/timelineeditor/timelinewidget.cpp index d399eb1952..ed727dc4cc 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/timelinewidget.cpp +++ b/src/plugins/qmldesigner/components/timelineeditor/timelinewidget.cpp @@ -563,11 +563,11 @@ void TimelineWidget::setTimelineId(const QString &id) if (m_timelineView->isAttached() && !empty) { m_toolbar->setCurrentTimeline(m_timelineView->modelNodeForId(id)); m_toolbar->setCurrentState(m_timelineView->currentState().name()); - m_timelineView->setTimelineRecording(false); } else { m_toolbar->setCurrentTimeline({}); m_toolbar->setCurrentState({}); } + m_timelineView->setTimelineRecording(false); } void TimelineWidget::setTimelineActive(bool b) |