Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Add device type logging for Wheel events

Dmitry Kazakoveae562d4a1be
diff --git a/libs/ui/input/kis_tablet_debugger.cpp b/libs/ui/input/kis_tablet_debugger.cpp
index 60789b4626..242b217266 100644
--- a/libs/ui/input/kis_tablet_debugger.cpp
+++ b/libs/ui/input/kis_tablet_debugger.cpp
@@ -91,13 +91,13 @@ QString KisTabletDebugger::exTypeToString(QEvent::Type type) {
inline QString sourceToString(Qt::MouseEventSource source) {
switch (source) {
case Qt::MouseEventNotSynthesized:
- return "MouseEventNotSynthesized";
+ return "NotSynthesized";
case Qt::MouseEventSynthesizedBySystem:
- return "MouseEventSynthesizedBySystem";
+ return "SynthesizedBySystem";
case Qt::MouseEventSynthesizedByQt:
- return "MouseEventSynthesizedByQt";
+ return "SynthesizedByQt";
case Qt::MouseEventSynthesizedByApplication:
- return "MouseEventSynthesizedByApplication";
+ return "SynthesizedByApplication";
}
return "<unknown>";
@@ -142,7 +142,7 @@ QString KisTabletDebugger::eventToString(const QMouseEvent &ev, const QString &p
dumpBaseParams(s, ev, prefix);
dumpMouseRelatedParams(s, ev);
s << "hires: " << qSetFieldWidth(8) << ev.screenPos().x() << qSetFieldWidth(0) << "," << qSetFieldWidth(8) << ev.screenPos().y() << qSetFieldWidth(0) << " ";
- s << "source:" << sourceToString(ev.source());
+ s << "source: " << sourceToString(ev.source());
return string;
}
@@ -173,7 +173,10 @@ QString KisTabletDebugger::eventToString(const QWheelEvent &ev, const QString &p
dumpMouseRelatedParams(s, ev);
s << "delta: x: " << ev.angleDelta().x() << " y: " << ev.angleDelta().y() << " ";
- s << "source:" << sourceToString(ev.source());
+ s << "source: " << sourceToString(ev.source()) << " ";
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ s << "dev. type: " << static_cast<int>(ev.device()->type());
+#endif
return string;
}