Skip to main content

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

  1. Create dataclass widget using DataclassWidget.fromDataclass().
  2. Get current state of widget with dataValueChanged signal and dataValue() method.
  3. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dataclass2PySide6-1.3.1.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

dataclass2PySide6-1.3.1-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

Details for the file dataclass2PySide6-1.3.1.tar.gz.

File metadata

  • Download URL: dataclass2PySide6-1.3.1.tar.gz
  • Upload date:
  • Size: 12.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

Hashes for dataclass2PySide6-1.3.1.tar.gz
Algorithm Hash digest
SHA256 e56d839dff1129641bf731eccbf8e831533ba56796e474640245a3b2ea1afbb5
MD5 4d9977113113ca3c934e290bf78d273a
BLAKE2b-256 c5e6fe1a8e2d8137790cfa68b926941bf134254f2644b633c21c651678bbc0f4

See more details on using hashes here.

File details

Details for the file dataclass2PySide6-1.3.1-py3-none-any.whl.

File metadata

  • Download URL: dataclass2PySide6-1.3.1-py3-none-any.whl
  • Upload date:
  • Size: 13.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

Hashes for dataclass2PySide6-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c7060416baa350b43e882970cee051366a31a756fb05ea0062dac792e7f2ca7e
MD5 151e790b941005c951cd7fb4a064ecf0
BLAKE2b-256 58bffe256f94edc4cc3c90ead1bba84f0ccc608dced7834ca937886272639b95

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