forked from qt-creator/qt-creator
QmlDesigner: Restart puppet asynchronously when imports change
If imports are changed in transaction, the puppet restart should be done after the transaction is completed, or the new types won't work correctly until puppet is reset again. Task-number: QDS-11811 Change-Id: Ie60945fbe9e7090b7fc27b55e1b6d23d5aa04a55 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
This commit is contained in:
@@ -625,7 +625,7 @@ void NodeInstanceView::nodeOrderChanged(const NodeListProperty &listProperty)
|
||||
|
||||
void NodeInstanceView::importsChanged(const Imports &/*addedImports*/, const Imports &/*removedImports*/)
|
||||
{
|
||||
restartProcess();
|
||||
delayedRestartProcess();
|
||||
}
|
||||
|
||||
void NodeInstanceView::auxiliaryDataChanged(const ModelNode &node,
|
||||
|
@@ -182,11 +182,8 @@ QmlItemNode QmlItemNode::createQmlItemNodeForEffect(AbstractView *view,
|
||||
const QString effectName = QFileInfo(effectPath).baseName();
|
||||
Import import = Import::createLibraryImport("Effects." + effectName, "1.0");
|
||||
try {
|
||||
if (!view->model()->hasImport(import, true, true)) {
|
||||
if (!view->model()->hasImport(import, true, true))
|
||||
view->model()->changeImports({import}, {});
|
||||
// Trigger async reset puppet to ensure full transaction is done before reset
|
||||
view->resetPuppet();
|
||||
}
|
||||
} catch (const Exception &) {
|
||||
QTC_ASSERT(false, return);
|
||||
}
|
||||
|
Reference in New Issue
Block a user