BPS C++ API  2.24.4
bpssortfilterproxymodel.h
Go to the documentation of this file.
1 
4 #ifndef BPSSORTFILTERPROXYMODEL_H
5 #define BPSSORTFILTERPROXYMODEL_H
6 
7 #include "bpsgui_global.h"
8 #include <QSortFilterProxyModel>
9 
10 class BpsTable;
11 
20 {
21  Q_OBJECT
23 
24 public:
28  BpsSortFilterProxyModel(QObject* aParent = nullptr);
29 
35  QModelIndexList mapListFromSource(const QModelIndexList& aSourceIndexList) const;
36 
42  QModelIndexList mapListToSource(const QModelIndexList& aProxyIndexList) const;
43 
50 
58  void setColumnSortRole(int aColumn, int aRole);
59 
65  int columnSortRole(int aColumn) const;
66 
72 
73 protected:
83  virtual bool lessThan(const QModelIndex& aLeft, const QModelIndex& aRight ) const;
84 
85 }; // BpsSortFilterProxyModel
86 
87 #endif // BPSSORTFILTERPROXYMODEL_H
#define BPS_PRIVATE(Class)
Declare pointer to private object in a public class.
Definition: bpsglobals.h:102
Public include file for BPS GUI library macros.
#define BPSGUI_EXPORT
Declare class an import from the shared library.
Definition: bpsgui_global.h:22
Derived from QSortFilterProxyModel with enhancements for BPS.
Definition: bpssortfilterproxymodel.h:20
BpsSortFilterProxyModel(QObject *aParent=nullptr)
void setColumnSortRole(int aColumn, int aRole)
Sets a special sort role for a distinct column.
virtual bool lessThan(const QModelIndex &aLeft, const QModelIndex &aRight) const
Compares the sortRole() if set in the left item, and Qt::DisplayRole otherwise.
void setColumnSortRoles(BpsTable *aTable)
Sets special sort roles for all columns from a table specification.
QModelIndexList mapListToSource(const QModelIndexList &aProxyIndexList) const
Convenience function to convert a list of proxy into source model indexes.
QModelIndexList mapListFromSource(const QModelIndexList &aSourceIndexList) const
Convenience function to convert a list of source into proxy model indexes.
int columnSortRole(int aColumn) const
Get the special role for a distinct column.
QModelIndex firstIndex(const QModelIndex &aParent=QModelIndex())
Get index of first item.
Database table descriptor.
Definition: bpstable.h:19