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. Change-Id: Ie046fee1659fc3967caf7eafbaf46f3ed22be5bb Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 1ad00d3878271450cc55eb84d4c5f3cddd460b8b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
059cbd17ba
commit
19207456bd
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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())
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user