Skip to content

Commit b8f6423

Browse files
committed
SyncPlotWindow: added methods get_toolbar/manager
1 parent 302f7cc commit b8f6423

File tree

1 file changed

+42
-1
lines changed

1 file changed

+42
-1
lines changed

plotpy/plot/plotwidget.py

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ def __set_image_layout(self) -> None:
160160

161161
# Avoid circular import
162162
# pylint: disable=import-outside-toplevel
163-
from plotpy.panels.csection.cswidget import XCrossSection, YCrossSection
163+
from plotpy.panels.csection.cswidget import (XCrossSection,
164+
YCrossSection)
164165

165166
self.ycsw = YCrossSection(
166167
self,
@@ -430,6 +431,30 @@ def add_widget_to_grid_layout(
430431
class AbstractPlotDialogWindow(abc.ABC):
431432
"""Abstract base class for plot dialog and plot window"""
432433

434+
@abc.abstractmethod
435+
def get_plot(self) -> BasePlot | None:
436+
"""Return the plot object
437+
438+
Returns:
439+
BasePlot: The plot object
440+
"""
441+
442+
@abc.abstractmethod
443+
def get_toolbar(self) -> QW.QToolBar:
444+
"""Return main toolbar
445+
446+
Returns:
447+
The plot widget main toolbar
448+
"""
449+
450+
@abc.abstractmethod
451+
def get_manager(self) -> PlotManager:
452+
"""Return the plot manager
453+
454+
Returns:
455+
The plot widget manager
456+
"""
457+
433458
@abc.abstractmethod
434459
def setup_widget(
435460
self,
@@ -911,6 +936,22 @@ def __init__(
911936
self.addToolBar(self.toolbar)
912937
self.auto_tools = auto_tools
913938

939+
def get_toolbar(self) -> QW.QToolBar:
940+
"""Return main toolbar
941+
942+
Returns:
943+
The plot widget main toolbar
944+
"""
945+
return self.toolbar
946+
947+
def get_manager(self) -> PlotManager:
948+
"""Return the plot manager
949+
950+
Returns:
951+
The plot widget manager
952+
"""
953+
return self.manager
954+
914955
def finalize_configuration(self) -> None:
915956
"""Configure plot manager and register all tools"""
916957
self.subplotwidget.add_panels_to_manager()

0 commit comments

Comments
 (0)