trspectrometer.busydialog module

class trspectrometer.busydialog.BusyDialog(parent=None, modal=False, title=None, label='Please wait...', progress=(0, 0), task=None, args=(), kwargs={}, callback=None)[source]

Bases: QDialog

closeEvent(event)[source]

Handler for window close event. If the background task is still running, the window close event will be ignored.

incrementProgress(increment=1)[source]
setLabel(label)[source]

Update the text of the dialog label. This method is thread safe and may be called by the running background task. Do not attempt to manipulate the label directly from outside the main Qt application thread!

Parameters:

label – String to display in the dialog label.

setProgress(progress_current, progress_maximum=-1)[source]

Update the progress bar of the dialog. This method is thread safe and may be called by the running background task. Do not attempt to manipulate the progress bar directly from outside the main Qt application thread!

Parameters:
  • progress_current – Number representing current progress.

  • progress_maximum – Number representing maximum (complete) progress.

staticMetaObject = PySide6.QtCore.QMetaObject("BusyDialog" inherits "QDialog": Methods:   #42 type=Signal, signature=_task_finished_signal(PyObject), parameters=PyObject   #43 type=Signal, signature=_update_label_signal(QString), parameters=QString   #44 type=Signal, signature=_update_progress_signal(int,int), parameters=int, int   #45 type=Signal, signature=_increment_progress_signal(int), parameters=int )
class trspectrometer.busydialog.BusyThread(task=None, args=(), kwargs={}, callback=None)[source]

Bases: QObject

staticMetaObject = PySide6.QtCore.QMetaObject("BusyThread" inherits "QObject": Methods:   #5 type=Signal, signature=_task_finished_signal(PyObject), parameters=PyObject )
trspectrometer.busydialog.main()[source]

Run a demo of the BusyDialog.