summaryrefslogtreecommitdiffstats
path: root/src/library
diff options
context:
space:
mode:
authorBe <be@mixxx.org>2021-10-16 15:22:36 -0500
committerBe <be@mixxx.org>2021-10-16 15:22:36 -0500
commitcd0ad0e632e0d8939f8fc6a78d37bb5854b4a18b (patch)
tree3928219faf98d5531b15c718a6c3990417a55a6b /src/library
parent28be756b585f1c236e0c5c1850ce61358b68a349 (diff)
DlgCoverArtFullSize: fix QMouseEvent deprecation warnings with Qt6
https://doc.qt.io/qt-6/qmouseevent-obsolete.html#globalPos https://www.qt.io/blog/input-events-in-qt-6
Diffstat (limited to 'src/library')
-rw-r--r--src/library/dlgcoverartfullsize.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/library/dlgcoverartfullsize.cpp b/src/library/dlgcoverartfullsize.cpp
index 9723f3abb7..ac22b95904 100644
--- a/src/library/dlgcoverartfullsize.cpp
+++ b/src/library/dlgcoverartfullsize.cpp
@@ -223,7 +223,12 @@ void DlgCoverArtFullSize::mousePressEvent(QMouseEvent* event) {
m_clickTimer.setSingleShot(true);
m_clickTimer.start(500);
m_coverPressed = true;
- m_dragStartPosition = event->globalPos() - frameGeometry().topLeft();
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ QPoint eventPosition = event->globalPosition().toPoint();
+#else
+ QPoint eventPosition = event->globalPos();
+#endif
+ m_dragStartPosition = eventPosition - frameGeometry().topLeft();
}
}
@@ -247,7 +252,12 @@ void DlgCoverArtFullSize::mouseReleaseEvent(QMouseEvent* event) {
void DlgCoverArtFullSize::mouseMoveEvent(QMouseEvent* event) {
if (m_coverPressed) {
- move(event->globalPos() - m_dragStartPosition);
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ QPoint eventPosition = event->globalPosition().toPoint();
+#else
+ QPoint eventPosition = event->globalPos();
+#endif
+ move(eventPosition - m_dragStartPosition);
event->accept();
} else {
return;