Skip to main content

PyQt/PyQt compatibility layer.

Project description

ManyQt is a lightweight abstraction layer that enables developers to write applications with a single API targeting PyQt and PySide. It supports multiple Qt versions and bindings—PyQt4, PyQt5, PySide, PySide2, PyQt6, and PySide6—under a Qt5-style layout, where QtGui and QtWidgets are separated.

(Inspired from `QtPy <https://github.com/spyder-ide/qtpy>`_ and `AnyQt <https://github.com/ales-erjavec/anyqt>`_.)


Purpose & Benefits:

ManyQt simplifies cross-version and cross-binding development:

  • Write your code using standard Qt API patterns.

  • Import from manyqt instead of PyQtX or PySideX.

  • Seamlessly port between Qt4, Qt5, and Qt6.

  • Resolve incompatibilities automatically.

  • Incrementally migrate large codebases—module by module.


Requirements:

To use ManyQt, you must have one of the following libraries installed:

  • PyQt4

  • PyQt5

  • PyQt6

  • PySide

  • PySide2

  • PySide6

If multiple packages are available, ``PyQt5`` is selected by default unless overridden by an environment variable.


Selecting the Backend:

The active Qt binding can be set using the QT_API environment variable:

Value

Selects

pyqt4

PyQt4

pyqt5

PyQt5

pyqt6

PyQt6

pyside

PySide

pyside2

PySide2

pyside6

PySide6

Alternatively, you may also configure the API programmatically—as long as no other Qt libraries have been imported yet.


Features at a Glance:

Unified Namespace:

Provides a consistent, Qt5-compatible module layout with some minor renaming for portability.

Environment & Code-Based Selection:

Specify your preferred binding via:

  • QT_API environment variable.

  • Python code (early in execution).

Safe Import Hook (Optional):

Includes an import guard that:

  • Detects and blocks mixed Qt binding imports.

  • Emulates Qt4-style imports via Qt5-compatible monkey patching.

Simple Usage:

from os import environ
environ["QT_API"] = "pyqt5"  # or "pyqt4", "pyside", "pyside2", "pyqt6", "pyside6", to force a specific backend.
from ManyQt.QtWidgets import *
from ManyQt.QtCore import *
from ManyQt.QtGui import *

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ManyQt-0.3.2.tar.gz (72.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

ManyQt-0.3.2-py3-none-any.whl (107.2 kB view details)

Uploaded Python 3

ManyQt-0.3.2-py2-none-any.whl (107.2 kB view details)

Uploaded Python 2

File details

Details for the file ManyQt-0.3.2.tar.gz.

File metadata

  • Download URL: ManyQt-0.3.2.tar.gz
  • Upload date:
  • Size: 72.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for ManyQt-0.3.2.tar.gz
Algorithm Hash digest
SHA256 03b9d67bc4e9545f75acad85d4c50e7bdce7fb3bb9260c586a56d48e4abaec41
MD5 f4238ca63dec1bd56a2efcb23aa453f2
BLAKE2b-256 ccd637d9a933a5ffed3f5298a74b977042219a5a5f49ecd1800d82d7f2797b97

See more details on using hashes here.

File details

Details for the file ManyQt-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: ManyQt-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 107.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for ManyQt-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5760b04293a9d4b3f3d723544bd53c5856ea3ebb43fd167925a4dde32fea7f79
MD5 cba6f0ca5ee2a4aa3f7bbbbf765a8966
BLAKE2b-256 c26438dd8550a4b48e1224a029b0c4b267faca13ae5b68aa5a0592b367957008

See more details on using hashes here.

File details

Details for the file ManyQt-0.3.2-py2-none-any.whl.

File metadata

  • Download URL: ManyQt-0.3.2-py2-none-any.whl
  • Upload date:
  • Size: 107.2 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for ManyQt-0.3.2-py2-none-any.whl
Algorithm Hash digest
SHA256 159f7327913ea4c8df03b90ebcfade8997259d31261488df50b92a47a6d1aa87
MD5 8c72ae0f014b8b390495baa084ede24a
BLAKE2b-256 10a1d55d2b08ecb80c78653cde6c55e8bc12b91acdf9999bf20e383d233528e6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page