amaze.misc.utils

Various utility functions from handling the Qt Application

Functions

has_qt_application()

Sanity check to ensure that a QtApplication exists

is_qt_offscreen()

Tests whether the offscreen has been requested either through the environmental variable or through the Qt application itself

qt_application([allow_create, start_offscreen])

Returns the currently running Qt application or creates a new one.

qt_offscreen([offscreen])

Whether to request offscreen rendering from Qt (for headless environments)

Exceptions

amaze.misc.utils.qt_application(allow_create=True, start_offscreen=False)[source]

Returns the currently running Qt application or creates a new one.

Raises:

RuntimeError if allow_create is False and no application exists.

exception amaze.misc.utils.NoQtApplicationException[source]
amaze.misc.utils.has_qt_application()[source]

Sanity check to ensure that a QtApplication exists

Raises:

NoQtApplicationException if no Qt application exists

amaze.misc.utils.qt_offscreen(offscreen=True)[source]

Whether to request offscreen rendering from Qt (for headless environments)

amaze.misc.utils.is_qt_offscreen()[source]

Tests whether the offscreen has been requested either through the environmental variable or through the Qt application itself