-
Bug
-
Resolution: Unresolved
-
Not Evaluated
-
6.9.0, 6.9.1
-
None
-
da0f2625b (dev), d90b40c1b (6.9), fef02319d (dev)
In type hints, I find
@staticmethod def screenAt(point: PySide6.QtCore.QPoint, /) -> PySide6.QtGui.QScreen: ...
However, the C++ QGuiApplication.screenAt can return nullptr as well, and so the PySide implementation can return None: see attached code example, which outputs
<PySide6.QtGui.QScreen(0x178779c62f0, name="\\\\.\\DISPLAY1") at 0x000001787969AC80>
None
So the type hint should be
@staticmethod def screenAt(point: PySide6.QtCore.QPoint, /) -> PySide6.QtGui.QScreen | None: ...
Essentially the same thing is true for QGuiApplication.modalWindow.
- relates to
-
PYSIDE-2440 Type hints should indicate optionality
-
- Closed
-