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) noexcept
 
 SortFilterProxyModel (QObject *parent=nullptr) noexcept
 
virtual ~SortFilterProxyModel () noexcept
 
void setKeepLastRowAtBottom (bool keep) noexcept
 
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 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)
noexcept

◆ SortFilterProxyModel() [3/3]

SortFilterProxyModel ( QObject *  parent = nullptr)
explicitnoexcept

◆ ~SortFilterProxyModel()

~SortFilterProxyModel ( )
virtualnoexcept

Member Function Documentation

◆ setKeepLastRowAtBottom()

void setKeepLastRowAtBottom ( bool  keep)
inlinenoexcept
+ Here is the call 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

◆ mKeepLastRowAtBottom

bool mKeepLastRowAtBottom
private

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