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
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);
21 // ### Qt7: add qreal scale argument and remove scaledPixmap
23
24 virtual void addPixmap(const QPixmap &pixmap, QIcon::Mode mode, QIcon::State state);
25 virtual void addFile(const QString &fileName, const QSize &size, QIcon::Mode mode, QIcon::State state);
26
27 virtual QString key() const;
28 virtual QIconEngine *clone() const = 0;
29 virtual bool read(QDataStream &in);
30 virtual bool write(QDataStream &out) const;
31
32 virtual QList<QSize> availableSizes(QIcon::Mode mode = QIcon::Normal,
34
35 virtual QString iconName();
36 virtual bool isNull();
37 virtual QPixmap scaledPixmap(const QSize &size, QIcon::Mode mode, QIcon::State state, qreal scale);
38
39 enum IconEngineHook { IsNullHook = 3, ScaledPixmapHook };
40
49
50 virtual void virtual_hook(int id, void *data);
51
52protected:
54
55private:
56 QIconEngine &operator=(const QIconEngine &other) = delete;
57};
58
60
61#endif // QICONENGINE_H
\inmodule QtCore\reentrant
Definition qdatastream.h:46
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
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:129
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:187
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]