diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-02-18 17:49:19 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-02-20 12:37:37 +0100 |
commit | 3bafe234940f6e3faef77f03a9a2d2071c12111b (patch) | |
tree | 96b534f4d8a6884d4662553d56e373e1b66d29e4 | |
parent | 78fd438f158839ffebcd52cc7974eac28489dbdd (diff) |
Make qtdeclarative compile with -no-feature-tabletevent
Amends 8e822e981d91e688799c8670f11dfdf6aaf9e0d1.
Fixes: QTBUG-82168
Change-Id: I8d849747a3394ca05d62b674a725d45165f081eb
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
-rw-r--r-- | src/quick/handlers/qquickhandlerpoint.cpp | 2 | ||||
-rw-r--r-- | src/quick/items/qquickevents.cpp | 4 | ||||
-rw-r--r-- | src/quick/items/qquickevents_p_p.h | 2 | ||||
-rw-r--r-- | src/quick/items/qquickwindow.cpp | 2 |
4 files changed, 10 insertions, 0 deletions
diff --git a/src/quick/handlers/qquickhandlerpoint.cpp b/src/quick/handlers/qquickhandlerpoint.cpp index e6148ca072..72efdfd0f4 100644 --- a/src/quick/handlers/qquickhandlerpoint.cpp +++ b/src/quick/handlers/qquickhandlerpoint.cpp @@ -119,11 +119,13 @@ void QQuickHandlerPoint::reset(const QQuickEventPoint *point) m_rotation = tp->rotation(); m_pressure = tp->pressure(); m_ellipseDiameters = tp->ellipseDiameters(); +#if QT_CONFIG(tabletevent) } else if (event->asPointerTabletEvent()) { m_uniqueId = event->device()->uniqueId(); m_rotation = static_cast<const QQuickEventTabletPoint *>(point)->rotation(); m_pressure = static_cast<const QQuickEventTabletPoint *>(point)->pressure(); m_ellipseDiameters = QSizeF(); +#endif } else { m_uniqueId = event->device()->uniqueId(); m_rotation = 0; diff --git a/src/quick/items/qquickevents.cpp b/src/quick/items/qquickevents.cpp index 0a9abb3322..2b3ea7d63d 100644 --- a/src/quick/items/qquickevents.cpp +++ b/src/quick/items/qquickevents.cpp @@ -597,8 +597,10 @@ Q_GLOBAL_STATIC_WITH_ARGS(ConstructableQQuickPointerDevice, g_genericMouseDevice QQuickPointerDevice::Position | QQuickPointerDevice::Scroll | QQuickPointerDevice::Hover, 1, 3, QLatin1String("core pointer"), 0)) +#if QT_CONFIG(tabletevent) typedef QHash<qint64, QQuickPointerDevice *> PointerDeviceForDeviceIdHash; Q_GLOBAL_STATIC(PointerDeviceForDeviceIdHash, g_tabletDevices) +#endif // debugging helpers static const char *pointStateString(const QQuickEventPoint *point) @@ -658,6 +660,7 @@ QQuickPointerDevice *QQuickPointerDevice::genericMouseDevice() return g_genericMouseDevice; } +#if QT_CONFIG(tabletevent) QQuickPointerDevice *QQuickPointerDevice::tabletDevice(const QTabletEvent *event) { // QTabletEvent::uniqueId() is the same for the pointy end and the eraser end of the stylus. @@ -726,6 +729,7 @@ QQuickPointerDevice *QQuickPointerDevice::tabletDevice(const QTabletEvent *event g_tabletDevices->insert(key, device); return device; } +#endif /*! \qmltype EventPoint diff --git a/src/quick/items/qquickevents_p_p.h b/src/quick/items/qquickevents_p_p.h index 3a8028678e..7004b341de 100644 --- a/src/quick/items/qquickevents_p_p.h +++ b/src/quick/items/qquickevents_p_p.h @@ -763,7 +763,9 @@ public: static QQuickPointerDevice *touchDevice(const QTouchDevice *d); static QList<QQuickPointerDevice *> touchDevices(); static QQuickPointerDevice *genericMouseDevice(); +#if QT_CONFIG(tabletevent) static QQuickPointerDevice *tabletDevice(const QTabletEvent *event); +#endif QVector<QQuickPointerHandler *> &eventDeliveryTargets() { return m_eventDeliveryTargets; } diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index fa7c71e43a..426a30dfca 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -2412,11 +2412,13 @@ QQuickPointerEvent *QQuickWindowPrivate::pointerEventInstance(QQuickPointerDevic #endif ev = new QQuickPointerTouchEvent(q, device); break; +#if QT_CONFIG(tabletevent) case QQuickPointerDevice::Stylus: case QQuickPointerDevice::Airbrush: case QQuickPointerDevice::Puck: ev = new QQuickPointerTabletEvent(q, device); break; +#endif default: break; } |