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);
|
const QtSupport::QtVersion *version = QtSupport::QtKitAspect::qtVersion(k);
|
||||||
if (!version)
|
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);
|
IDevice::ConstPtr dev = DeviceKitAspect::device(k);
|
||||||
if (dev.isNull())
|
if (dev.isNull())
|
||||||
|
@@ -199,6 +199,14 @@ FilePath QmlProjectRunConfiguration::qmlRuntimeFilePath() const
|
|||||||
return qmlViewer;
|
return qmlViewer;
|
||||||
|
|
||||||
Kit *kit = target()->kit();
|
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);
|
QtVersion *version = QtKitAspect::qtVersion(kit);
|
||||||
if (!version) // No Qt version in Kit. Don't try to run QML runtime.
|
if (!version) // No Qt version in Kit. Don't try to run QML runtime.
|
||||||
return {};
|
return {};
|
||||||
@@ -210,13 +218,12 @@ FilePath QmlProjectRunConfiguration::qmlRuntimeFilePath() const
|
|||||||
return isDesktop ? version->qmlRuntimeFilePath() : "qmlscene";
|
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.
|
if (dev.isNull()) // No device set. We don't know where a QML utility is.
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
const FilePath qmlRuntime = dev->qmlRunCommand();
|
const FilePath qmlRuntime = dev->qmlRunCommand();
|
||||||
// If not given explicitly by device, try to pick it from $PATH.
|
// 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()
|
void QmlProjectRunConfiguration::createQtVersionAspect()
|
||||||
|
Reference in New Issue
Block a user