widgets.*

Provides

class widgets.AlignmentButton(main_window)[source]

Bases: MultiStateBitmapButton

Alignment button for the format toolbar

Parameters:

main_window (QMainWindow) – Application main window

action_names = ('align_top', 'align_center', 'align_bottom')
icon()[source]

Returns icon for button identification

Return type:

QIcon

label = 'Alignment'
class widgets.BackgroundColorButton(color)[source]

Bases: ColorButton

Color button with text icon

Parameters:

color (QColor) – Color that is initially set

label = 'Background Color'
class widgets.CellButton(text, grid, key)[source]

Bases: QPushButton

Button that is used for button cells in the grid

Parameters:
  • text (str) – button label text

  • grid (QTableView) – Main grid

  • key (Tuple[int, int, int]) – key of button’s cell (row, column, table)

on_clicked()[source]

Clicked event handler, executes cell code

class widgets.ColorButton(color, icon=None, max_size=PyQt6.QtCore.QSize(28, 28))[source]

Bases: QToolButton

Color button widget

Parameters:
  • color (QColor) – Color that is initially set

  • icon (QIcon) – Button foreground image

  • max_size (QSize) – Maximum Size of the button

_color = None
property color: QColor

Chosen color

colorChanged

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

default_color = None
on_pressed()[source]

Button pressed event handler

Shows color dialog and sets the chosen color.

set_max_size(size)[source]

Set the maximum size of the widget

Parameters:

color – Maximum button size

title = 'Select Color'
class widgets.FindEditor(parent)[source]

Bases: QLineEdit

The Find editor widget for the find toolbar

Parameters:

parent (QWidget) – Parent widget

case = False
on_context_menu(point)[source]

Context menu event handler

Parameters:

point (QPoint) – Context menu coordinates on screen

on_toggle_case(toggled)[source]

Find case sensitively toggle event handler

Parameters:

toggled (bool) – case sensitivity option toggle state

on_toggle_regexp(toggled)[source]

Find with regular expression toggle event handler

Parameters:

toggled (bool) – regular expression option toggle state

on_toggle_results(toggled)[source]

Find in results toggle event handler

Parameters:

toggled (bool) – results option toggle state

on_toggle_up(toggled)[source]

Find upwards toggle event handler

Parameters:

toggled (bool) – up option toggle state

on_toggle_word(toggled)[source]

Find whole word toggle event handler

Parameters:

toggled (bool) – whole word option toggle state

prepend_actions(menu)[source]

Prepends find specific actions to menu

Parameters:

menu (QMenu) – Find editor context menu

regexp = False
results = False
up = False
word = False
class widgets.FontChoiceCombo(main_window)[source]

Bases: QFontComboBox

Font choice combo box

Parameters:

main_window (QMainWindow) – Application main window

property font: str

Font family name

fontChanged

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

icon()[source]

Returns QIcon for button identification

Return type:

QIcon

label = 'Font Family'
on_font()[source]

Font choice event handler

class widgets.FontSizeCombo(main_window)[source]

Bases: QComboBox

Font choice combo box

Parameters:

main_window (QMainWindow) – Application main window

fontSizeChanged

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

icon()[source]

Returns icon for button identification

Return type:

QIcon

label = 'Font Size'
on_text()[source]

Font size choice event handler

property size: int

Size of current text

class widgets.HelpBrowser(parent, path)[source]

Bases: QTextBrowser

Help browser widget

Parameters:
  • parent (QWidget) – Parent window

  • path (Path) – Path to markdown file that is displayed

get_html(path)[source]

Returns html content for content of browser

Parameters:

path (Path) – Path to markdown file that is displayed

Return type:

str

update(path)[source]

Updates content

Parameters:

path (Path) – Path to markdown file that is displayed

class widgets.JustificationButton(main_window)[source]

Bases: MultiStateBitmapButton

Justification button for the format toolbar

Parameters:

main_window (QMainWindow) – Application main window

action_names = ('justify_left', 'justify_center', 'justify_right', 'justify_fill')
icon()[source]

Returns icon for button identification

Return type:

QIcon

label = 'Justification'
class widgets.LineColorButton(color)[source]

Bases: ColorButton

Color button with text icon

Parameters:

color (QColor) – Color that is initially set

label = 'Line Color'
class widgets.MenuComboBox(items)[source]

Bases: QComboBox

ComboBox that uses a menu instead of a list

Parameters:

items (dict) – Menu items

The dict items needs to be given in the following format: {

“<label_1>”: None, # For leaf item “<label_2>”: {“<label_2.1>”: None}, # For submenu

}

_fill(items, menu, parent_item_text='')[source]

Fills the menu and the combobox

Parameters:
  • items (dict) – Menu items for respective (sub)menu

  • items – Menu or submenu

  • parent_item_text (str) – Text of parent item in submenu

hidePopup()[source]

Hide combo menu

on_menu_selected(action)[source]

Event handler for menu

showPopup()[source]

Show combo menu

text_tpl = '{} ({})'
class widgets.MultiStateBitmapButton(main_window)[source]

Bases: QToolButton

QToolButton that cycles through arbitrary states

The states are defined by an iterable of QIcons

Parameters:

main_window (QMainWindow) – Application main window

property current_action_idx: int

Index of current action

get_action(index)[source]

Returns action from index in action_names

Parameters:

index (int) – Index of action to be returned

Return type:

QAction

next()[source]

Advances current_action_idx and returns current action

Return type:

QAction

on_clicked()[source]

Button clicked event handler. Chechs corresponding menu item

set_current_action(action_name)[source]

Sets current action

Parameters:

action_name (str) – Name of action as in MainWindowActions

set_menu_checked(action_name)[source]

Sets checked status of menu

Parameters:

action_name (str) – Name of action as in MainWindowActions

class widgets.RendererButton(main_window)[source]

Bases: MultiStateBitmapButton

Cell render button for the format toolbar

Parameters:

main_window (QMainWindow) – Application main window

action_names = ('text', 'markup', 'image', 'matplotlib')
icon()[source]

Returns icon for button identification

Return type:

QIcon

label = 'Renderer'
class widgets.RotationButton(main_window)[source]

Bases: MultiStateBitmapButton

Rotation button for the format toolbar

Parameters:

main_window (QMainWindow) – Application main window

action_names = ('rotate_0', 'rotate_90', 'rotate_180', 'rotate_270')
icon()[source]

Returns icon for button identification

Return type:

QIcon

label = 'Rotate'
class widgets.TextColorButton(color)[source]

Bases: ColorButton

Color button with text icon

Parameters:

color (QColor) – Color that is initially set

label = 'Text Color'
class widgets.TypeMenuComboBox[source]

Bases: MenuComboBox

MenuComboBox that comprises types and currencies for CSV import

Parameters:

items – Menu items

The dict items needs to be given in the following format: {

“<label_1>”: None, # For leaf item “<label_2>”: {“<label_2.1>”: None}, # For submenu

}

class widgets.Widgets(main_window)[source]

Bases: object

Container class for widgets

Parameters:

main_window (QMainWindow) – Application main window