sas.qtgui.Utilities.Preferences package

Subpackages

Submodules

sas.qtgui.Utilities.Preferences.DisplayPreferencesWidget module

class sas.qtgui.Utilities.Preferences.DisplayPreferencesWidget.DisplayPreferencesWidget

Bases: PreferencesWidget

__doc__ = None
__init__(self, parent: PySide6.QtWidgets.QWidget | None = None, f: PySide6.QtCore.Qt.WindowType = Default(Qt.WindowFlags)) None

Initialize self. See help(type(self)) for accurate signature.

__module__ = 'sas.qtgui.Utilities.Preferences.DisplayPreferencesWidget'
_addAllWidgets()

A private pseudo-abstract class that children should override. Widgets with their own UI file should pass.

_restoreFromConfig()

A pseudo-abstract class that children should override. Recalls all config values and restores the GUI.

_toggleBlockAllSignaling(toggle)

A pseudo-abstract class that children should override. Toggles signalling for all elements.

staticMetaObject = PySide6.QtCore.QMetaObject("DisplayPreferencesWidget" inherits "PreferencesWidget": )

sas.qtgui.Utilities.Preferences.PlottingPreferencesWidget module

class sas.qtgui.Utilities.Preferences.PlottingPreferencesWidget.PlottingPreferencesWidget

Bases: PreferencesWidget

__doc__ = None
__init__(self, parent: PySide6.QtWidgets.QWidget | None = None, f: PySide6.QtCore.Qt.WindowType = Default(Qt.WindowFlags)) None

Initialize self. See help(type(self)) for accurate signature.

__module__ = 'sas.qtgui.Utilities.Preferences.PlottingPreferencesWidget'
_addAllWidgets()

A private pseudo-abstract class that children should override. Widgets with their own UI file should pass.

_restoreFromConfig()

A pseudo-abstract class that children should override. Recalls all config values and restores the GUI.

_toggleBlockAllSignaling(toggle)

A pseudo-abstract class that children should override. Toggles signalling for all elements.

staticMetaObject = PySide6.QtCore.QMetaObject("PlottingPreferencesWidget" inherits "PreferencesWidget": )

sas.qtgui.Utilities.Preferences.PreferencesPanel module

class sas.qtgui.Utilities.Preferences.PreferencesPanel.PreferencesPanel(parent: Any | None = None)

Bases: QDialog, Ui_preferencesUI

__doc__ = None
__init__(self, parent: PySide6.QtWidgets.QWidget | None = None, f: PySide6.QtCore.Qt.WindowType = Default(Qt.WindowFlags)) None

Initialize self. See help(type(self)) for accurate signature.

__module__ = 'sas.qtgui.Utilities.Preferences.PreferencesPanel'
_cancelStaging()

When the Cancel button is clicked, throw away any staged changes and hide the window

_okClicked()

Action triggered when the OK button is clicked

_reset_state()
_saveStagedChanges()

When OK or Apply are clicked, all staged changes should be applied to the config.

_set_accept()

Enable/disable the ‘Accept’ and ‘OK’ buttons based on the current state.

addWidget(widget: QWidget, name: str | None = None)

Add a single widget to the panel

addWidgets(widgets: Dict[str, Callable])

Add a list of named widgets to the window

close()

Save the configuration values when the preferences window is closed

closeEvent(event)

Capture all window close events and ensure the window is in a base state

help()

Open the help window associated with the preferences window

prefMenuChanged()

When the preferences menu selection changes, change to the appropriate preferences widget

registerPerspectivePreferences(perspective: Perspective)

Register preferences from a perspective

restoreDefaultPreferences()

Reset preferences for the active widget to the default values.

setMenuByName(name: str)

Set the index of the listWidget and stackedWidget, using the display name as the search term

setWidgetIndex(row: int)

Set the menu and options stack to a given index

set_invalid_input(key: str)

Widgets should call this if an input is invalid to disable the ‘OK’ and ‘Apply’ buttons.

stageSingleChange(key: str, value: str | bool | float | int | List[str | float | int], config_restart_message: str | None = '')

Preferences widgets should call this method when changing a variable to prevent direct configuration changes

staticMetaObject = PySide6.QtCore.QMetaObject("PreferencesPanel" inherits "QDialog": )
unStageSingleChange(key: str, config_restart_message: str | None = '')

Preferences widgets should call this method when removing an invalid value from the staged changes.

unset_invalid_input(key: str)

Remove the key from the invalid staged values, if necessary

sas.qtgui.Utilities.Preferences.PreferencesPanel.restart_main()

sas.qtgui.Utilities.Preferences.PreferencesWidget module

class sas.qtgui.Utilities.Preferences.PreferencesWidget.PrefDoubleValidator

Bases: QDoubleValidator

__doc__ = None
__module__ = 'sas.qtgui.Utilities.Preferences.PreferencesWidget'
fixup(self, input: str) str
staticMetaObject = PySide6.QtCore.QMetaObject("PrefDoubleValidator" inherits "QDoubleValidator": )
validate(self, arg__1: str, arg__2: int) object
class sas.qtgui.Utilities.Preferences.PreferencesWidget.PrefFloatEdit(parent)

Bases: QLineEdit

__doc__ = None
__init__(self, arg__1: str, parent: PySide6.QtWidgets.QWidget | None = None) None
__init__(self, parent: PySide6.QtWidgets.QWidget | None = None) None

Initialize self. See help(type(self)) for accurate signature.

__module__ = 'sas.qtgui.Utilities.Preferences.PreferencesWidget'
staticMetaObject = PySide6.QtCore.QMetaObject("PrefFloatEdit" inherits "QLineEdit": )
text(self) str
class sas.qtgui.Utilities.Preferences.PreferencesWidget.PrefIntEdit(parent)

Bases: QLineEdit

__doc__ = None
__init__(self, arg__1: str, parent: PySide6.QtWidgets.QWidget | None = None) None
__init__(self, parent: PySide6.QtWidgets.QWidget | None = None) None

Initialize self. See help(type(self)) for accurate signature.

__module__ = 'sas.qtgui.Utilities.Preferences.PreferencesWidget'
staticMetaObject = PySide6.QtCore.QMetaObject("PrefIntEdit" inherits "QLineEdit": )
text(self) str
class sas.qtgui.Utilities.Preferences.PreferencesWidget.PreferencesWidget(name: str, build_gui=True)

Bases: QWidget

__doc__ = None
__init__(self, parent: PySide6.QtWidgets.QWidget | None = None, f: PySide6.QtCore.Qt.WindowType = Default(Qt.WindowFlags)) None

Initialize self. See help(type(self)) for accurate signature.

__module__ = 'sas.qtgui.Utilities.Preferences.PreferencesWidget'
_addAllWidgets()

A private pseudo-abstract class that children should override. Widgets with their own UI file should pass.

_createLayoutAndTitle(title: str)

A private class method that creates a horizontal layout to hold the title and interactive item. :param title: The title of the interactive item to be added to the preferences panel. :return: A QHBoxLayout instance with a title box already added

_restoreFromConfig()

A pseudo-abstract class that children should override. Recalls all config values and restores the GUI.

_setInvalid(key: str)

Adds the input key to a set to ensure the preference panel does not try to apply invalid values

_stageChange(key: str, value: str | bool | float | int | List[str | float | int])

All inputs should call this method when attempting to change config values.

_toggleBlockAllSignaling(toggle: bool)

A pseudo-abstract class that children should override. Toggles signalling for all elements.

_unStageChange(key: str)

A private class method to unstage a single configuration change. Typically when the value is not valid.

_validate_input_and_stage(edit: QLineEdit, key: str)

A generic method to validate values entered into QLineEdit inputs. If the value is acceptable, it is staged, otherwise, the input background color is changed to yellow and any previous changes will be unstaged until the value is corrected. :param edit: The QLineEdit input that is being validated. :param key: The string representation of the key the QLineEdit value is stored as in the configuration system. :return: None

addCheckBox(title: str, checked: bool | None = False) QCheckBox

Add a title and check box within the widget. :param title: The title of the check box to be added to the preferences panel. :param checked: An optional boolean value to specify if the check box is checked. Defaults to unchecked. :return: QCheckBox instance to allow subclasses to assign instance name

addComboBox(title: str, params: List[str | float | int], default: str | None = None) QComboBox

Add a title and combo box within the widget. :param title: The title of the combo box to be added to the preferences panel. :param params: A list of options to be added to the combo box. :param default: The default option to be selected in the combo box. The first item is selected if None. :return: QComboBox instance to allow subclasses to assign instance name

addFloatInput(title: str, default_number: int | None = 0) QLineEdit

Similar to the text input creator, this creates a text input with an float validator assigned to it. :param title: The title of the text box to be added to the preferences panel. :param default_number: An optional value to be put within the text box as a default. Defaults to an empty string. :return: QLineEdit instance to allow subclasses to assign instance name

addHeaderText(text: str)

Add a static text box to the widget, likely as a heading to separate options :param text: The title of the check box to be added to the preferences panel.

addHorizontalLine()

Add a horizontal line as a divider.

addIntegerInput(title: str, default_number: int | None = 0) QLineEdit

Similar to the text input creator, this creates a text input with an integer validator assigned to it. :param title: The title of the text box to be added to the preferences panel. :param default_number: An optional value to be put within the text box as a default. Defaults to an empty string. :return: QLineEdit instance to allow subclasses to assign instance name

addTextInput(title: str, default_text: str | None = '') QLineEdit

Add a title and text box within the widget. :param title: The title of the text box to be added to the preferences panel. :param default_text: An optional value to be put within the text box as a default. Defaults to an empty string. :return: QLineEdit instance to allow subclasses to assign instance name

applyNonConfigValues()

Applies values that aren’t stored in config. Only widgets that require this need to override this method.

restoreDefaults()

Generic method to restore all default values for the widget.

restoreGUIValuesFromConfig()

A generic method that blocks all signalling, and restores the GUI values from the config file. Called when staging is cancelled or defaults should be restored.

staticMetaObject = PySide6.QtCore.QMetaObject("PreferencesWidget" inherits "QWidget": )
class sas.qtgui.Utilities.Preferences.PreferencesWidget.QHLine

Bases: QFrame

__doc__ = None
__init__(self, parent: PySide6.QtWidgets.QWidget | None = None, f: PySide6.QtCore.Qt.WindowType = Default(Qt.WindowFlags)) None

Initialize self. See help(type(self)) for accurate signature.

__module__ = 'sas.qtgui.Utilities.Preferences.PreferencesWidget'
staticMetaObject = PySide6.QtCore.QMetaObject("QHLine" inherits "QFrame": )
sas.qtgui.Utilities.Preferences.PreferencesWidget.cb_replace_all_items_with_new(cb: QComboBox, new_items: List[str], default_item: str | None = None)

Helper method that removes existing ComboBox values, replaces them and sets a default item, if defined :param cb: A QComboBox object :param new_items: A list of strings that will be used to populate the QComboBox :param default_item: The value to set the QComboBox to, if set

Module contents