diff options
author | Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com> | 2011-03-25 13:36:16 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com> | 2011-05-10 20:40:41 +0200 |
commit | 517404f62660aa9438f213bf37b3aa7a522dbcee (patch) | |
tree | 4ad7987f469dc74cfa1ea5b87443660a2de90b72 /src/declarative/qml | |
parent | 84a5bde0c4aba8bab1556ccf221aab626bf68d3d (diff) |
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
(cherry picked from commit 35faeb205843c4f0b921d2b878d2d24962c64664)
Fixups squashed into this one:
(cherry picked from commit 0abf1dd99eeb252ae10c9f3cd99b64ee0b4d6e72)
(cherry picked from commit 894515429397be20670806825099b4b9896d50d6)
(cherry picked from commit 7d9f03c87e0e096934583a36340de5446e1d0520)
Conflicts:
src/plugins/qmltooling/qmltooling.pro
src/plugins/qmltooling/tcpserver/qtcpserverconnection.cpp
Diffstat (limited to 'src/declarative/qml')
-rw-r--r-- | src/declarative/qml/qdeclarativeengine.cpp | 6 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativeengine_p.h | 1 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index 9fde18c81c..fb3e136926 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 88b4e800f8..1777c88652 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; |