• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KFile

Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
KDirSortFilterProxyModel Class Reference

#include <kdirsortfilterproxymodel.h>

Inheritance diagram for KDirSortFilterProxyModel:
KCategorizedSortFilterProxyModel QSortFilterProxyModel

Public Member Functions

 KDirSortFilterProxyModel (QObject *parent=0)
virtual ~KDirSortFilterProxyModel ()
virtual bool canFetchMore (const QModelIndex &parent) const
virtual bool hasChildren (const QModelIndex &parent=QModelIndex()) const
void setSortFoldersFirst (bool foldersFirst)
bool sortFoldersFirst () const
Public Member Functions inherited from KCategorizedSortFilterProxyModel
 KCategorizedSortFilterProxyModel (QObject *parent=0)
virtual ~KCategorizedSortFilterProxyModel ()
bool isCategorizedModel () const
void setCategorizedModel (bool categorizedModel)
void setSortCategoriesByNaturalComparison (bool sortCategoriesByNaturalComparison)
virtual void sort (int column, Qt::SortOrder order=Qt::AscendingOrder)
bool sortCategoriesByNaturalComparison () const
int sortColumn () const
Qt::SortOrder sortOrder () const

Static Public Member Functions

static int pointsForPermissions (const QFileInfo &info)
Static Public Member Functions inherited from KCategorizedSortFilterProxyModel
static int naturalCompare (const QString &a, const QString &b)

Protected Member Functions

virtual bool subSortLessThan (const QModelIndex &left, const QModelIndex &right) const
Protected Member Functions inherited from KCategorizedSortFilterProxyModel
virtual int compareCategories (const QModelIndex &left, const QModelIndex &right) const
virtual bool lessThan (const QModelIndex &left, const QModelIndex &right) const

Additional Inherited Members

Public Types inherited from KCategorizedSortFilterProxyModel
enum  AdditionalRoles
Public Attributes inherited from KCategorizedSortFilterProxyModel
 CategoryDisplayRole
 CategorySortRole

Detailed Description

Acts as proxy model for KDirModel to sort and filter KFileItems.

A natural sorting is done. This means that items like:

  • item_10.png
  • item_1.png
  • item_2.png

are sorted like

  • item_1.png
  • item_2.png
  • item_10.png

Don't use it with non-KDirModel derivatives.

Author
Dominic Battre, Martin Pool and Peter Penz

Definition at line 50 of file kdirsortfilterproxymodel.h.

Constructor & Destructor Documentation

◆ KDirSortFilterProxyModel()

KDirSortFilterProxyModel::KDirSortFilterProxyModel ( QObject * parent = 0)

Definition at line 78 of file kdirsortfilterproxymodel.cpp.

◆ ~KDirSortFilterProxyModel()

KDirSortFilterProxyModel::~KDirSortFilterProxyModel ( )
virtual

Definition at line 90 of file kdirsortfilterproxymodel.cpp.

Member Function Documentation

◆ canFetchMore()

bool KDirSortFilterProxyModel::canFetchMore ( const QModelIndex & parent) const
virtual

Reimplemented from QAbstractItemModel.

Returns true for 'empty' directories so they can be populated later.

Definition at line 101 of file kdirsortfilterproxymodel.cpp.

◆ hasChildren()

bool KDirSortFilterProxyModel::hasChildren ( const QModelIndex & parent = QModelIndex()) const
virtual

Reimplemented from QAbstractItemModel.

Returns true for directories.

Definition at line 95 of file kdirsortfilterproxymodel.cpp.

◆ pointsForPermissions()

int KDirSortFilterProxyModel::pointsForPermissions ( const QFileInfo & info)
static

Returns the permissions in "points".

This is useful for sorting by permissions.

Definition at line 107 of file kdirsortfilterproxymodel.cpp.

◆ setSortFoldersFirst()

void KDirSortFilterProxyModel::setSortFoldersFirst ( bool foldersFirst)

Choose if files and folders are sorted separately (with folders first) or not.

Since
4.3

Definition at line 128 of file kdirsortfilterproxymodel.cpp.

◆ sortFoldersFirst()

bool KDirSortFilterProxyModel::sortFoldersFirst ( ) const

Returns if files and folders are sorted separately (with folders first) or not.

Since
4.3

Definition at line 133 of file kdirsortfilterproxymodel.cpp.

◆ subSortLessThan()

bool KDirSortFilterProxyModel::subSortLessThan ( const QModelIndex & left,
const QModelIndex & right ) const
protectedvirtual

Reimplemented from KCategorizedSortFilterProxyModel.

Reimplemented from KCategorizedSortFilterProxyModel.

Definition at line 138 of file kdirsortfilterproxymodel.cpp.


The documentation for this class was generated from the following files:
  • kdirsortfilterproxymodel.h
  • kdirsortfilterproxymodel.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Tue Mar 25 2025 00:00:00 by doxygen 1.14.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KFile

Skip menu "KFile"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal