text widgets#

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

A subclass of QLineEdit. Can be setup with a link to QSettings instance to maintain state between program restarts.

__init__(*args, **kwargs)#
setup(config: QSettings, name: str, default: str = '', autocollect: bool = True)#

Setup the link to a QSettings instance for this lineedit.

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.

  • autocollect (bool, optional) – If true, every change is collected.

collect() str#

save text in config.

load_value() str#

load text from config.

set_value(val: str) str#

to widget and config.

class configwidgets.ConfigComboBox(parent=None)#

A subclass of QComboBox. Can be setup with a link to QSettings instance to maintain state between program restarts.

__init__(parent=None)#

Initialize a ConfigRadioButton. Other than declaring default values as None the super constructor is called.

Parameters:

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

setup(config: QSettings, name: str, items: list[str], default: str = None, enable_custom: bool = False)#

Setup the link to a QSettings instance for this combobox.

Parameters:
  • config (QSettings) – The QSettings instance, that shall be connected.

  • name (str) – The QSettings key to store the synced value.

  • items (list[str]) – The list of items to be displayed.

  • default (bool, optional) – The default value. The default is False.

set_items(items: list[str])#

set the items of the combobox.

collect() str#

save text in config.

load_value() str#

load text from config.

set_value(val: str) str#

to widget and config.

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

A subclass of QPlainTextEdit. Can be setup with a link to a QSettings instance to maintain state between program restarts.

__init__(*args, **kwargs)#
setup(config: QSettings, name: str, default: str = '', autocollect: bool = False)#

Setup the link to a QSettings instance for this plaintextedit.

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.

  • autocollect (bool, optional) – When False the state is not automatically saved. The default is False.

collect() str#

save text in config.

load_value() str#

load text from config.

set_value(val: str) str#

to widget and config.