diff options
author | Tor Arne Vestbø <[email protected]> | 2024-11-12 12:10:37 +0100 |
---|---|---|
committer | Tor Arne Vestbø <[email protected]> | 2024-11-15 22:06:25 +0100 |
commit | 1ad00d3878271450cc55eb84d4c5f3cddd460b8b (patch) | |
tree | 5f416bde33c3d8e827004a987922ec86ba3241cb | |
parent | 121551e88380a9e87d2190ccdc6417214622a0fb (diff) |
Tweak QInputDevice logging
The logging category now silences QtWarningMsg and below by
default, so we can be more granular in our logging.
Use info logging category for registering/unregistering, to allow
filtering out the detailed debug logging while still seeing when
devices are registered/unregistered.
Log the number of buttons for pointing devices, if there are any.
Log the device for wheel events.
Pick-to: 6.8
Change-Id: Ie046fee1659fc3967caf7eafbaf46f3ed22be5bb
Reviewed-by: Shawn Rutledge <[email protected]>
-rw-r--r-- | src/gui/kernel/qevent.cpp | 1 | ||||
-rw-r--r-- | src/gui/kernel/qinputdevice.cpp | 4 | ||||
-rw-r--r-- | src/gui/kernel/qpointingdevice.cpp | 2 | ||||
-rw-r--r-- | src/gui/kernel/qwindowsysteminterface.cpp | 2 |
4 files changed, 6 insertions, 3 deletions
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index fa28aff7dc1..5f4daced732 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -4111,6 +4111,7 @@ QDebug operator<<(QDebug dbg, const QEvent *e) dbg << "QWheelEvent(" << we->phase(); if (!we->pixelDelta().isNull() || !we->angleDelta().isNull()) dbg << ", pixelDelta=" << we->pixelDelta() << ", angleDelta=" << we->angleDelta(); + dbg << " dev=" << we->device() << ')'; dbg << ')'; } break; diff --git a/src/gui/kernel/qinputdevice.cpp b/src/gui/kernel/qinputdevice.cpp index e515d5410bb..3ef8ad10c7d 100644 --- a/src/gui/kernel/qinputdevice.cpp +++ b/src/gui/kernel/qinputdevice.cpp @@ -348,7 +348,7 @@ void QInputDevicePrivate::registerDevice(const QInputDevice *dev) { QMutexLocker lock(&devicesMutex); deviceList()->append(dev); - qCDebug(lcQpaInputDevices) << "Registered" << dev; + qCInfo(lcQpaInputDevices) << "Registered" << dev; } /*! @@ -358,7 +358,7 @@ void QInputDevicePrivate::unregisterDevice(const QInputDevice *dev) { QMutexLocker lock(&devicesMutex); deviceList()->removeOne(dev); - qCDebug(lcQpaInputDevices) << "Unregistered" << dev; + qCInfo(lcQpaInputDevices) << "Unregistered" << dev; } bool QInputDevice::operator==(const QInputDevice &other) const diff --git a/src/gui/kernel/qpointingdevice.cpp b/src/gui/kernel/qpointingdevice.cpp index ef534b19cd0..859d3e293ee 100644 --- a/src/gui/kernel/qpointingdevice.cpp +++ b/src/gui/kernel/qpointingdevice.cpp @@ -719,6 +719,8 @@ QDebug operator<<(QDebug debug, const QPointingDevice *device) debug << " caps="; QtDebugUtils::formatQFlags(debug, device->capabilities()); } + if (device->buttonCount() > 0) + debug << " buttonCount=" << device->buttonCount(); if (device->maximumPoints() > 1) debug << " maxPts=" << device->maximumPoints(); if (device->uniqueId().isValid()) diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp index 3e88380ae56..5f08bff1ad1 100644 --- a/src/gui/kernel/qwindowsysteminterface.cpp +++ b/src/gui/kernel/qwindowsysteminterface.cpp @@ -24,7 +24,7 @@ QT_BEGIN_NAMESPACE using namespace Qt::StringLiterals; -Q_LOGGING_CATEGORY(lcQpaInputDevices, "qt.qpa.input.devices") +Q_LOGGING_CATEGORY(lcQpaInputDevices, "qt.qpa.input.devices", QtWarningMsg) Q_CONSTINIT QElapsedTimer QWindowSystemInterfacePrivate::eventTime; bool QWindowSystemInterfacePrivate::synchronousWindowSystemEvents = false; |