aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickwidgets
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@theqtcompany.com>2015-11-19 17:14:23 +0100
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2016-01-12 18:00:47 +0000
commit258638f3726f63b308b6275090b1dad596f4fb56 (patch)
treecbbcfe5772a90b8e2dd0cfe493be465f9bc2003f /src/quickwidgets
parent11bd376d1399faff71ff17af9ee10f61b959901b (diff)
Rewrite inspector service
The inspector service had bitrotted to a point where there was little code to be rescued. Apparently it was never really finished and quite some code didn't make any sense. This change removes some features that were unused or didn't work correctly: 1. Panning and Zooming with mouse wheel and touch interaction. This might be useful in some contexts, but the implementation was so broken that it wasn't worth trying to fix it. The whole idea of doing this on the layer of QQuickItems is not so great because there is no distinction between spontaneous changes triggered by the application and debugging interaction triggered from outside. It might be better to implement such functionality on a lower level, e.g. in the renderer. 2. Reloading the scene with debug changes. Use one of the other debug services to change properties. Clearing the component cache is a rather drastic measure and not necessary here. In turn, we get support for inspecting multiple windows, and all subclasses of QQuickWindow are supported now. Also, show-on-top works now. Task-number: QTBUG-33376 Change-Id: I65497f49c6b46128a600b0e3a31483eeef40313c Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/quickwidgets')
-rw-r--r--src/quickwidgets/qquickwidget.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/quickwidgets/qquickwidget.cpp b/src/quickwidgets/qquickwidget.cpp
index 11e7953e93..6335e25d63 100644
--- a/src/quickwidgets/qquickwidget.cpp
+++ b/src/quickwidgets/qquickwidget.cpp
@@ -96,10 +96,6 @@ void QQuickWidgetPrivate::init(QQmlEngine* e)
if (!engine.data()->incubationController())
engine.data()->setIncubationController(offscreenWindow->incubationController());
- QQmlInspectorService *service = QQmlDebugConnector::service<QQmlInspectorService>();
- if (service)
- service->addView(q);
-
#ifndef QT_NO_DRAGANDDROP
q->setAcceptDrops(true);
#endif
@@ -150,10 +146,6 @@ QQuickWidgetPrivate::QQuickWidgetPrivate()
QQuickWidgetPrivate::~QQuickWidgetPrivate()
{
- QQmlInspectorService *service = QQmlDebugConnector::service<QQmlInspectorService>();
- if (service)
- service->removeView(q_func());
-
invalidateRenderControl();
// context and offscreenSurface are current at this stage, if the context was created.
@@ -1115,6 +1107,8 @@ void QQuickWidget::showEvent(QShowEvent *)
emit d->offscreenWindow->visibleChanged(true);
offscreenPrivate->updateVisibility();
}
+ if (QQmlInspectorService *service = QQmlDebugConnector::service<QQmlInspectorService>())
+ service->setParentWindow(d->offscreenWindow, window()->windowHandle());
}
/*! \reimp */
@@ -1128,6 +1122,8 @@ void QQuickWidget::hideEvent(QHideEvent *)
emit d->offscreenWindow->visibleChanged(false);
offscreenPrivate->updateVisibility();
}
+ if (QQmlInspectorService *service = QQmlDebugConnector::service<QQmlInspectorService>())
+ service->setParentWindow(d->offscreenWindow, d->offscreenWindow);
}
/*! \reimp */