nqrduck.core.main_view#

The main view of the application.

Classes

AboutModules(*args, **kwargs)

This class provides a simple dialog for displaying information about the different modules.

AboutNQRduck(*args, **kwargs)

This class provides a simple dialog for displaying information about the application.

ConfirmationDialog(*args, **kwargs)

Opens up a dialog to confirm the changes which allows the user to revert the changes.

LoggerWindow(*args, **kwargs)

This class provides a simple dialog for displaying the log messages of the application.

MainView(*args, **kwargs)

The main view of the application.

NotificationDialog(*args, **kwargs)

This class provides a simple dialog for displaying notifications by the different modules.

PreferencesWindow(*args, **kwargs)

This class provides a simple dialog for displaying the preferences of the application.

class nqrduck.core.main_view.AboutModules(*args: Any, **kwargs: Any)#

This class provides a simple dialog for displaying information about the different modules.

It shows the module name and the version of the module.

Parameters:

parent (QWidget) – The parent widget of the dialog - this makes sure the dialog has the same style as the parent

class nqrduck.core.main_view.AboutNQRduck(*args: Any, **kwargs: Any)#

This class provides a simple dialog for displaying information about the application.

It shows the name of the application and the version of the application.

Parameters:

parent (QWidget) – The parent widget of the dialog - this makes sure the dialog has the same style as the parent

class nqrduck.core.main_view.ConfirmationDialog(*args: Any, **kwargs: Any)#

Opens up a dialog to confirm the changes which allows the user to revert the changes.

The dialog includes a timer that automatically closes the dialog after 15 seconds reverting the changes.

apply()#

Applies the changes and closes the dialog.

revert()#

Reverts the changes and closes the dialog.

timer_timeout()#

Updates the countdown label and closes the dialog after the countdown is over.

class nqrduck.core.main_view.LoggerWindow(*args: Any, **kwargs: Any)#

This class provides a simple dialog for displaying the log messages of the application.

It shows the log messages and the log level of the log message.

Parameters:

parent (QWidget) – The parent widget of the dialog - this makes sure the dialog has the same style as the parent

on_log_level_changed(level: str) None#

Changes the log level of the logger to the selected log level.

Parameters:

level (str) – The selected log level

update_logs()#

Updates the log messages in the text area.

class nqrduck.core.main_view.MainView(*args: Any, **kwargs: Any)#

The main view of the application.

This class provides the main view of the application. It contains the toolbar, the stacked widget for the different modules and the status bar.

Parameters:
  • main_model (MainModel) – The main model of the application

  • main_controller (MainController) – The main controller of the application

connect_signals() None#

Connects various signals to the according slots in the main view.

create_notification_dialog(notification: list) None#

Creates a notification dialog with the given message and type.

The type can be ‘Info’, ‘Warning’ or ‘Error’ and changes the color and symbol of the dialog.

Parameters:

notification (list) – The notification to display. It has the form [type, message]

on_about_modules() None#

Opens a dialog with information about the loaded modules.

on_about_nqrduck() None#

Opens a dialog with information about the application.

on_active_module_changed(module: nqrduck.module.module.Module) None#

Changes the current widget in the stacked widget to the view of the active module.

Args: module (Module) : The active module

on_logger() None#

Opens a dialog with the log messages of the application.

on_menu_bar_item_added(menu_name: str, actions: list, group: bool = None) None#

Adds a menu bar item to the main view.

Parameters:
  • menu_name (str) – The name of the menu bar item

  • actions (list) – A list of actions to add to the menu bar item if the items in the list are of type QActionGroup this group will be added to the menu bar item

  • group (bool) – If the actions are of type QActionGroup

on_module_loaded(module: nqrduck.module.module.Module) None#

Adds a module to the toolbar and connects the clicked signal to the according slot in the main view.

Also connects the widget_changed signal of the module to the according slot in the main view.

Parameters:

module (Module) – The module to add

on_module_widget_added(widget: PyQt6.QtWidgets.QWidget) None#

Adds a module widget to the stacked widget and sets it as the current widget.

Args: widget (QWidget) : The widget to add

on_preferences() None#

Opens a dialog with the preferences of the application.

on_settings_changed() None#

Updates the font of the application with the new settings.

on_tool_button_clicked(module_name)#

Changes the active module to the module with the given name.

Parameters:

module_name (str) – The name of the module to change to

update_mpl_parameters() None#

Updates the mpl parameters so the plots are adjusted to the current application settings.

class nqrduck.core.main_view.NotificationDialog(*args: Any, **kwargs: Any)#

This class provides a simple dialog for displaying notifications by the different modules.

It has a message it displays and a type. The type can be ‘Info’, ‘Warning’ or ‘Error’ and changes the color and symbol of the dialog.

Parameters:
  • notification (str) – The string that will be displayed in the dialog

  • parent (QWidget) – The parent widget of the dialog - this makes sure the dialog has the same style as the parent

class nqrduck.core.main_view.PreferencesWindow(*args: Any, **kwargs: Any)#

This class provides a simple dialog for displaying the preferences of the application.

It shows the preferences of the application and allows the user to change them.

Parameters:

parent (QWidget) – The parent widget of the dialog - this makes sure the dialog has the same style as the parent

on_dark_mode_changed(state: int) None#

Enables or disables dark mode for the application.

Parameters:

state (int) – The state of the check box

on_font_changed(font: str) None#

Changes the font of the application to the selected font.

Parameters:

font (str) – The selected font

on_font_size_changed(font_size: int) None#

Changes the font size of the application to the selected font size.

Parameters:

font_size (str) – The selected font size

on_move_down(module: str) None#

Moves the selected module down in the module order.

Parameters:

module (str) – The selected module

on_move_up(module: str) None#

Moves the selected module up in the module order.

Parameters:

module (str) – The selected module

on_ok_button() None#

Opens up a dialog to confirm the changes. which allows the user to revert the changes.

on_reset_settings() None#

Resets the settings of the application to the default settings.

on_style_factory_changed(style_factory: str) None#

Changes the style factory of the application to the selected style factory.

Parameters:

style_factory (str) – The selected style factory

update_module_order_table()#

Updates the module order table with the new module order.

update_settings(settings: dict) None#

Updates the settings of the application with the given settings.

Parameters:

settings (dict) – The new settings