summaryrefslogtreecommitdiff
path: root/qutebrowser/qt/widgets.py
blob: eac8cafbbba00c47307ea7630a5a28b67a97814f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# pylint: disable=import-error,wildcard-import,unused-wildcard-import

"""Wrapped Qt imports for Qt Widgets.

All code in qutebrowser should use this module instead of importing from
PyQt/PySide directly. This allows supporting both Qt 5 and Qt 6.

See machinery.py for details on how Qt wrapper selection works.

Any API exported from this module is based on the Qt 6 API:
https://doc.qt.io/qt-6/qtwidgets-index.html
"""

from qutebrowser.qt import machinery

machinery.init_implicit()


if machinery.USE_PYSIDE6:
    from PySide6.QtWidgets import *
elif machinery.USE_PYQT5:
    from PyQt5.QtWidgets import *
elif machinery.USE_PYQT6:
    from PyQt6.QtWidgets import *
else:
    raise machinery.UnknownWrapper()

if machinery.IS_QT5:
    del QFileSystemModel  # moved to QtGui in Qt 6