diff --git a/src/plugins/qmlprojectmanager/qmlproject.cpp b/src/plugins/qmlprojectmanager/qmlproject.cpp index 5e334827f61..60726bf14f6 100644 --- a/src/plugins/qmlprojectmanager/qmlproject.cpp +++ b/src/plugins/qmlprojectmanager/qmlproject.cpp @@ -34,6 +34,7 @@ #include #include +#include #include #include #include @@ -142,6 +143,18 @@ QmlProject::QmlProject(const Utils::FilePath &fileName) QTimer::singleShot(0, this, lambda); } + } else { + connect(this, &QmlProject::anyParsingFinished, this, [this](Target *target, bool success) { + if (target && success) { + const Utils::FilePath &folder = projectDirectory(); + const Utils::FilePaths &uiFiles = files([&](const ProjectExplorer::Node *node) { + return node->filePath().completeSuffix() == "ui.qml" + && node->filePath().parentDir() == folder; + }); + if (!uiFiles.isEmpty()) + Core::EditorManager::openEditor(uiFiles.first(), Utils::Id()); + } + }); } }