]> sigrok.org Git - pulseview.git/blobdiff - pv/widgets/popup.cpp
Fix depreciation warnings caused by newer Qt versions
[pulseview.git] / pv / widgets / popup.cpp
index ec6d29c981c235b86451353ca620d9c5cf147868..9614701b7a9701d9c9cb2d2d277dfb388b4295ab 100644 (file)
@@ -252,8 +252,12 @@ void Popup::reposition_widget()
 {
        QPoint o;
 
+#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
+       const QRect screen_rect = QApplication::screenAt(point_)->availableGeometry();
+#else
        const QRect screen_rect = QApplication::desktop()->availableGeometry(
                QApplication::desktop()->screenNumber(point_));
+#endif
 
        if (pos_ == Right || pos_ == Left)
                o.ry() = -height() / 2;