Skip to content

Utilities

Small helpers for stylesheets and modifier keys.

nodeeditor.utils

Module with some helper functions

loadStylesheet

loadStylesheet(filename)

Loads an qss stylesheet to the current QApplication instance

:param filename: Filename of qss stylesheet :type filename: str Raises: RuntimeError: If no QApplication instance exists

loadStylesheets

loadStylesheets(*args)

Loads multiple qss stylesheets. Concatenates them together and applies the final stylesheet to the current QApplication instance

:param args: variable number of filenames of qss stylesheets :type args: str, str,... Raises: RuntimeError: If no QApplication instance exists

isCTRLPressed

isCTRLPressed(event)

Checks whether the Control key is held down in the given event.

:param event: Qt's mouse or key event :type event: QEvent :return: the Control modifier of the event, truthy when the key is held :rtype: int

isSHIFTPressed

isSHIFTPressed(event)

Checks whether the Shift key is held down in the given event.

:param event: Qt's mouse or key event :type event: QEvent :return: the Shift modifier of the event, truthy when the key is held :rtype: int

isALTPressed

isALTPressed(event)

Checks whether the Alt key is held down in the given event.

:param event: Qt's mouse or key event :type event: QEvent :return: the Alt modifier of the event, truthy when the key is held :rtype: int

nodeeditor.utils_no_qt

Module with helper functions which do not depend on Qt

dumpException

dumpException(e=None)

Prints out an Exception message with a traceback to the console

:param e: Exception to print out :type e: Exception