diff --git a/mainwindow.cpp b/mainwindow.cpp index 8479c1c..28be67a 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #ifdef _WIN32 #include @@ -339,7 +340,13 @@ void MainWindow::mousePressEvent(QMouseEvent *event) void MainWindow::mouseMoveEvent(QMouseEvent *event) { if (event->buttons() & Qt::LeftButton && m_clickedOnWindow && !isMaximized()) { +#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) + if (!window()->windowHandle()->startSystemMove()) { + move(event->globalPos() - m_oldMousePos); + } +#else move(event->globalPos() - m_oldMousePos); +#endif // QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) event->accept(); }