forked from qt-creator/qt-creator
QmlProjectManager: Fix starting .qmlproject on Boot2Qt
The "qmlscene" is called "qml" nowadays. Also give device settings more priority to cover cases where there is no Qt build setup at all. For this case, also demote the missing Qt build version from "Error" to "Warning". Task-number: QTCREATORBUG-28074 Change-Id: Ic44d2bee1965493925d21317d12d5c1f66ace88b Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -533,7 +533,7 @@ Tasks QmlProject::projectIssues(const Kit *k) const
|
||||
|
||||
const QtSupport::QtVersion *version = QtSupport::QtKitAspect::qtVersion(k);
|
||||
if (!version)
|
||||
result.append(createProjectTask(Task::TaskType::Error, tr("No Qt version set in kit.")));
|
||||
result.append(createProjectTask(Task::TaskType::Warning, tr("No Qt version set in kit.")));
|
||||
|
||||
IDevice::ConstPtr dev = DeviceKitAspect::device(k);
|
||||
if (dev.isNull())
|
||||
|
@@ -199,6 +199,14 @@ FilePath QmlProjectRunConfiguration::qmlRuntimeFilePath() const
|
||||
return qmlViewer;
|
||||
|
||||
Kit *kit = target()->kit();
|
||||
IDevice::ConstPtr dev = DeviceKitAspect::device(kit);
|
||||
if (!dev.isNull()) {
|
||||
const FilePath qmlRuntime = dev->qmlRunCommand();
|
||||
if (!qmlRuntime.isEmpty())
|
||||
return qmlRuntime;
|
||||
}
|
||||
|
||||
// If not given explicitly by device, try to pick it from $PATH.
|
||||
QtVersion *version = QtKitAspect::qtVersion(kit);
|
||||
if (!version) // No Qt version in Kit. Don't try to run QML runtime.
|
||||
return {};
|
||||
@@ -210,13 +218,12 @@ FilePath QmlProjectRunConfiguration::qmlRuntimeFilePath() const
|
||||
return isDesktop ? version->qmlRuntimeFilePath() : "qmlscene";
|
||||
}
|
||||
|
||||
IDevice::ConstPtr dev = DeviceKitAspect::device(kit);
|
||||
if (dev.isNull()) // No device set. We don't know where a QML utility is.
|
||||
return {};
|
||||
|
||||
const FilePath qmlRuntime = dev->qmlRunCommand();
|
||||
// If not given explicitly by device, try to pick it from $PATH.
|
||||
return qmlRuntime.isEmpty() ? "qmlscene" : qmlRuntime;
|
||||
return qmlRuntime.isEmpty() ? "qml" : qmlRuntime;
|
||||
}
|
||||
|
||||
void QmlProjectRunConfiguration::createQtVersionAspect()
|
||||
|
Reference in New Issue
Block a user