Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
e4a3ad21
Commit
e4a3ad21
authored
Sep 30, 2009
by
Kai Koehne
Browse files
Add option to specify qmlviewer command line arguments
parent
eef3f47a
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/qmlprojectmanager/qmlproject.cpp
View file @
e4a3ad21
...
...
@@ -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
())
...
...
src/plugins/qmlprojectmanager/qmlproject.h
View file @
e4a3ad21
...
...
@@ -166,6 +166,7 @@ public:
private
Q_SLOTS
:
void
setMainScript
(
const
QString
&
scriptFile
);
void
onQmlViewerChanged
();
void
onQmlViewerArgsChanged
();
private:
...
...
@@ -175,6 +176,7 @@ private:
QmlProject
*
m_project
;
QString
m_scriptFile
;
QString
m_qmlViewer
;
QString
m_qmlViewerArgs
;
QLatin1String
m_type
;
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment