Pages
API Documentation
On this page

KDirSortFilterProxyModel Class

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

  • Header: #include <KDirSortFilterProxyModel>
  • CMake: find_package(KF6 REQUIRED COMPONENTS KIO)
    target_link_libraries(mytarget PRIVATE KF6::KIOFileWidgets)

List of all members, including inherited members

Public Functions

Static Public Members

Detailed Description

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.

Member Function Documentation

[override virtual] bool KDirSortFilterProxyModel::canFetchMore(const QModelIndex &parent) const

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

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

Returns true for directories.

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

Returns the permissions in "points". This is useful for sorting by permissions.

void KDirSortFilterProxyModel::setSortFoldersFirst(bool foldersFirst)

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

See also sortFoldersFirst()

void KDirSortFilterProxyModel::setSortHiddenFilesLast(bool hiddenFilesLast)

Sets a separate sorting with hidden files and folders last (true) or not (false).

See also sortHiddenFilesLast()

bool KDirSortFilterProxyModel::sortFoldersFirst() const

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

See also setSortFoldersFirst()

bool KDirSortFilterProxyModel::sortHiddenFilesLast() const

See also setSortHiddenFilesLast()

Qt::DropActions KDirSortFilterProxyModel::supportedDragOptions() const

We use cookies to personalize content and to analyze our traffic. Please decide if you are willing to accept cookies from our website.