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
qappleiconengine_p.h
Go to the documentation of this file.
1// Copyright (C) 2023 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 QAPPLEICONENGINE_P_H
5#define QAPPLEICONENGINE_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtGui/qiconengine.h>
19
20#include <QtCore/private/qcore_mac_p.h>
21
24
26
27class Q_GUI_EXPORT QAppleIconEngine : public QIconEngine
28{
29public:
30 QAppleIconEngine(const QString &iconName);
32 QIconEngine *clone() const override;
33 QString key() const override;
34 QString iconName() override;
35 bool isNull() override;
36
37 QList<QSize> availableSizes(QIcon::Mode, QIcon::State) override;
38 QSize actualSize(const QSize &size, QIcon::Mode mode, QIcon::State state) override;
40 QPixmap scaledPixmap(const QSize &size, QIcon::Mode mode, QIcon::State state, qreal scale) override;
42
43 static QList<QSize> availableIconSizes(double aspectRatio = 1.0);
44
45private:
46 static constexpr quint64 calculateCacheKey(QIcon::Mode mode, QIcon::State state)
47 {
48 return (quint64(mode) << 32) | state;
49 }
50
51 const QString m_iconName;
52#if defined(Q_OS_MACOS)
53 const NSImage *m_image;
54#elif defined(QT_PLATFORM_UIKIT)
55 const UIImage *m_image;
56#endif
57 mutable QPixmap m_pixmap;
58 mutable quint64 m_cacheKey = {};
59};
60
61
63
64#endif // QAPPLEICONENGINE_P_H
The QIconEngine class provides an abstract base class for QIcon renderers.
Definition qiconengine.h:15
Mode
This enum type describes the mode for which a pixmap is intended to be used.
Definition qicon.h:22
State
This enum describes the state for which a pixmap is intended to be used.
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
QPainter paint
rect
[4]
else opt state
[0]
Combined button and popup list for selecting options.
#define Q_FORWARD_DECLARE_OBJC_CLASS(classname)
GLenum mode
GLuint64 key
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLenum GLenum GLenum GLenum scale
unsigned long long quint64
Definition qtypes.h:61
double qreal
Definition qtypes.h:187
widget render & pixmap
QPainter painter(this)
[7]