QGIS API Documentation  3.12.1-BucureČ™ti (121cc00ff0)
Public Types | Public Member Functions | Protected Member Functions | List of all members
QgsLayoutTableSortColumnsProxyModel Class Reference

Allows for filtering QgsComposerAttributeTable columns by columns which are sorted or unsorted. More...

#include <qgslayoutattributeselectiondialog.h>

Inheritance diagram for QgsLayoutTableSortColumnsProxyModel:
Inheritance graph
[legend]

Public Types

enum  ColumnFilterType { ShowSortedColumns, ShowUnsortedColumns }
 Controls whether the proxy model shows sorted or unsorted columns. More...
 

Public Member Functions

 QgsLayoutTableSortColumnsProxyModel (QgsLayoutItemAttributeTable *table, ColumnFilterType filterType, QObject *parent=nullptr)
 Constructor for QgsLayoutTableSortColumnsProxyModel. More...
 
int columnCount (const QModelIndex &parent=QModelIndex()) const override
 
QgsLayoutTableColumncolumnFromIndex (const QModelIndex &index) const
 Returns the QgsLayoutTableColumn corresponding to an index in the proxy model. More...
 
QgsLayoutTableColumncolumnFromRow (int row)
 Returns the QgsLayoutTableColumn corresponding to a row in the proxy model. More...
 
QgsLayoutTableColumncolumnFromSourceIndex (const QModelIndex &sourceIndex) const
 Returns the QgsLayoutTableColumn corresponding to an index from the source QgsLayoutItemAttributeTableColumnModel 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
 
bool lessThan (const QModelIndex &left, const QModelIndex &right) const override
 
void resetFilter ()
 Invalidates the current filter used by the proxy model. More...
 
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
 

Protected Member Functions

bool filterAcceptsRow (int source_row, const QModelIndex &source_parent) const override
 

Detailed Description

Allows for filtering QgsComposerAttributeTable columns by columns which are sorted or unsorted.

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

Definition at line 144 of file qgslayoutattributeselectiondialog.h.

Member Enumeration Documentation

◆ ColumnFilterType

Controls whether the proxy model shows sorted or unsorted columns.

Enumerator
ShowSortedColumns 

Show only sorted columns.

ShowUnsortedColumns 

Show only unsorted columns.

Definition at line 153 of file qgslayoutattributeselectiondialog.h.

Constructor & Destructor Documentation

◆ QgsLayoutTableSortColumnsProxyModel()

QgsLayoutTableSortColumnsProxyModel::QgsLayoutTableSortColumnsProxyModel ( QgsLayoutItemAttributeTable table,
ColumnFilterType  filterType,
QObject *  parent = nullptr 
)

Constructor for QgsLayoutTableSortColumnsProxyModel.

Parameters
tableQgsLayoutItemAttributeTable the model is attached to
filterTypefilter for columns, controls whether sorted or unsorted columns are shown
parentoptional parent

Definition at line 456 of file qgslayoutattributeselectiondialog.cpp.

Member Function Documentation

◆ columnCount()

int QgsLayoutTableSortColumnsProxyModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const
override

Definition at line 517 of file qgslayoutattributeselectiondialog.cpp.

◆ columnFromIndex()

QgsLayoutTableColumn * QgsLayoutTableSortColumnsProxyModel::columnFromIndex ( const QModelIndex &  index) const

Returns the QgsLayoutTableColumn corresponding to an index in the proxy model.

See also
columnFromRow()
columnFromSourceIndex()

Definition at line 487 of file qgslayoutattributeselectiondialog.cpp.

◆ columnFromRow()

QgsLayoutTableColumn * QgsLayoutTableSortColumnsProxyModel::columnFromRow ( int  row)

Returns the QgsLayoutTableColumn corresponding to a row in the proxy model.

See also
columnFromIndex()

Definition at line 636 of file qgslayoutattributeselectiondialog.cpp.

◆ columnFromSourceIndex()

QgsLayoutTableColumn * QgsLayoutTableSortColumnsProxyModel::columnFromSourceIndex ( const QModelIndex &  sourceIndex) const

Returns the QgsLayoutTableColumn corresponding to an index from the source QgsLayoutItemAttributeTableColumnModel model.

See also
columnFromRow()
columnFromIndex()

Definition at line 494 of file qgslayoutattributeselectiondialog.cpp.

◆ data()

QVariant QgsLayoutTableSortColumnsProxyModel::data ( const QModelIndex &  index,
int  role 
) const
override

Definition at line 523 of file qgslayoutattributeselectiondialog.cpp.

◆ filterAcceptsRow()

bool QgsLayoutTableSortColumnsProxyModel::filterAcceptsRow ( int  source_row,
const QModelIndex &  source_parent 
) const
overrideprotected

Definition at line 464 of file qgslayoutattributeselectiondialog.cpp.

◆ flags()

Qt::ItemFlags QgsLayoutTableSortColumnsProxyModel::flags ( const QModelIndex &  index) const
override

Definition at line 597 of file qgslayoutattributeselectiondialog.cpp.

◆ headerData()

QVariant QgsLayoutTableSortColumnsProxyModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const
override

Definition at line 563 of file qgslayoutattributeselectiondialog.cpp.

◆ lessThan()

bool QgsLayoutTableSortColumnsProxyModel::lessThan ( const QModelIndex &  left,
const QModelIndex &  right 
) const
override

Definition at line 502 of file qgslayoutattributeselectiondialog.cpp.

◆ resetFilter()

void QgsLayoutTableSortColumnsProxyModel::resetFilter ( )

Invalidates the current filter used by the proxy model.

Definition at line 642 of file qgslayoutattributeselectiondialog.cpp.

◆ setData()

bool QgsLayoutTableSortColumnsProxyModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role = Qt::EditRole 
)
override

Definition at line 610 of file qgslayoutattributeselectiondialog.cpp.


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