summaryrefslogtreecommitdiffstats
path: root/src/widget/openglwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widget/openglwindow.cpp')
-rw-r--r--src/widget/openglwindow.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/widget/openglwindow.cpp b/src/widget/openglwindow.cpp
index c2249a9e8e..5d4495d783 100644
--- a/src/widget/openglwindow.cpp
+++ b/src/widget/openglwindow.cpp
@@ -68,8 +68,12 @@ bool OpenGLWindow::event(QEvent* ev) {
// Tooltip don't work by forwarding the events. This mimics the
// tooltip behavior.
if (t == QEvent::MouseMove) {
- ToolTipQOpenGL::singleton().start(
- m_pWidget, dynamic_cast<QMouseEvent*>(ev)->globalPos());
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ QPoint eventPosition = dynamic_cast<QMouseEvent*>(ev)->globalPosition().toPoint();
+#else
+ QPoint eventPosition = dynamic_cast<QMouseEvent*>(ev)->globalPos();
+#endif
+ ToolTipQOpenGL::singleton().start(m_pWidget, eventPosition);
}
if (t == QEvent::Leave) {
ToolTipQOpenGL::singleton().stop(m_pWidget);