11 from __future__ import unicode_literals |
11 from __future__ import unicode_literals |
12 |
12 |
13 from PyQt5.QtCore import pyqtSignal, Qt, QTimer, QPoint, QRect |
13 from PyQt5.QtCore import pyqtSignal, Qt, QTimer, QPoint, QRect |
14 from PyQt5.QtWidgets import QFrame, QVBoxLayout, QApplication |
14 from PyQt5.QtWidgets import QFrame, QVBoxLayout, QApplication |
15 |
15 |
|
16 from Globals import qVersionTuple |
16 |
17 |
17 class E5PassivePopup(QFrame): |
18 class E5PassivePopup(QFrame): |
18 """ |
19 """ |
19 Class implementing dialog-like popup that displays messages without |
20 Class implementing dialog-like popup that displays messages without |
20 interrupting the user. |
21 interrupting the user. |
187 x = pos.x() |
188 x = pos.x() |
188 y = pos.y() |
189 y = pos.y() |
189 w = self.minimumSizeHint().width() |
190 w = self.minimumSizeHint().width() |
190 h = self.minimumSizeHint().height() |
191 h = self.minimumSizeHint().height() |
191 |
192 |
192 r = QApplication.desktop().screenGeometry( |
193 if qVersionTuple() >= (5, 10, 0): |
193 QPoint(x + w // 2, y + h // 2)) |
194 r = QApplication.screenAt(QPoint(x + w // 2, y + h // 2))\ |
|
195 .geometry() |
|
196 else: |
|
197 r = QApplication.desktop().screenGeometry( |
|
198 QPoint(x + w // 2, y + h // 2)) |
194 |
199 |
195 if x < r.center().x(): |
200 if x < r.center().x(): |
196 x += target.width() |
201 x += target.width() |
197 else: |
202 else: |
198 x -= w |
203 x -= w |