QGIS API Documentation
3.12.1-București (121cc00ff0)
|
A model for displaying columns shown in a QgsLayoutAttributeTable. More...
#include <qgslayoutattributeselectiondialog.h>
Public Types | |
enum | ShiftDirection { ShiftUp, ShiftDown } |
Controls whether a row/column is shifted up or down. More... | |
Public Member Functions | |
QgsLayoutAttributeTableColumnModel (QgsLayoutItemAttributeTable *table, QObject *parent=nullptr) | |
Constructor for QgsLayoutAttributeTableColumnModel. More... | |
int | columnCount (const QModelIndex &parent=QModelIndex()) const override |
QgsLayoutTableColumn * | columnFromIndex (const QModelIndex &index) const |
Returns the QgsLayoutTableColumn corresponding to an index in the model. More... | |
QVariant | data (const QModelIndex &index, int role) const override |
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 |
QModelIndex | indexFromColumn (QgsLayoutTableColumn *column) |
Returns a QModelIndex corresponding to a QgsLayoutTableColumn in the model. More... | |
bool | insertRows (int row, int count, const QModelIndex &parent=QModelIndex()) override |
bool | moveColumnInSortRank (QgsLayoutTableColumn *column, ShiftDirection direction) |
Moves a column up or down in the sort rank for the QgsLayoutItemAttributeTable. More... | |
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 |
void | resetToLayer () |
Resets the attribute table's columns to match the source layer's fields. More... | |
int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
void | setColumnAsSorted (QgsLayoutTableColumn *column, Qt::SortOrder order) |
Sets a specified column as a sorted column in the QgsLayoutItemAttributeTable. More... | |
void | setColumnAsUnsorted (QgsLayoutTableColumn *column) |
Sets a specified column as an unsorted column in the QgsLayoutItemAttributeTable. More... | |
bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override |
A model for displaying columns shown in a QgsLayoutAttributeTable.
Definition at line 52 of file qgslayoutattributeselectiondialog.h.
Controls whether a row/column is shifted up or down.
Enumerator | |
---|---|
ShiftUp | Shift the row/column up. |
ShiftDown | Shift the row/column down. |
Definition at line 61 of file qgslayoutattributeselectiondialog.h.
QgsLayoutAttributeTableColumnModel::QgsLayoutAttributeTableColumnModel | ( | QgsLayoutItemAttributeTable * | table, |
QObject * | parent = nullptr |
||
) |
Constructor for QgsLayoutAttributeTableColumnModel.
table | QgsLayoutItemAttributeTable the model is attached to |
parent | optional parent |
Definition at line 41 of file qgslayoutattributeselectiondialog.cpp.
|
override |
Definition at line 73 of file qgslayoutattributeselectiondialog.cpp.
QgsLayoutTableColumn * QgsLayoutAttributeTableColumnModel::columnFromIndex | ( | const QModelIndex & | index | ) | const |
Returns the QgsLayoutTableColumn corresponding to an index in the model.
Definition at line 340 of file qgslayoutattributeselectiondialog.cpp.
|
override |
Definition at line 79 of file qgslayoutattributeselectiondialog.cpp.
|
override |
Definition at line 264 of file qgslayoutattributeselectiondialog.cpp.
|
override |
Definition at line 174 of file qgslayoutattributeselectiondialog.cpp.
|
override |
Definition at line 47 of file qgslayoutattributeselectiondialog.cpp.
QModelIndex QgsLayoutAttributeTableColumnModel::indexFromColumn | ( | QgsLayoutTableColumn * | column | ) |
Returns a QModelIndex corresponding to a QgsLayoutTableColumn in the model.
Definition at line 346 of file qgslayoutattributeselectiondialog.cpp.
|
override |
Definition at line 294 of file qgslayoutattributeselectiondialog.cpp.
bool QgsLayoutAttributeTableColumnModel::moveColumnInSortRank | ( | QgsLayoutTableColumn * | column, |
ShiftDirection | direction | ||
) |
Moves a column up or down in the sort rank for the QgsLayoutItemAttributeTable.
Definition at line 402 of file qgslayoutattributeselectiondialog.cpp.
bool QgsLayoutAttributeTableColumnModel::moveRow | ( | int | row, |
ShiftDirection | direction | ||
) |
Moves the specified row up or down in the model.
Used for rearranging the attribute tables columns.
row | row in model representing attribute table column to move |
direction | direction to move the attribute table column |
Definition at line 308 of file qgslayoutattributeselectiondialog.cpp.
|
override |
Definition at line 59 of file qgslayoutattributeselectiondialog.cpp.
|
override |
Definition at line 278 of file qgslayoutattributeselectiondialog.cpp.
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 333 of file qgslayoutattributeselectiondialog.cpp.
|
override |
Definition at line 65 of file qgslayoutattributeselectiondialog.cpp.
void QgsLayoutAttributeTableColumnModel::setColumnAsSorted | ( | QgsLayoutTableColumn * | column, |
Qt::SortOrder | order | ||
) |
Sets a specified column as a sorted column in the QgsLayoutItemAttributeTable.
The column will be added to the end of the sort rank list, ie it will take the next largest available sort rank.
Definition at line 364 of file qgslayoutattributeselectiondialog.cpp.
void QgsLayoutAttributeTableColumnModel::setColumnAsUnsorted | ( | QgsLayoutTableColumn * | column | ) |
Sets a specified column as an unsorted column in the QgsLayoutItemAttributeTable.
The column will be removed from the sort rank list.
Definition at line 385 of file qgslayoutattributeselectiondialog.cpp.
|
override |
Definition at line 214 of file qgslayoutattributeselectiondialog.cpp.