Class: QgsTableWidgetBase

Base widget allowing to edit 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 to edit a QVariantMap, using a table.

QgsListWidget

Widget allowing to edit 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.

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

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.