Skip to content

QtLegacy - Qt 5 compatibility for Qt 4 projects #107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions QtLegacy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"""Map all bindings to PySide

This module is a backward compatible for of Qt.py

Resolution order:
- PySide2
- PyQt5
- PySide
- PyQt4

Usage:
>>> import sys
>>> from QtLegacy import QtGui
>>> app = QtGui.QApplication(sys.argv)
>>> button = QtGui.QPushButton("Hello World")
>>> button.show()
>>> app.exec_()

"""

import sys

__version__ = "0.3.3"

import Qt

for key, value in vars(Qt.QtWidgets).iteritems():
setattr(Qt.QtGui, key, value)

del QtWidgets
sys.modules[__name__] = Qt