Package to construct PySide6 widgets from dataclass
Project description
Python package to dynamically create PySide6 widgets from dataclass
Introduction
dataclass2PySide6 is a package which provides widgets and functions to represent dataclass instance as PySide6 GUI.
For example, here is a simple dataclass:
from dataclasses import dataclass
from typing import Tuple
@dataclass
class DataClass:
a: bool
b: int
c: Tuple[float, Tuple[bool, int]] = (4.2, (True, 99))
Dataclass widget can be dynamically created as follows.
Installation
Before you install, be careful for other Qt-dependent packages installed in your environment.
For example, non-headless OpenCV-Python module modifies the Qt dependency thus making PySide6 unavailable.
dataclass2PySide6 can be installed using pip.
$ pip install dataclass2PySide6
How to use
- Create dataclass widget using
DataclassWidget.fromDataclass(). - Get current state of widget with
dataValueChangedsignal anddataValue()method. - Update the current state of widget with
setDataValue()method.
User may subclass DataclassWidget to define own datclass widget.
Refer to the docstring for detailed description.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dataclass2PySide6-1.4.0.tar.gz.
File metadata
- Download URL: dataclass2PySide6-1.4.0.tar.gz
- Upload date:
- Size: 13.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e900f8b7f7ecfb794dc339dbf905c6a390de272a35dd5be3d6b506f366da879c
|
|
| MD5 |
7225f63671e0150b1c4d099dccbe01bc
|
|
| BLAKE2b-256 |
5931b5dcab7b0795d4437e6ff3174bc12f6c2d65db6687a2ea8514a118498447
|
File details
Details for the file dataclass2PySide6-1.4.0-py3-none-any.whl.
File metadata
- Download URL: dataclass2PySide6-1.4.0-py3-none-any.whl
- Upload date:
- Size: 14.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac9c1f5b71f185e322dc682c637c1c746eddfa7130645e332d6db1fb3b7c1f02
|
|
| MD5 |
3e224dbdf51e3cf742a81dec2e3ab082
|
|
| BLAKE2b-256 |
948efc014fea6f7b92e847432308cd390512fd4edadcf1add1f2f8d05ba76c14
|