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.4.0.tar.gz (80.7 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.4.0-py3-none-any.whl (115.7 kB view details)

Uploaded Python 3

ManyQt-0.4.0-py2-none-any.whl (115.6 kB view details)

Uploaded Python 2

File details

Details for the file manyqt-0.4.0.tar.gz.

File metadata

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

File hashes

Hashes for manyqt-0.4.0.tar.gz
Algorithm Hash digest
SHA256 7847f9c6ebe9d13edc4cce7176d2fe24b5df6f46f5f097ee87e23d715ea841a0
MD5 6c939f2c28c0dd030bd1cb101c626025
BLAKE2b-256 476a41c8ac60ba1e5fdeee27334751ce3e595ad40500fea78c085ae25caff44a

See more details on using hashes here.

File details

Details for the file manyqt-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: manyqt-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 115.7 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.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 42d9fb48c952aa4a80eea04a92ca3db0d583d1543a04b0ad4fda96cc393700ed
MD5 860d5d436399c1b254173676fe9a4f00
BLAKE2b-256 7be1c3aa31ec7153cbfdb745aebb0aae7a5ab79f352e8655a8f2a9f3b4b3e868

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ManyQt-0.4.0-py2-none-any.whl
  • Upload date:
  • Size: 115.6 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.4.0-py2-none-any.whl
Algorithm Hash digest
SHA256 63fa48eebb832c7656566674b1f3d80a789aad7ecde174b887fd6852f16ffa58
MD5 7c302f1238549c920e3c4edae78aee67
BLAKE2b-256 f011627fe78941dbc96bdcf7d906f3cfda0e6d8ac322f344f6409bcbed2a8780

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