QmlDesigner: Fix mode switch crash

Task-number: QDS-8599
Change-Id: I4bebd2ff4f2ce93788743304ff335d118e23ce68
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Henning Gruendl
2022-12-15 14:38:59 +01:00
committed by Henning Gründl
parent bf4a94d619
commit 8b1233c11e
2 changed files with 5 additions and 2 deletions

View File

@@ -136,6 +136,7 @@ NodeInstanceView::NodeInstanceView(ConnectionManagerInterface &connectionManager
m_resetTimer.setSingleShot(true);
m_resetTimer.setInterval(100);
QObject::connect(&m_resetTimer, &QTimer::timeout, [this] {
if (isAttached())
resetPuppet();
});
m_updateWatcherTimer.setSingleShot(true);

View File

@@ -559,6 +559,7 @@ void AbstractView::resetView()
void AbstractView::resetPuppet()
{
QTC_ASSERT(isAttached(), return);
emitCustomNotification(QStringLiteral("reset QmlPuppet"));
}
@@ -689,6 +690,7 @@ void AbstractView::emitCustomNotification(const QString &identifier, const QList
void AbstractView::emitCustomNotification(const QString &identifier, const QList<ModelNode> &nodeList, const QList<QVariant> &data)
{
if (model())
model()->d->notifyCustomNotification(this, identifier, nodeList, data);
}