Added debugging mode for simultaneous QML and C++ debugging

It's not yet possible to attach to an external app running a qml
debugging server, because the server is only started on startup if an
env variable is set. Changing this requires action from Brisbane, but
even the current solution works for C++ apps with QML in them.

Task-number: BAUHAUS-585
Reviewed-by: dt
This commit is contained in:
Lasse Holmstedt
2010-04-15 11:59:22 +02:00
parent 6c244f2162
commit 990ec1be91
20 changed files with 560 additions and 85 deletions

View File

@@ -57,7 +57,6 @@
#include <QtGui/QHBoxLayout>
#include <QtGui/QToolButton>
#include <QtGui/QMessageBox>
#include <QtCore/QDebug>
@@ -73,10 +72,9 @@ static QToolButton *createToolButton(QAction *action)
}
QmlInspectorPlugin::QmlInspectorPlugin()
: m_inspector(0), m_connectionTimer(new QTimer(this)),
m_connectionAttempts(0)
: m_inspector(0)
{
m_connectionTimer->setInterval(75);
}
QmlInspectorPlugin::~QmlInspectorPlugin()
@@ -107,8 +105,6 @@ bool QmlInspectorPlugin::initialize(const QStringList &arguments, QString *error
m_inspector->createDockWidgets();
addObject(m_inspector);
connect(m_connectionTimer, SIGNAL(timeout()), SLOT(pollInspector()));
return true;
}
@@ -148,26 +144,11 @@ void QmlInspectorPlugin::activateDebuggerForProject(ProjectExplorer::Project *pr
// FIXME we probably want to activate the debugger for other projects than QmlProjects,
// if they contain Qml files. Some kind of options should exist for this behavior.
QmlProjectManager::QmlProject *qmlproj = qobject_cast<QmlProjectManager::QmlProject*>(project);
if (qmlproj)
m_connectionTimer->start();
if (qmlproj && m_inspector->setDebugConfigurationDataFromProject(qmlproj))
m_inspector->startConnectionTimer();
}
}
void QmlInspectorPlugin::pollInspector()
{
++m_connectionAttempts;
if (m_inspector->connectToViewer()) {
m_connectionTimer->stop();
m_connectionAttempts = 0;
} else if (m_connectionAttempts == MaxConnectionAttempts) {
m_connectionTimer->stop();
m_connectionAttempts = 0;
QMessageBox::critical(0,
tr("Failed to connect to debugger"),
tr("Could not connect to debugger server. Please check your settings from Projects pane.") );
}
}
void QmlInspectorPlugin::prepareDebugger(Core::IMode *mode)
{