The util module#
Various utility classes and functions.
- class Job(function, finished=None, with_result=False)[source]#
Bases:
QThreadSimple QThread helper that runs a
functionin a background thread.If you specify a
finishedcallable, it will be called when the function has finished. Ifwith_resultis True, thefinishedcallable 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:
QObjectKeeps 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.