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
6f11765d
Commit
6f11765d
authored
Sep 02, 2010
by
Kai Koehne
Browse files
Qml: Allow user to configure port used (all project types)
Reviewed-by: dt
parent
cacd1a91
Changes
18
Hide whitespace changes
Inline
Side-by-side
src/libs/utils/debuggerlanguagechooser.cpp
View file @
6f11765d
...
...
@@ -2,24 +2,61 @@
#include
<QHBoxLayout>
#include
<QCheckBox>
#include
<QSpinBox>
#include
<QLabel>
namespace
Utils
{
DebuggerLanguageChooser
::
DebuggerLanguageChooser
(
QWidget
*
parent
)
:
QWidget
(
parent
)
{
QHBoxLayout
*
layout
=
new
QHBoxLayout
(
this
);
setLayout
(
layout
);
m_useCppDebugger
=
new
QCheckBox
(
tr
(
"C++"
),
this
);
m_useQmlDebugger
=
new
QCheckBox
(
tr
(
"QML"
),
this
);
layout
->
setMargin
(
0
);
layout
->
addWidget
(
m_useCppDebugger
);
layout
->
addWidget
(
m_useQmlDebugger
);
connect
(
m_useCppDebugger
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
useCppDebuggerToggled
(
bool
)));
connect
(
m_useQmlDebugger
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
useQmlDebuggerToggled
(
bool
)));
m_debugServerPortLabel
=
new
QLabel
(
tr
(
"Debug Port:"
),
this
);
m_debugServerPort
=
new
QSpinBox
(
this
);
m_debugServerPort
->
setMinimum
(
1
);
m_debugServerPort
->
setMaximum
(
65535
);
m_debugServerPortLabel
->
setBuddy
(
m_debugServerPort
);
connect
(
m_useQmlDebugger
,
SIGNAL
(
toggled
(
bool
)),
m_debugServerPort
,
SLOT
(
setEnabled
(
bool
)));
connect
(
m_useQmlDebugger
,
SIGNAL
(
toggled
(
bool
)),
m_debugServerPortLabel
,
SLOT
(
setEnabled
(
bool
)));
connect
(
m_debugServerPort
,
SIGNAL
(
valueChanged
(
int
)),
this
,
SIGNAL
(
qmlDebugServerPortChanged
(
uint
)));
QHBoxLayout
*
qmlLayout
=
new
QHBoxLayout
;
qmlLayout
->
setMargin
(
0
);
qmlLayout
->
addWidget
(
m_useQmlDebugger
);
qmlLayout
->
addWidget
(
m_debugServerPortLabel
);
qmlLayout
->
addWidget
(
m_debugServerPort
);
qmlLayout
->
addStretch
();
QVBoxLayout
*
layout
=
new
QVBoxLayout
;
layout
->
setMargin
(
0
);
layout
->
addWidget
(
m_useCppDebugger
);
layout
->
addLayout
(
qmlLayout
);
setLayout
(
layout
);
}
bool
DebuggerLanguageChooser
::
cppChecked
()
const
{
return
m_useCppDebugger
->
isChecked
();
}
bool
DebuggerLanguageChooser
::
qmlChecked
()
const
{
return
m_useQmlDebugger
->
isChecked
();
}
uint
DebuggerLanguageChooser
::
qmlDebugServerPort
()
const
{
return
m_debugServerPort
->
value
();
}
void
DebuggerLanguageChooser
::
setCppChecked
(
bool
value
)
...
...
@@ -30,6 +67,13 @@ void DebuggerLanguageChooser::setCppChecked(bool value)
void
DebuggerLanguageChooser
::
setQmlChecked
(
bool
value
)
{
m_useQmlDebugger
->
setChecked
(
value
);
m_debugServerPortLabel
->
setEnabled
(
value
);
m_debugServerPort
->
setEnabled
(
value
);
}
void
DebuggerLanguageChooser
::
setQmlDebugServerPort
(
uint
port
)
{
m_debugServerPort
->
setValue
(
port
);
}
void
DebuggerLanguageChooser
::
useCppDebuggerToggled
(
bool
toggled
)
...
...
src/libs/utils/debuggerlanguagechooser.h
View file @
6f11765d
...
...
@@ -5,6 +5,8 @@
#include
"utils_global.h"
QT_FORWARD_DECLARE_CLASS
(
QCheckBox
);
QT_FORWARD_DECLARE_CLASS
(
QLabel
);
QT_FORWARD_DECLARE_CLASS
(
QSpinBox
);
namespace
Utils
{
...
...
@@ -14,12 +16,18 @@ class QTCREATOR_UTILS_EXPORT DebuggerLanguageChooser : public QWidget
public:
explicit
DebuggerLanguageChooser
(
QWidget
*
parent
=
0
);
bool
cppChecked
()
const
;
bool
qmlChecked
()
const
;
uint
qmlDebugServerPort
()
const
;
void
setCppChecked
(
bool
value
);
void
setQmlChecked
(
bool
value
);
void
setQmlDebugServerPort
(
uint
port
);
signals:
void
cppLanguageToggled
(
bool
value
);
void
qmlLanguageToggled
(
bool
value
);
void
qmlDebugServerPortChanged
(
uint
port
);
private
slots
:
void
useCppDebuggerToggled
(
bool
toggled
);
...
...
@@ -28,6 +36,8 @@ private slots:
private:
QCheckBox
*
m_useCppDebugger
;
QCheckBox
*
m_useQmlDebugger
;
QSpinBox
*
m_debugServerPort
;
QLabel
*
m_debugServerPortLabel
;
};
}
// namespace Utils
...
...
src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp
View file @
6f11765d
...
...
@@ -353,6 +353,7 @@ CMakeRunConfigurationWidget::CMakeRunConfigurationWidget(CMakeRunConfiguration *
m_debuggerLanguageChooser
->
setCppChecked
(
m_cmakeRunConfiguration
->
useCppDebugger
());
m_debuggerLanguageChooser
->
setQmlChecked
(
m_cmakeRunConfiguration
->
useQmlDebugger
());
m_debuggerLanguageChooser
->
setQmlDebugServerPort
(
m_cmakeRunConfiguration
->
qmlDebugServerPort
());
m_detailsContainer
=
new
Utils
::
DetailsWidget
(
this
);
m_detailsContainer
->
setState
(
Utils
::
DetailsWidget
::
NoSummary
);
...
...
@@ -406,6 +407,8 @@ CMakeRunConfigurationWidget::CMakeRunConfigurationWidget(CMakeRunConfiguration *
this
,
SLOT
(
useCppDebuggerToggled
(
bool
)));
connect
(
m_debuggerLanguageChooser
,
SIGNAL
(
qmlLanguageToggled
(
bool
)),
this
,
SLOT
(
useQmlDebuggerToggled
(
bool
)));
connect
(
m_debuggerLanguageChooser
,
SIGNAL
(
qmlDebugServerPortChanged
(
uint
)),
this
,
SLOT
(
qmlDebugServerPortChanged
(
uint
)));
connect
(
m_environmentWidget
,
SIGNAL
(
userChangesChanged
()),
this
,
SLOT
(
userChangesChanged
()));
...
...
@@ -451,6 +454,11 @@ void CMakeRunConfigurationWidget::useQmlDebuggerToggled(bool toggled)
m_cmakeRunConfiguration
->
setUseQmlDebugger
(
toggled
);
}
void
CMakeRunConfigurationWidget
::
qmlDebugServerPortChanged
(
uint
port
)
{
m_cmakeRunConfiguration
->
setQmlDebugServerPort
(
port
);
}
void
CMakeRunConfigurationWidget
::
userChangesChanged
()
{
m_cmakeRunConfiguration
->
setUserEnvironmentChanges
(
m_environmentWidget
->
userChanges
());
...
...
src/plugins/cmakeprojectmanager/cmakerunconfiguration.h
View file @
6f11765d
...
...
@@ -143,6 +143,7 @@ private slots:
void
resetWorkingDirectory
();
void
useCppDebuggerToggled
(
bool
toggled
);
void
useQmlDebuggerToggled
(
bool
toggled
);
void
qmlDebugServerPortChanged
(
uint
port
);
private
slots
:
void
baseEnvironmentComboBoxChanged
(
int
index
);
...
...
src/plugins/debugger/debuggerconstants.h
View file @
6f11765d
...
...
@@ -62,7 +62,6 @@ const char * const DEBUGGER_SETTINGS_TR_CATEGORY =
const
char
*
const
DEBUGGER_COMMON_SETTINGS_CATEGORY_ICON
=
":/core/images/category_debug.png"
;
const
int
QML_DEFAULT_DEBUG_SERVER_PORT
=
3768
;
const
char
*
const
E_QML_DEBUG_SERVER_PORT
=
"QML_DEBUG_SERVER_PORT"
;
// dock widget names
...
...
src/plugins/debugger/debuggerengine.cpp
View file @
6f11765d
...
...
@@ -110,7 +110,7 @@ DebuggerStartParameters::DebuggerStartParameters()
useTerminal
(
false
),
breakAtMain
(
false
),
qmlServerAddress
(
"127.0.0.1"
),
qmlServerPort
(
Constants
::
QML_DEFAULT_DEBUG_SERVER_PORT
),
qmlServerPort
(
0
),
toolChainType
(
ToolChain
::
UNKNOWN
),
startMode
(
NoStartMode
),
executableUid
(
0
)
...
...
src/plugins/debugger/debuggerrunner.cpp
View file @
6f11765d
...
...
@@ -154,9 +154,7 @@ static DebuggerStartParameters localStartParameters(RunConfiguration *runConfigu
DebuggerLanguages
activeLangs
=
DebuggerUISwitcher
::
instance
()
->
activeDebugLanguages
();
if
(
activeLangs
&
QmlLanguage
)
{
sp
.
qmlServerAddress
=
QLatin1String
(
"127.0.0.1"
);
sp
.
qmlServerPort
=
rc
->
environment
().
value
(
"QML_DEBUG_SERVER_PORT"
).
toUInt
();
if
(
sp
.
qmlServerPort
==
0
)
sp
.
qmlServerPort
=
Constants
::
QML_DEFAULT_DEBUG_SERVER_PORT
;
sp
.
qmlServerPort
=
runConfiguration
->
qmlDebugServerPort
();
sp
.
environment
<<
QString
(
Constants
::
E_QML_DEBUG_SERVER_PORT
)
+
QLatin1Char
(
'='
)
+
QString
::
number
(
sp
.
qmlServerPort
);
...
...
src/plugins/projectexplorer/customexecutablerunconfiguration.cpp
View file @
6f11765d
...
...
@@ -109,6 +109,7 @@ CustomExecutableConfigurationWidget::CustomExecutableConfigurationWidget(CustomE
m_debuggerLanguageChooser
->
setCppChecked
(
m_runConfiguration
->
useCppDebugger
());
m_debuggerLanguageChooser
->
setQmlChecked
(
m_runConfiguration
->
useQmlDebugger
());
m_debuggerLanguageChooser
->
setQmlDebugServerPort
(
m_runConfiguration
->
qmlDebugServerPort
());
QVBoxLayout
*
vbox
=
new
QVBoxLayout
(
this
);
vbox
->
setMargin
(
0
);
...
...
@@ -166,6 +167,8 @@ CustomExecutableConfigurationWidget::CustomExecutableConfigurationWidget(CustomE
this
,
SLOT
(
useCppDebuggerToggled
(
bool
)));
connect
(
m_debuggerLanguageChooser
,
SIGNAL
(
qmlLanguageToggled
(
bool
)),
this
,
SLOT
(
useQmlDebuggerToggled
(
bool
)));
connect
(
m_debuggerLanguageChooser
,
SIGNAL
(
qmlDebugServerPortChanged
(
uint
)),
this
,
SLOT
(
qmlDebugServerPortChanged
(
uint
)));
connect
(
m_runConfiguration
,
SIGNAL
(
changed
()),
this
,
SLOT
(
changed
()));
...
...
@@ -203,6 +206,11 @@ void CustomExecutableConfigurationWidget::useQmlDebuggerToggled(bool toggled)
m_runConfiguration
->
setUseQmlDebugger
(
toggled
);
}
void
CustomExecutableConfigurationWidget
::
qmlDebugServerPortChanged
(
uint
port
)
{
m_runConfiguration
->
setQmlDebugServerPort
(
port
);
}
void
CustomExecutableConfigurationWidget
::
baseEnvironmentChanged
()
{
if
(
m_ignoreChange
)
...
...
src/plugins/projectexplorer/customexecutablerunconfiguration.h
View file @
6f11765d
...
...
@@ -187,6 +187,7 @@ private slots:
void
baseEnvironmentSelected
(
int
index
);
void
useCppDebuggerToggled
(
bool
toggled
);
void
useQmlDebuggerToggled
(
bool
toggled
);
void
qmlDebugServerPortChanged
(
uint
port
);
private:
bool
m_ignoreChange
;
...
...
src/plugins/projectexplorer/projectexplorerconstants.h
View file @
6f11765d
...
...
@@ -217,6 +217,9 @@ const char * const BUILDSTEPS_DEPLOY = "ProjectExplorer.BuildSteps.Deploy";
// Deploy Configuration id:
const
char
*
const
DEFAULT_DEPLOYCONFIGURATION_ID
=
"ProjectExplorer.DefaultDeployConfiguration"
;
// Run Configuration defaults:
const
int
QML_DEFAULT_DEBUG_SERVER_PORT
=
3768
;
}
// namespace Constants
}
// namespace ProjectExplorer
...
...
src/plugins/projectexplorer/runconfiguration.cpp
View file @
6f11765d
...
...
@@ -33,6 +33,7 @@
#include
"project.h"
#include
"target.h"
#include
"buildconfiguration.h"
#include
"projectexplorerconstants.h"
#include
<extensionsystem/pluginmanager.h>
#include
<coreplugin/icore.h>
...
...
@@ -54,6 +55,7 @@ namespace {
const
char
*
const
USE_CPP_DEBUGGER_KEY
(
"RunConfiguration.UseCppDebugger"
);
const
char
*
const
USE_QML_DEBUGGER_KEY
(
"RunConfiguration.UseQmlDebugger"
);
const
char
*
const
QML_DEBUG_SERVER_PORT_KEY
(
"RunConfiguration.QmlDebugServerPort"
);
class
RunConfigurationFactoryMatcher
{
...
...
@@ -146,7 +148,8 @@ IRunConfigurationFactory * findRunConfigurationFactory(RunConfigurationFactoryMa
RunConfiguration
::
RunConfiguration
(
Target
*
target
,
const
QString
&
id
)
:
ProjectConfiguration
(
target
,
id
),
m_useCppDebugger
(
true
),
m_useQmlDebugger
(
false
)
m_useQmlDebugger
(
false
),
m_qmlDebugServerPort
(
Constants
::
QML_DEFAULT_DEBUG_SERVER_PORT
)
{
Q_ASSERT
(
target
);
}
...
...
@@ -209,11 +212,23 @@ bool RunConfiguration::useQmlDebugger() const
return
m_useQmlDebugger
;
}
uint
RunConfiguration
::
qmlDebugServerPort
()
const
{
return
m_qmlDebugServerPort
;
}
void
RunConfiguration
::
setQmlDebugServerPort
(
uint
port
)
{
m_qmlDebugServerPort
=
port
;
emit
qmlDebugServerPortChanged
(
port
);
}
QVariantMap
RunConfiguration
::
toMap
()
const
{
QVariantMap
map
(
ProjectConfiguration
::
toMap
());
map
.
insert
(
QLatin1String
(
USE_CPP_DEBUGGER_KEY
),
m_useCppDebugger
);
map
.
insert
(
QLatin1String
(
USE_QML_DEBUGGER_KEY
),
m_useQmlDebugger
);
map
.
insert
(
QLatin1String
(
QML_DEBUG_SERVER_PORT_KEY
),
m_qmlDebugServerPort
);
return
map
;
}
...
...
@@ -221,6 +236,7 @@ bool RunConfiguration::fromMap(const QVariantMap &map)
{
m_useCppDebugger
=
map
.
value
(
QLatin1String
(
USE_CPP_DEBUGGER_KEY
),
true
).
toBool
();
m_useQmlDebugger
=
map
.
value
(
QLatin1String
(
USE_QML_DEBUGGER_KEY
),
false
).
toBool
();
m_qmlDebugServerPort
=
map
.
value
(
QLatin1String
(
QML_DEBUG_SERVER_PORT_KEY
),
Constants
::
QML_DEFAULT_DEBUG_SERVER_PORT
).
toUInt
();
return
ProjectConfiguration
::
fromMap
(
map
);
}
...
...
src/plugins/projectexplorer/runconfiguration.h
View file @
6f11765d
...
...
@@ -91,11 +91,16 @@ public:
void
setUseCppDebugger
(
bool
value
);
bool
useQmlDebugger
()
const
;
bool
useCppDebugger
()
const
;
uint
qmlDebugServerPort
()
const
;
void
setQmlDebugServerPort
(
uint
port
);
virtual
QVariantMap
toMap
()
const
;
signals:
void
isEnabledChanged
(
bool
value
);
void
debuggersChanged
();
void
qmlDebugServerPortChanged
(
uint
port
);
protected:
RunConfiguration
(
Target
*
parent
,
const
QString
&
id
);
...
...
@@ -109,6 +114,7 @@ protected:
private:
bool
m_useCppDebugger
;
bool
m_useQmlDebugger
;
uint
m_qmlDebugServerPort
;
};
/**
...
...
src/plugins/qmlprojectmanager/qmlprojectmanagerconstants.h
View file @
6f11765d
...
...
@@ -39,10 +39,6 @@ const char * const QML_VIEWER_ARGUMENTS_KEY = "QmlProjectManager.QmlRunConfigura
const
char
*
const
QML_VIEWER_TARGET_ID
=
"QmlProjectManager.QmlTarget"
;
const
char
*
const
QML_VIEWER_TARGET_DISPLAY_NAME
=
"QML Viewer"
;
const
char
*
const
QML_MAINSCRIPT_KEY
=
"QmlProjectManager.QmlRunConfiguration.MainScript"
;
const
char
*
const
QML_DEBUG_SERVER_ADDRESS_KEY
=
"QmlProjectManager.QmlRunConfiguration.DebugServerAddress"
;
const
char
*
const
QML_DEBUG_SERVER_PORT_KEY
=
"QmlProjectManager.QmlRunConfiguration.DebugServerPort"
;
const
int
QML_DEFAULT_DEBUG_SERVER_PORT
=
3768
;
}
// namespace Constants
}
// namespace QmlProjectManager
src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp
View file @
6f11765d
...
...
@@ -55,12 +55,6 @@
namespace
QmlProjectManager
{
QmlProjectRunConfigurationDebugData
::
QmlProjectRunConfigurationDebugData
()
:
serverAddress
(
"127.0.0.1"
),
serverPort
(
Constants
::
QML_DEFAULT_DEBUG_SERVER_PORT
)
{
}
QmlProjectRunConfiguration
::
QmlProjectRunConfiguration
(
Internal
::
QmlProjectTarget
*
parent
)
:
ProjectExplorer
::
RunConfiguration
(
parent
,
QLatin1String
(
Constants
::
QML_RC_ID
)),
m_fileListModel
(
new
QStringListModel
(
this
)),
...
...
@@ -79,8 +73,6 @@ QmlProjectRunConfiguration::QmlProjectRunConfiguration(Internal::QmlProjectTarge
m_projectTarget
(
parent
)
{
ctor
();
m_debugData
.
serverAddress
=
source
->
m_debugData
.
serverAddress
;
m_debugData
.
serverPort
=
source
->
m_debugData
.
serverPort
;
setMainScript
(
source
->
m_scriptFile
);
}
...
...
@@ -112,11 +104,6 @@ QmlProjectRunConfiguration::~QmlProjectRunConfiguration()
{
}
QString
QmlProjectRunConfiguration
::
debugServerAddress
()
const
{
return
m_debugData
.
serverAddress
;
}
Internal
::
QmlProjectTarget
*
QmlProjectRunConfiguration
::
qmlTarget
()
const
{
return
static_cast
<
Internal
::
QmlProjectTarget
*>
(
target
());
...
...
@@ -156,11 +143,6 @@ QString QmlProjectRunConfiguration::workingDirectory() const
return
projectFile
.
absolutePath
();
}
uint
QmlProjectRunConfiguration
::
debugServerPort
()
const
{
return
m_debugData
.
serverPort
;
}
static
bool
caseInsensitiveLessThan
(
const
QString
&
s1
,
const
QString
&
s2
)
{
return
s1
.
toLower
()
<
s2
.
toLower
();
...
...
@@ -191,21 +173,9 @@ QWidget *QmlProjectRunConfiguration::createConfigurationWidget()
qmlViewerArgs
->
setText
(
m_qmlViewerArgs
);
connect
(
qmlViewerArgs
,
SIGNAL
(
textChanged
(
QString
)),
this
,
SLOT
(
onViewerArgsChanged
()));
QLineEdit
*
debugServer
=
new
QLineEdit
;
debugServer
->
setText
(
m_debugData
.
serverAddress
);
connect
(
debugServer
,
SIGNAL
(
textChanged
(
QString
)),
this
,
SLOT
(
onDebugServerAddressChanged
()));
QSpinBox
*
debugPort
=
new
QSpinBox
;
debugPort
->
setMinimum
(
1024
);
// valid registered/dynamic/free ports according to http://www.iana.org/assignments/port-numbers
debugPort
->
setMaximum
(
65535
);
debugPort
->
setValue
(
m_debugData
.
serverPort
);
connect
(
debugPort
,
SIGNAL
(
valueChanged
(
int
)),
this
,
SLOT
(
onDebugServerPortChanged
()));
form
->
addRow
(
tr
(
"Custom QML Viewer:"
),
qmlViewer
);
form
->
addRow
(
tr
(
"QML Viewer arguments:"
),
qmlViewerArgs
);
form
->
addRow
(
QString
(),
m_qmlViewerExecutable
.
data
());
form
->
addRow
(
tr
(
"Debugging Address:"
),
debugServer
);
form
->
addRow
(
tr
(
"Debugging Port:"
),
debugPort
);
QLabel
*
debuggerLabel
=
new
QLabel
(
tr
(
"Debugger:"
),
config
);
Utils
::
DebuggerLanguageChooser
*
debuggerLanguageChooser
=
new
Utils
::
DebuggerLanguageChooser
(
config
);
...
...
@@ -215,11 +185,14 @@ QWidget *QmlProjectRunConfiguration::createConfigurationWidget()
debuggerLanguageChooser
->
setCppChecked
(
useCppDebugger
());
debuggerLanguageChooser
->
setQmlChecked
(
useQmlDebugger
());
debuggerLanguageChooser
->
setQmlDebugServerPort
(
qmlDebugServerPort
());
connect
(
debuggerLanguageChooser
,
SIGNAL
(
cppLanguageToggled
(
bool
)),
this
,
SLOT
(
useCppDebuggerToggled
(
bool
)));
connect
(
debuggerLanguageChooser
,
SIGNAL
(
qmlLanguageToggled
(
bool
)),
this
,
SLOT
(
useQmlDebuggerToggled
(
bool
)));
connect
(
debuggerLanguageChooser
,
SIGNAL
(
qmlDebugServerPortChanged
(
uint
)),
this
,
SLOT
(
qmlDebugServerPortChanged
(
uint
)));
return
config
;
}
...
...
@@ -265,12 +238,6 @@ void QmlProjectRunConfiguration::updateFileComboBox()
m_fileListCombo
.
data
()
->
setCurrentIndex
(
0
);
}
void
QmlProjectRunConfiguration
::
onDebugServerAddressChanged
()
{
if
(
QLineEdit
*
lineEdit
=
qobject_cast
<
QLineEdit
*>
(
sender
()))
m_debugData
.
serverAddress
=
lineEdit
->
text
();
}
void
QmlProjectRunConfiguration
::
setMainScript
(
const
QString
&
scriptFile
)
{
m_scriptFile
=
scriptFile
;
...
...
@@ -308,13 +275,6 @@ void QmlProjectRunConfiguration::onViewerArgsChanged()
}
}
void
QmlProjectRunConfiguration
::
onDebugServerPortChanged
()
{
if
(
QSpinBox
*
spinBox
=
qobject_cast
<
QSpinBox
*>
(
sender
()))
{
m_debugData
.
serverPort
=
spinBox
->
value
();
}
}
void
QmlProjectRunConfiguration
::
useCppDebuggerToggled
(
bool
toggled
)
{
setUseCppDebugger
(
toggled
);
...
...
@@ -325,6 +285,10 @@ void QmlProjectRunConfiguration::useQmlDebuggerToggled(bool toggled)
setUseQmlDebugger
(
toggled
);
}
void
QmlProjectRunConfiguration
::
qmlDebugServerPortChanged
(
uint
port
)
{
setQmlDebugServerPort
(
port
);
}
QVariantMap
QmlProjectRunConfiguration
::
toMap
()
const
{
...
...
@@ -333,8 +297,6 @@ QVariantMap QmlProjectRunConfiguration::toMap() const
map
.
insert
(
QLatin1String
(
Constants
::
QML_VIEWER_KEY
),
m_qmlViewerCustomPath
);
map
.
insert
(
QLatin1String
(
Constants
::
QML_VIEWER_ARGUMENTS_KEY
),
m_qmlViewerArgs
);
map
.
insert
(
QLatin1String
(
Constants
::
QML_MAINSCRIPT_KEY
),
m_scriptFile
);
map
.
insert
(
QLatin1String
(
Constants
::
QML_DEBUG_SERVER_PORT_KEY
),
m_debugData
.
serverPort
);
map
.
insert
(
QLatin1String
(
Constants
::
QML_DEBUG_SERVER_ADDRESS_KEY
),
m_debugData
.
serverAddress
);
return
map
;
}
...
...
@@ -343,8 +305,6 @@ bool QmlProjectRunConfiguration::fromMap(const QVariantMap &map)
m_qmlViewerCustomPath
=
map
.
value
(
QLatin1String
(
Constants
::
QML_VIEWER_KEY
)).
toString
();
m_qmlViewerArgs
=
map
.
value
(
QLatin1String
(
Constants
::
QML_VIEWER_ARGUMENTS_KEY
)).
toString
();
m_scriptFile
=
map
.
value
(
QLatin1String
(
Constants
::
QML_MAINSCRIPT_KEY
),
M_CURRENT_FILE
).
toString
();
m_debugData
.
serverPort
=
map
.
value
(
QLatin1String
(
Constants
::
QML_DEBUG_SERVER_PORT_KEY
),
Constants
::
QML_DEFAULT_DEBUG_SERVER_PORT
).
toUInt
();
m_debugData
.
serverAddress
=
map
.
value
(
QLatin1String
(
Constants
::
QML_DEBUG_SERVER_ADDRESS_KEY
),
QLatin1String
(
"127.0.0.1"
)).
toString
();
setMainScript
(
m_scriptFile
);
return
RunConfiguration
::
fromMap
(
map
);
...
...
src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.h
View file @
6f11765d
...
...
@@ -54,13 +54,6 @@ const char * const CURRENT_FILE = QT_TRANSLATE_NOOP("QmlManager", "<Current Fil
const
char
*
const
M_CURRENT_FILE
=
"CurrentFile"
;
class
QMLPROJECTMANAGER_EXPORT
QmlProjectRunConfigurationDebugData
{
public:
QmlProjectRunConfigurationDebugData
();
QString
serverAddress
;
quint16
serverPort
;
};
class
QMLPROJECTMANAGER_EXPORT
QmlProjectRunConfiguration
:
public
ProjectExplorer
::
RunConfiguration
{
Q_OBJECT
...
...
@@ -77,8 +70,6 @@ public:
QString
viewerPath
()
const
;
QStringList
viewerArguments
()
const
;
QString
workingDirectory
()
const
;
QString
debugServerAddress
()
const
;
uint
debugServerPort
()
const
;
// RunConfiguration
virtual
QWidget
*
createConfigurationWidget
();
...
...
@@ -97,10 +88,9 @@ private slots:
void
onViewerChanged
();
void
onViewerArgsChanged
();
void
onDebugServerAddressChanged
();
void
onDebugServerPortChanged
();
void
useCppDebuggerToggled
(
bool
toggled
);
void
useQmlDebuggerToggled
(
bool
toggled
);
void
qmlDebugServerPortChanged
(
uint
port
);
protected:
QString
viewerDefaultPath
()
const
;
...
...
@@ -119,7 +109,6 @@ private:
QString
m_scriptFile
;
QString
m_qmlViewerCustomPath
;
QString
m_qmlViewerArgs
;
QmlProjectRunConfigurationDebugData
m_debugData
;
QStringListModel
*
m_fileListModel
;
// weakpointer is used to make sure we don't try to manipulate
...
...
src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp
View file @
6f11765d
...
...
@@ -57,8 +57,6 @@ QmlRunControl::QmlRunControl(QmlProjectRunConfiguration *runConfiguration, QStri
:
RunControl
(
runConfiguration
,
mode
)
{
ProjectExplorer
::
Environment
environment
=
ProjectExplorer
::
Environment
::
systemEnvironment
();
if
(
runMode
()
==
ProjectExplorer
::
Constants
::
DEBUGMODE
)
environment
.
set
(
QmlProjectManager
::
Constants
::
E_QML_DEBUG_SERVER_PORT
,
QString
::
number
(
runConfiguration
->
debugServerPort
()));
m_applicationLauncher
.
setEnvironment
(
environment
.
toStringList
());
m_applicationLauncher
.
setWorkingDirectory
(
runConfiguration
->
workingDirectory
());
...
...
@@ -176,13 +174,12 @@ QWidget *QmlRunControlFactory::createConfigurationWidget(RunConfiguration *runCo
ProjectExplorer
::
RunControl
*
QmlRunControlFactory
::
createDebugRunControl
(
QmlProjectRunConfiguration
*
runConfig
)
{
ProjectExplorer
::
Environment
environment
=
ProjectExplorer
::
Environment
::
systemEnvironment
();
environment
.
set
(
QmlProjectManager
::
Constants
::
E_QML_DEBUG_SERVER_PORT
,
QString
::
number
(
runConfig
->
debugServerPort
()));
environment
.
set
(
Debugger
::
Constants
::
E_QML_DEBUG_SERVER_PORT
,
QString
::
number
(
runConfig
->
qmlDebugServerPort
()));
Debugger
::
DebuggerStartParameters
params
;
params
.
startMode
=
Debugger
::
StartInternal
;
params
.
executable
=
runConfig
->
viewerPath
();
params
.
qmlServerAddress
=
runConfig
->
debugServerAddress
()
;
params
.
qmlServerPort
=
runConfig
->
d
ebugServerPort
();
params
.
qmlServerAddress
=
"127.0.0.1"
;
params
.
qmlServerPort
=
runConfig
->
qmlD
ebugServerPort
();
params
.
processArgs
=
runConfig
->
viewerArguments
();
params
.
workingDirectory
=
runConfig
->
workingDirectory
();
params
.
environment
=
environment
.
toStringList
();
...
...
src/plugins/qt4projectmanager/qt4runconfiguration.cpp
View file @
6f11765d
...
...
@@ -230,6 +230,7 @@ Qt4RunConfigurationWidget::Qt4RunConfigurationWidget(Qt4RunConfiguration *qt4Run
m_debuggerLanguageChooser
->
setCppChecked
(
m_qt4RunConfiguration
->
useCppDebugger
());
m_debuggerLanguageChooser
->
setQmlChecked
(
m_qt4RunConfiguration
->
useQmlDebugger
());
m_debuggerLanguageChooser
->
setQmlDebugServerPort
(
m_qt4RunConfiguration
->
qmlDebugServerPort
());
#ifdef Q_OS_MAC
m_usingDyldImageSuffix
=
new
QCheckBox
(
tr
(
"Use debug version of frameworks (DYLD_IMAGE_SUFFIX=_debug)"
),
this
);
...
...
@@ -285,6 +286,8 @@ Qt4RunConfigurationWidget::Qt4RunConfigurationWidget(Qt4RunConfiguration *qt4Run
this
,
SLOT
(
useCppDebuggerToggled
(
bool
)));
connect
(
m_debuggerLanguageChooser
,
SIGNAL
(
qmlLanguageToggled
(
bool
)),
this
,
SLOT
(
useQmlDebuggerToggled
(
bool
)));
connect
(
m_debuggerLanguageChooser
,
SIGNAL
(
qmlDebugServerPortChanged
(
uint
)),
this
,
SLOT
(
qmlDebugServerPortChanged
(
uint
)));
connect
(
m_environmentWidget
,
SIGNAL
(
userChangesChanged
()),
this
,
SLOT
(
userChangesEdited
()));
...
...
@@ -322,6 +325,11 @@ void Qt4RunConfigurationWidget::useQmlDebuggerToggled(bool toggled)
m_qt4RunConfiguration
->
setUseQmlDebugger
(
toggled
);
}
void
Qt4RunConfigurationWidget
::
qmlDebugServerPortChanged
(
uint
port
)
{
m_qt4RunConfiguration
->
setQmlDebugServerPort
(
port
);
}
void
Qt4RunConfigurationWidget
::
baseEnvironmentSelected
(
int
index
)
{
m_ignoreChange
=
true
;
...
...
src/plugins/qt4projectmanager/qt4runconfiguration.h
View file @
6f11765d
...
...
@@ -88,6 +88,7 @@ public:
bool
isUsingDyldImageSuffix
()
const
;
void
setUsingDyldImageSuffix
(
bool
state
);
QString
proFilePath
()
const
;
// TODO detectQtShadowBuild() ? how did this work ?
...
...
@@ -175,6 +176,7 @@ private slots:
void
baseEnvironmentSelected
(
int
index
);
void
useCppDebuggerToggled
(
bool
toggled
);
void
useQmlDebuggerToggled
(
bool
toggled
);
void
qmlDebugServerPortChanged
(
uint
port
);
private:
Qt4RunConfiguration
*
m_qt4RunConfiguration
;
...
...
@@ -184,6 +186,7 @@ private:
QLineEdit
*
m_argumentsLineEdit
;
QCheckBox
*
m_useTerminalCheck
;
QCheckBox
*
m_usingDyldImageSuffix
;
QLineEdit
*
m_qmlDebugPort
;
QComboBox
*
m_baseEnvironmentComboBox
;
Utils
::
DetailsWidget
*
m_detailsContainer
;
...
...
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