diff --git a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp index 1e47de5b1ff6783abe51b7c2a727ca75e56ee3a3..25f395034bcb7eb3441f814c1a72a876a0b678aa 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp @@ -98,6 +98,8 @@ void QmlProjectRunConfiguration::ctor() Qt4ProjectManager::QtVersionManager *qtVersions = Qt4ProjectManager::QtVersionManager::instance(); connect(qtVersions, SIGNAL(qtVersionsChanged(QList<int>)), this, SLOT(updateEnabled())); + connect(qtVersions, SIGNAL(qtVersionsChanged(QList<int>)), this, SLOT(onViewerChanged())); + setDisplayName(tr("QML Viewer", "QMLRunConfiguration display name.")); } @@ -174,16 +176,21 @@ QWidget *QmlProjectRunConfiguration::createConfigurationWidget() Utils::PathChooser *qmlViewer = new Utils::PathChooser; qmlViewer->setExpectedKind(Utils::PathChooser::Command); - qmlViewer->setPath(viewerPath()); + qmlViewer->setPath(m_qmlViewerCustomPath); connect(qmlViewer, SIGNAL(changed(QString)), this, SLOT(onViewerChanged())); + m_qmlViewerExecutable = new QLabel; + m_qmlViewerExecutable.data()->setText(viewerPath() + " " + m_qmlViewerArgs); + QLineEdit *qmlViewerArgs = new QLineEdit; qmlViewerArgs->setText(m_qmlViewerArgs); connect(qmlViewerArgs, SIGNAL(textChanged(QString)), this, SLOT(onViewerArgsChanged())); form->addRow(tr("QML Viewer"), qmlViewer); form->addRow(tr("QML Viewer arguments:"), qmlViewerArgs); + form->addRow(QString(), m_qmlViewerExecutable.data()); + form->addRow(tr("Main QML File:"), m_fileListCombo.data()); return config; @@ -258,12 +265,19 @@ void QmlProjectRunConfiguration::onViewerChanged() if (Utils::PathChooser *chooser = qobject_cast<Utils::PathChooser *>(sender())) { m_qmlViewerCustomPath = chooser->path(); } + if (!m_qmlViewerExecutable.isNull()) { + m_qmlViewerExecutable.data()->setText(viewerPath() + " " + m_qmlViewerArgs); + } } void QmlProjectRunConfiguration::onViewerArgsChanged() { if (QLineEdit *lineEdit = qobject_cast<QLineEdit*>(sender())) m_qmlViewerArgs = lineEdit->text(); + + if (!m_qmlViewerExecutable.isNull()) { + m_qmlViewerExecutable.data()->setText(viewerPath() + " " + m_qmlViewerArgs); + } } void QmlProjectRunConfiguration::onDebugServerPortChanged() diff --git a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.h b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.h index 53adfb0cb6c8adea95886a35ee901e9b0c5852b4..1c3f12cd6ed1e2ad04f0f870b0d0f432a858ec1d 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.h +++ b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.h @@ -34,6 +34,7 @@ #include <projectexplorer/runconfiguration.h> #include <QWeakPointer> #include <QComboBox> +#include <QLabel> QT_FORWARD_DECLARE_CLASS(QStringListModel); @@ -121,6 +122,7 @@ private: QStringListModel *m_fileListModel; // weakpointer is used to make sure we don't try to manipulate // widget which was deleted already, as can be the case here. + QWeakPointer<QLabel> m_qmlViewerExecutable; QWeakPointer<QComboBox> m_fileListCombo; Internal::QmlProjectTarget *m_projectTarget;