standardize QPA input event logging category hierarchy

If qtlogging.ini contains a rule
qt.qpa.input*=true
then all available input event logging will be enabled on any platform.
There are more specific categories for touch, tablet, gestures,
input methods etc. on some platforms.

Change-Id: I8754ce23df8f0b750a4b7dfcf3afe5bab800ead8
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
This commit is contained in:
Shawn Rutledge 2014-08-21 15:27:30 +02:00
parent 4040bc21ab
commit b983818219
3 changed files with 19 additions and 24 deletions

View File

@ -66,7 +66,11 @@
#include <accessibilityinspector.h> #include <accessibilityinspector.h>
#endif #endif
Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.tabletsupport") Q_LOGGING_CATEGORY(lcQpaTouch, "qt.qpa.input.touch")
#ifndef QT_NO_GESTURES
Q_LOGGING_CATEGORY(lcQpaGestures, "qt.qpa.input.gestures")
#endif
Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet")
static QTouchDevice *touchDevice = 0; static QTouchDevice *touchDevice = 0;
@ -1124,6 +1128,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
{ {
const NSTimeInterval timestamp = [event timestamp]; const NSTimeInterval timestamp = [event timestamp];
const QList<QWindowSystemInterface::TouchPoint> points = QCocoaTouch::getCurrentTouchPointList(event, /*acceptSingleTouch= ### true or false?*/false); const QList<QWindowSystemInterface::TouchPoint> points = QCocoaTouch::getCurrentTouchPointList(event, /*acceptSingleTouch= ### true or false?*/false);
qCDebug(lcQpaTouch) << "touchesBeganWithEvent" << points;
QWindowSystemInterface::handleTouchEvent(m_window, timestamp * 1000, touchDevice, points); QWindowSystemInterface::handleTouchEvent(m_window, timestamp * 1000, touchDevice, points);
} }
@ -1131,6 +1136,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
{ {
const NSTimeInterval timestamp = [event timestamp]; const NSTimeInterval timestamp = [event timestamp];
const QList<QWindowSystemInterface::TouchPoint> points = QCocoaTouch::getCurrentTouchPointList(event, /*acceptSingleTouch= ### true or false?*/false); const QList<QWindowSystemInterface::TouchPoint> points = QCocoaTouch::getCurrentTouchPointList(event, /*acceptSingleTouch= ### true or false?*/false);
qCDebug(lcQpaTouch) << "touchesMovedWithEvent" << points;
QWindowSystemInterface::handleTouchEvent(m_window, timestamp * 1000, touchDevice, points); QWindowSystemInterface::handleTouchEvent(m_window, timestamp * 1000, touchDevice, points);
} }
@ -1138,6 +1144,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
{ {
const NSTimeInterval timestamp = [event timestamp]; const NSTimeInterval timestamp = [event timestamp];
const QList<QWindowSystemInterface::TouchPoint> points = QCocoaTouch::getCurrentTouchPointList(event, /*acceptSingleTouch= ### true or false?*/false); const QList<QWindowSystemInterface::TouchPoint> points = QCocoaTouch::getCurrentTouchPointList(event, /*acceptSingleTouch= ### true or false?*/false);
qCDebug(lcQpaTouch) << "touchesEndedWithEvent" << points;
QWindowSystemInterface::handleTouchEvent(m_window, timestamp * 1000, touchDevice, points); QWindowSystemInterface::handleTouchEvent(m_window, timestamp * 1000, touchDevice, points);
} }
@ -1145,16 +1152,14 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
{ {
const NSTimeInterval timestamp = [event timestamp]; const NSTimeInterval timestamp = [event timestamp];
const QList<QWindowSystemInterface::TouchPoint> points = QCocoaTouch::getCurrentTouchPointList(event, /*acceptSingleTouch= ### true or false?*/false); const QList<QWindowSystemInterface::TouchPoint> points = QCocoaTouch::getCurrentTouchPointList(event, /*acceptSingleTouch= ### true or false?*/false);
qCDebug(lcQpaTouch) << "touchesCancelledWithEvent" << points;
QWindowSystemInterface::handleTouchEvent(m_window, timestamp * 1000, touchDevice, points); QWindowSystemInterface::handleTouchEvent(m_window, timestamp * 1000, touchDevice, points);
} }
#ifndef QT_NO_GESTURES #ifndef QT_NO_GESTURES
//#define QT_COCOA_ENABLE_GESTURE_DEBUG
- (void)magnifyWithEvent:(NSEvent *)event - (void)magnifyWithEvent:(NSEvent *)event
{ {
#ifdef QT_COCOA_ENABLE_GESTURE_DEBUG qCDebug(lcQpaGestures) << "magnifyWithEvent" << [event magnification];
qDebug() << "magnifyWithEvent" << [event magnification];
#endif
const NSTimeInterval timestamp = [event timestamp]; const NSTimeInterval timestamp = [event timestamp];
QPointF windowPoint; QPointF windowPoint;
QPointF screenPoint; QPointF screenPoint;
@ -1167,9 +1172,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
- (void)smartMagnifyWithEvent:(NSEvent *)event - (void)smartMagnifyWithEvent:(NSEvent *)event
{ {
static bool zoomIn = true; static bool zoomIn = true;
#ifdef QT_COCOA_ENABLE_GESTURE_DEBUG qCDebug(lcQpaGestures) << "smartMagnifyWithEvent" << zoomIn;
qDebug() << "smartMagnifyWithEvent" << zoomIn;
#endif
const NSTimeInterval timestamp = [event timestamp]; const NSTimeInterval timestamp = [event timestamp];
QPointF windowPoint; QPointF windowPoint;
QPointF screenPoint; QPointF screenPoint;
@ -1182,9 +1185,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
- (void)rotateWithEvent:(NSEvent *)event - (void)rotateWithEvent:(NSEvent *)event
{ {
#ifdef QT_COCOA_ENABLE_GESTURE_DEBUG qCDebug(lcQpaGestures) << "rotateWithEvent" << [event rotation];
qDebug() << "rotateWithEvent" << [event rotation];
#endif
const NSTimeInterval timestamp = [event timestamp]; const NSTimeInterval timestamp = [event timestamp];
QPointF windowPoint; QPointF windowPoint;
QPointF screenPoint; QPointF screenPoint;
@ -1195,9 +1196,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
- (void)swipeWithEvent:(NSEvent *)event - (void)swipeWithEvent:(NSEvent *)event
{ {
#ifdef QT_COCOA_ENABLE_GESTURE_DEBUG qCDebug(lcQpaGestures) << "swipeWithEvent" << [event deltaX] << [event deltaY];
qDebug() << "swipeWithEvent" << [event deltaX] << [event deltaY];
#endif
const NSTimeInterval timestamp = [event timestamp]; const NSTimeInterval timestamp = [event timestamp];
QPointF windowPoint; QPointF windowPoint;
QPointF screenPoint; QPointF screenPoint;
@ -1219,22 +1218,18 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
- (void)beginGestureWithEvent:(NSEvent *)event - (void)beginGestureWithEvent:(NSEvent *)event
{ {
#ifdef QT_COCOA_ENABLE_GESTURE_DEBUG
qDebug() << "beginGestureWithEvent";
#endif
const NSTimeInterval timestamp = [event timestamp]; const NSTimeInterval timestamp = [event timestamp];
QPointF windowPoint; QPointF windowPoint;
QPointF screenPoint; QPointF screenPoint;
[self convertFromScreen:[NSEvent mouseLocation] toWindowPoint:&windowPoint andScreenPoint:&screenPoint]; [self convertFromScreen:[NSEvent mouseLocation] toWindowPoint:&windowPoint andScreenPoint:&screenPoint];
qCDebug(lcQpaGestures) << "beginGestureWithEvent @" << windowPoint;
QWindowSystemInterface::handleGestureEvent(m_window, timestamp, Qt::BeginNativeGesture, QWindowSystemInterface::handleGestureEvent(m_window, timestamp, Qt::BeginNativeGesture,
windowPoint, screenPoint); windowPoint, screenPoint);
} }
- (void)endGestureWithEvent:(NSEvent *)event - (void)endGestureWithEvent:(NSEvent *)event
{ {
#ifdef QT_COCOA_ENABLE_GESTURE_DEBUG qCDebug(lcQpaGestures) << "endGestureWithEvent";
qDebug() << "endGestureWithEvent";
#endif
const NSTimeInterval timestamp = [event timestamp]; const NSTimeInterval timestamp = [event timestamp];
QPointF windowPoint; QPointF windowPoint;
QPointF screenPoint; QPointF screenPoint;

View File

@ -88,9 +88,9 @@ Q_LOGGING_CATEGORY(lcQpaEvents, "qt.qpa.events")
Q_LOGGING_CATEGORY(lcQpaFonts, "qt.qpa.fonts") Q_LOGGING_CATEGORY(lcQpaFonts, "qt.qpa.fonts")
Q_LOGGING_CATEGORY(lcQpaGl, "qt.qpa.gl") Q_LOGGING_CATEGORY(lcQpaGl, "qt.qpa.gl")
Q_LOGGING_CATEGORY(lcQpaMime, "qt.qpa.mime") Q_LOGGING_CATEGORY(lcQpaMime, "qt.qpa.mime")
Q_LOGGING_CATEGORY(lcQpaInputMethods, "qt.qpa.inputmethods") Q_LOGGING_CATEGORY(lcQpaInputMethods, "qt.qpa.input.methods")
Q_LOGGING_CATEGORY(lcQpaDialogs, "qt.qpa.dialogs") Q_LOGGING_CATEGORY(lcQpaDialogs, "qt.qpa.dialogs")
Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.tabletsupport") Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet")
Q_LOGGING_CATEGORY(lcQpaAccessibility, "qt.qpa.accessibility") Q_LOGGING_CATEGORY(lcQpaAccessibility, "qt.qpa.accessibility")
int QWindowsContext::verbose = 0; int QWindowsContext::verbose = 0;

View File

@ -92,8 +92,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
Q_LOGGING_CATEGORY(lcQpaXInput, "qt.qpa.events.input") Q_LOGGING_CATEGORY(lcQpaXInput, "qt.qpa.input")
Q_LOGGING_CATEGORY(lcQpaXInputDevices, "qt.qpa.devices") Q_LOGGING_CATEGORY(lcQpaXInputDevices, "qt.qpa.input.devices")
#ifdef XCB_USE_XLIB #ifdef XCB_USE_XLIB
static const char * const xcbConnectionErrors[] = { static const char * const xcbConnectionErrors[] = {