QmlDesigner: Do not open extra editor when opening an example

Opening an example triggered explicit opening of the editor for the
main qml file. Code comment indicated that this was a workaround,
which appears to no longer be necessary, as project opens fine without
it. This workaround led to a duplicate DesignDocument instance being
created. This duplicate was not properly cleaned up at project close,
causing crash.

Fixes: QDS-15016
Change-Id: I7ea258470399edeffd22ed2d54f79f1779a0f8e7
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Miikka Heikkinen
2025-03-25 13:24:55 +02:00
committed by Thomas Hartmann
parent 3eefed3364
commit 6f7664855b

View File

@@ -298,13 +298,6 @@ public:
projectFile = exampleFolder + explicitQmlproject; projectFile = exampleFolder + explicitQmlproject;
ProjectExplorer::ProjectExplorerPlugin::openProjectWelcomePage(FilePath::fromString(projectFile)); ProjectExplorer::ProjectExplorerPlugin::openProjectWelcomePage(FilePath::fromString(projectFile));
const QString qmlFile = QFileInfo(projectFile).dir().absolutePath() + "/" + formFile;
// This timer should be replaced with a signal send from project loading
QTimer::singleShot(1000, this, [qmlFile]() {
Core::EditorManager::openEditor(Utils::FilePath::fromString(qmlFile));
});
} }
Q_INVOKABLE void openExample(const QString &example, Q_INVOKABLE void openExample(const QString &example,