widgets.*

Provides

class widgets.AlignmentButton(main_window)[source]

Bases: widgets.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: widgets.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: PyQt5.QtWidgets.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=PyQt5.QtCore.QSize(28, 28))[source]

Bases: PyQt5.QtWidgets.QToolButton

Color button widget

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

  • icon (Optional[QIcon]) – Button foreground image

  • max_size (QSize) – Maximum Size of the button

property color: PyQt5.QtGui.QColor

Chosen color

Return type

QColor

colorChanged
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: PyQt5.QtWidgets.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: PyQt5.QtWidgets.QFontComboBox

Font choice combo box

Parameters

main_window (QMainWindow) – Application main window

property font: str

Font family name

Return type

str

fontChanged
icon()[source]

Returns QIcon for button identification

Return type

QIcon

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

Font choice event handler

class widgets.FontSizeCombo(main_window)[source]

Bases: PyQt5.QtWidgets.QComboBox

Font choice combo box

Parameters

main_window (QMainWindow) – Application main window

fontSizeChanged
icon()[source]

Returns icon for button identification

Return type

QIcon

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

Font size choice event handler

property size: int
Return type

int

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

Bases: PyQt5.QtWidgets.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: widgets.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: widgets.ColorButton

Color button with text icon

Parameters

color (QColor) – Color that is initially set

label = 'Line Color'
class widgets.MultiStateBitmapButton(main_window)[source]

Bases: PyQt5.QtWidgets.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
Return type

int

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: widgets.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: widgets.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: widgets.ColorButton

Color button with text icon

Parameters

color (QColor) – Color that is initially set

label = 'Text Color'
class widgets.Widgets(main_window)[source]

Bases: object

Container class for widgets

Parameters

main_window (QMainWindow) – Application main window