diff options
author | Jan Arve Saether <jan-arve.saether@qt.io> | 2016-08-17 13:59:33 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2016-08-18 07:23:53 +0000 |
commit | 3eed20c22ee046c42fec81b0d9d6e47a27bdbe03 (patch) | |
tree | ca129c2faaa814162858b0439072c95cd3c22815 /src/quick/items/qquickevents.cpp | |
parent | dc07b802df10f22e4422486ad470fc85d17e28b7 (diff) |
Make ctor and dtor of QQuickPointerDevice private
Since its used in a Q_GLOBAL_STATIC which requires its type to have
a public ctor, we have to delegate the ctor to a subclass (named
ConstructableQQuickPointerDevice).
Change-Id: I51932f16254f6ec6e512c78b280b307d6e0a300e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quick/items/qquickevents.cpp')
-rw-r--r-- | src/quick/items/qquickevents.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/quick/items/qquickevents.cpp b/src/quick/items/qquickevents.cpp index 59faafa023..47cfec14da 100644 --- a/src/quick/items/qquickevents.cpp +++ b/src/quick/items/qquickevents.cpp @@ -446,7 +446,15 @@ Item { typedef QHash<QTouchDevice *, QQuickPointerDevice *> PointerDeviceForTouchDeviceHash; Q_GLOBAL_STATIC(PointerDeviceForTouchDeviceHash, g_touchDevices) -Q_GLOBAL_STATIC_WITH_ARGS(QQuickPointerDevice, g_genericMouseDevice, +struct ConstructableQQuickPointerDevice : public QQuickPointerDevice +{ + ConstructableQQuickPointerDevice(DeviceType devType, PointerType pType, Capabilities caps, + int maxPoints, int buttonCount, const QString &name, + qint64 uniqueId = 0) + : QQuickPointerDevice(devType, pType, caps, maxPoints, buttonCount, name, uniqueId) {} + +}; +Q_GLOBAL_STATIC_WITH_ARGS(ConstructableQQuickPointerDevice, g_genericMouseDevice, (QQuickPointerDevice::Mouse, QQuickPointerDevice::GenericPointer, QQuickPointerDevice::Position | QQuickPointerDevice::Scroll | QQuickPointerDevice::Hover, |