chore: avoid using deprecated function in qt6 builds

This commit is contained in:
Gary Wang 2023-06-06 00:15:43 +08:00
parent c69483eff1
commit a29a1806a3
No known key found for this signature in database
GPG Key ID: 5D30A4F15EA78760

View File

@ -319,7 +319,11 @@ void MainWindow::mouseMoveEvent(QMouseEvent *event)
{ {
if (event->buttons() & Qt::LeftButton && m_clickedOnWindow && !isMaximized()) { if (event->buttons() & Qt::LeftButton && m_clickedOnWindow && !isMaximized()) {
if (!window()->windowHandle()->startSystemMove()) { if (!window()->windowHandle()->startSystemMove()) {
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
move(event->globalPosition().toPoint() - m_oldMousePos);
#else
move(event->globalPos() - m_oldMousePos); move(event->globalPos() - m_oldMousePos);
#endif // QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
} }
event->accept(); event->accept();
} }