QML Project Manager: fix host detection

Assuming that a kit that has deploy steps is not meant for
running on the host is not always correct.
When working with Qt for MCU for live previews there is an essentially
ordinary desktop kit with a QML exporter set to run as a deploy step.
We used to wrongly treat this as a remote setup, selecting
the standard QML runtime instead of QML puppet.
It caused caused fonts to be rendered incorrectly in Live Preview.

Amends: 8e0e097f55

Fixes: QDS-14901
Change-Id: Iace1943bf888274fc47680a2bd8b1d787f665620
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Andrii Semkiv
2025-03-17 10:42:34 +01:00
parent 06b15a1a1b
commit ba2d4aaa52

View File

@@ -211,18 +211,13 @@ FilePath QmlProjectRunConfiguration::qmlRuntimeFilePath() const
if (!qmlRuntime.isEmpty()) if (!qmlRuntime.isEmpty())
return qmlRuntime; return qmlRuntime;
} }
auto hasDeployStep = [this] {
return target()->activeDeployConfiguration() &&
!target()->activeDeployConfiguration()->stepList()->isEmpty();
};
// The Qt version might know, but we need to make sure // The Qt version might know, but we need to make sure
// that the device can reach it. // that the device can reach it.
if (QtVersion *version = QtKitAspect::qtVersion(kit)) { if (QtVersion *version = QtKitAspect::qtVersion(kit)) {
// look for QML Puppet as qmlruntime only in QtStudio Qt versions // look for QML Puppet as qmlruntime only in QtStudio Qt versions
if (version->features().contains("QtStudio") && if (version->features().contains("QtStudio") && version->qtVersion().majorVersion() > 5
version->qtVersion().majorVersion() > 5 && !hasDeployStep()) { && dev->rootPath().isLocal()) {
auto [workingDirectoryPath, puppetPath] = QmlDesigner::QmlPuppetPaths::qmlPuppetPaths( auto [workingDirectoryPath, puppetPath] = QmlDesigner::QmlPuppetPaths::qmlPuppetPaths(
target(), QmlDesigner::QmlDesignerBasePlugin::settings()); target(), QmlDesigner::QmlDesignerBasePlugin::settings());
if (!puppetPath.isEmpty()) { if (!puppetPath.isEmpty()) {