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.0.tar.gz (12.2 kB view details)

Uploaded Source

Built Distribution

dataclass2PySide6-1.3.0-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dataclass2PySide6-1.3.0.tar.gz
  • Upload date:
  • Size: 12.2 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.0.tar.gz
Algorithm Hash digest
SHA256 6455a921dcb9457d5029c1963a4e5ffb4f6821c1c2ebed90a9a75d18baf1580c
MD5 9b0e088f05c37eb55f523b5011446914
BLAKE2b-256 e37efc21fecb25132c30f15b926496db0fd17d648fd8441533259cfe8089ae04

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dataclass2PySide6-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 13.6 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e5e3ab575345d841491f6d9620ab1e7dc03c4529ed64f0d859987836b8efae84
MD5 b52564db3a3d26b7c1a1fbfac29db7a9
BLAKE2b-256 55e199050189a478c350577cb79318c99d13d74956c443da46c122b0f919472f

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