pynaviz.qt.widget_menu#
Action and context classes
This module provides custom Qt widgets to create interactive menus for plots. Each menu allows the user to configure plot-specific behavior using GUI components such as dropdowns, spin boxes, and list views. The widgets are dynamically constructed based on metadata and plotting context.
Main Classes: - DropdownDialog: Dynamically generates a dialog with labeled input widgets. - MenuWidget: UI component to attach interactive actions and selections to a plot.
Functions
|
Constructs a QWidget (QComboBox or QDoubleSpinBox) with specified parameters. |
Classes
|
A popup dialog that dynamically creates widgets from metadata and applies a callback. |
|
Menu bar widget that allows all possible actions |
- class pynaviz.qt.widget_menu.DropdownDialog(title, widgets, func, ok_cancel_button=False, parent=None)[source]#
Bases:
QDialogA popup dialog that dynamically creates widgets from metadata and applies a callback.
- Parameters:
title (
str) – Title of the dialog window.widgets (
OrderedDict[str,dict]) – Keys are labels; values are widget parameter dictionaries.func (
Callable) – Function to call when selections are made.ok_cancel_button (
bool, optional) – Whether to display OK/Cancel buttons (default is False).parent (
QWidget, optional) – Parent widget.
- get_selections()[source]#
Extracts current selections from the widgets.
- Returns:
List of selected values from each widget.
- Return type:
- staticMetaObject = PySide6.QtCore.QMetaObject("DropdownDialog" inherits "QDialog": )#
- class pynaviz.qt.widget_menu.MenuWidget(metadata, plot, interval_sets=None, tsdframes=None)[source]#
Bases:
QWidgetMenu bar widget that allows all possible actions
- Parameters:
metadata (
dictorpd.DataFrameorNone) – Metadata associated with the plot.plot (
_BasePlot) – The plot instance this menu is attached to.interval_sets (
dict, optional) – Dictionary of interval sets that can be added to the plot. Specific to Tsd, TsdFrame and TsGroup plots.tsdframes (
dict, optional) – TsdFrame object for overlaying on TsdTensor plot or VideoWidget plot.
- show_overlay_menu(popup_name)[source]#
Opens the TsdFrame overlay selection dialog.
- Return type:
None
- staticMetaObject = PySide6.QtCore.QMetaObject("MenuWidget" inherits "QWidget": )#