populse_mia.user_interface.data_viewer.data_viewer_tab¶
Populse_mia data viewer GUI interface (in the “Data Viewer” tab).
Classes
|
A flexible and extensible widget for managing data viewers in a GUI application. |
- class populse_mia.user_interface.data_viewer.data_viewer_tab.DataViewerTab(main_window)[source]¶
Bases:
QWidgetA flexible and extensible widget for managing data viewers in a GUI application.
This widget provides a dynamic interface for loading and switching between different data viewers. Key features include:
Automatic discovery of viewers in the data_viewer directory
Graceful handling of viewer import failures
Ability to dynamically add new viewers
Centralized document and project management across viewers
Contains:
Methods:
activate_viewer: Activates viewer which was selected in the combobox.
change_viewer: Switches to viewer selected in the combobox.
clear: Clears all loaded viewers before closing Mia.
closeEvent: Clears and closes all events before closing Mia.
current_viewer: Return current viewer (selected viewer in combobox).
load_viewer: Load a viewer.
set_documents: Shares project with documents to all viewers.
- __init__(main_window)[source]¶
Initialize the DataViewerTab with a reference to the main window.
- Parameters:
main_window – (Qt.QMainWindow) The main application window providing context and potential shared resources.
- activate_viewer(viewer_name)[source]¶
Activate a specific viewer by name.
- Parameters:
viewer_name – (str) Name of the viewer to activate.
- change_viewer()[source]¶
Handle viewer change event triggered by the combobox.
Retrieves the selected viewer, activates it, and ensures that the current project and documents are set.
- clear()[source]¶
Clean up and close all loaded viewers.
Called before closing the application to ensure proper resource management.
- closeEvent(event)[source]¶
Override close event to ensure proper cleanup.
- Parameters:
event – (QCloseEvent) Close event triggered by the window system.
- current_viewer()[source]¶
Retrieve the name of the currently active viewer.
- Returns:
(str) Name of the current viewer, either from the current viewer tracking or the combobox selection.