Convert features.tabletevent to QT_CONFIG

Change-Id: Ibd7ed7f269a64afddadee70979b20f1c58398378
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
Stephan Binner 2017-05-30 23:04:21 +02:00
parent 5ede5706a8
commit 7f62c5fedc
21 changed files with 68 additions and 69 deletions

View File

@ -2,7 +2,7 @@
"Id": "wintab", "Id": "wintab",
"Name": "Wintab API", "Name": "Wintab API",
"QDocModule": "qtgui", "QDocModule": "qtgui",
"QtUsage": "Used in the Qt platform plugin for Windows. Configure with -DQT_NO_TABLETEVENT to avoid.", "QtUsage": "Used in the Qt platform plugin for Windows. Configure with -no-feature-tabletevent to avoid.",
"Description": "Wintab is a de facto API for pointing devices on Windows.", "Description": "Wintab is a de facto API for pointing devices on Windows.",
"Homepage": "http://www.pointing.com/Wintab.html", "Homepage": "http://www.pointing.com/Wintab.html",

View File

@ -2264,7 +2264,7 @@ QVariant QInputMethodQueryEvent::value(Qt::InputMethodQuery query) const
return QVariant(); return QVariant();
} }
#ifndef QT_NO_TABLETEVENT #if QT_CONFIG(tabletevent)
/*! /*!
\class QTabletEvent \class QTabletEvent
@ -2706,7 +2706,7 @@ Qt::MouseButtons QTabletEvent::buttons() const
\sa posF() \sa posF()
*/ */
#endif // QT_NO_TABLETEVENT #endif // QT_CONFIG(tabletevent)
#ifndef QT_NO_GESTURES #ifndef QT_NO_GESTURES
/*! /*!
@ -3856,7 +3856,7 @@ static void formatDropEvent(QDebug d, const QDropEvent *e)
# endif // !QT_NO_DRAGANDDROP # endif // !QT_NO_DRAGANDDROP
# ifndef QT_NO_TABLETEVENT # if QT_CONFIG(tabletevent)
static void formatTabletEvent(QDebug d, const QTabletEvent *e) static void formatTabletEvent(QDebug d, const QTabletEvent *e)
{ {
@ -3883,7 +3883,7 @@ static void formatTabletEvent(QDebug d, const QTabletEvent *e)
d << ", tangentialPressure=" << e->tangentialPressure(); d << ", tangentialPressure=" << e->tangentialPressure();
} }
# endif // !QT_NO_TABLETEVENT # endif // QT_CONFIG(tabletevent)
QDebug operator<<(QDebug dbg, const QTouchEvent::TouchPoint &tp) QDebug operator<<(QDebug dbg, const QTouchEvent::TouchPoint &tp)
{ {
@ -4063,7 +4063,7 @@ QDebug operator<<(QDebug dbg, const QEvent *e)
dbg << "QContextMenuEvent(" << static_cast<const QContextMenuEvent *>(e)->pos() << ')'; dbg << "QContextMenuEvent(" << static_cast<const QContextMenuEvent *>(e)->pos() << ')';
break; break;
# endif // !QT_NO_CONTEXTMENU # endif // !QT_NO_CONTEXTMENU
# ifndef QT_NO_TABLETEVENT # if QT_CONFIG(tabletevent)
case QEvent::TabletEnterProximity: case QEvent::TabletEnterProximity:
case QEvent::TabletLeaveProximity: case QEvent::TabletLeaveProximity:
case QEvent::TabletPress: case QEvent::TabletPress:
@ -4071,7 +4071,7 @@ QDebug operator<<(QDebug dbg, const QEvent *e)
case QEvent::TabletRelease: case QEvent::TabletRelease:
formatTabletEvent(dbg, static_cast<const QTabletEvent *>(e)); formatTabletEvent(dbg, static_cast<const QTabletEvent *>(e));
break; break;
# endif // !QT_NO_TABLETEVENT # endif // QT_CONFIG(tabletevent)
case QEvent::Enter: case QEvent::Enter:
dbg << "QEnterEvent(" << static_cast<const QEnterEvent *>(e)->pos() << ')'; dbg << "QEnterEvent(" << static_cast<const QEnterEvent *>(e)->pos() << ')';
break; break;

View File

@ -237,7 +237,7 @@ protected:
}; };
#endif #endif
#ifndef QT_NO_TABLETEVENT #if QT_CONFIG(tabletevent)
class Q_GUI_EXPORT QTabletEvent : public QInputEvent class Q_GUI_EXPORT QTabletEvent : public QInputEvent
{ {
Q_GADGET Q_GADGET
@ -295,7 +295,7 @@ protected:
// ### Qt 6: QPointingEvent will have Buttons, QTabletEvent will inherit // ### Qt 6: QPointingEvent will have Buttons, QTabletEvent will inherit
void *mExtra; void *mExtra;
}; };
#endif // QT_NO_TABLETEVENT #endif // QT_CONFIG(tabletevent)
#ifndef QT_NO_GESTURES #ifndef QT_NO_GESTURES
class Q_GUI_EXPORT QNativeGestureEvent : public QInputEvent class Q_GUI_EXPORT QNativeGestureEvent : public QInputEvent

View File

@ -94,7 +94,7 @@ public:
QVector<QPointF> rawScreenPositions; QVector<QPointF> rawScreenPositions;
}; };
#ifndef QT_NO_TABLETEVENT #if QT_CONFIG(tabletevent)
class QTabletEventPrivate class QTabletEventPrivate
{ {
public: public:
@ -106,7 +106,7 @@ public:
Qt::MouseButton b; Qt::MouseButton b;
Qt::MouseButtons buttonState; Qt::MouseButtons buttonState;
}; };
#endif // QT_NO_TABLETEVENT #endif // QT_CONFIG(tabletevent)
QT_END_NAMESPACE QT_END_NAMESPACE

View File

@ -2302,7 +2302,7 @@ QGuiApplicationPrivate::TabletPointData &QGuiApplicationPrivate::tabletDevicePoi
void QGuiApplicationPrivate::processTabletEvent(QWindowSystemInterfacePrivate::TabletEvent *e) void QGuiApplicationPrivate::processTabletEvent(QWindowSystemInterfacePrivate::TabletEvent *e)
{ {
#ifndef QT_NO_TABLETEVENT #if QT_CONFIG(tabletevent)
TabletPointData &pointData = tabletDevicePoint(e->uid); TabletPointData &pointData = tabletDevicePoint(e->uid);
QEvent::Type type = QEvent::TabletMove; QEvent::Type type = QEvent::TabletMove;
@ -2369,7 +2369,7 @@ void QGuiApplicationPrivate::processTabletEvent(QWindowSystemInterfacePrivate::T
void QGuiApplicationPrivate::processTabletEnterProximityEvent(QWindowSystemInterfacePrivate::TabletEnterProximityEvent *e) void QGuiApplicationPrivate::processTabletEnterProximityEvent(QWindowSystemInterfacePrivate::TabletEnterProximityEvent *e)
{ {
#ifndef QT_NO_TABLETEVENT #if QT_CONFIG(tabletevent)
QTabletEvent ev(QEvent::TabletEnterProximity, QPointF(), QPointF(), QTabletEvent ev(QEvent::TabletEnterProximity, QPointF(), QPointF(),
e->device, e->pointerType, 0, 0, 0, e->device, e->pointerType, 0, 0, 0,
0, 0, 0, 0, 0, 0,
@ -2383,7 +2383,7 @@ void QGuiApplicationPrivate::processTabletEnterProximityEvent(QWindowSystemInter
void QGuiApplicationPrivate::processTabletLeaveProximityEvent(QWindowSystemInterfacePrivate::TabletLeaveProximityEvent *e) void QGuiApplicationPrivate::processTabletLeaveProximityEvent(QWindowSystemInterfacePrivate::TabletLeaveProximityEvent *e)
{ {
#ifndef QT_NO_TABLETEVENT #if QT_CONFIG(tabletevent)
QTabletEvent ev(QEvent::TabletLeaveProximity, QPointF(), QPointF(), QTabletEvent ev(QEvent::TabletLeaveProximity, QPointF(), QPointF(),
e->device, e->pointerType, 0, 0, 0, e->device, e->pointerType, 0, 0, 0,
0, 0, 0, 0, 0, 0,

View File

@ -2254,7 +2254,7 @@ bool QWindow::event(QEvent *ev)
break; break;
} }
#ifndef QT_NO_TABLETEVENT #if QT_CONFIG(tabletevent)
case QEvent::TabletPress: case QEvent::TabletPress:
case QEvent::TabletMove: case QEvent::TabletMove:
case QEvent::TabletRelease: case QEvent::TabletRelease:
@ -2436,7 +2436,7 @@ void QWindow::touchEvent(QTouchEvent *ev)
ev->ignore(); ev->ignore();
} }
#ifndef QT_NO_TABLETEVENT #if QT_CONFIG(tabletevent)
/*! /*!
Override this to handle tablet press, move, and release events (\a ev). Override this to handle tablet press, move, and release events (\a ev).

View File

@ -75,7 +75,7 @@ class QMouseEvent;
class QWheelEvent; class QWheelEvent;
#endif #endif
class QTouchEvent; class QTouchEvent;
#ifndef QT_NO_TABLETEVENT #if QT_CONFIG(tabletevent)
class QTabletEvent; class QTabletEvent;
#endif #endif
@ -348,7 +348,7 @@ protected:
virtual void wheelEvent(QWheelEvent *); virtual void wheelEvent(QWheelEvent *);
#endif #endif
virtual void touchEvent(QTouchEvent *); virtual void touchEvent(QTouchEvent *);
#ifndef QT_NO_TABLETEVENT #if QT_CONFIG(tabletevent)
virtual void tabletEvent(QTabletEvent *); virtual void tabletEvent(QTabletEvent *);
#endif #endif
virtual bool nativeEvent(const QByteArray &eventType, void *message, long *result); virtual bool nativeEvent(const QByteArray &eventType, void *message, long *result);

View File

@ -38,6 +38,8 @@
** **
****************************************************************************/ ****************************************************************************/
#include <QtGui/qtguiglobal.h>
#include "androidjniinput.h" #include "androidjniinput.h"
#include "androidjnimain.h" #include "androidjnimain.h"
#include "qandroidplatformintegration.h" #include "qandroidplatformintegration.h"
@ -292,17 +294,17 @@ namespace QtAndroidInput
static bool isTabletEventSupported(JNIEnv */*env*/, jobject /*thiz*/) static bool isTabletEventSupported(JNIEnv */*env*/, jobject /*thiz*/)
{ {
#ifdef QT_NO_TABLETEVENT #if QT_CONFIG(tabletevent)
return false;
#else
return true; return true;
#endif // QT_NO_TABLETEVENT #else
return false;
#endif // QT_CONFIG(tabletevent)
} }
static void tabletEvent(JNIEnv */*env*/, jobject /*thiz*/, jint /*winId*/, jint deviceId, jlong time, jint action, static void tabletEvent(JNIEnv */*env*/, jobject /*thiz*/, jint /*winId*/, jint deviceId, jlong time, jint action,
jint pointerType, jint buttonState, jfloat x, jfloat y, jfloat pressure) jint pointerType, jint buttonState, jfloat x, jfloat y, jfloat pressure)
{ {
#ifndef QT_NO_TABLETEVENT #if QT_CONFIG(tabletevent)
QPointF globalPosF(x, y); QPointF globalPosF(x, y);
QPoint globalPos((int)x, (int)y); QPoint globalPos((int)x, (int)y);
QWindow *tlw = topLevelWindowAt(globalPos); QWindow *tlw = topLevelWindowAt(globalPos);
@ -344,7 +346,7 @@ namespace QtAndroidInput
QWindowSystemInterface::handleTabletEvent(tlw, ulong(time), QWindowSystemInterface::handleTabletEvent(tlw, ulong(time),
localPos, globalPosF, QTabletEvent::Stylus, pointerType, localPos, globalPosF, QTabletEvent::Stylus, pointerType,
buttons, pressure, 0, 0, 0., 0., 0, deviceId, Qt::NoModifier); buttons, pressure, 0, 0, 0., 0., 0, deviceId, Qt::NoModifier);
#endif // QT_NO_TABLETEVENT #endif // QT_CONFIG(tabletevent)
} }
static int mapAndroidKey(int key) static int mapAndroidKey(int key)

View File

@ -59,6 +59,7 @@
#include "qwindowsscreen.h" #include "qwindowsscreen.h"
#include "qwindowstheme.h" #include "qwindowstheme.h"
#include <QtGui/qtguiglobal.h>
#include <QtGui/QWindow> #include <QtGui/QWindow>
#include <qpa/qwindowsysteminterface.h> #include <qpa/qwindowsysteminterface.h>
#include <qpa/qplatformnativeinterface.h> #include <qpa/qplatformnativeinterface.h>
@ -1077,10 +1078,10 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
*result = LRESULT(MA_NOACTIVATE); *result = LRESULT(MA_NOACTIVATE);
return true; return true;
} }
#ifndef QT_NO_TABLETEVENT #if QT_CONFIG(tabletevent)
if (!d->m_tabletSupport.isNull()) if (!d->m_tabletSupport.isNull())
d->m_tabletSupport->notifyActivate(); d->m_tabletSupport->notifyActivate();
#endif // !QT_NO_TABLETEVENT #endif // QT_CONFIG(tabletevent)
if (platformWindow->testFlag(QWindowsWindow::BlockedByModal)) if (platformWindow->testFlag(QWindowsWindow::BlockedByModal))
if (const QWindow *modalWindow = QGuiApplication::modalWindow()) { if (const QWindow *modalWindow = QGuiApplication::modalWindow()) {
QWindowsWindow *platformWindow = QWindowsWindow::windowsWindowOf(modalWindow); QWindowsWindow *platformWindow = QWindowsWindow::windowsWindowOf(modalWindow);

View File

@ -39,8 +39,6 @@
#include "qwindowstabletsupport.h" #include "qwindowstabletsupport.h"
#ifndef QT_NO_TABLETEVENT
#include "qwindowscontext.h" #include "qwindowscontext.h"
#include "qwindowskeymapper.h" #include "qwindowskeymapper.h"
#include "qwindowswindow.h" #include "qwindowswindow.h"
@ -498,5 +496,3 @@ bool QWindowsTabletSupport::translateTabletPacketEvent()
} }
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // QT_NO_TABLETEVENT

View File

@ -41,14 +41,15 @@
#define QWINDOWSTABLETSUPPORT_H #define QWINDOWSTABLETSUPPORT_H
#include "qtwindowsglobal.h" #include "qtwindowsglobal.h"
#include <QtGui/qtguiglobal.h>
#if !defined(QT_NO_TABLETEVENT)
#include <QtCore/QVector> #include <QtCore/QVector>
#include <QtCore/QPointF> #include <QtCore/QPointF>
#include <wintab.h> #include <wintab.h>
QT_REQUIRE_CONFIG(tabletevent);
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QDebug; class QDebug;
@ -140,5 +141,4 @@ private:
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // !QT_NO_TABLETEVENT
#endif // QWINDOWSTABLETSUPPORT_H #endif // QWINDOWSTABLETSUPPORT_H

View File

@ -1626,11 +1626,11 @@ bool QXcbConnection::compressEvent(xcb_generic_event_t *event, int currentIndex,
// compress XI_Motion, but not from tablet devices // compress XI_Motion, but not from tablet devices
if (isXIType(event, m_xiOpCode, XI_Motion)) { if (isXIType(event, m_xiOpCode, XI_Motion)) {
#ifndef QT_NO_TABLETEVENT #if QT_CONFIG(tabletevent)
xXIDeviceEvent *xdev = reinterpret_cast<xXIDeviceEvent *>(event); xXIDeviceEvent *xdev = reinterpret_cast<xXIDeviceEvent *>(event);
if (const_cast<QXcbConnection *>(this)->tabletDataForDevice(xdev->sourceid)) if (const_cast<QXcbConnection *>(this)->tabletDataForDevice(xdev->sourceid))
return false; return false;
#endif // QT_NO_TABLETEVENT #endif // QT_CONFIG(tabletevent)
for (int j = nextIndex; j < eventqueue->size(); ++j) { for (int j = nextIndex; j < eventqueue->size(); ++j) {
xcb_generic_event_t *next = eventqueue->at(j); xcb_generic_event_t *next = eventqueue->at(j);
if (!isValid(next)) if (!isValid(next))

View File

@ -64,7 +64,7 @@
#undef explicit #undef explicit
#endif #endif
#ifndef QT_NO_TABLETEVENT #if QT_CONFIG(tabletevent)
#include <QTabletEvent> #include <QTabletEvent>
#endif #endif
@ -565,7 +565,7 @@ private:
#ifdef XCB_USE_XINPUT22 #ifdef XCB_USE_XINPUT22
void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow);
#endif // XCB_USE_XINPUT22 #endif // XCB_USE_XINPUT22
#ifndef QT_NO_TABLETEVENT #if QT_CONFIG(tabletevent)
struct TabletData { struct TabletData {
int deviceId = 0; int deviceId = 0;
QTabletEvent::PointerType pointerType = QTabletEvent::UnknownPointer; QTabletEvent::PointerType pointerType = QTabletEvent::UnknownPointer;
@ -587,7 +587,7 @@ private:
void xi2ReportTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData);
QVector<TabletData> m_tabletData; QVector<TabletData> m_tabletData;
TabletData *tabletDataForDevice(int id); TabletData *tabletDataForDevice(int id);
#endif // !QT_NO_TABLETEVENT #endif // QT_CONFIG(tabletevent)
struct ScrollingDevice { struct ScrollingDevice {
int deviceId = 0; int deviceId = 0;
int verticalIndex = 0; int verticalIndex = 0;
@ -695,7 +695,7 @@ private:
friend class QXcbEventReader; friend class QXcbEventReader;
}; };
#ifdef XCB_USE_XINPUT2 #ifdef XCB_USE_XINPUT2
#ifndef QT_NO_TABLETEVENT #if QT_CONFIG(tabletevent)
Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE);
Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_MOVABLE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_MOVABLE_TYPE);
#endif #endif

View File

@ -100,7 +100,7 @@ void QXcbConnection::initializeXInput2()
void QXcbConnection::xi2SetupDevices() void QXcbConnection::xi2SetupDevices()
{ {
#ifndef QT_NO_TABLETEVENT #if QT_CONFIG(tabletevent)
m_tabletData.clear(); m_tabletData.clear();
#endif #endif
m_scrollingDevices.clear(); m_scrollingDevices.clear();
@ -116,7 +116,7 @@ void QXcbConnection::xi2SetupDevices()
if (devices[i].use != XISlavePointer) if (devices[i].use != XISlavePointer)
continue; continue;
qCDebug(lcQpaXInputDevices) << "input device " << devices[i].name << "ID" << devices[i].deviceid; qCDebug(lcQpaXInputDevices) << "input device " << devices[i].name << "ID" << devices[i].deviceid;
#ifndef QT_NO_TABLETEVENT #if QT_CONFIG(tabletevent)
TabletData tabletData; TabletData tabletData;
#endif #endif
ScrollingDevice scrollingDevice; ScrollingDevice scrollingDevice;
@ -126,7 +126,7 @@ void QXcbConnection::xi2SetupDevices()
XIValuatorClassInfo *vci = reinterpret_cast<XIValuatorClassInfo *>(devices[i].classes[c]); XIValuatorClassInfo *vci = reinterpret_cast<XIValuatorClassInfo *>(devices[i].classes[c]);
const int valuatorAtom = qatom(vci->label); const int valuatorAtom = qatom(vci->label);
qCDebug(lcQpaXInputDevices) << " has valuator" << atomName(vci->label) << "recognized?" << (valuatorAtom < QXcbAtom::NAtoms); qCDebug(lcQpaXInputDevices) << " has valuator" << atomName(vci->label) << "recognized?" << (valuatorAtom < QXcbAtom::NAtoms);
#ifndef QT_NO_TABLETEVENT #if QT_CONFIG(tabletevent)
if (valuatorAtom < QXcbAtom::NAtoms) { if (valuatorAtom < QXcbAtom::NAtoms) {
TabletData::ValuatorClassInfo info; TabletData::ValuatorClassInfo info;
info.minVal = vci->min; info.minVal = vci->min;
@ -134,7 +134,7 @@ void QXcbConnection::xi2SetupDevices()
info.number = vci->number; info.number = vci->number;
tabletData.valuatorInfo[valuatorAtom] = info; tabletData.valuatorInfo[valuatorAtom] = info;
} }
#endif // QT_NO_TABLETEVENT #endif // QT_CONFIG(tabletevent)
if (valuatorAtom == QXcbAtom::RelHorizScroll || valuatorAtom == QXcbAtom::RelHorizWheel) if (valuatorAtom == QXcbAtom::RelHorizScroll || valuatorAtom == QXcbAtom::RelHorizWheel)
scrollingDevice.lastScrollPosition.setX(vci->value); scrollingDevice.lastScrollPosition.setX(vci->value);
else if (valuatorAtom == QXcbAtom::RelVertScroll || valuatorAtom == QXcbAtom::RelVertWheel) else if (valuatorAtom == QXcbAtom::RelVertScroll || valuatorAtom == QXcbAtom::RelVertWheel)
@ -191,7 +191,7 @@ void QXcbConnection::xi2SetupDevices()
} }
} }
bool isTablet = false; bool isTablet = false;
#ifndef QT_NO_TABLETEVENT #if QT_CONFIG(tabletevent)
// If we have found the valuators which we expect a tablet to have, it might be a tablet. // If we have found the valuators which we expect a tablet to have, it might be a tablet.
if (tabletData.valuatorInfo.contains(QXcbAtom::AbsX) && if (tabletData.valuatorInfo.contains(QXcbAtom::AbsX) &&
tabletData.valuatorInfo.contains(QXcbAtom::AbsY) && tabletData.valuatorInfo.contains(QXcbAtom::AbsY) &&
@ -241,7 +241,7 @@ void QXcbConnection::xi2SetupDevices()
m_tabletData.append(tabletData); m_tabletData.append(tabletData);
qCDebug(lcQpaXInputDevices) << " it's a tablet with pointer type" << dbgType; qCDebug(lcQpaXInputDevices) << " it's a tablet with pointer type" << dbgType;
} }
#endif // QT_NO_TABLETEVENT #endif // QT_CONFIG(tabletevent)
#ifdef XCB_USE_XINPUT21 #ifdef XCB_USE_XINPUT21
if (scrollingDevice.orientations || scrollingDevice.legacyOrientations) { if (scrollingDevice.orientations || scrollingDevice.legacyOrientations) {
@ -330,7 +330,7 @@ void QXcbConnection::xi2Select(xcb_window_t window)
#endif // XCB_USE_XINPUT22 #endif // XCB_USE_XINPUT22
QSet<int> tabletDevices; QSet<int> tabletDevices;
#ifndef QT_NO_TABLETEVENT #if QT_CONFIG(tabletevent)
if (!m_tabletData.isEmpty()) { if (!m_tabletData.isEmpty()) {
unsigned int tabletBitMask; unsigned int tabletBitMask;
unsigned char *xiTabletBitMask = reinterpret_cast<unsigned char *>(&tabletBitMask); unsigned char *xiTabletBitMask = reinterpret_cast<unsigned char *>(&tabletBitMask);
@ -347,7 +347,7 @@ void QXcbConnection::xi2Select(xcb_window_t window)
} }
XISelectEvents(xDisplay, window, xiEventMask.data(), m_tabletData.count()); XISelectEvents(xDisplay, window, xiEventMask.data(), m_tabletData.count());
} }
#endif // QT_NO_TABLETEVENT #endif // QT_CONFIG(tabletevent)
#ifdef XCB_USE_XINPUT21 #ifdef XCB_USE_XINPUT21
// Enable each scroll device // Enable each scroll device
@ -482,12 +482,12 @@ XInput2TouchDeviceData *QXcbConnection::touchDeviceForId(int id)
return dev; return dev;
} }
#if defined(XCB_USE_XINPUT21) || !defined(QT_NO_TABLETEVENT) #if defined(XCB_USE_XINPUT21) || QT_CONFIG(tabletevent)
static inline qreal fixed1616ToReal(FP1616 val) static inline qreal fixed1616ToReal(FP1616 val)
{ {
return qreal(val) / 0x10000; return qreal(val) / 0x10000;
} }
#endif // defined(XCB_USE_XINPUT21) || !defined(QT_NO_TABLETEVENT) #endif // defined(XCB_USE_XINPUT21) || QT_CONFIG(tabletevent)
void QXcbConnection::xi2HandleEvent(xcb_ge_event_t *event) void QXcbConnection::xi2HandleEvent(xcb_ge_event_t *event)
{ {
@ -536,13 +536,13 @@ void QXcbConnection::xi2HandleEvent(xcb_ge_event_t *event)
return; return;
} }
#ifndef QT_NO_TABLETEVENT #if QT_CONFIG(tabletevent)
if (!xiEnterEvent) { if (!xiEnterEvent) {
QXcbConnection::TabletData *tablet = tabletDataForDevice(sourceDeviceId); QXcbConnection::TabletData *tablet = tabletDataForDevice(sourceDeviceId);
if (tablet && xi2HandleTabletEvent(xiEvent, tablet)) if (tablet && xi2HandleTabletEvent(xiEvent, tablet))
return; return;
} }
#endif // QT_NO_TABLETEVENT #endif // QT_CONFIG(tabletevent)
#ifdef XCB_USE_XINPUT21 #ifdef XCB_USE_XINPUT21
QHash<int, ScrollingDevice>::iterator device = m_scrollingDevices.find(sourceDeviceId); QHash<int, ScrollingDevice>::iterator device = m_scrollingDevices.find(sourceDeviceId);
@ -1240,6 +1240,6 @@ QXcbConnection::TabletData *QXcbConnection::tabletDataForDevice(int id)
return Q_NULLPTR; return Q_NULLPTR;
} }
#endif // QT_NO_TABLETEVENT #endif // QT_CONFIG(tabletevent)
#endif // XCB_USE_XINPUT2 #endif // XCB_USE_XINPUT2

View File

@ -2990,7 +2990,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
case QEvent::TouchBegin: case QEvent::TouchBegin:
case QEvent::TouchUpdate: case QEvent::TouchUpdate:
case QEvent::TouchEnd: case QEvent::TouchEnd:
#ifndef QT_NO_TABLETEVENT #if QT_CONFIG(tabletevent)
case QEvent::TabletMove: case QEvent::TabletMove:
case QEvent::TabletPress: case QEvent::TabletPress:
case QEvent::TabletRelease: case QEvent::TabletRelease:
@ -3349,7 +3349,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
} }
break; break;
#endif // QT_NO_CONTEXTMENU #endif // QT_NO_CONTEXTMENU
#ifndef QT_NO_TABLETEVENT #if QT_CONFIG(tabletevent)
case QEvent::TabletMove: case QEvent::TabletMove:
case QEvent::TabletPress: case QEvent::TabletPress:
case QEvent::TabletRelease: case QEvent::TabletRelease:
@ -3379,7 +3379,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
tablet->setAccepted(eventAccepted); tablet->setAccepted(eventAccepted);
} }
break; break;
#endif // QT_NO_TABLETEVENT #endif // QT_CONFIG(tabletevent)
#if !defined(QT_NO_TOOLTIP) || !defined(QT_NO_WHATSTHIS) #if !defined(QT_NO_TOOLTIP) || !defined(QT_NO_WHATSTHIS)
case QEvent::ToolTip: case QEvent::ToolTip:

View File

@ -8806,7 +8806,7 @@ bool QWidget::event(QEvent *event)
wheelEvent((QWheelEvent*)event); wheelEvent((QWheelEvent*)event);
break; break;
#endif #endif
#ifndef QT_NO_TABLETEVENT #if QT_CONFIG(tabletevent)
case QEvent::TabletMove: case QEvent::TabletMove:
if (static_cast<QTabletEvent *>(event)->buttons() == Qt::NoButton && !testAttribute(Qt::WA_TabletTracking)) if (static_cast<QTabletEvent *>(event)->buttons() == Qt::NoButton && !testAttribute(Qt::WA_TabletTracking))
break; break;
@ -9439,7 +9439,7 @@ void QWidget::wheelEvent(QWheelEvent *event)
} }
#endif // QT_CONFIG(wheelevent) #endif // QT_CONFIG(wheelevent)
#ifndef QT_NO_TABLETEVENT #if QT_CONFIG(tabletevent)
/*! /*!
This event handler, for event \a event, can be reimplemented in a This event handler, for event \a event, can be reimplemented in a
subclass to receive tablet events for the widget. subclass to receive tablet events for the widget.
@ -9464,7 +9464,7 @@ void QWidget::tabletEvent(QTabletEvent *event)
{ {
event->ignore(); event->ignore();
} }
#endif // QT_NO_TABLETEVENT #endif // QT_CONFIG(tabletevent)
/*! /*!
This event handler, for event \a event, can be reimplemented in a This event handler, for event \a event, can be reimplemented in a

View File

@ -629,7 +629,7 @@ protected:
#ifndef QT_NO_CONTEXTMENU #ifndef QT_NO_CONTEXTMENU
virtual void contextMenuEvent(QContextMenuEvent *event); virtual void contextMenuEvent(QContextMenuEvent *event);
#endif #endif
#ifndef QT_NO_TABLETEVENT #if QT_CONFIG(tabletevent)
virtual void tabletEvent(QTabletEvent *event); virtual void tabletEvent(QTabletEvent *event);
#endif #endif
#ifndef QT_NO_ACTION #ifndef QT_NO_ACTION

View File

@ -299,7 +299,7 @@ bool QWidgetWindow::event(QEvent *event)
} }
return true; return true;
#ifndef QT_NO_TABLETEVENT #if QT_CONFIG(tabletevent)
case QEvent::TabletPress: case QEvent::TabletPress:
case QEvent::TabletMove: case QEvent::TabletMove:
case QEvent::TabletRelease: case QEvent::TabletRelease:
@ -974,7 +974,7 @@ bool QWidgetWindow::nativeEvent(const QByteArray &eventType, void *message, long
return m_widget->nativeEvent(eventType, message, result); return m_widget->nativeEvent(eventType, message, result);
} }
#ifndef QT_NO_TABLETEVENT #if QT_CONFIG(tabletevent)
void QWidgetWindow::handleTabletEvent(QTabletEvent *event) void QWidgetWindow::handleTabletEvent(QTabletEvent *event)
{ {
static QPointer<QWidget> qt_tablet_target = 0; static QPointer<QWidget> qt_tablet_target = 0;
@ -1004,7 +1004,7 @@ void QWidgetWindow::handleTabletEvent(QTabletEvent *event)
if (event->type() == QEvent::TabletRelease && event->buttons() == Qt::NoButton) if (event->type() == QEvent::TabletRelease && event->buttons() == Qt::NoButton)
qt_tablet_target = 0; qt_tablet_target = 0;
} }
#endif // QT_NO_TABLETEVENT #endif // QT_CONFIG(tabletevent)
#ifndef QT_NO_GESTURES #ifndef QT_NO_GESTURES
void QWidgetWindow::handleGestureEvent(QNativeGestureEvent *e) void QWidgetWindow::handleGestureEvent(QNativeGestureEvent *e)

View File

@ -100,7 +100,7 @@ protected:
void handleExposeEvent(QExposeEvent *); void handleExposeEvent(QExposeEvent *);
void handleWindowStateChangedEvent(QWindowStateChangeEvent *event); void handleWindowStateChangedEvent(QWindowStateChangeEvent *event);
bool nativeEvent(const QByteArray &eventType, void *message, long *result) Q_DECL_OVERRIDE; bool nativeEvent(const QByteArray &eventType, void *message, long *result) Q_DECL_OVERRIDE;
#ifndef QT_NO_TABLETEVENT #if QT_CONFIG(tabletevent)
void handleTabletEvent(QTabletEvent *); void handleTabletEvent(QTabletEvent *);
#endif #endif
#ifndef QT_NO_GESTURES #ifndef QT_NO_GESTURES

View File

@ -183,12 +183,12 @@ static QEvent *cloneEvent(QEvent *e)
return new QEvent(*e); return new QEvent(*e);
case QEvent::Style: case QEvent::Style:
return new QEvent(*e); return new QEvent(*e);
#ifndef QT_NO_TABLETEVENT #if QT_CONFIG(tabletevent)
case QEvent::TabletMove: case QEvent::TabletMove:
case QEvent::TabletPress: case QEvent::TabletPress:
case QEvent::TabletRelease: case QEvent::TabletRelease:
return new QTabletEvent(*static_cast<QTabletEvent*>(e)); return new QTabletEvent(*static_cast<QTabletEvent*>(e));
#endif //QT_NO_TABLETEVENT #endif // QT_CONFIG(tabletevent)
case QEvent::OkRequest: case QEvent::OkRequest:
return new QEvent(*e); return new QEvent(*e);
case QEvent::HelpRequest: case QEvent::HelpRequest:
@ -372,11 +372,11 @@ static QEvent *cloneEvent(QEvent *e)
case QEvent::DynamicPropertyChange: case QEvent::DynamicPropertyChange:
return new QDynamicPropertyChangeEvent(*static_cast<QDynamicPropertyChangeEvent*>(e)); return new QDynamicPropertyChangeEvent(*static_cast<QDynamicPropertyChangeEvent*>(e));
#ifndef QT_NO_TABLETEVENT #if QT_CONFIG(tabletevent)
case QEvent::TabletEnterProximity: case QEvent::TabletEnterProximity:
case QEvent::TabletLeaveProximity: case QEvent::TabletLeaveProximity:
return new QTabletEvent(*static_cast<QTabletEvent*>(e)); return new QTabletEvent(*static_cast<QTabletEvent*>(e));
#endif //QT_NO_TABLETEVENT #endif // QT_CONFIG(tabletevent)
case QEvent::NonClientAreaMouseMove: case QEvent::NonClientAreaMouseMove:
case QEvent::NonClientAreaMouseButtonPress: case QEvent::NonClientAreaMouseButtonPress:

View File

@ -1644,7 +1644,7 @@ void tst_QWindow::inputReentrancy()
QCOMPARE(window.touchReleasedCount, 1); QCOMPARE(window.touchReleasedCount, 1);
} }
#ifndef QT_NO_TABLETEVENT #if QT_CONFIG(tabletevent)
class TabletTestWindow : public QWindow class TabletTestWindow : public QWindow
{ {
public: public:
@ -1672,7 +1672,7 @@ public:
void tst_QWindow::tabletEvents() void tst_QWindow::tabletEvents()
{ {
#ifndef QT_NO_TABLETEVENT #if QT_CONFIG(tabletevent)
TabletTestWindow window; TabletTestWindow window;
window.setGeometry(QRect(m_availableTopLeft + QPoint(10, 10), m_testWindowSize)); window.setGeometry(QRect(m_availableTopLeft + QPoint(10, 10), m_testWindowSize));
qGuiApp->installEventFilter(&window); qGuiApp->installEventFilter(&window);