Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qiconengine.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QICONENGINE_H
5#define QICONENGINE_H
6
7#include <QtGui/qtguiglobal.h>
8#include <QtCore/qlist.h>
9#include <QtGui/qicon.h>
10
12
13
14class Q_GUI_EXPORT QIconEngine
15{
16public:
18 virtual ~QIconEngine();
20 virtual QSize actualSize(const QSize &size, QIcon::Mode mode, QIcon::State state);
22
23 virtual void addPixmap(const QPixmap &pixmap, QIcon::Mode mode, QIcon::State state);
24 virtual void addFile(const QString &fileName, const QSize &size, QIcon::Mode mode, QIcon::State state);
25
26 virtual QString key() const;
27 virtual QIconEngine *clone() const = 0;
28 virtual bool read(QDataStream &in);
29 virtual bool write(QDataStream &out) const;
30
31 virtual QList<QSize> availableSizes(QIcon::Mode mode = QIcon::Normal,
33
34 virtual QString iconName();
35 virtual bool isNull();
36 virtual QPixmap scaledPixmap(const QSize &size, QIcon::Mode mode, QIcon::State state, qreal scale);
37
38 enum IconEngineHook { IsNullHook = 3, ScaledPixmapHook };
39
41 {
47 };
48
49 virtual void virtual_hook(int id, void *data);
50
51protected:
53
54private:
55 QIconEngine &operator=(const QIconEngine &other) = delete;
56};
57
59
60#endif // QICONENGINE_H
\inmodule QtCore\reentrant
Definition qdatastream.h:30
The QIconEngine class provides an abstract base class for QIcon renderers.
Definition qiconengine.h:15
virtual void paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state)=0
Uses the given painter to paint the icon with the required mode and state into the rectangle rect.
virtual QIconEngine * clone() const =0
Reimplement this method to return a clone of this icon engine.
Mode
This enum type describes the mode for which a pixmap is intended to be used.
Definition qicon.h:22
@ Normal
Definition qicon.h:22
State
This enum describes the state for which a pixmap is intended to be used.
Definition qicon.h:23
@ Off
Definition qicon.h:23
Definition qlist.h:74
The QPainter class performs low-level painting on widgets and other paint devices.
Definition qpainter.h:46
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
Definition qpixmap.h:27
\inmodule QtCore\reentrant
Definition qrect.h:30
\inmodule QtCore
Definition qsize.h:25
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
rect
[4]
else opt state
[0]
Combined button and popup list for selecting options.
GLenum mode
GLuint64 key
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLuint in
GLenum GLenum GLenum GLenum GLenum scale
double qreal
Definition qtypes.h:92
ReturnedValue read(const char *data)
gzip write("uncompressed data")
QTextStream out(stdout)
[7]
QSharedPointer< T > other(t)
[5]
widget render & pixmap
QPainter painter(this)
[7]