Skip to main content

PySide6/PyQt5 abstraction layer, mulithreading and UI loader utilities, icon set, and more

Project description

qtutils

Actions Status GitHub release Python Version Documentation Status PyPi Version Conda Version PyPi License

Utilities for providing concurrent access to Qt objects, simplified QSettings storage, and dynamic widget promotion when loading UI files, in Python Qt applications. Includes the Fugue icon set, free to use with attribution to Yusuke Kamiyamane, and the Ubuntu font family (available under the Ubuntu font license).

Installation

  • To install the latest release version, run pip install qtutils.

  • To install latest development version, clone the GitHub repository and run pip install . to install, or pip install -e . to install in 'editable' mode.

Summary

qtutils is a Python library that provides some convenient features to Python applications using the PyQt5/PyQt6/PySide6 widget library.

qtutils 4.0 dropped support for PySide2. If you need to use PySide2, you may use qtutils 3.1.0 or earlier.

qtutils contains the following components:

  • invoke_in_main: This provides some helper functions to interact with Qt from threads.

  • UiLoader: This provides a simplified means of promoting widgets in *.ui files to a custom widget of your choice.

  • qsettings_wrapper: A wrapper around QSettings which allows you to access keys of QSettings as instance attributes. It also performs automatic type conversions.

  • icons: An icon set as a QResource file and corresponding Python module. The resulting resource file can be used by Qt designer, and the python module imported by applications to make the icons available to them. The Fugue icon set was made by Yusuke Kamiyamane, and is licensed under a Creative Commons Attribution 3.0 License. If you can't or don't want to provide attribution, please purchase a royalty-free license from http://p.yusukekamiyamane.com/

  • Qt: a PyQt5/PyQt6/PySide6 agnostic interface to Qt that allows you to import qtutils.qt instead of PySide6 or PyQt5/6, and have your code run on both, with some convenience aliases to make it easier to write code that works with both libraries. Note that this is not a comprehensive abstraction layer like QtPy and your code will still need to be written in a way generally compatible with both libraries if you want to support both. qtutils does provide aliases for short enums in PyQt6, however, which is one of the most singificant differences between PySide6 and PyQt6. qtutils.qt will choose which Qt library to use based on a) if the QT_ENV environment variable is set to PyQt5, PySide6, or PyQt6, otherwise whichever library has already been imported, or if none, whichever is installed, with order of priority PyQt5, PySide6, then PyQt6.

  • outputbox: a QTextEdit widget for displaying log/output text of an application, either by calling methods or by sending data to it over zeromq.

  • fonts: bundled fonts from the Ubuntu font family - call qtutils.fonts.load_fonts() after instantiating a QApplication to add them to the Qt font database and make them available to your application.

Using icons with Qt designer

To use the icons from Qt designer, clone this repository, and point Qt designer to the .qrc file for the icons set: icons/icons.qrc. Unfortunately Qt desginer saves the absolute path to this file in the resulting .ui file, so if the .ui file is later edited by someone on another system, they will see an error at startup saying the .qrc file cannot be found. This can be ignored and the .ui file will still function correctly, but Qt designer will need to be told the local path to the .qrc file before it can display the icons within its interface.

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

qtutils-4.1.3.tar.gz (7.1 MB view details)

Uploaded Source

Built Distribution

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

qtutils-4.1.3-py3-none-any.whl (9.3 MB view details)

Uploaded Python 3

File details

Details for the file qtutils-4.1.3.tar.gz.

File metadata

  • Download URL: qtutils-4.1.3.tar.gz
  • Upload date:
  • Size: 7.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for qtutils-4.1.3.tar.gz
Algorithm Hash digest
SHA256 7f61b4ebf4d9d354704522b3cb71c6089874ab2fea8c7a71e8306f5c03adbd9e
MD5 bdd85e39a3786ca90848aea2b69c2bbd
BLAKE2b-256 e65513b3a29f2f86c932da8f14fc168f0bf7d47ec76dd993fcc19c644a9558b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for qtutils-4.1.3.tar.gz:

Publisher: release.yml on philipstarkey/qtutils

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qtutils-4.1.3-py3-none-any.whl.

File metadata

  • Download URL: qtutils-4.1.3-py3-none-any.whl
  • Upload date:
  • Size: 9.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for qtutils-4.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 faa0c9c631900bc6ccd78a0ed50f26a47dd8d28103c176d2dc01d1178d834c56
MD5 67d436f4a2241a4b5142a01316b9e5a0
BLAKE2b-256 e022deff531a1ee004486c83a4a2fa65327d35e5743039a3c36f0b25ad6aa102

See more details on using hashes here.

Provenance

The following attestation bundles were made for qtutils-4.1.3-py3-none-any.whl:

Publisher: release.yml on philipstarkey/qtutils

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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