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
- bool canFetchMore(const QModelIndex &parent) const
- bool hasChildren(const QModelIndex &parent = QModelIndex()) const
- void setSortFoldersFirst(bool foldersFirst)
- void setSortHiddenFilesLast(bool hiddenFilesLast)
- bool sortFoldersFirst() const
- bool sortHiddenFilesLast() const
- Qt::DropActions supportedDragOptions() const
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()