Commit 4bcd3d1d authored by luyikei's avatar luyikei

Timeline: Clear when MainWorkflow is cleared

parent 0079c892
......@@ -49,6 +49,13 @@ Timeline::Timeline( MainWindow* parent )
m_view->rootContext()->setContextProperty( QStringLiteral( "mainwindow" ), parent );
m_view->rootContext()->setContextProperty( QStringLiteral( "workflow" ), Core::instance()->workflow() );
m_view->setSource( QUrl( QStringLiteral( "qrc:/QML/main.qml" ) ) );
connect( Core::instance()->workflow(), &MainWorkflow::cleared, this, [this]()
{
m_view->setSource( QUrl() );
m_view->engine()->clearComponentCache();
m_view->setSource( QUrl( QStringLiteral( "qrc:/QML/main.qml" ) ) );
} );
}
Timeline::~Timeline()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment