Class: QgsTableWidgetBase

Base widget allowing editing a collection, using a table.

This widget includes buttons to add and remove rows. Child classes must call init(QAbstractTableModel*) from their constructor.

Class Hierarchy

Inheritance diagram of qgis.gui.QgsTableWidgetBase

Base classes

QWidget

QObject

QPaintDevice

Subclasses

QgsKeyValueWidget

Widget allowing editing a QVariantMap, using a table.

QgsListWidget

Widget allowing editing a QVariantList, using a table.

Methods

init

Initialize the table with the given model.

isReadOnly

Returns True if the widget is shown in a read-only state.

Virtual Methods

In PyQGIS, only methods marked as virtual can be safely overridden in a Python subclass of QgsTableWidgetBase. See the FAQ for more details.

setReadOnly

Sets whether the widget should be shown in a read-only state.

Signals

valueChanged

Emitted each time a key or a value is changed.

class qgis.gui.QgsTableWidgetBase[source]

Bases: QWidget

__init__(parent: QWidget | None)

Constructor.

Parameters:

parent (Optional[QWidget])

init(self, model: QAbstractTableModel | None)[source]

Initialize the table with the given model. Must be called once in the child class’ constructor.

Parameters:

model (Optional[QAbstractTableModel])

isReadOnly(self) bool[source]

Returns True if the widget is shown in a read-only state.

See also

setReadOnly()

Added in version 3.38.

Return type:

bool

virtual setReadOnly(self, readOnly: bool)[source]

Sets whether the widget should be shown in a read-only state.

See also

isReadOnly()

Added in version 3.38.

Parameters:

readOnly (bool)

signal valueChanged[source]

Emitted each time a key or a value is changed.