Skip to content

progress_dialog

Mihaly Konda edited this page Nov 12, 2025 · 2 revisions

progress_dialog

version: v1.0.3

A cancellable, optionally nested progress dialog, reporting on a compatible process ran by a QObject-subclass on a separate thread.

class _Threaded(QObject) [src]

An example, progress dialog compatible class. Worker objects of simple (not nested) PDs do not need sub-signals.


Signals:

  • sig_new_process_unit: A signal carrying a string identifier of the new main process unit.
  • sig_new_subprocess_unit: A signal carrying a string identifier of the new subprocess unit.
  • sig_main_progress: A signal carrying the progress (integer percentage) of the main process.
  • sig_sub_progress: A signal carrying the progress (integer percentage) of the subprocess.
  • sig_finished: The signal emitted when the process finishes.
  • sig_start: The signal that starts the process execution.
  • sig_cancel: A signal for external cancellation of the process execution.

[src]

def __init__(self, nested=False) -> None

Initializer for the class.

Parameters:

  • nested: A flag marking whether the progress dialog should be nested. The default is False.

[src]

@property
def nested(self) -> bool

Returns whether the associated progress dialog is nested.


[src]

@Slot()
def _process(self) -> None

The slot connected to the start signal. Emits sig_finished when the process finishes.


[src]

@Slot()
def _cancel_process(self) -> None

The slot connected to the cancel signal. Needs the button press event to be processed beforehand.


class _ProgressMixin [src]

A window reporting on the progress of a process running on a separate thread.


[src]

def __init__(self, worker, title, widget_theme=None) -> None

Initializer for the class.

Parameters:

  • worker: A worker subclassing QObject, handling a process.
  • title: The title to set for the window.
  • widget_theme: A widget theme from the 'theme' module. The default is None, for the Qt-default theme.

[src]

def _setup_ui(self) -> None

Sets up the user interface: GUI objects and layouts.


[src]

def _setup_connections(self) -> None

Sets up the connections of the GUI objects.


[src]

@property
def theme(self) -> ThemeParameters

Returns the parameters of the theme set for this object.


[src]

@theme.setter
def theme(self, new_theme: ThemeParameters) -> None

Sets a new set of parameters defining a theme to this object.


[src]

def _create_worker_thread(self) -> None

Creates a new thread and moves the worker there.


[src]

def _quit_thread(self) -> None

Closes the thread after the worker has finished.


[src]

def _cancel_process(self) -> None

Asks for confirmation to cancel the process.


class ProgressDialog(_ProgressMixin, QDialog) [src]

A dialog reporting on the progress of a process running on a separate thread.


[src]

def __init__(self, worker: QObject, title="Progress report", widget_theme=None) -> None

Initializer for the class.

Parameters:

  • worker: A worker subclassing QObject, handling a process.
  • title: The title to set for the dialog. The default is "Progress report".
  • widget_theme: A widget theme from the 'theme' module. The default is None, for the Qt-default theme.

class ProgressDW(_ProgressMixin, QDockWidget) [src]

A dock widget reporting on the progress of a process running on a separate thread.


[src]

def __init__(self, worker: QObject, title="Progress report", widget_theme=None) -> None

Initializer for the class.

Parameters:

  • worker: A worker subclassing QObject, handling a process.
  • title: The title to set for the dialog. The default is "Progress report".
  • widget_theme: A widget theme from the 'theme' module. The default is None, for the Qt-default theme.

API reference

Base/technical modules:

Other modules

Clone this wiki locally