QAbstractFileIconProvider 类提供文件图标为 QFileSystemModel 类。 更多...
头: | #include <QAbstractFileIconProvider> |
CMake: |
find_package(Qt6 COMPONENTS Gui REQUIRED)
target_link_libraries(mytarget PRIVATE Qt6::Gui) |
qmake: | QT += gui |
Since: | Qt 6.0 |
继承者: | QFileIconProvider |
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 |
常量 | 值 | 描述 |
---|---|---|
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 |
常量 | 值 | 描述 |
---|---|---|
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. |
Options 类型是 typedef 对于 QFlags <Option>。它存储 Option 值的 OR 组合。
构造文件图标提供程序。
[虚拟]
QAbstractFileIconProvider::
~QAbstractFileIconProvider
()
销毁文件图标提供程序。
[虚拟]
QIcon
QAbstractFileIconProvider::
icon
(
QAbstractFileIconProvider::IconType
type
) const
Returns an icon set for the given type ,使用当前图标主题。
另请参阅 QIcon::fromTheme .
[虚拟]
QIcon
QAbstractFileIconProvider::
icon
(const
QFileInfo
&
info
) const
Returns an icon for the file described by info ,使用当前图标主题。
另请参阅 QIcon::fromTheme .
[虚拟]
QAbstractFileIconProvider::Options
QAbstractFileIconProvider::
options
() const
Returns all the options that affect the icon provider. By default, all options are disabled.
另请参阅 setOptions ().
[虚拟]
void
QAbstractFileIconProvider::
setOptions
(
QAbstractFileIconProvider::Options
options
)
设置 options 影响图标提供程序。
另请参阅 options ().
[虚拟]
QString
QAbstractFileIconProvider::
type
(const
QFileInfo
&
info
) const
返回文件的类型,描述通过 info .