Skip to content

Commit

Permalink
Fix some deprecated warnings
Browse files Browse the repository at this point in the history
The QMouseEvent.x() and QMouseEvent.y() methods have been deprecated in
favour of those in QMouseEvent.position(), so use those instead.
  • Loading branch information
Colin Ward authored and hitman-codehq committed May 15, 2024
1 parent f26d598 commit 9482682
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Qt/QtWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ void CQtWindow::HandlePointerEvent(QMouseEvent *a_poMouseEvent)
/* the top of the menu bar so take that into account, so that we have X and Y positions that */
/* are relative to the client area */

X = a_poMouseEvent->x();
Y = (a_poMouseEvent->y() - m_poWindow->m_poWindow->menuBar()->height());
X = qRound(a_poMouseEvent->position().x());
Y = qRound(a_poMouseEvent->position().y()) - m_poWindow->m_poWindow->menuBar()->height();

/* And pass the event onto the client's CWindow::HandlePointerEvent() function. Qt has a bug whereby */
/* if you click on the menu bar to drop down a menu and then you click on the window border above that */
Expand Down

0 comments on commit 9482682

Please sign in to comment.