LibrePCB Developers Documentation
SortFilterProxyModel Class Reference

A QSortFilterProxyModel subclass to implement custom sort behavior. More...

#include <sortfilterproxymodel.h>

Inherits QSortFilterProxyModel.

+ Collaboration diagram for SortFilterProxyModel:

Public Member Functions

 SortFilterProxyModel ()=delete
 
 SortFilterProxyModel (const SortFilterProxyModel &other)=delete
 
 SortFilterProxyModel (QObject *parent=nullptr) noexcept
 
virtual ~SortFilterProxyModel () noexcept
 
void setKeepHeaderColumnUnsorted (bool keep) noexcept
 
void setKeepLastRowAtBottom (bool keep) noexcept
 
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
 
SortFilterProxyModeloperator= (const SortFilterProxyModel &rhs) noexcept
 

Protected Member Functions

virtual bool lessThan (const QModelIndex &source_left, const QModelIndex &source_right) const override
 

Private Attributes

QCollator mCollator
 
bool mKeepHeaderColumnUnsorted
 
bool mKeepLastRowAtBottom
 

Detailed Description

A QSortFilterProxyModel subclass to implement custom sort behavior.

Features:

  • Use natural sort algorithm (e.g. to sort "X9" in front of "X10").
  • Optionally don't sort the last row (needed if the last row is used to add more items instead of displaying existing items).

Constructor & Destructor Documentation

◆ SortFilterProxyModel() [1/3]

◆ SortFilterProxyModel() [2/3]

SortFilterProxyModel ( const SortFilterProxyModel other)
delete

◆ SortFilterProxyModel() [3/3]

SortFilterProxyModel ( QObject *  parent = nullptr)
explicitnoexcept

◆ ~SortFilterProxyModel()

~SortFilterProxyModel ( )
virtualnoexcept

Member Function Documentation

◆ setKeepHeaderColumnUnsorted()

void setKeepHeaderColumnUnsorted ( bool  keep)
inlinenoexcept

◆ setKeepLastRowAtBottom()

void setKeepLastRowAtBottom ( bool  keep)
inlinenoexcept
+ Here is the call graph for this function:

◆ headerData()

QVariant headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const
override
+ Here is the caller graph for this function:

◆ operator=()

SortFilterProxyModel& operator= ( const SortFilterProxyModel rhs)
noexcept
+ Here is the caller graph for this function:

◆ lessThan()

bool lessThan ( const QModelIndex &  source_left,
const QModelIndex &  source_right 
) const
overrideprotectedvirtual
+ Here is the caller graph for this function:

Member Data Documentation

◆ mCollator

QCollator mCollator
private

◆ mKeepHeaderColumnUnsorted

bool mKeepHeaderColumnUnsorted
private

◆ mKeepLastRowAtBottom

bool mKeepLastRowAtBottom
private

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