KFileItemList Class

Header: #include <KFileItem>
CMake: find_package(KF6 REQUIRED COMPONENTS KIO)
target_link_libraries(mytarget PRIVATE KF6::KIOCore)
Inherits: QList

Public Functions

KFileItemList()
KFileItemList(const QList<KFileItem> &items)
(since 5.76) KFileItemList(std::initializer_list<KFileItem> items)
KFileItem findByName(const QString &fileName) const
KFileItem findByUrl(const QUrl &url) const
(since 4.2) QList<QUrl> targetUrlList() const
QList<QUrl> urlList() const

Detailed Description

List of KFileItem, which adds a few helper methods to QList<KFileItem>.

Member Function Documentation

KFileItemList::KFileItemList()

Creates an empty list of file items.

KFileItemList::KFileItemList(const QList<KFileItem> &items)

Creates a new KFileItemList from a QList of file items.

[since 5.76] KFileItemList::KFileItemList(std::initializer_list<KFileItem> items)

Creates a new KFileItemList from an initializer_list of file items.

This function was introduced in 5.76.

KFileItem KFileItemList::findByName(const QString &fileName) const

Find a KFileItem by name and return it.

Returns the item with the given name, or a null-item if none was found (see KFileItem::isNull())

KFileItem KFileItemList::findByUrl(const QUrl &url) const

Find a KFileItem by URL and return it.

Returns the item with the given URL, or a null-item if none was found (see KFileItem::isNull())

[since 4.2] QList<QUrl> KFileItemList::targetUrlList() const

Returns the list of target URLs that those items represent

This function was introduced in 4.2.

QList<QUrl> KFileItemList::urlList() const

Returns the list of URLs that those items represent