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>
(cherry picked from commit 50f6afe4d0)
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
hjk
2022-11-28 14:16:21 +01:00
committed by Thomas Hartmann
parent c7f9d9af24
commit 82ecd3910b

View File

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