19#include "moc_qgslayoutitemtexttable.cpp"
37 return tr(
"<Text table frame>" );
47 mRowText.append( row );
61 for (
const QStringList &row : std::as_const( mRowText ) )
65 for (
int i = 0; i <
mColumns.count(); ++i )
67 if ( i < row.count() )
69 currentRow << row.at( i );
73 currentRow << QString();
@ LayoutTextTable
Preset text table.
A text table item that reads text from string lists.
static QgsLayoutItemTextTable * create(QgsLayout *layout)
Returns a new QgsLayoutItemTextTable for the specified parent layout.
QgsLayoutItemTextTable(QgsLayout *layout)
Constructor for QgsLayoutItemTextTable, for the specified layout.
QString displayName() const override
Returns the multiframe display name.
bool getTableContents(QgsLayoutTableContents &contents) override
Fetches the contents used for the cells in the table.
int type() const override
Returns unique multiframe type id.
void addRow(const QStringList &row)
Adds a row to the table.
void setContents(const QVector< QStringList > &contents)
Sets the contents of the text table.
const QgsLayout * layout() const
Returns the layout the object is attached to.
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 recalculateTableSize()
Recalculates and updates the size of the table and all table frames.
QgsLayoutTableColumns mColumns
Columns to show in table.
QgsLayoutTableContents & contents()
Returns the current contents of the table.
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
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 QgsLayoutTable.