Class: QgsLayoutItemTextTable

class qgis.core.QgsLayoutItemTextTable(layout: QgsLayout)

Bases: qgis._core.QgsLayoutTable

Constructor for QgsLayoutItemTextTable, for the specified layout.

Ownership is transferred to the layout.

A text table item that reads text from string lists

addRow(self, row: Iterable[str])

Adds a row to the table

Parameters:row – list of strings to use for each cell’s value in the newly added row

Note

If row is shorter than the number of columns in the table than blank cells will be inserted at the end of the row. If row contains more strings then the number of columns in the table then these extra strings will be ignored.

Note

if adding many rows, setContents() is much faster

calculateMaxColumnWidths()
calculateMaxRowHeights()
childEvent()
connectNotify()
contentsContainsRow()
create(layout: QgsLayout) → QgsLayoutItemTextTable

Returns a new QgsLayoutItemTextTable for the specified parent layout.

customEvent()
disconnectNotify()
displayName(self) → str
drawHorizontalGridLines()
getTableContents(self, contents: object) → bool
isSignalConnected()
readObjectPropertiesFromElement()
recalculateTableSize()
receivers()
rowRange()
rowsVisible()
sender()
senderSignalIndex()
setContents(self, contents: object)

Sets the contents of the text table.

Parameters:contents – list of table rows

See also

addRow()

timerEvent()
totalHeight()
totalWidth()
type(self) → int
writeObjectPropertiesToElement()