forked from qt-creator/qt-creator
QmlProject: Allow different QML viewers per project
Change-Id: I7ca136fe1cf51b8335a15b1b2b7ea838e4859f78 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -56,6 +56,11 @@ QmlProjectRunConfiguration::QmlProjectRunConfiguration(Target *target, Id id)
|
||||
: RunConfiguration(target, id)
|
||||
{
|
||||
addAspect<QmlProjectEnvironmentAspect>();
|
||||
m_qmlViewerAspect = addAspect<BaseStringAspect>();
|
||||
m_qmlViewerAspect->setLabelText(tr("QML viewer:"));
|
||||
m_qmlViewerAspect->setPlaceHolderText(executable());
|
||||
m_qmlViewerAspect->setDisplayStyle(BaseStringAspect::LineEditDisplay);
|
||||
|
||||
setOutputFormatter<QtSupport::QtOutputFormatter>();
|
||||
|
||||
// reset default settings in constructor
|
||||
@@ -98,6 +103,10 @@ QString QmlProjectRunConfiguration::disabledReason() const
|
||||
|
||||
QString QmlProjectRunConfiguration::executable() const
|
||||
{
|
||||
const QString qmlViewer = m_qmlViewerAspect->value();
|
||||
if (!qmlViewer.isEmpty())
|
||||
return qmlViewer;
|
||||
|
||||
BaseQtVersion *version = QtKitInformation::qtVersion(target()->kit());
|
||||
if (!version) // No Qt version in Kit. Don't try to run qmlscene.
|
||||
return QString();
|
||||
|
||||
Reference in New Issue
Block a user