QNodeEditor.themes.theme.Theme#

class QNodeEditor.themes.theme.Theme#

Bases: object

Theme base class storing colors and other graphical properties for the node editor

Properties

editor_color_background

Color of editor background

editor_color_region_select

Color of region select in node view

editor_color_grid

Color of editor grid

editor_color_cut

Color of cutting line

editor_cut_dash_pattern

Dash pattern for cutting length (length must be even)

editor_cut_width

Width of cutting line

font_name

Relative path to .ttf file in ./fonts/ directory

font_size

Default font size

editor_grid_point_size

Size of editor background grid points

editor_grid_spacing

Spacing of editor background grid points

node_color_body

Color of node body

node_color_header

Color of node header (behind title)

node_color_outline_default

Color of node outline in default state

node_color_outline_hovered

Color of node outline in hovered state

node_color_outline_selected

Color of node outline in selected state

node_color_shadow

Color of node shadow

node_color_title

Color of node title text

node_border_radius

Node body border radius

node_outline_width

Node outline width

node_shadow_radius

Node shadow blur radius

node_shadow_offset

Node shadow offset (dx, dy)

node_padding

Node body padding (horizontal, vertical)

node_entry_spacing

Vertical spacing between node entries

edge_type

Type of edge ('direct' or 'bezier')

edge_color_default

Color of edges in default state

edge_color_hover

Color of edges in hovered state

edge_color_selected

Color of edges in selected state

edge_color_drag

Color of edges that are being dragged

edge_width_default

Width of edges in default state

edge_width_hover

Width of edges in hovered state

edge_width_selected

Width of edges in selected state

edge_width_drag

Width of edges that are being dragged

edge_style_default

Style of edges in default state

edge_style_hover

Style of edges in hovered state

edge_style_selected

Style of edges in selected state

edge_style_drag

Style of edges that are being dragged

widget_combo_box_arrow_name

Filename of SVG to use for combo box arrow in ./img/ directory

widget_color_base

Color of widget in default state

widget_color_hovered

Primary color of widget in hovered state

widget_color_hovered_accent

Secondary color of widget in hovered state

widget_color_pressed

Primary color of widget in pressed state

widget_color_pressed_accent

Secondary color of widget in pressed state

widget_color_active

Color of active part of widget (such as progress bar)

widget_color_text

Color of widget text in default state

widget_color_text_hover

Color of widget text in hovered state

widget_color_text_disabled

Color of widget text in disabled state

widget_border_radius

Widget border radius

widget_outline_width

Widget outline width

widget_height

Widget height

socket_color_fill

Color of socket

socket_color_outline

Color of socket outline

socket_radius

Socket radius

socket_outline_width

Socket outline width

Methods

font

Load the specified font from the ./fonts/ directory.

load_combo_box_arrow

Get the absolute path to the SVG file used for the combo box arrow.

load_svg

Get the absolute path to an SVG file.

__init__()#
classmethod font(point_size: int | None = None) QFont#

Load the specified font from the ./fonts/ directory.

Parameters:

point_size (int, optional) – Font point size. If not specified, the default font size is used.

Returns:

Loaded font

Return type:

QFont

classmethod load_combo_box_arrow() str#

Get the absolute path to the SVG file used for the combo box arrow.

Returns:

Absolute path to SVG file

Return type:

str

classmethod load_svg(filename: str) str#

Get the absolute path to an SVG file.

Needed since filepaths for packages are not always intuitive.

Parameters:

filename (str) – Name of SVG file in ./img/ directory to locate

Returns:

Absolute path to SVG file

Return type:

str

edge_color_default: QColor#

Color of edges in default state

Type:

QColor

edge_color_drag: QColor#

Color of edges that are being dragged

Type:

QColor

edge_color_hover: QColor#

Color of edges in hovered state

Type:

QColor

edge_color_selected: QColor#

Color of edges in selected state

Type:

QColor

edge_style_default: PenStyle#

Style of edges in default state

Type:

PenStyle

edge_style_drag: PenStyle#

Style of edges that are being dragged

Type:

PenStyle

edge_style_hover: PenStyle#

Style of edges in hovered state

Type:

PenStyle

edge_style_selected: PenStyle#

Style of edges in selected state

Type:

PenStyle

edge_type: str#

Type of edge (‘direct’ or ‘bezier’)

Type:

str

edge_width_default: float#

Width of edges in default state

Type:

float

edge_width_drag: float#

Width of edges that are being dragged

Type:

float

edge_width_hover: float#

Width of edges in hovered state

Type:

float

edge_width_selected: float#

Width of edges in selected state

Type:

float

editor_color_background: QColor#

Color of editor background

Type:

QColor

editor_color_cut: QColor#

Color of cutting line

Type:

QColor

editor_color_grid: QColor#

Color of editor grid

Type:

QColor

editor_color_region_select: QColor#

Color of region select in node view

Type:

QColor

editor_cut_dash_pattern: list[int]#

Dash pattern for cutting length (length must be even)

Type:

list[int]

editor_cut_width: float#

Width of cutting line

Type:

float

editor_grid_point_size: float#

Size of editor background grid points

Type:

float

editor_grid_spacing: int#

Spacing of editor background grid points

Type:

int

font_name: str#

Relative path to .ttf file in ./fonts/ directory

Type:

str

font_size: int#

Default font size

Type:

int

node_border_radius: float#

Node body border radius

Type:

float

node_color_body: QColor#

Color of node body

Type:

QColor

node_color_header: QColor#

Color of node header (behind title)

Type:

QColor

node_color_outline_default: QColor#

Color of node outline in default state

Type:

QColor

node_color_outline_hovered: QColor#

Color of node outline in hovered state

Type:

QColor

node_color_outline_selected: QColor#

Color of node outline in selected state

Type:

QColor

node_color_shadow: QColor#

Color of node shadow

Type:

QColor

node_color_title: QColor#

Color of node title text

Type:

QColor

node_entry_spacing: float#

Vertical spacing between node entries

Type:

float

node_outline_width: float#

Node outline width

Type:

float

node_padding: tuple[int]#

Node body padding (horizontal, vertical)

Type:

tuple[int]

node_shadow_offset: tuple[float]#

Node shadow offset (dx, dy)

Type:

tuple[float]

node_shadow_radius: float#

Node shadow blur radius

Type:

float

socket_color_fill: QColor#

Color of socket

Type:

QColor

socket_color_outline: QColor#

Color of socket outline

Type:

QColor

socket_outline_width: float#

Socket outline width

Type:

float

socket_radius: int#

Socket radius

Type:

int

widget_border_radius: float#

Widget border radius

Type:

float

widget_color_active: QColor#

Color of active part of widget (such as progress bar)

Type:

QColor

widget_color_base: QColor#

Color of widget in default state

Type:

QColor

widget_color_hovered: QColor#

Primary color of widget in hovered state

Type:

QColor

widget_color_hovered_accent: QColor#

Secondary color of widget in hovered state

Type:

QColor

widget_color_pressed: QColor#

Primary color of widget in pressed state

Type:

QColor

widget_color_pressed_accent: QColor#

Secondary color of widget in pressed state

Type:

QColor

widget_color_text: QColor#

Color of widget text in default state

Type:

QColor

widget_color_text_disabled: QColor#

Color of widget text in disabled state

Type:

QColor

widget_color_text_hover: QColor#

Color of widget text in hovered state

Type:

QColor

widget_combo_box_arrow_name: str#

Filename of SVG to use for combo box arrow in ./img/ directory

Type:

str

widget_height: int#

Widget height

Type:

int

widget_outline_width: float#

Widget outline width

Type:

float