summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>2011-03-25 12:36:16 (GMT)
committerThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>2011-05-04 13:47:50 (GMT)
commit35faeb205843c4f0b921d2b878d2d24962c64664 (patch)
treebd672bf81c38d7b0c6d07b669d62124118a3aab6 /src/declarative/qml
parent9fa0a9319ee0f178d03f9bdc4afbabb8563b4c62 (diff)
downloadQt-35faeb205843c4f0b921d2b878d2d24962c64664.zip
Qt-35faeb205843c4f0b921d2b878d2d24962c64664.tar.gz
Qt-35faeb205843c4f0b921d2b878d2d24962c64664.tar.bz2
Moved the QML Observer Service and related functionality into Qt
This code was previously developed as part of Qt Creator in share/qtcreator/qml/qmljsdebugger/ Moving it into Qt will allow us to simplify the setup required before you can debug QML applications. To avoid adding too much weight to the QtDeclarative module, a declarativeobserver plugin was introduced that contains the QDeclarativeViewObserver and related classes. The QDeclarativeObserverService is just a stub service that loads this plugin once a QML debugging client connects. The plugin implements the QDeclarativeObserverInterface A QJSDebugService was separated out of QJSDebuggerAgent, so that the service can be active while the agent is instantiated lazily. Each QDeclarativeEngine adds itself to the QJSDebugService. Currently only the first one is used when instantiating the agent. QDeclarativeObserverService is hooked into QDeclarativeView, with the view registering itself to the service, allowing the QDeclarativeViewObserver to be created for the view once somebody connects to the service. Again, only the first view is used at the moment. Change-Id: Ib50579c6d24361c2b39528e5556410d3446c2e90 Reviewed-by: Martin Jones Reviewed-by: Michael Brasser
Diffstat (limited to 'src/declarative/qml')
-rw-r--r--src/declarative/qml/qdeclarativeengine.cpp6
-rw-r--r--src/declarative/qml/qdeclarativeengine_p.h1
2 files changed, 5 insertions, 2 deletions
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index 9fde18c..fb3e136 100644
--- a/src/declarative/qml/qdeclarativeengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -71,6 +71,7 @@
#include "private/qdeclarativenotifier_p.h"
#include "private/qdeclarativedebugtrace_p.h"
#include "private/qdeclarativeapplication_p.h"
+#include "private/qjsdebugservice_p.h"
#include <QtCore/qmetaobject.h>
#include <QScriptClass>
@@ -583,6 +584,7 @@ void QDeclarativeEnginePrivate::init()
QDeclarativeEngineDebugServer::isDebuggingEnabled()) {
isDebugging = true;
QDeclarativeEngineDebugServer::instance()->addEngine(q);
+ QJSDebugService::instance()->addEngine(q);
}
}
@@ -645,8 +647,10 @@ QDeclarativeEngine::QDeclarativeEngine(QObject *parent)
QDeclarativeEngine::~QDeclarativeEngine()
{
Q_D(QDeclarativeEngine);
- if (d->isDebugging)
+ if (d->isDebugging) {
QDeclarativeEngineDebugServer::instance()->remEngine(this);
+ QJSDebugService::instance()->removeEngine(this);
+ }
}
/*! \fn void QDeclarativeEngine::quit()
diff --git a/src/declarative/qml/qdeclarativeengine_p.h b/src/declarative/qml/qdeclarativeengine_p.h
index 88b4e80..1777c88 100644
--- a/src/declarative/qml/qdeclarativeengine_p.h
+++ b/src/declarative/qml/qdeclarativeengine_p.h
@@ -95,7 +95,6 @@ class QDeclarativeImportDatabase;
class QDeclarativeObjectScriptClass;
class QDeclarativeTypeNameScriptClass;
class QDeclarativeValueTypeScriptClass;
-class QScriptEngineDebugger;
class QNetworkReply;
class QNetworkAccessManager;
class QDeclarativeNetworkAccessManagerFactory;