naturtag.app.threadpool module#

Adapted from examples in Python & Qt6 by Martin Fitzpatrick

class naturtag.app.threadpool.ProgressBar(**kwargs)#

Bases: QProgressBar

add(amount=1)#
advance(amount=1)#
fadein()#
fadeout()#
reset(self) None#
schedule_reset()#

After a delay, if no new tasks have been added, reset and hide the progress bar

staticMetaObject = PySide6.QtCore.QMetaObject("ProgressBar" inherits "QProgressBar": )#
class naturtag.app.threadpool.ThreadPool(**kwargs)#

Bases: QThreadPool

cancel()#

Cancel all queued tasks and reset progress bar. Currently running tasks will be allowed to complete.

schedule(callback, priority=Priority.NormalPriority, **kwargs)#

Schedule a task to be run by the next available worker thread

Return type:

WorkerSignals

schedule_all(callbacks, **kwargs)#

Schedule multiple tasks to be run by the next available worker thread

Return type:

list[WorkerSignals]

staticMetaObject = PySide6.QtCore.QMetaObject("ThreadPool" inherits "QThreadPool": )#
class naturtag.app.threadpool.Worker(callback, **kwargs)#

Bases: QRunnable

run(self) None#
class naturtag.app.threadpool.WorkerSignals#

Bases: QObject

on_error#

Return exception info on error

on_progress#

Increment progress bar

on_result#

Return result on completion

staticMetaObject = PySide6.QtCore.QMetaObject("WorkerSignals" inherits "QObject": Methods:   #5 type=Signal, signature=on_error(PyObject), parameters=PyObject   #6 type=Signal, signature=on_result(PyObject), parameters=PyObject   #7 type=Signal, signature=on_progress() )#