QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
Public Member Functions | List of all members
QgsLayoutAttributeTableColumnModel Class Reference

A model for displaying columns shown in a QgsLayoutAttributeTable. More...

#include <qgslayoutattributeselectiondialog.h>

Inheritance diagram for QgsLayoutAttributeTableColumnModel:
Inheritance graph
[legend]

Public Member Functions

 QgsLayoutAttributeTableColumnModel (QgsLayoutItemAttributeTable *table, QObject *parent=nullptr)
 Constructor for QgsLayoutAttributeTableColumnModel. More...
 
QVector< QgsLayoutTableColumn > & columns () const override
 To be reimplemented to provide the display or the sort columns. More...
 
QList< ColumndisplayedColumns () const override
 To be reimplemented to choose which column should be used by the model. More...
 
void resetToLayer ()
 Resets the attribute table's columns to match the source layer's fields. More...
 
- Public Member Functions inherited from QgsLayoutAttributeTableColumnModelBase
 QgsLayoutAttributeTableColumnModelBase (QgsLayoutItemAttributeTable *table, QObject *parent=nullptr)
 Constructor for QgsLayoutAttributeTableColumnModel. More...
 
int columnCount (const QModelIndex &parent=QModelIndex()) const override
 
virtual QVector< QgsLayoutTableColumn > & columns () const =0
 To be reimplemented to provide the display or the sort columns. More...
 
QVariant data (const QModelIndex &index, int role) const override
 
virtual QList< ColumndisplayedColumns () const =0
 To be reimplemented to choose which column should be used by the model. More...
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
 
QModelIndex index (int row, int column, const QModelIndex &parent) const override
 
bool insertRows (int row, int count, const QModelIndex &parent=QModelIndex()) override
 
bool moveRow (int row, ShiftDirection direction)
 Moves the specified row up or down in the model. More...
 
QModelIndex parent (const QModelIndex &child) const override
 
bool removeRows (int row, int count, const QModelIndex &parent=QModelIndex()) override
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
 

Additional Inherited Members

- Public Types inherited from QgsLayoutAttributeTableColumnModelBase
enum  Column {
  Attribute , Heading , Alignment , Width ,
  SortOrder
}
 Available columns for the configuration table to be used by the model. More...
 
enum  ShiftDirection { ShiftUp , ShiftDown }
 Controls whether a row/column is shifted up or down. More...
 
- Protected Attributes inherited from QgsLayoutAttributeTableColumnModelBase
QgsLayoutItemAttributeTablemTable = nullptr
 

Detailed Description

A model for displaying columns shown in a QgsLayoutAttributeTable.

Note
This class is not a part of public API
Since
QGIS 3.12

Definition at line 125 of file qgslayoutattributeselectiondialog.h.

Constructor & Destructor Documentation

◆ QgsLayoutAttributeTableColumnModel()

QgsLayoutAttributeTableColumnModel::QgsLayoutAttributeTableColumnModel ( QgsLayoutItemAttributeTable table,
QObject *  parent = nullptr 
)
inline

Constructor for QgsLayoutAttributeTableColumnModel.

Parameters
tableQgsLayoutItemAttributeTable the model is attached to
parentoptional parent

Definition at line 136 of file qgslayoutattributeselectiondialog.h.

Member Function Documentation

◆ columns()

QVector< QgsLayoutTableColumn > & QgsLayoutAttributeTableColumnModel::columns ( ) const
overridevirtual

To be reimplemented to provide the display or the sort columns.

Implements QgsLayoutAttributeTableColumnModelBase.

Definition at line 342 of file qgslayoutattributeselectiondialog.cpp.

◆ displayedColumns()

QList< Column > QgsLayoutAttributeTableColumnModel::displayedColumns ( ) const
inlineoverridevirtual

To be reimplemented to choose which column should be used by the model.

Implements QgsLayoutAttributeTableColumnModelBase.

Definition at line 142 of file qgslayoutattributeselectiondialog.h.

◆ resetToLayer()

void QgsLayoutAttributeTableColumnModel::resetToLayer ( )

Resets the attribute table's columns to match the source layer's fields.

Remove all existing attribute table columns and column customizations.

Definition at line 347 of file qgslayoutattributeselectiondialog.cpp.


The documentation for this class was generated from the following files: