rbutil: Use globalPos() for getting mouse position.

globalX() / globalY() are deprecated for Qt6. Use globalPos() instead,
which gives the same result.

Change-Id: Ie0b733b88107e971de9c3e8c42434d7d47a65b76
This commit is contained in:
Dominik Riebeling 2020-10-11 16:29:51 +02:00
parent 4e89e0e0ea
commit 5efaa9ef80
2 changed files with 4 additions and 5 deletions

View file

@ -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);
}

View file

@ -66,8 +66,7 @@ private slots:
private:
QTimer hovertimer;
int mousex;
int mousey;
QPoint mousepos;
PreviewDlg* preview;
};