aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-12-20 08:32:22 +0100
committerLiang Qi <liang.qi@qt.io>2017-12-20 08:50:58 +0100
commit9a38fdcf8f9b734808bb54422e306872f3bfa944 (patch)
tree20fd361db6c505d99a40ab7a695511b97dcdcbd3 /src/plugins
parent1db9405128972d5ba77e33181bee40356f718cea (diff)
parent4fff2bb14e55484eacec0a1b49a2b02958f75eca (diff)
Merge remote-tracking branch 'origin/5.10' into dev
Conflicts: tests/auto/quick/pointerhandlers/flickableinterop/data/FlashAnimation.qml tests/auto/quick/pointerhandlers/flickableinterop/data/Slider.qml tests/auto/quick/pointerhandlers/flickableinterop/data/TapHandlerButton.qml tests/auto/quick/pointerhandlers/flickableinterop/data/flickableWithHandlers.qml tests/auto/quick/pointerhandlers/multipointtoucharea_interop/data/pinchDragMPTA.qml tests/auto/quick/pointerhandlers/qquickdraghandler/data/DragAnywhereSlider.qml tests/auto/quick/pointerhandlers/qquickdraghandler/data/FlashAnimation.qml tests/auto/quick/pointerhandlers/qquickdraghandler/data/Slider.qml tests/auto/quick/pointerhandlers/qquickdraghandler/data/draggables.qml tests/auto/quick/pointerhandlers/qquickdraghandler/data/multipleSliders.qml tests/auto/quick/pointerhandlers/qquicktaphandler/data/Button.qml tests/auto/quick/pointerhandlers/qquicktaphandler/data/FlashAnimation.qml tests/auto/quick/pointerhandlers/qquicktaphandler/data/buttons.qml tests/manual/pointer/content/FakeFlickable.qml tests/manual/pointer/content/FlashAnimation.qml tests/manual/pointer/content/MomentumAnimation.qml tests/manual/pointer/content/MouseAreaButton.qml tests/manual/pointer/content/MouseAreaSlider.qml tests/manual/pointer/content/MptaButton.qml tests/manual/pointer/content/MultiButton.qml tests/manual/pointer/content/ScrollBar.qml tests/manual/pointer/content/Slider.qml tests/manual/pointer/content/TapHandlerButton.qml tests/manual/pointer/fakeFlickable.qml tests/manual/pointer/flickableWithHandlers.qml tests/manual/pointer/flingAnimation.qml tests/manual/pointer/joystick.qml tests/manual/pointer/main.cpp tests/manual/pointer/main.qml tests/manual/pointer/map.qml tests/manual/pointer/map2.qml tests/manual/pointer/mixer.qml tests/manual/pointer/multibuttons.qml tests/manual/pointer/photosurface.qml tests/manual/pointer/pinchDragFlingMPTA.qml tests/manual/pointer/pinchHandler.qml tests/manual/pointer/singlePointHandlerProperties.qml tests/manual/pointer/tapHandler.qml tests/manual/pointer/tapWithModifiers.qml tests/manual/shapestest/main.cpp Change-Id: I4f233a521305fab1ebfecbac801da192434ed524
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp b/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp
index 182e4257f8..f191fe9679 100644
--- a/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp
+++ b/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp
@@ -337,6 +337,9 @@ void QQmlEngineDebugServiceImpl::buildObjectList(QDataStream &message,
QQmlContext *ctxt,
const QList<QPointer<QObject> > &instances)
{
+ if (!ctxt->isValid())
+ return;
+
QQmlContextData *p = QQmlContextData::get(ctxt);
QString ctxtName = ctxt->objectName();
@@ -399,11 +402,8 @@ QQmlEngineDebugServiceImpl::objectData(QObject *object)
}
QQmlContext *context = qmlContext(object);
- if (context) {
- QQmlContextData *cdata = QQmlContextData::get(context);
- if (cdata)
- rv.idString = cdata->findObjectId(object);
- }
+ if (context && context->isValid())
+ rv.idString = QQmlContextData::get(context)->findObjectId(object);
rv.objectName = object->objectName();
rv.objectId = QQmlDebugService::idForObject(object);
@@ -564,14 +564,14 @@ void QQmlEngineDebugServiceImpl::processMessage(const QByteArray &message)
QObject *object = QQmlDebugService::objectForId(objectId);
QQmlContext *context = qmlContext(object);
- if (!context) {
+ if (!context || !context->isValid()) {
QQmlEngine *engine = qobject_cast<QQmlEngine *>(
QQmlDebugService::objectForId(engineId));
if (engine && m_engines.contains(engine))
context = engine->rootContext();
}
QVariant result;
- if (context) {
+ if (context && context->isValid()) {
QQmlExpression exprObj(context, object, expr);
bool undefined = false;
QVariant value = exprObj.evaluate(&undefined);
@@ -632,7 +632,7 @@ bool QQmlEngineDebugServiceImpl::setBinding(int objectId,
QObject *object = objectForId(objectId);
QQmlContext *context = qmlContext(object);
- if (object && context) {
+ if (object && context && context->isValid()) {
QQmlProperty property(object, propertyName, context);
if (property.isValid()) {
@@ -677,7 +677,7 @@ bool QQmlEngineDebugServiceImpl::resetBinding(int objectId, const QString &prope
QObject *object = objectForId(objectId);
QQmlContext *context = qmlContext(object);
- if (object && context) {
+ if (object && context && context->isValid()) {
QStringRef parentPropertyRef(&propertyName);
const int idx = parentPropertyRef.indexOf(QLatin1Char('.'));
if (idx != -1)
@@ -732,11 +732,9 @@ bool QQmlEngineDebugServiceImpl::setMethodBody(int objectId, const QString &meth
{
QObject *object = objectForId(objectId);
QQmlContext *context = qmlContext(object);
- if (!object || !context || !context->engine())
+ if (!object || !context || !context->isValid())
return false;
QQmlContextData *contextData = QQmlContextData::get(context);
- if (!contextData)
- return false;
QQmlPropertyData dummy;
QQmlPropertyData *prop =