button widgets#
- class configwidgets.ConfigCheckBox(*args, **kwargs)#
A subclass of
QCheckBox. Can be setup with a link to QSettings instance to maintain state between program restarts.- __init__(*args, **kwargs)#
Initialize a ConfigCheckBox. Other than declaring default values as None the super constructor is called.
- Parameters:
text (str) – The text of the checkbox.
parent (QWidget, optional) – The parent widget of the checkbox. The default is None.
- setup(config: QSettings, name: str, default: bool = False)#
Setup the link to a
QSettingsinstance for this checkbox.- Parameters:
config (QSettings) – The QSettings instance, that shall be connected.
name (str) – The QSettings key to store the synced value.
default (bool, optional) – The default value. The default is False.
- set_name(name: str)#
set the QSetting-Key for this checkbox.
- set_default(default: bool)#
set the default value for retrieving the value.
- load_value() → bool#
load the state from the QSettings instance to the widget state. If the key is not defined, the
defaultis used instead.
- set_value(val: bool) → bool#
set a value to the widget state and the QSettings Instance.
- collect() → bool#
collect the widget state and store in QSettings Instance. Gets connected to the
toggled()signal.
- class configwidgets.ConfigRadioButton(*args, **kwargs)#
A subclass of
QRadioButton. Can be setup with a link to QSettings instance to maintain state between program restarts.- __init__(*args, **kwargs)#
Initialize a ConfigRadioButton. Other than declaring default values as None the super constructor is called.
- Parameters:
text (str) – The text of the radiobutton.
parent (QWidget, optional) – The parent widget of the radiobutton. The default is None.
- setup(config: QSettings, name: str, default: bool = False)#
Setup the link to a
QSettingsinstance for this radiobutton.- Parameters:
config (QSettings) – The QSettings instance, that shall be connected.
name (str) – The QSettings key to store the synced value.
default (bool, optional) – The default value. The default is False.
- set_name(name: str)#
set the QSetting-Key for this radiobutton.
- set_default(default: bool)#
set the default value for retrieving the value.
- load_value() → bool#
load the state from the QSettings instance to the widget state. If the key is not defined, the
defaultis used instead.
- set_value(val: bool) → bool#
set a value to the widget state and the QSettings Instance.
- collect() → bool#
collect the widget state and store in QSettings Instance. Gets connected to the
toggled()signal.