QmlProjectManager: Use a PathChooser for the fallback qmlscene

Allows to browse for binaries on the target instead of having to
specify a proper fully qualified remote path manually.

Change-Id: Iaf9dc5c4fe921a7188ef2178f10403fa01e69d03
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
hjk
2022-11-28 14:16:21 +01:00
parent 9a9061a04a
commit 50f6afe4d0

View File

@@ -74,7 +74,7 @@ QmlProjectRunConfiguration::QmlProjectRunConfiguration(Target *target, Id id)
m_qmlViewerAspect = addAspect<StringAspect>();
m_qmlViewerAspect->setLabelText(tr("QML Viewer:"));
m_qmlViewerAspect->setPlaceHolderText(commandLine().executable().toString());
m_qmlViewerAspect->setDisplayStyle(StringAspect::LineEditDisplay);
m_qmlViewerAspect->setDisplayStyle(StringAspect::PathChooserDisplay);
m_qmlViewerAspect->setHistoryCompleter("QmlProjectManager.viewer.history");
auto argumentAspect = addAspect<ArgumentsAspect>(macroExpander());
@@ -157,9 +157,10 @@ QString QmlProjectRunConfiguration::disabledReason() const
FilePath QmlProjectRunConfiguration::qmlRuntimeFilePath() const
{
const QString qmlViewer = m_qmlViewerAspect->value();
// Give precedence to the manual override.
const FilePath qmlViewer = m_qmlViewerAspect->filePath();
if (!qmlViewer.isEmpty())
return FilePath::fromString(qmlViewer);
return qmlViewer;
Kit *kit = target()->kit();
QtVersion *version = QtKitAspect::qtVersion(kit);