QNodeEditor.themes#
Module containing graphical themes for all node editor elements.
The package comes with two themes:
DarkTheme: dark themeLightTheme: light theme
To set the theme for an entire node scene, use the
theme property of a
NodeView the scene is displayed in.
Both the NodeEditorDialog and
NodeEditor have theme properties that can also be used to set
the theme of a node editor.
Examples
To define your own theme, derive a class from Theme and set all the properties:
from PyQt5.QtGui import QColor
class MyTheme(Theme):
# Editor properties
editor_color_background = QColor('#ff0000')
editor_color_grid = QColor('#00ff00')
font_size = 10
...
See the Theme class for all properties that need to be set.
Once you created a theme, use the theme property of a
NodeView to apply your theme:
# For a new scene
theme = MyTheme
scene = NodeScene()
view = NodeView(scene, MyTheme)
# For an existing scene
view.theme = MyTheme
# Inside of the node editor widget
editor = NodeEditor()
editor.theme = MyTheme
# Inside of the node editor dialog
dialog = NodeEditorDialog()
dialog.theme = MyTheme
Note that you do not need to create an instance of the theme class.
Modules
Class containing dark theme for node editor |
|
Class containing light theme for node editor |
|
Base class for node editor themes |