Skip to content

tabwidget

sgp.ui.widgets.tabwidget.FigureCanvas module-attribute

FigureCanvas = CustomFigureCanvasQTAgg

sgp.ui.widgets.tabwidget.TabWidget

Bases: QTabWidget

Tab widget with methods for adding tabs of any types.

sgp.ui.widgets.tabwidget.TabWidget.figures property

figures: dict[str, Figure]

Get all figures.

sgp.ui.widgets.tabwidget.TabWidget.addAnyTab

addAnyTab(widget: Type | QWidget, title: str, *args, **kwargs)

Add any tab to the tab widget.

PARAMETER DESCRIPTION
widget

A class or instance of the tab.

TYPE: Type | QWidget

title

The title of the tab.

TYPE: str

*args

The arguments and keyword arguments for the tab.

DEFAULT: ()

**kwargs

The arguments and keyword arguments for the tab.

DEFAULT: ()

sgp.ui.widgets.tabwidget.TabWidget.addFigureTab

addFigureTab(window: MainWindow, canvas: FigureCanvas)

Add a figure tab to the tab widget.

PARAMETER DESCRIPTION
window

The window to be displayed in the tab.

TYPE: MainWindow

canvas

The canvas to be displayed in the window.

TYPE: FigureCanvas

sgp.ui.widgets.tabwidget.TabWidget.addTableTab

addTableTab(data, title: str) -> TableWidget

Add a table tab to the tab widget.

PARAMETER DESCRIPTION
title

The title of the tab.

TYPE: str

data

The data to be displayed in the table.

TYPE: dict

sgp.ui.widgets.tabwidget.TabWidget.getCanvas

getCanvas(label: str) -> FigureCanvas

Get canvas with given label.

sgp.ui.widgets.tabwidget.TabWidget.getFigure

getFigure(label: str) -> Figure

Get figure with given label.