aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmlprojectmanager/qmlproject.cpp
diff options
context:
space:
mode:
authorKai Koehne <[email protected]>2009-09-30 11:36:34 +0200
committerKai Koehne <[email protected]>2009-09-30 11:37:17 +0200
commite4a3ad2108fd211642c5f91ebca90c23c94250b4 (patch)
tree2ed84b1d8d39337ede48ead23437152596c8a568 /src/plugins/qmlprojectmanager/qmlproject.cpp
parenteef3f47a33b1151480f13e99a0f1574bb73f58b6 (diff)
Add option to specify qmlviewer command line arguments
Diffstat (limited to 'src/plugins/qmlprojectmanager/qmlproject.cpp')
-rw-r--r--src/plugins/qmlprojectmanager/qmlproject.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/plugins/qmlprojectmanager/qmlproject.cpp b/src/plugins/qmlprojectmanager/qmlproject.cpp
index a7651566a1d..f65944933ee 100644
--- a/src/plugins/qmlprojectmanager/qmlproject.cpp
+++ b/src/plugins/qmlprojectmanager/qmlproject.cpp
@@ -55,6 +55,7 @@
#include <QtGui/QMainWindow>
#include <QtGui/QComboBox>
#include <QtGui/QMessageBox>
+#include <QtGui/QLineEdit>
using namespace QmlProjectManager;
using namespace QmlProjectManager::Internal;
@@ -365,6 +366,9 @@ QStringList QmlRunConfiguration::commandLineArguments() const
{
QStringList args;
+ if (!m_qmlViewerArgs.isEmpty())
+ args.append(m_qmlViewerArgs);
+
const QString s = mainScript();
if (! s.isEmpty())
args.append(s);
@@ -424,7 +428,12 @@ QWidget *QmlRunConfiguration::configurationWidget()
qmlViewer->setPath(executable());
connect(qmlViewer, SIGNAL(changed(QString)), this, SLOT(onQmlViewerChanged()));
+ QLineEdit *qmlViewerArgs = new QLineEdit;
+ qmlViewerArgs->setText(m_qmlViewerArgs);
+ connect(qmlViewerArgs, SIGNAL(textChanged(QString)), this, SLOT(onQmlViewerArgsChanged()));
+
form->addRow(tr("QML Viewer"), qmlViewer);
+ form->addRow(tr("QML Viewer arguments:"), qmlViewerArgs);
form->addRow(tr("Main QML File:"), combo);
return config;
@@ -454,11 +463,18 @@ void QmlRunConfiguration::onQmlViewerChanged()
}
}
+void QmlRunConfiguration::onQmlViewerArgsChanged()
+{
+ if (QLineEdit *lineEdit = qobject_cast<QLineEdit*>(sender()))
+ m_qmlViewerArgs = lineEdit->text();
+}
+
void QmlRunConfiguration::save(ProjectExplorer::PersistentSettingsWriter &writer) const
{
ProjectExplorer::LocalApplicationRunConfiguration::save(writer);
writer.saveValue(QLatin1String("qmlviewer"), m_qmlViewer);
+ writer.saveValue(QLatin1String("qmlviewerargs"), m_qmlViewerArgs);
writer.saveValue(QLatin1String("mainscript"), m_scriptFile);
}
@@ -467,6 +483,7 @@ void QmlRunConfiguration::restore(const ProjectExplorer::PersistentSettingsReade
ProjectExplorer::LocalApplicationRunConfiguration::restore(reader);
m_qmlViewer = reader.restoreValue(QLatin1String("qmlviewer")).toString();
+ m_qmlViewerArgs = reader.restoreValue(QLatin1String("qmlviewerargs")).toString();
m_scriptFile = reader.restoreValue(QLatin1String("mainscript")).toString();
if (m_qmlViewer.isEmpty())