The util module#
Various utility classes and functions.
- class Job(function, finished=None, with_result=False)[source]#
Bases:
QThread
Simple QThread helper that runs a
function
in a background thread.If you specify a
finished
callable, it will be called when the function has finished. Ifwith_result
is True, thefinished
callable will be called with the result of the function.The job is started immediately. You do not need to store the job, it will keep a reference itself as long as it is running.
- class SingleInstance(parent, *args, **kwargs)[source]#
Bases:
QObject
Keeps a single instance around for another object.
We keep only a weak reference to the object, if the object is garbage collected, we disappear as well.