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
dataValueChanged
signal 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
File details
Details for the file dataclass2PySide6-1.2.1.tar.gz
.
File metadata
- Download URL: dataclass2PySide6-1.2.1.tar.gz
- Upload date:
- Size: 11.7 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 | e849b01871ad8735f19a251345c43d1e6ffe8d062d9647a5a93dd0ddb0510d94 |
|
MD5 | 92047e2524d114ef5865f2ef55c2b391 |
|
BLAKE2b-256 | 122b1336618f2d01d404abb6dc816092bad4a2ced6cdae8dd65f56a1069f75b6 |
File details
Details for the file dataclass2PySide6-1.2.1-py3-none-any.whl
.
File metadata
- Download URL: dataclass2PySide6-1.2.1-py3-none-any.whl
- Upload date:
- Size: 13.0 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 | 5964ac53bde606f36274c0f103f3e5b958ca7b9fd8ae12ee8913580eb0c870b9 |
|
MD5 | 3d50b10be94e0a43167d95d452d491c7 |
|
BLAKE2b-256 | 9dcb2fdf6796b3a5246114060d640709fa6d68ffb04dcbed505714fa752cc0f0 |