Python package to build Qt Widget from Dataclass
MIT License
DaWiQ is a Python package to generate Qt widget from dataclass.
It provides:
The following Qt bindings are supported:
Here is a simple dataclass:
from dataclasses import dataclass
@dataclass
class DataClass:
x: int
y: 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.
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.
DaWiQ is documented with Sphinx. Documentation can be found on Read the Docs:
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.