The QAbstractFileIconProvider class provides file icons for the QFileSystemModel class. More...
Header: | #include <QAbstractFileIconProvider> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Gui) target_link_libraries(mytarget PRIVATE Qt6::Gui) |
qmake: | QT += gui |
Since: | Qt 6.0 |
Inherited By: |
enum | IconType { Computer, Desktop, Trashcan, Network, Drive, …, File } |
enum | Option { DontUseCustomDirectoryIcons } |
flags | Options |
QAbstractFileIconProvider() | |
virtual | ~QAbstractFileIconProvider() |
virtual QIcon | icon(QAbstractFileIconProvider::IconType type) const |
virtual QIcon | icon(const QFileInfo &info) const |
virtual QAbstractFileIconProvider::Options | options() const |
virtual void | setOptions(QAbstractFileIconProvider::Options options) |
virtual QString | type(const QFileInfo &info) const |
Constant | Value | Description |
---|---|---|
QAbstractFileIconProvider::Computer |
0 |
The icon used for the computing device as a whole |
QAbstractFileIconProvider::Desktop |
1 |
The icon for the special "Desktop" directory of the user |
QAbstractFileIconProvider::Trashcan |
2 |
The icon for the user's "Trash" place in the desktop's file manager |
QAbstractFileIconProvider::Network |
3 |
The icon for the “Network Servers” place in the desktop's file manager, and workgroups within the network |
QAbstractFileIconProvider::Drive |
4 |
The icon used for disk drives |
QAbstractFileIconProvider::Folder |
5 |
The standard folder icon used to represent directories on local filesystems |
QAbstractFileIconProvider::File |
6 |
The icon used for generic text file types |
Constant | Value | Description |
---|---|---|
QAbstractFileIconProvider::DontUseCustomDirectoryIcons |
0x00000001 |
Always use the default directory icon. Some platforms allow the user to set a different icon. Custom icon lookup cause a big performance impact over network or removable drives. |
The Options type is a typedef for QFlags<Option>. It stores an OR combination of Option values.
Constructs a file icon provider.
[virtual]
QAbstractFileIconProvider::~QAbstractFileIconProvider()Destroys the file icon provider.
[virtual]
QIcon QAbstractFileIconProvider::icon(QAbstractFileIconProvider::IconType type) constReturns an icon set for the given type, using the current icon theme.
See also QIcon::fromTheme.
[virtual]
QIcon QAbstractFileIconProvider::icon(const QFileInfo &info) constReturns an icon for the file described by info, using the current icon theme.
See also QIcon::fromTheme.
[virtual]
QAbstractFileIconProvider::Options QAbstractFileIconProvider::options() constReturns all the options that affect the icon provider. By default, all options are disabled.
See also setOptions().
[virtual]
void QAbstractFileIconProvider::setOptions(QAbstractFileIconProvider::Options options)Sets options that affect the icon provider.
See also options().
[virtual]
QString QAbstractFileIconProvider::type(const QFileInfo &info) constReturns the type of the file described by info.