Skip to main content

PyQt/PySide 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.3.tar.gz (74.9 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.3-py3-none-any.whl (109.9 kB view details)

Uploaded Python 3

ManyQt-0.3.3-py2-none-any.whl (109.8 kB view details)

Uploaded Python 2

File details

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

File metadata

  • Download URL: ManyQt-0.3.3.tar.gz
  • Upload date:
  • Size: 74.9 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.3.tar.gz
Algorithm Hash digest
SHA256 6ecad51ca8df08116c41c7f2c1eb823f708bd12745833eb75cb28a2a6625a674
MD5 5ae5d894332dadc932d525786c210328
BLAKE2b-256 d5d0530782b61e430b074bf68cbba59ecce042f2dd990d00cd687b79a47334fc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ManyQt-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 109.9 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 13c54a57fa9d8dd7b0e930611ce065766744e58cd3483abe4137d427ac0d6dfa
MD5 8f02a125b7a86b63369d41779f5808df
BLAKE2b-256 7a1bc87328c5d832f712fefa2b2c477801ec8ce1ff0d9e7edbf5b53f23e4f3d7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ManyQt-0.3.3-py2-none-any.whl
  • Upload date:
  • Size: 109.8 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.3-py2-none-any.whl
Algorithm Hash digest
SHA256 d356e79c5d7e634fdc0cd9bb6441c45753743be496b3e0eae0e4c4bf762e3871
MD5 9ca481927a439d5658bd5d298fd3b923
BLAKE2b-256 0d7ae5aa9fbbf1760bcd1b60aa2c4eb696d9ee1104e4de13db6af742e6fdfd20

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