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

Fix build on Qt5

Dmitry Kazakov62196480db7d
diff --git a/libs/ui/input/kis_abstract_input_action.cpp b/libs/ui/input/kis_abstract_input_action.cpp
index a65ceec0d7..2827b2cf72 100644
--- a/libs/ui/input/kis_abstract_input_action.cpp
+++ b/libs/ui/input/kis_abstract_input_action.cpp
@@ -199,7 +199,11 @@ QPoint KisAbstractInputAction::eventPos(const QEvent *event)
* in the widget's coordinates). So we should manually map it
* from global.
*/
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
return canvas->canvasWidget()->mapFromGlobal(QPointF(static_cast<const QNativeGestureEvent*>(event)->globalPos())).toPoint();
+#else
+ return canvas->canvasWidget()->mapFromGlobal(static_cast<const QNativeGestureEvent*>(event)->globalPos());
+#endif
}
default:
@@ -240,7 +244,11 @@ QPointF KisAbstractInputAction::eventPosF(const QEvent *event) {
* in the widget's coordinates). So we should manually map it
* from global.
*/
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
return canvas->canvasWidget()->mapFromGlobal(QPointF(static_cast<const QNativeGestureEvent*>(event)->globalPos()));
+#else
+ return canvas->canvasWidget()->mapFromGlobal(static_cast<const QNativeGestureEvent*>(event)->globalPos());
+#endif
}
default:
warnInput << "KisAbstractInputAction" << d->name << "tried to process event data from an unhandled event type" << event->type();