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 dataChanged signal and currentData() method.
  3. Update the current state of widget with applyData() 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-0.0.0.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

dataclass2PySide6-0.0.0-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dataclass2PySide6-0.0.0.tar.gz
  • Upload date:
  • Size: 10.6 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.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for dataclass2PySide6-0.0.0.tar.gz
Algorithm Hash digest
SHA256 3f0ffd14fd5deae22735ff59b1998e66477fb95d4d63dc72ae5acee510d1e46f
MD5 0884af4512a65ac7634a4cd8d871baaf
BLAKE2b-256 84d2379c9b7785e32d22e7a87918c3cb10ca523a0cb82eb8f2f54b4054909b40

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dataclass2PySide6-0.0.0-py3-none-any.whl
  • Upload date:
  • Size: 11.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.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for dataclass2PySide6-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 884ed755c1359a245e60ad7c32d32300451f4ed2d8070e213ad5b18ba3385464
MD5 5dcac47bbcc1a3f5fccca34562597bcd
BLAKE2b-256 52071b5e962dca3917d4e34e2166cdd6c6cf516cf88f898229c170abec59f1f1

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