Previous topic

qarbon.qt.gui.treeqobject

Next topic

qarbon.qt.gui.x11

This Page

qarbon.qt.gui.util

Helper functions to deal with Qt GUI related stuff

Functions

isWidget Determines if the given object is a Qt Widget.
isWidgetClass Determines if the given object is a Qt Widget class.
getWidgetClasses Returns the widget classes defined in a given module.
grabWidget Grabs the given widget into the given image filename.
qarbon.qt.gui.util.isWidget(obj)[source]

Determines if the given object is a Qt Widget.

Parameters:obj – object
Returns:True if the given object is a Qt Widget or False otherwise
Return type:bool
qarbon.qt.gui.util.isWidgetClass(obj)[source]

Determines if the given object is a Qt Widget class.

Parameters:obj – object
Returns:True if the given object is a Qt Widget class or False otherwise
Return type:bool
qarbon.qt.gui.util.getWidgetClasses(module_name)[source]

Returns the widget classes defined in a given module.

Returns:

{widget full name(str): {“klass”: widget class(class), “name”: widget name(str), “full_name”: widget full name(str)}}

Parameters:module_name (str) – name of the module in the format “a.b.c”
Returns:a map with the widgets for the given module
Return type:dict
qarbon.qt.gui.util.grabWidget(widget, fileName, period=None)[source]

Grabs the given widget into the given image filename. If period is None (default) it grabs immediately once and returns. If period is given and >0 means grab the image every period (in seconds).

Warning

this method MUST be called from the same thread which created the widget

Parameters:
  • widget (QtWidget) – the Qt widget to be grabbed
  • fileName (str) – the name of the image file
  • period (float) – period (seconds)