diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2020-10-11 16:29:51 +0200 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2020-10-11 18:05:21 +0200 |
commit | 5efaa9ef8073bb216e3dcdbb4476f2fa7c672b76 (patch) | |
tree | 7ff8f444c66c385e26206b2143a75fec9d9eea91 /rbutil | |
parent | 4e89e0e0eaff0c86f9ff71f04860c3e210c39490 (diff) | |
download | rockbox-5efaa9ef8073bb216e3dcdbb4476f2fa7c672b76.tar.gz rockbox-5efaa9ef8073bb216e3dcdbb4476f2fa7c672b76.zip |
rbutil: Use globalPos() for getting mouse position.
globalX() / globalY() are deprecated for Qt6. Use globalPos() instead,
which gives the same result.
Change-Id: Ie0b733b88107e971de9c3e8c42434d7d47a65b76
Diffstat (limited to 'rbutil')
-rw-r--r-- | rbutil/rbutilqt/preview.cpp | 6 | ||||
-rw-r--r-- | rbutil/rbutilqt/preview.h | 3 |
2 files changed, 4 insertions, 5 deletions
diff --git a/rbutil/rbutilqt/preview.cpp b/rbutil/rbutilqt/preview.cpp index 72af37deee..5006a03a09 100644 --- a/rbutil/rbutilqt/preview.cpp +++ b/rbutil/rbutilqt/preview.cpp | |||
@@ -79,8 +79,7 @@ PreviewLabel::PreviewLabel(QWidget * parent, Qt::WindowFlags f) | |||
79 | void PreviewLabel::mouseMoveEvent(QMouseEvent * event) | 79 | void PreviewLabel::mouseMoveEvent(QMouseEvent * event) |
80 | { | 80 | { |
81 | hovertimer.start(); | 81 | hovertimer.start(); |
82 | mousex = event->globalX(); | 82 | mousepos = event->globalPos(); |
83 | mousey = event->globalY(); | ||
84 | } | 83 | } |
85 | void PreviewLabel::enterEvent(QEvent * event) | 84 | void PreviewLabel::enterEvent(QEvent * event) |
86 | { | 85 | { |
@@ -95,7 +94,8 @@ void PreviewLabel::leaveEvent(QEvent * event) | |||
95 | 94 | ||
96 | void PreviewLabel::timeout() | 95 | void PreviewLabel::timeout() |
97 | { | 96 | { |
98 | preview->move(mousex-(preview->width()/2) ,mousey-(preview->height()/2)); | 97 | preview->move(mousepos.x() - (preview->width() / 2), |
98 | mousepos.y() - (preview->height() / 2)); | ||
99 | preview->setVisible(true); | 99 | preview->setVisible(true); |
100 | } | 100 | } |
101 | 101 | ||
diff --git a/rbutil/rbutilqt/preview.h b/rbutil/rbutilqt/preview.h index 4c51cb8031..5e43c2d9ac 100644 --- a/rbutil/rbutilqt/preview.h +++ b/rbutil/rbutilqt/preview.h | |||
@@ -66,8 +66,7 @@ private slots: | |||
66 | 66 | ||
67 | private: | 67 | private: |
68 | QTimer hovertimer; | 68 | QTimer hovertimer; |
69 | int mousex; | 69 | QPoint mousepos; |
70 | int mousey; | ||
71 | PreviewDlg* preview; | 70 | PreviewDlg* preview; |
72 | }; | 71 | }; |
73 | 72 | ||