summaryrefslogtreecommitdiff
path: root/rbutil
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2020-10-11 16:29:51 +0200
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2020-10-11 18:05:21 +0200
commit5efaa9ef8073bb216e3dcdbb4476f2fa7c672b76 (patch)
tree7ff8f444c66c385e26206b2143a75fec9d9eea91 /rbutil
parent4e89e0e0eaff0c86f9ff71f04860c3e210c39490 (diff)
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.cpp6
-rw-r--r--rbutil/rbutilqt/preview.h3
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)
void PreviewLabel::mouseMoveEvent(QMouseEvent * event)
{
hovertimer.start();
- mousex = event->globalX();
- mousey = event->globalY();
+ mousepos = event->globalPos();
}
void PreviewLabel::enterEvent(QEvent * event)
{
@@ -95,7 +94,8 @@ void PreviewLabel::leaveEvent(QEvent * event)
void PreviewLabel::timeout()
{
- preview->move(mousex-(preview->width()/2) ,mousey-(preview->height()/2));
+ preview->move(mousepos.x() - (preview->width() / 2),
+ mousepos.y() - (preview->height() / 2));
preview->setVisible(true);
}
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:
private:
QTimer hovertimer;
- int mousex;
- int mousey;
+ QPoint mousepos;
PreviewDlg* preview;
};