Skip to content

Commit

Permalink
QT6.8: RotWidget - Mouse Global Event position
Browse files Browse the repository at this point in the history
  • Loading branch information
foldynl committed Dec 12, 2024
1 parent 7265800 commit 035cf1d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ui/RotatorWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,13 @@ void RotatorWidget::mousePressEvent(QMouseEvent *event)

if( event->button() == Qt::LeftButton )
{
QPointF clickPos = ui->compassView->mapToScene(ui->compassView->mapFromGlobal(event->globalPos()));
QPointF clickPos = ui->compassView->mapToScene(ui->compassView->mapFromGlobal(
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
event->globalPosition().toPoint()
#else
event->globalPos()
#endif
));

qreal dx = clickPos.x();
qreal dy = -1 * clickPos.y();
Expand Down

0 comments on commit 035cf1d

Please sign in to comment.