spinetoolbox.import_editor.widgets.options_widget

Contains OptionsWidget class.

author:
  1. Vennström (VTT)
date:

1.6.2019

Module Contents

Classes

OptionsWidget A widget for handling simple options.

Functions

_emit_spin_box_option_changed(i, option_key, options_widget) A ‘slot’ to transform changes in QSpinBox into changes in options.
_emit_line_edit_option_changed(text, option_key, options_widget) A ‘slot’ to transform changes in QLineEdit into changes in options.
_emit_check_box_option_changed(state, option_key, options_widget) A ‘slot’ to transform changes in QCheckBox into changes in options.
_emit_combo_box_option_changed(text, option_key, options_widget) A ‘slot’ to transform changes in QComboBox into changes in options.
class spinetoolbox.import_editor.widgets.options_widget.OptionsWidget(connector, undo_stack)[source]

Bases: PySide2.QtWidgets.QWidget

A widget for handling simple options.

Parameters:
  • connector (ConnectionManager) – the connection manager whose current table’s options are show on the widget
  • undo_stack (QUndoStack) – undo stack
options_changed[source]

Emitted whenever an option in the widget is changed.

about_to_undo[source]

Emitted before undo action.

connector[source]

The connection manager linked to this options widget.

undo_stack[source]
undo_enabled[source]
current_source_table[source]
_build_ui(self)[source]

Builds ui from specification in dict

_set_options(self, source_table, options=None)[source]

Sets state of options

Parameters:
  • source_table (str) – name of the source table
  • options (dict, optional) – Dict with option name as key and value as value (default: {None})
set_option_without_undo(self, source_table, option_key, value)[source]
_fetch_options_from_connector(self)[source]

Read options from the connector.

spinetoolbox.import_editor.widgets.options_widget._emit_spin_box_option_changed(i, option_key, options_widget)[source]

A ‘slot’ to transform changes in QSpinBox into changes in options.

Parameters:
  • text (str) – text for undo/redo
  • option_key (str) – option’s key
  • options_widget (OptionsWidget) – options widget
spinetoolbox.import_editor.widgets.options_widget._emit_line_edit_option_changed(text, option_key, options_widget)[source]

A ‘slot’ to transform changes in QLineEdit into changes in options.

Parameters:
  • text (str) – text for undo/redo
  • option_key (str) – option’s key
  • options_widget (OptionsWidget) – options widget
spinetoolbox.import_editor.widgets.options_widget._emit_check_box_option_changed(state, option_key, options_widget)[source]

A ‘slot’ to transform changes in QCheckBox into changes in options.

Parameters:
  • text (str) – text for undo/redo
  • option_key (str) – option’s key
  • options_widget (OptionsWidget) – options widget
spinetoolbox.import_editor.widgets.options_widget._emit_combo_box_option_changed(text, option_key, options_widget)[source]

A ‘slot’ to transform changes in QComboBox into changes in options.

Parameters:
  • text (str) – text for undo/redo
  • option_key (str) – option’s key
  • options_widget (OptionsWidget) – options widget