![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
Helper base class for retrieving icons for files for usage by QFileIconProvider and related. More...
#include <qabstractfileiconengine_p.h>
Public Member Functions | |
QAbstractFileIconEngine (const QFileInfo &info, QPlatformTheme::IconOptions opts) | |
QPixmap | pixmap (const QSize &size, QIcon::Mode mode, QIcon::State) override |
Returns the icon as a pixmap with the required size, mode, and state. | |
QPixmap | scaledPixmap (const QSize &size, QIcon::Mode mode, QIcon::State, qreal scale) override |
QSize | actualSize (const QSize &size, QIcon::Mode mode, QIcon::State state) override |
Returns the actual size of the icon the engine provides for the requested size, mode and state. | |
bool | isNull () override |
QFileInfo | fileInfo () const |
QPlatformTheme::IconOptions | options () const |
Public Member Functions inherited from QPixmapIconEngine | |
QPixmapIconEngine () | |
QPixmapIconEngine (const QPixmapIconEngine &) | |
~QPixmapIconEngine () | |
void | paint (QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state) override |
Uses the given painter to paint the icon with the required mode and state into the rectangle rect. | |
QPixmap | pixmap (const QSize &size, QIcon::Mode mode, QIcon::State state) override |
Returns the icon as a pixmap with the required size, mode, and state. | |
QPixmap | scaledPixmap (const QSize &size, QIcon::Mode mode, QIcon::State state, qreal scale) override |
QPixmapIconEngineEntry * | bestMatch (const QSize &size, qreal scale, QIcon::Mode mode, QIcon::State state) |
QSize | actualSize (const QSize &size, QIcon::Mode mode, QIcon::State state) override |
Returns the actual size of the icon the engine provides for the requested size, mode and state. | |
QList< QSize > | availableSizes (QIcon::Mode mode, QIcon::State state) override |
Returns sizes of all images that are contained in the engine for the specific mode and state. | |
void | addPixmap (const QPixmap &pixmap, QIcon::Mode mode, QIcon::State state) override |
Called by QIcon::addPixmap(). | |
void | addFile (const QString &fileName, const QSize &size, QIcon::Mode mode, QIcon::State state) override |
Called by QIcon::addFile(). | |
bool | isNull () override |
QString | key () const override |
\variable QIconEngine::ScaledPixmapArgument::size | |
QIconEngine * | clone () const override |
Reimplement this method to return a clone of this icon engine. | |
bool | read (QDataStream &in) override |
Reads icon engine contents from the QDataStream in. | |
bool | write (QDataStream &out) const override |
Writes the contents of this engine to the QDataStream out. | |
Public Member Functions inherited from QIconEngine | |
QIconEngine () | |
virtual | ~QIconEngine () |
Destroys the icon engine. | |
virtual QString | iconName () |
Returns the name used to create the engine, if available. | |
virtual void | virtual_hook (int id, void *data) |
Additional method to allow extending QIconEngine without adding new virtual methods (and without breaking binary compatibility). |
Static Public Member Functions | |
template<class It> | |
static QList< QSize > | toSizeList (It i1, It i2) |
Static Public Member Functions inherited from QPixmapIconEngine | |
static QSize | adjustSize (const QSize &expectedSize, QSize size) |
Protected Member Functions | |
virtual QPixmap | filePixmap (const QSize &size, QIcon::Mode mode, QIcon::State)=0 |
virtual QString | cacheKey () const |
Protected Member Functions inherited from QIconEngine | |
QIconEngine (const QIconEngine &other) |
Additional Inherited Members | |
Public Types inherited from QIconEngine | |
enum | IconEngineHook { IsNullHook = 3 , ScaledPixmapHook } |
These enum values are used for virtual_hook() to allow additional queries to icon engine without breaking binary compatibility. More... |
Helper base class for retrieving icons for files for usage by QFileIconProvider and related.
Reimplement availableSizes() and new virtual filePixmap() and return icons created with this engine from QPlatformTheme::fileIcon().
Note: The class internally caches pixmaps for files by suffix (with the exception of some files on Windows), but not for directories (since directory icons may have overlay icons on Windows). You might want to cache pixmaps for directories in your implementation.
Definition at line 24 of file qabstractfileiconengine_p.h.
|
inlineexplicit |
Definition at line 27 of file qabstractfileiconengine_p.h.
|
overridevirtual |
Returns the actual size of the icon the engine provides for the requested size, mode and state.
The default implementation returns the given size.
The returned size is in device-independent pixels (This is relevant for high-dpi pixmaps).
Reimplemented from QIconEngine.
Definition at line 59 of file qabstractfileiconengine.cpp.
|
protectedvirtual |
Reimplemented in QWindowsFileIconEngine, and QWindowsFileIconEngine.
Definition at line 90 of file qabstractfileiconengine.cpp.
|
inline |
Definition at line 35 of file qabstractfileiconengine_p.h.
|
protectedpure virtual |
Implemented in QAndroidPlatformFileIconEngine, QAppleFileIconEngine, QWindowsFileIconEngine, and QWindowsFileIconEngine.
|
inlineoverridevirtual |
Returns true if this icon engine represent a null QIcon.
Reimplemented from QIconEngine.
Reimplemented in QAndroidPlatformFileIconEngine, and QAppleFileIconEngine.
Definition at line 33 of file qabstractfileiconengine_p.h.
|
inline |
Definition at line 36 of file qabstractfileiconengine_p.h.
Referenced by testing.tools.test_runner._TestCaseRunner::_NewImageArtifact(), testing.tools.test_runner._TestCaseRunner::_RegenerateIfNeeded(), testing.tools.test_runner.TestRunner::IsSkiaGoldEnabled(), testing.tools.test_runner._TestCaseRunner::TestPixel(), and testing.tools.test_runner._TestCaseRunner::TestText().
|
overridevirtual |
Returns the icon as a pixmap with the required size, mode, and state.
The default implementation creates a new pixmap and calls paint() to fill it.
Reimplemented from QIconEngine.
Definition at line 29 of file qabstractfileiconengine.cpp.
|
overridevirtual |
Returns a pixmap for the given size, mode, state and scale.
The scale argument is typically equal to the \l {High DPI} {device pixel ratio} of the display. The size is given in device-independent pixels.
Reimplemented from QIconEngine.
Definition at line 35 of file qabstractfileiconengine.cpp.
Definition at line 51 of file qabstractfileiconengine_p.h.