forked from qt-creator/qt-creator
Use the QmlProject configuration to set the debug server port.
This commit is contained in:
@@ -20,6 +20,7 @@ RESOURCES += qmlinspector.qrc
|
|||||||
|
|
||||||
include(../../qtcreatorplugin.pri)
|
include(../../qtcreatorplugin.pri)
|
||||||
include(../../plugins/projectexplorer/projectexplorer.pri)
|
include(../../plugins/projectexplorer/projectexplorer.pri)
|
||||||
|
include(../../plugins/qmlprojectmanager/qmlprojectmanager.pri)
|
||||||
include(../../plugins/coreplugin/coreplugin.pri)
|
include(../../plugins/coreplugin/coreplugin.pri)
|
||||||
include(../../plugins/texteditor/texteditor.pri)
|
include(../../plugins/texteditor/texteditor.pri)
|
||||||
|
|
||||||
|
|||||||
@@ -61,6 +61,8 @@
|
|||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
|
|
||||||
|
#include <qmlprojectmanager/qmlproject.h>
|
||||||
|
|
||||||
#include <QtCore/QStringList>
|
#include <QtCore/QStringList>
|
||||||
#include <QtCore/QtPlugin>
|
#include <QtCore/QtPlugin>
|
||||||
#include <QtCore/QDebug>
|
#include <QtCore/QDebug>
|
||||||
@@ -183,15 +185,15 @@ void QmlInspectorMode::connectToViewer()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectExplorer::RunConfiguration* config = project->activeRunConfiguration();
|
QmlProjectManager::QmlRunConfiguration* config =
|
||||||
|
qobject_cast<QmlProjectManager::QmlRunConfiguration*>(project->activeRunConfiguration());
|
||||||
if (!config) {
|
if (!config) {
|
||||||
emit statusMessage(tr("Cannot find project run configuration, debugging canceled."));
|
emit statusMessage(tr("Cannot find project run configuration, debugging canceled."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO load from QmlProject settings!!
|
|
||||||
QHostAddress host = QHostAddress::LocalHost;
|
QHostAddress host = QHostAddress::LocalHost;
|
||||||
quint16 port = 3768;
|
quint16 port = quint16(config->debugServerPort());
|
||||||
|
|
||||||
m_conn = new QmlDebugConnection(this);
|
m_conn = new QmlDebugConnection(this);
|
||||||
connect(m_conn, SIGNAL(stateChanged(QAbstractSocket::SocketState)),
|
connect(m_conn, SIGNAL(stateChanged(QAbstractSocket::SocketState)),
|
||||||
|
|||||||
2
src/plugins/qmlprojectmanager/qmlprojectmanager.pri
Normal file
2
src/plugins/qmlprojectmanager/qmlprojectmanager.pri
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
include(qmlprojectmanager_dependencies.pri)
|
||||||
|
LIBS *= -l$$qtLibraryTarget(QmlProjectManager)
|
||||||
Reference in New Issue
Block a user