#include "abstractviewinspector.h"
#include "abstracttool.h"
-#include "qqmlinspectorservice.h"
#include <QtCore/QDebug>
#include <QtQml/QQmlEngine>
namespace QmlJSDebugger {
-AbstractViewInspector::AbstractViewInspector(QObject *parent) :
+AbstractViewInspector::AbstractViewInspector(QQmlDebugService *service, QObject *parent) :
QObject(parent),
m_enabled(false),
- m_debugService(QQmlDebugConnector::service<QQmlInspectorServiceImpl>()),
+ m_debugService(service),
m_eventId(0),
m_reloadEventId(-1)
{
Q_OBJECT
public:
- explicit AbstractViewInspector(QObject *parent = 0);
+ explicit AbstractViewInspector(QQmlDebugService *service, QObject *parent = 0);
void handleMessage(const QByteArray &message);
#include <QtQml/qtqmlglobal.h>
#include <private/qqmlglobal_p.h>
+#include <private/qqmldebugservice_p.h>
QT_BEGIN_NAMESPACE
virtual bool canHandleView(QObject *view) = 0;
- virtual void activate(QObject *view) = 0;
+ virtual void activate(QQmlDebugService *service, QObject *view) = 0;
virtual void deactivate() = 0;
virtual void clientMessage(const QByteArray &message) = 0;
qWarning() << "QQmlInspector: No plugin available for view '" << m_views.first()->metaObject()->className() << "'.";
return;
}
- m_currentInspectorPlugin->activate(m_views.first());
+ m_currentInspectorPlugin->activate(this, m_views.first());
} else {
if (m_currentInspectorPlugin) {
m_currentInspectorPlugin->deactivate();
QT_BEGIN_NAMESPACE
-namespace QmlJSDebugger { class AbstractViewInspector; }
class QQmlInspectorInterface;
void updateState();
private:
- friend class QmlJSDebugger::AbstractViewInspector;
friend class QQmlInspectorServiceFactory;
void loadInspectorPlugins();
}
-QQuickViewInspector::QQuickViewInspector(QQuickView *view, QObject *parent) :
- AbstractViewInspector(parent),
+QQuickViewInspector::QQuickViewInspector(QQmlDebugService *service, QQuickView *view,
+ QObject *parent) :
+ AbstractViewInspector(service, parent),
m_view(view),
m_overlay(new QQuickItem),
m_inspectTool(new InspectTool(this, view)),
{
Q_OBJECT
public:
- explicit QQuickViewInspector(QQuickView *view, QObject *parent = 0);
+ explicit QQuickViewInspector(QQmlDebugService *service, QQuickView *view, QObject *parent = 0);
// AbstractViewInspector
void changeCurrentObjects(const QList<QObject*> &objects);
return qobject_cast<QQuickView*>(view);
}
-void QtQuick2Plugin::activate(QObject *view)
+void QtQuick2Plugin::activate(QQmlDebugService *service, QObject *view)
{
QQuickView *qtQuickView = qobject_cast<QQuickView*>(view);
Q_ASSERT(qtQuickView);
- m_inspector = new QQuickViewInspector(qtQuickView, qtQuickView);
+ m_inspector = new QQuickViewInspector(service, qtQuickView, qtQuickView);
}
void QtQuick2Plugin::deactivate()
#include <QtCore/QPointer>
#include "qqmlinspectorinterface.h"
+#include <private/qqmldebugservice_p.h>
QT_BEGIN_NAMESPACE
// QQmlInspectorInterface
bool canHandleView(QObject *view);
- void activate(QObject *view);
+ void activate(QQmlDebugService *service, QObject *view);
void deactivate();
void clientMessage(const QByteArray &message);