Skip to main content

qtcompat

Project description

qtcompat

A compatibility package to allow usage of PySide2, PyQt5 or PySide6 in Python applications. It has been written in OGS to allow our Python applications written in PyQt4 / PySide to migrate slowly to PyQt5 / Pyside2 and PySide6.

Install qtcompat

Run command:

pip3 install qtcompat 

For the bleeding edge install with:

pip3 install git+https://bitbucket.org/bvidmar/qtcompat

Usage

When writing a new package import all the modules required by it in its init.py file:

from qtcompat import (Signal, QtCore, Qt, QtGui, QtWidgets, LIB,                
    QAction, QShortcut)

and then import only the Qt modules needed by every new module from .

To write a single scrpit simply import the required modules from qtcompat:

from qtcompat import QtCore, QtGui, QtWidgets

Write applications using:

- QtCore
- QtGui
- QtWidgets
- QtOpenGL
- Signal
- Slot
- Property
- QOpenGLWidget
- QGLFormat
- QAction
- QShortcut
- Qt (shortcut for QtCore.Qt)

and the application will work with any of PySide2, PyQt5 or PySide6.

If more than one of these packages are installed qtcompat will pick the first one available in this order. To change this behaviour set the environment variable

QT_PREFERRED_LIB=PyQt5

or

QT_PREFERRED_LIB=PySide6

The selected package name will be available in the LIB attribute of qtcompat.

Who do I talk to?

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

qtcompat-0.0.1a0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

qtcompat-0.0.1a0-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file qtcompat-0.0.1a0.tar.gz.

File metadata

  • Download URL: qtcompat-0.0.1a0.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.3.0 pkginfo/1.5.0.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5

File hashes

Hashes for qtcompat-0.0.1a0.tar.gz
Algorithm Hash digest
SHA256 104ad3029b47d85d42bbf442ae3150ad85542ed1d6ec7958bcdee0c5757d3a82
MD5 e0f68b44171686e7652fa6cc89da6d58
BLAKE2b-256 721360f05bd68cf84a427188c97eed5376dfe9236acfaedd65b625569afc0011

See more details on using hashes here.

File details

Details for the file qtcompat-0.0.1a0-py3-none-any.whl.

File metadata

  • Download URL: qtcompat-0.0.1a0-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.3.0 pkginfo/1.5.0.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5

File hashes

Hashes for qtcompat-0.0.1a0-py3-none-any.whl
Algorithm Hash digest
SHA256 c83d2754f188902a31b678a3da84580c8a5d9962002f61359d1ebcafef3341f4
MD5 da6cef4c0c72115e6fef82a8d2487803
BLAKE2b-256 8f30008f04bd3c8a8a12ffe1337f784af823c7fcf9e5b998e2882e65c38720ae

See more details on using hashes here.

Supported by

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