autoqt
A simple single file module that makes setting up basic Qt properties a little bit nicer without restricting you.
This is very useful if you have QObjects with many readonly properties and a few special setters or state modifying slots.
Example:
from PyQt6.QtCore import pyqtSignal, pyqtSlot
from autoqt6 import AutoObject, AutoProp
class SomeObject(AutoObject):
valuesChanged = pyqtSignal()
aNumber = AutoProp(int, 'valuesChanged', '_aNumber')
otherNumber = AutoProp(float, 'valuesChanged', '_otherNumber')
aString = AutoProp(str, 'valuesChanged', '_aString', write=True)
def __init__(self, parent=None):
super().__init__(parent=parent)
self._aNumber = 10
self._otherNumber = 20
self._aString = 'spam'
@pyqtSlot()
def incrementNumber(self):
self._aNumber += 1
self.valuesChanged.emit()
@otherNumber.setter
def otherNumber(self, value):
self._otherNumber = value + 2
self.valuesChanged.emit()
x = SomeObject()
print(x.aNumber) # 10
x.aNumber = 10 # throws AttributeError, readonly property
x.incrementNumber() # valuesChanged is emitted
print(x.aNumber) # 11
print(x.otherNumber) # 20
x.otherNumber = 40 # otherNumber.setter called, valuesChanged is emitted
print(x.otherNumber) # 42
print(x.aString) # 'spam'
x.aString = 'ham' # valuesChanged is emitted, writable property
print(x.aString) # 'ham'
Metadata
Release files for autoqt6 0.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| autoqt6-0.0.8.tar.gz | 3.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| autoqt6-0.0.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.9 kB
Release files / autoqt6-0.0.8.tar.gz
| Download URL | autoqt6-0.0.8.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
91b575eea61be5552bd1eb562e07de2ccac037f2506de3c1c80a9da196daba14
|
|
BLAKE2b-256 checksum How to use checksums |
bb49c5c0b3432800303acc744646ccd23329a24345a1bc4271653fcbc5f9f985
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.10.0 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/1.0.0 urllib3/1.26.20 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.8
|
Release files / autoqt6-0.0.8-py3-none-any.whl
| Download URL | autoqt6-0.0.8-py3-none-any.whl |
|---|---|
| Size | 4.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
62fd885edbc04531f52881260a974d848c7b2b8c2eb5683c5cbe7a6d0e37ecca
|
|
BLAKE2b-256 checksum How to use checksums |
5e74109a97c495e182c85f39d4c3efc4f75e08d9fcbbe043d9ddf5bd82f8fa71
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.10.0 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/1.0.0 urllib3/1.26.20 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.8
|
Security for autoqt6 0.0.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.