Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QAbstractFileIconProvider Class Reference

\inmodule QtGui More...

#include <qabstractfileiconprovider.h>

+ Inheritance diagram for QAbstractFileIconProvider:
+ Collaboration diagram for QAbstractFileIconProvider:

Public Types

enum  IconType {
  Computer , Desktop , Trashcan , Network ,
  Drive , Folder , File
}
 \value Computer The icon used for the computing device as a whole \value Desktop The icon for the special "Desktop" directory of the user \value Trashcan The icon for the user's "Trash" place in the desktop's file manager \value Network The icon for the “Network Servers” place in the desktop's file manager, and workgroups within the network \value Drive The icon used for disk drives \value Folder The standard folder icon used to represent directories on local filesystems \value File The icon used for generic text file types More...
 
enum  Option { DontUseCustomDirectoryIcons = 0x00000001 }
 \value DontUseCustomDirectoryIcons Always use the default directory icon. More...
 

Public Member Functions

 QAbstractFileIconProvider ()
 Constructs a file icon provider.
 
virtual ~QAbstractFileIconProvider ()
 Destroys the file icon provider.
 
virtual QIcon icon (IconType) const
 Returns an icon set for the given type, using the current icon theme.
 
virtual QIcon icon (const QFileInfo &) const
 Returns an icon for the file described by info, using the current icon theme.
 
virtual QString type (const QFileInfo &) const
 Returns the type of the file described by info.
 
virtual void setOptions (Options)
 Sets options that affect the icon provider.
 
virtual Options options () const
 Returns all the options that affect the icon provider.
 

Protected Member Functions

 QAbstractFileIconProvider (QAbstractFileIconProviderPrivate &dd)
 

Protected Attributes

QScopedPointer< QAbstractFileIconProviderPrivated_ptr
 

Detailed Description

\inmodule QtGui

Since
6.0

The QAbstractFileIconProvider class provides file icons for the QFileSystemModel class.

Definition at line 16 of file qabstractfileiconprovider.h.

Member Enumeration Documentation

◆ IconType

\value Computer The icon used for the computing device as a whole \value Desktop The icon for the special "Desktop" directory of the user \value Trashcan The icon for the user's "Trash" place in the desktop's file manager \value Network The icon for the “Network Servers” place in the desktop's file manager, and workgroups within the network \value Drive The icon used for disk drives \value Folder The standard folder icon used to represent directories on local filesystems \value File The icon used for generic text file types

Enumerator
Computer 
Desktop 
Trashcan 
Network 
Drive 
Folder 
File 

Definition at line 19 of file qabstractfileiconprovider.h.

◆ Option

\value DontUseCustomDirectoryIcons 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.

Enumerator
DontUseCustomDirectoryIcons 

Definition at line 20 of file qabstractfileiconprovider.h.

Constructor & Destructor Documentation

◆ QAbstractFileIconProvider() [1/2]

QAbstractFileIconProvider::QAbstractFileIconProvider ( )

Constructs a file icon provider.

Definition at line 162 of file qabstractfileiconprovider.cpp.

◆ ~QAbstractFileIconProvider()

QAbstractFileIconProvider::~QAbstractFileIconProvider ( )
virtualdefault

Destroys the file icon provider.

◆ QAbstractFileIconProvider() [2/2]

QAbstractFileIconProvider::QAbstractFileIconProvider ( QAbstractFileIconProviderPrivate & dd)
protected

Definition at line 170 of file qabstractfileiconprovider.cpp.

Member Function Documentation

◆ icon() [1/2]

QIcon QAbstractFileIconProvider::icon ( const QFileInfo & info) const
virtual

Returns an icon for the file described by info, using the current icon theme.

See also
QIcon::fromTheme

Reimplemented in QFileIconProvider.

Definition at line 225 of file qabstractfileiconprovider.cpp.

References d, info, and QIcon::isNull().

+ Here is the call graph for this function:

◆ icon() [2/2]

QIcon QAbstractFileIconProvider::icon ( IconType type) const
virtual

Returns an icon set for the given type, using the current icon theme.

See also
QIcon::fromTheme

Reimplemented in QFileIconProvider.

Definition at line 211 of file qabstractfileiconprovider.cpp.

References d, and QIcon::isNull().

Referenced by QFileInfoGatherer::getInfo(), and QFileSystemModelPrivate::QFileSystemNode::updateIcon().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ options()

QAbstractFileIconProvider::Options QAbstractFileIconProvider::options ( ) const
virtual

Returns all the options that affect the icon provider.

By default, all options are disabled.

See also
setOptions()

Definition at line 198 of file qabstractfileiconprovider.cpp.

References d.

Referenced by QFileDialog::setOptions(), and setOptions().

+ Here is the caller graph for this function:

◆ setOptions()

void QAbstractFileIconProvider::setOptions ( Options )
virtual

Sets options that affect the icon provider.

See also
options()

Definition at line 186 of file qabstractfileiconprovider.cpp.

References d, and options().

Referenced by QFileDialog::setOptions().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ type()

QString QAbstractFileIconProvider::type ( const QFileInfo & info) const
virtual

Returns the type of the file described by info.

Definition at line 275 of file qabstractfileiconprovider.cpp.

References QAbstractFileIconProviderPrivate::getFileType(), and info.

Referenced by QFileInfoGatherer::getInfo(), and QFileSystemModelPrivate::QFileSystemNode::retranslateStrings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ d_ptr

QScopedPointer<QAbstractFileIconProviderPrivate> QAbstractFileIconProvider::d_ptr
protected

Definition at line 37 of file qabstractfileiconprovider.h.


The documentation for this class was generated from the following files: