diff options
author | Jan Arve Saether <jan-arve.saether@qt.io> | 2017-06-16 12:06:03 +0200 |
---|---|---|
committer | Jan Arve Sæther <jan-arve.saether@qt.io> | 2017-06-23 11:27:23 +0000 |
commit | d5b3f5da9cfa90fc43f29f3bdeec01884a47d6ca (patch) | |
tree | 1c37f97e021cfbf0c2eb5a0e649c90bbc49efc31 | |
parent | 3c778cfb8361f1afdd81feb4eaed91473ccc1f93 (diff) |
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 <jpnurmi@qt.io>
-rw-r--r-- | src/quick/handlers/qquickhandlersmodule.cpp | 1 | ||||
-rw-r--r-- | src/quick/handlers/qquickpointersinglehandler.cpp | 2 | ||||
-rw-r--r-- | 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<QQuickPinchHandler>(uri,major,minor,"PinchHandler"); qmlRegisterType<QQuickTapHandler>(uri,major,minor,"TapHandler"); + qRegisterMetaType<QQuickHandlerPoint>(); } 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<QQuickHandlerPoint>(); - 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(); |