Skip to content

Commit 522b9a0

Browse files
committed
OWNomogram: PyQt4 compat way to query screeen avail geometry
1 parent cabb3c3 commit 522b9a0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Orange/widgets/visualize/ownomogram.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
QGraphicsTextItem, QGraphicsLineItem, QGraphicsWidget, QGraphicsRectItem,
1010
QGraphicsEllipseItem, QGraphicsLinearLayout, QGridLayout, QLabel, QFrame,
1111
QSizePolicy, QApplication,
12+
QDesktopWidget,
1213
)
1314
from AnyQt.QtGui import QColor, QPainter, QFont, QPen, QBrush
1415
from AnyQt.QtCore import Qt, QRectF, QSize
@@ -50,7 +51,7 @@ def show(self, pos, text, change_y=True):
5051
self.adjustSize()
5152

5253
x, y = pos.x(), (pos.y() + 15 if change_y else self.y())
53-
avail = QApplication.focusWindow().screen().availableGeometry()
54+
avail = QDesktopWidget.availableGeometry(self)
5455
if x + self.width() > avail.right():
5556
x -= self.width()
5657
if y + self.height() > avail.bottom():

0 commit comments

Comments
 (0)