container widgets#

class configwidgets.ConfigGroupBox(*args, **kwargs)#

A subclass of QGroupBox. Can be setup with a link to QSettings instance to maintain state between program restarts. Supports toggeling the visibility.

__init__(*args, **kwargs)#

Initialize a checkable ConfigCheckBox.

Parameters:
  • text (str, optional) – The title of the groupbox.

  • parent (QWidget, optional) – The parent widget of the groupbox. The default is None.

setup(config: QSettings, name: str, default: bool = False, toggle_visibility: bool = False)#

Setup the link to a QSettings instance for this groupbox.

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.

  • toggle_visibility (bool, optional) – If true, than the check state also controls the visibility of the content.

set_name(name: str)#

set the QSetting-Key for this groupbox.

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 default is 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.

activate(val: bool)#

if setup, change the visibility of the content of this widget.