You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In [Strict Mode](https://github.com/mottosso/Qt.py#qt_strict), `qApp` is not included in Qt.py due to the way Qt keeps this up to date with the currently active QApplication.
287
+
288
+
Qt implicitly updates this variable through monkey patching whenever a new QApplication is instantiated. This means that our variable quickly goes out of date and is not updated at the same time.
289
+
290
+
```python
291
+
# PySide2
292
+
>>>import os
293
+
>>> os.environ["QT_STRICT"] ="1"
294
+
>>>from Qt import QtWidgets
295
+
>>>"qApp"indir(QtWidgets)
296
+
False
297
+
```
298
+
299
+
##### Workaround
300
+
301
+
Use `QApplication.instance()` instead.
302
+
303
+
Technically, there is no difference between the two, apart from more characters to type.
0 commit comments