]> git.lyx.org Git - features.git/commitdiff
Address Qt6 deprecation warnings
authorJuergen Spitzmueller <spitz@lyx.org>
Wed, 3 Nov 2021 16:41:41 +0000 (17:41 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Wed, 3 Nov 2021 16:41:41 +0000 (17:41 +0100)
src/frontends/qt/GuiSearch.cpp

index 075369b6c847166f421f3fb755bb7eaf81223c82..e3e1d8fbbd09e85c9e91d897f467cad19bf77554 100644 (file)
@@ -580,7 +580,11 @@ GuiSearch::GuiSearch(GuiView & parent, Qt::DockWidgetArea area, Qt::WindowFlags
 void GuiSearch::mousePressEvent(QMouseEvent * event)
 {
        if (isFloating() && event->button() == Qt::LeftButton) {
+#if QT_VERSION >= 0x060000
+               dragPosition = event->globalPosition().toPoint() - frameGeometry().topLeft();
+#else
                dragPosition = event->globalPos() - frameGeometry().topLeft();
+#endif
                event->accept();
        } else
                DockView::mousePressEvent(event);
@@ -590,7 +594,11 @@ void GuiSearch::mousePressEvent(QMouseEvent * event)
 void GuiSearch::mouseMoveEvent(QMouseEvent * event)
 {
        if (isFloating() && event->buttons() & Qt::LeftButton) {
+#if QT_VERSION >= 0x060000
+               move(event->globalPosition().toPoint() - dragPosition);
+#else
                move(event->globalPos() - dragPosition);
+#endif
                event->accept();
        } else
                DockView::mouseMoveEvent(event);