radioviz.views.sub_window
Sub-window view module for the radioviz application.
This module provides the SubWindow class which implements a
custom MDI sub-window for the application’s main window. It handles
window management events and integrates with the controller pattern
to manage the sub-window’s behavior.
Classes
|
Custom MDI sub-window implementation for the radioviz application. |
- class radioviz.views.sub_window.SubWindow(controller: T_SubWindowController, parent: QWidget | None = None)[source]
Bases:
QMdiSubWindow,Generic[T_SubWindowController]Custom MDI sub-window implementation for the radioviz application.
This class extends
QMdiSubWindowto provide specialized functionality for sub-windows within the application’s MDI interface. It manages the connection between the view and controller components and handles window closing events.Note
The signal payload is
(global_pos, controller).- Variables:
about_to_close (Signal) – Signal emitted when the sub-window is about to close
context_menu_requested (Signal) – Signal emitted when a context menu is requested
Initialize the sub-window view.
- Parameters:
controller (SubWindowController[Any]) – The controller instance managing this sub-window
parent (Optional[QWidget]) – Parent widget for this sub-window
- closeEvent(e: QCloseEvent) None[source]
Handle the close event for the sub-window.
This method is called when the user attempts to close the sub-window. It emits the
about_to_closesignal before calling the parent close event handler.- Parameters:
e (PySide6.QtGui.QCloseEvent) – The close event object
- on_data_state_changed() None[source]
Placeholder method for handling data state changes.
This method is currently a stub and does nothing. It is intended to be overridden by subclasses to implement specific behavior when data state changes occur.
- set_window_state(state: WindowState) None[source]
Set the window state to the specified state.
This method sets the window’s state based on the provided
WindowStateenum value. It calls the appropriate Qt show methods to achieve the desired window state.- Parameters:
state (WindowState) – The window state to set
- window_state() WindowState[source]
Get the current window state.
This method retrieves the current window state by checking the window’s state flags and returns the corresponding
WindowStateenum value.- Returns:
The current window state
- Return type: