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.

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]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.