LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 ( const SortFilterProxyModel other)
noexcept
SortFilterProxyModel ( QObject *  parent = nullptr)
explicitnoexcept
~SortFilterProxyModel ( )
virtualnoexcept

Member Function Documentation

void setKeepLastRowAtBottom ( bool  keep)
inlinenoexcept
SortFilterProxyModel& operator= ( const SortFilterProxyModel rhs)
noexcept
bool lessThan ( const QModelIndex &  source_left,
const QModelIndex &  source_right 
) const
overrideprotectedvirtual

Member Data Documentation

QCollator mCollator
private
bool mKeepLastRowAtBottom
private

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