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++

Qt6: ifdef around the changes in the input device api

Halla Rempt237091f9ad45
diff --git a/libs/ui/input/kis_tablet_debugger.cpp b/libs/ui/input/kis_tablet_debugger.cpp
index 4391357111..eb7c16ef1e 100644
--- a/libs/ui/input/kis_tablet_debugger.cpp
+++ b/libs/ui/input/kis_tablet_debugger.cpp
@@ -186,8 +186,17 @@ QString KisTabletDebugger::eventToString(const QTouchEvent &ev, const QString &p
KisPortingUtils::setUtf8OnStream(s);
dumpBaseParams(s, ev, prefix);
-
+#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
s << (ev.device()->type() ? "TouchPad" : "TouchScreen") << " ";
+#else
+ if (ev.deviceType() == QInputDevice::DeviceType::TouchPad) {
+ s << "Touchpad";
+ }
+ else if (ev.deviceType() == QInputDevice::DeviceType::TouchScreen) {
+ s << "TouchScreen";
+ }
+ s << " ";
+#endif
for (const auto& touchpoint: ev.touchPoints()) {
s << "id: " << touchpoint.id() << " ";
s << "hires: " << qSetFieldWidth(8) << touchpoint.screenPos().x() << qSetFieldWidth(0) << "," << qSetFieldWidth(8) << touchpoint.screenPos().y() << qSetFieldWidth(0) << " ";