GUI Widget Helpers¶
Provides a collection of custom QWidget subclasses
that provide specific functionalities.
-
class
prism._gui.widgets.helpers.ExceptionDialog(parent, etype, value, tb)[source]¶ Defines the
ExceptionDialogclass for the Projection GUI.This class takes a set of exception details and converts it into a format that can be shown using a dialog.
-
__init__(parent, etype, value, tb)[source]¶ Initialize an instance of the
ExceptionDialogclass.Parameters: - parent (
QWidgetobject or None) – The parent widget for this dialog or None for no parent. - etype (
Exceptionclass) – TheExceptionclass that is associated with this error. - value (
Exceptionobject) – TheExceptioninstance that is associated with this error. - tb (traceback object) – The corresponding traceback object.
- parent (
-
create_traceback_box()[source]¶ Creates a special box for the exception dialog that contains the traceback information and returns it.
-
init()[source]¶ Sets up the exception dialog after it has been initialized.
This function is mainly responsible for gathering all required information; formatting it; and drawing the dialog.
-
-
class
prism._gui.widgets.helpers.OverviewListWidget(*args, **kwargs)[source]¶ Defines the
OverviewListWidgetclass.This class defines the overview lists that are used by the
OverviewDockWidgetclass.-
__init__(*args, **kwargs)[source]¶ Initialize an instance of the
OverviewListWidgetclass.Parameters:
-
init(*, hcubes_list, status_tip, context_menu, activated)[source]¶ Sets up the overview list after it has been initialized.
This function is mainly responsible for creating the list; adding the items to it; and setting some properties.
Parameters: - hcubes_list (list of str) – List of projection hypercube names that must be used to initialize this overview list with.
- statustip (str) – The statustip that will be displayed in the statusbar whenever this overview list is hovered.
- context_menu (function) – The function that must be called whenever the context menu is requested.
- activated (function) – The function that must be called whenever an item in this overview list is activated. This corresponds to the default action.
-
-
class
prism._gui.widgets.helpers.ThreadedProgressDialog(main_window_obj, *args, **kwargs)[source]¶ Defines the
ThreadedProgressDialogclass for the Projection GUI.This class provides a
QProgressDialogclass that automatically executes a provided operation on a separate thread, allowing for the user to interrupt it.-
__init__(main_window_obj, *args, **kwargs)[source]¶ Initialize an instance of the
ThreadedProgressDialogclass.Parameters: - main_window_obj (
MainViewerWindowobject) – Instance of theMainViewerWindowclass that acts as the parent of progress dialog. - args (positional arguments) – The positional arguments that need to be passed to
init(). - kwargs (keyword arguments) – The keyword arguments that need to be passed to
init().
- main_window_obj (
-
init(label, func, *iterables)[source]¶ Sets up the progress dialog after it has been initialized.
This function is mainly responsible for preparing the dialog to be opened and the func function to be executed.
Parameters: - label (str) – The label that is used as the description of what operation is currently being executed.
- func (function) – The function that must be called iteratively using the arguments provided in iterables.
- iterables (positional arguments) – All iterables that must be used to call func with.
-
kill_threads()[source]¶ Terminates all currently running threads besides the main thread (on all MPI ranks) and returns control to the main thread.
This function is the sole way to abort the operation.
This function acts as a Qt slot.
-
-
prism._gui.widgets.helpers.show_exception_details(parent, *args, **kwargs)[source]¶ Creates an instance of the
ExceptionDialogclass and shows it.Parameters: parent (
QWidgetobject or None) – The parent widget for this dialog or None for no parent.Other Parameters: - args (positional arguments) – The positional arguments that must be passed to the constructor of
the
ExceptionDialogclass. - kwargs (keyword arguments) – The keyword arguments that must be passed to the constructor of the
ExceptionDialogclass.
- args (positional arguments) – The positional arguments that must be passed to the constructor of
the