Preferences/ConfigurationPages/NotificationsPage.py

changeset 6911
8f4a050c6895
parent 6645
ad476851d7e0
--- a/Preferences/ConfigurationPages/NotificationsPage.py	Sun Mar 31 12:38:25 2019 +0200
+++ b/Preferences/ConfigurationPages/NotificationsPage.py	Sun Mar 31 14:38:46 2019 +0200
@@ -18,6 +18,8 @@
 import Preferences
 import UI.PixmapCache
 
+from Globals import qVersionTuple
+
 
 class NotificationsPage(ConfigurationPageBase, Ui_NotificationsPage):
     """
@@ -33,13 +35,21 @@
         
         minX, maxX = self.xSpinBox.maximum(), self.xSpinBox.minimum()
         minY, maxY = self.ySpinBox.maximum(), self.ySpinBox.minimum()
-        desk = QApplication.desktop()
-        for screen in range(desk.screenCount()):
-            geom = desk.availableGeometry(screen)
-            minX = min(minX, geom.x())
-            maxX = max(maxX, geom.x() + geom.width())
-            minY = min(minY, geom.y())
-            maxY = max(maxY, geom.y() + geom.height())
+        if qVersionTuple() >= (5, 10, 0):
+            for screen in QApplication.screens():
+                geom = screen.availableGeometry()
+                minX = min(minX, geom.x())
+                maxX = max(maxX, geom.x() + geom.width())
+                minY = min(minY, geom.y())
+                maxY = max(maxY, geom.y() + geom.height())
+        else:
+            desk = QApplication.desktop()
+            for screen in range(desk.screenCount()):
+                geom = desk.availableGeometry(screen)
+                minX = min(minX, geom.x())
+                maxX = max(maxX, geom.x() + geom.width())
+                minY = min(minY, geom.y())
+                maxY = max(maxY, geom.y() + geom.height())
         self.xSpinBox.setMinimum(minX)
         self.xSpinBox.setMaximum(maxX)
         self.ySpinBox.setMinimum(minY)

eric ide

mercurial