Skip to main content

Package to construct Qt widgets from dataclasses

Project description

DaWiQ - Dataclass Widget with Qt

PyPI version Python Version Build Status Documentation Status License

DaWiQ is a Python package to generate Qt widget from dataclass.

It provides:

  • Dynamic construction of widget from dataclass
  • Customizing widget for user-defined type
  • Delegate and mapper for dataclass widget

The following Qt bindings are supported:

Usage

Here is a simple dataclass:

from dataclasses import dataclass
from typing import Tuple

@dataclass
class DataClass:
    a: int
    b: bool

DaWiQ can build a widget from this dataclass. For PySide6 example,

from PySide6.QtWidgets import QApplication
from dawiq import dataclass2Widget
import sys

app = QApplication(sys.argv)
dataWidget = dataclass2Widget(DataClass)
dataWidget.show()
app.exec()
app.quit()

This widget can be mapped to item model for storing the data. More examples are provided in the documentation.

Installation

DaWiQ can be installed from PyPI.

$ pip install dawiq

To install from GitHub source, clone the repository with git and install with pip.

$ git clone https://github.com/JSS95/dawiq.git
$ cd dawiq
$ pip install .

DaWiQ does not specify the Qt binding requirement, therefore you must manually install one.

Documentation

DaWiQ is documented with Sphinx. Documentation can be found on Read the Docs:

https://dawiq.readthedocs.io/

If you want to build the document yourself, get the source code and install with [doc] option. Then go to doc directory and build the document.

$ pip install .[doc]
$ cd doc
$ make html

Document will be generated in build/html directory. Open index.html to see the central page.

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

dawiq-0.5.0.tar.gz (30.3 kB view details)

Uploaded Source

Built Distribution

dawiq-0.5.0-py3-none-any.whl (33.1 kB view details)

Uploaded Python 3

File details

Details for the file dawiq-0.5.0.tar.gz.

File metadata

  • Download URL: dawiq-0.5.0.tar.gz
  • Upload date:
  • Size: 30.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.0

File hashes

Hashes for dawiq-0.5.0.tar.gz
Algorithm Hash digest
SHA256 7066f228626c157fd5256423322dfebd0af8e39cc2455d41bac20836f445a059
MD5 bf5a46dee4f8f49d483bb21d9bd31ae4
BLAKE2b-256 59e45d84da8bce5fc41b26f24f6dc5bfb80fd775c4dd70ffed19e5c2b1e34de5

See more details on using hashes here.

File details

Details for the file dawiq-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: dawiq-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 33.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.0

File hashes

Hashes for dawiq-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 38aad3467216fcdf620e716b5403e25b71de68506c602f0f5b7669fee11709cf
MD5 319b7be279d2324f9a2c47ba0f0602d5
BLAKE2b-256 ab2bb4e5fd5689e1f0c9bae9a772e17f54f3053a41a20fab9a4f8f5d92f4f095

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