From d5b3f5da9cfa90fc43f29f3bdeec01884a47d6ca Mon Sep 17 00:00:00 2001 From: Jan Arve Saether Date: Fri, 16 Jun 2017 12:06:03 +0200 Subject: Do not crash on Windows It seems that moving the registration to the block where the rest of the type registration was done avoids the crash. According to the documentation, a Q_GADGET doesn't have to be explicitly registered into the meta type system, but I never managed to get that working (and our existing Q_GADGETS seems to require explicit registration too) Change-Id: Iab1c258dbe40bd1c8062fab2c4b68fce208f5144 Reviewed-by: J-P Nurmi --- src/quick/handlers/qquickhandlersmodule.cpp | 1 + src/quick/handlers/qquickpointersinglehandler.cpp | 2 -- src/quick/handlers/qquickpointersinglehandler_p.h | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/quick/handlers/qquickhandlersmodule.cpp b/src/quick/handlers/qquickhandlersmodule.cpp index 4bfdc020d8..4a3a1f6aa2 100644 --- a/src/quick/handlers/qquickhandlersmodule.cpp +++ b/src/quick/handlers/qquickhandlersmodule.cpp @@ -82,6 +82,7 @@ static void qt_quickhandlers_defineModule(const char *uri, int major, int minor) QQuickDragHandler::tr("DragAxis is only available as a grouped property of DragHandler")); qmlRegisterType(uri,major,minor,"PinchHandler"); qmlRegisterType(uri,major,minor,"TapHandler"); + qRegisterMetaType(); } void QQuickHandlersModule::defineModule() diff --git a/src/quick/handlers/qquickpointersinglehandler.cpp b/src/quick/handlers/qquickpointersinglehandler.cpp index 40a99b0e99..0b0f482d8d 100644 --- a/src/quick/handlers/qquickpointersinglehandler.cpp +++ b/src/quick/handlers/qquickpointersinglehandler.cpp @@ -240,6 +240,4 @@ void QQuickHandlerPoint::reset() m_pressedButtons = Qt::NoButton; } -int g_metaTypeId = qRegisterMetaType(); - QT_END_NAMESPACE diff --git a/src/quick/handlers/qquickpointersinglehandler_p.h b/src/quick/handlers/qquickpointersinglehandler_p.h index 635c9e0a77..8898a1600b 100644 --- a/src/quick/handlers/qquickpointersinglehandler_p.h +++ b/src/quick/handlers/qquickpointersinglehandler_p.h @@ -58,6 +58,7 @@ QT_BEGIN_NAMESPACE class QQuickPointerSingleHandler; class Q_QUICK_PRIVATE_EXPORT QQuickHandlerPoint { + Q_GADGET Q_PROPERTY(int id READ id) Q_PROPERTY(QPointingDeviceUniqueId uniqueId READ uniqueId) Q_PROPERTY(QPointF position READ position) @@ -70,7 +71,6 @@ class Q_QUICK_PRIVATE_EXPORT QQuickHandlerPoint { Q_PROPERTY(qreal rotation READ rotation) Q_PROPERTY(qreal pressure READ pressure) Q_PROPERTY(QSizeF ellipseDiameters READ ellipseDiameters) - Q_GADGET public: QQuickHandlerPoint(); -- cgit v1.2.3