Provides automatic widget generation for editing member variables of an object.
Project description
propsettings_qt
This package provides a mechanism of automatic PySide2 (Qt) widget generation to edit member variables of an object. The variables should be registered as a propsettings.Setting. See propsettings for more information.
Installation
pip install propsettings-qt
Usage
The most common usage of this package is through the SettingsAreaWidget
Qt widget class. e.g. For a given class decorated with propsettings
's Settings
from propsettings.configurable import register_as_setting
from propsettings.setting_types.range_setting_type import Range
class Example:
def __init__(self):
self.a = 1
self.b = 0.3
self.c = 'asd'
register_as_setting(Example, "a")
register_as_setting(Example, "b", setting_type=Range(0.0, 1.0))
register_as_setting(Example, "c")
it can be drawn in a UI with
from propsettings_qt.ui_settings_area import SettingsAreaWidget
widget = SettingsAreaWidget()
example_object = Example()
widget.populate_object(example_object)
The resulting widget
will look like
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
propsettings_qt-0.2.3.tar.gz
(8.5 kB
view hashes)
Built Distribution
Close
Hashes for propsettings_qt-0.2.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56f9490257a84ad48a13e722b1da802b340c7e5ef7ba7ee77972a2872e4f80c6 |
|
MD5 | 22b3d69b976f306591a37994d2304193 |
|
BLAKE2b-256 | 206a365001f828e0bf4a966c928eaa78d72d6b4e5c8bc31923b9f4499a25071b |