forked from qt-creator/qt-creator
Prevent access of invalid frames
Changing keyframe positions while the timelineview is hidden might lead to access of invalid frames when showing the timelineview again. Prevent this by calling invalidateScene from within the showEvent. Change-Id: Ib9c1e90de5bd7679823c4faeed9156da764c98a6 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
committed by
Thomas Hartmann
parent
1df1a065de
commit
8d30f1d004
@@ -444,10 +444,12 @@ void TimelineGraphicsScene::invalidateHeightForTarget(const ModelNode &target)
|
|||||||
|
|
||||||
void TimelineGraphicsScene::invalidateScene()
|
void TimelineGraphicsScene::invalidateScene()
|
||||||
{
|
{
|
||||||
ModelNode node = timelineView()->modelNodeForId(
|
if (timelineView()->isAttached()) {
|
||||||
timelineWidget()->toolBar()->currentTimelineId());
|
ModelNode node = timelineView()->modelNodeForId(
|
||||||
setTimeline(QmlTimeline(node));
|
timelineWidget()->toolBar()->currentTimelineId());
|
||||||
invalidateScrollbar();
|
setTimeline(QmlTimeline(node));
|
||||||
|
invalidateScrollbar();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TimelineGraphicsScene::invalidateScrollbar()
|
void TimelineGraphicsScene::invalidateScrollbar()
|
||||||
|
|||||||
@@ -625,6 +625,7 @@ void TimelineWidget::showEvent(QShowEvent *event)
|
|||||||
m_timelineView->setEnabled(true);
|
m_timelineView->setEnabled(true);
|
||||||
|
|
||||||
graphicsScene()->setWidth(m_graphicsView->viewport()->width());
|
graphicsScene()->setWidth(m_graphicsView->viewport()->width());
|
||||||
|
graphicsScene()->invalidateScene();
|
||||||
graphicsScene()->invalidateLayout();
|
graphicsScene()->invalidateLayout();
|
||||||
graphicsScene()->invalidate();
|
graphicsScene()->invalidate();
|
||||||
graphicsScene()->onShow();
|
graphicsScene()->onShow();
|
||||||
|
|||||||
Reference in New Issue
Block a user