From d8593011d2d01a04a01e7bf369caa166d91b3d6a Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Mon, 18 Sep 2017 18:12:40 +0200 Subject: Fix crash when using signal handlers on group properties This is a regression introduced with commmit 49a11e882059ee1729f776722e085dd21d378c36: The typeRef can be null. I found this when testing grouped properties and property revisions. import QtQuick 2.0 Item { property alias textEdit: textEdit TextEdit { id: textEdit } } import QtQuick 2.8 Item { TestComponent { textEdit.onEditingFinished: console.log("test") } } Instead of an error message, this crashes without this patch. This is a regression introduced by using QQmlType by value. Change-Id: Ib18a0ad878f7c4696c22bc65fee636b84b966f03 Reviewed-by: Simon Hausmann --- src/qml/compiler/qqmltypecompiler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/qml') diff --git a/src/qml/compiler/qqmltypecompiler.cpp b/src/qml/compiler/qqmltypecompiler.cpp index eeb5595a9a..fab865081a 100644 --- a/src/qml/compiler/qqmltypecompiler.cpp +++ b/src/qml/compiler/qqmltypecompiler.cpp @@ -412,7 +412,7 @@ bool SignalHandlerConverter::convertSignalHandlerExpressionsToFunctionDeclaratio const QString &originalPropertyName = stringAt(binding->propertyNameIndex); auto *typeRef = resolvedTypes.value(obj->inheritedTypeNameIndex); - const QQmlType type = typeRef->type; + const QQmlType type = typeRef ? typeRef->type : QQmlType(); if (type.isValid()) { COMPILE_EXCEPTION(binding, tr("\"%1.%2\" is not available in %3 %4.%5.").arg(typeName).arg(originalPropertyName).arg(type.module()).arg(type.majorVersion()).arg(type.minorVersion())); } else { -- cgit v1.2.3 From 960bebd61f70c39e2fbce9f67b889cd64f48cea7 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 25 Sep 2017 11:55:20 +0200 Subject: QQmlTypeLoader: The profiler is a quintptr(0) if QT_NO_QML_DEBUGGING This follows the pattern established in other places. Task-number: QTBUG-63392 Change-Id: I11cd66d5552f751804dd0a9460b26bda546c1726 Reviewed-by: Mikko Gronoff Reviewed-by: Shawn Rutledge Reviewed-by: Samuli Piippo --- src/qml/qml/qqmltypeloader_p.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/qml') diff --git a/src/qml/qml/qqmltypeloader_p.h b/src/qml/qml/qqmltypeloader_p.h index c214f0cd43..abc0df9068 100644 --- a/src/qml/qml/qqmltypeloader_p.h +++ b/src/qml/qml/qqmltypeloader_p.h @@ -322,8 +322,8 @@ public: void invalidate(); #ifdef QT_NO_QML_DEBUGGER - QQmlProfiler *profiler() const { return nullptr; } - void setProfiler(QQmlProfiler *) {} + quintptr profiler() const { return 0; } + void setProfiler(quintptr) {} #else QQmlProfiler *profiler() const { return m_profiler.data(); } void setProfiler(QQmlProfiler *profiler); -- cgit v1.2.3