36 return tr(
"<Text table frame>" );
46 mRowText.append( row );
60 for (
const QStringList &row : qgis::as_const( mRowText ) )
64 for (
int i = 0; i <
mColumns.count(); ++i )
66 if ( i < row.count() )
68 currentRow << row.at( i );
72 currentRow << QString();
75 contents << currentRow;
QgsLayoutItemTextTable(QgsLayout *layout)
Constructor for QgsLayoutItemTextTable, for the specified layout.
int type() const override
Returns unique multiframe type id.
static QgsLayoutItemTextTable * create(QgsLayout *layout)
Returns a new QgsLayoutItemTextTable for the specified parent layout.
A class to display a table in the print layout, and allow the table to span over multiple frames...
virtual void refreshAttributes()
Refreshes the contents shown in the table by querying for new data.
void setContents(const QVector< QStringList > &contents)
Sets the contents of the text table.
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
void addRow(const QStringList &row)
Adds a row to the table.
QString displayName() const override
Returns the multiframe display name.
QgsLayoutTableColumns mColumns
Columns to show in table.
QgsLayoutTableContents & contents()
Returns the current contents of the table.
bool getTableContents(QgsLayoutTableContents &contents) override
Fetches the contents used for the cells in the table.
const QgsLayout * layout() const
Returns the layout the object is attached to.
A text table item that reads text from string lists.
QVector< QgsLayoutTableRow > QgsLayoutTableContents
List of QgsLayoutTableRows, representing rows and column cell contents for a QgsLayoutTable.
QVector< QVariant > QgsLayoutTableRow
List of QVariants, representing a the contents of a single row in a QgsComposerTable.
void recalculateTableSize()
Recalculates and updates the size of the table and all table frames.