6#include <QtCore/qoperatingsystemversion.h>
7#include <QtGui/qguiapplication.h>
8#include <QtGui/qpainter.h>
9#include <QtGui/qpalette.h>
15QString QWindowsIconEngine::glyphs()
const
20 static constexpr std::pair<QLatin1StringView, QStringView> glyphMap[] = {
21 {
"address-book-new"_L1, u
"\ue780"},
22 {
"application-exit"_L1, u
"\ue8bb"},
23 {
"appointment-new"_L1, u
"\ue878"},
24 {
"call-start"_L1, u
"\uf715"},
25 {
"call-stop"_L1, u
"\uf405"},
26 {
"contact-new"_L1, u
"\ue8fa"},
27 {
"document-new"_L1, u
"\ue8a5"},
28 {
"document-open"_L1, u
"\ue8e5"},
29 {
"document-open-recent"_L1, u
"\ue823"},
30 {
"document-page-setup"_L1, u
"\ue7c3"},
31 {
"document-print"_L1, u
"\ue749"},
32 {
"document-print-preview"_L1, u
"\ue956"},
33 {
"document-properties"_L1, u
"\ue90f"},
34 {
"document-revert"_L1, u
"\ue7a7"},
35 {
"document-save"_L1, u
"\ue74e"},
36 {
"document-save-as"_L1, u
"\ue792"},
37 {
"document-send"_L1, u
"\ue724"},
38 {
"edit-clear"_L1, u
"\ue894"},
39 {
"edit-copy"_L1, u
"\ue8c8"},
40 {
"edit-cut"_L1, u
"\ue8c6"},
41 {
"edit-delete"_L1, u
"\ue74d"},
42 {
"edit-find"_L1, u
"\ue721"},
44 {
"edit-paste"_L1, u
"\ue77f"},
45 {
"edit-redo"_L1, u
"\ue7a6"},
46 {
"edit-select-all"_L1, u
"\ue8b3"},
47 {
"edit-undo"_L1, u
"\ue7a7"},
48 {
"folder-new"_L1, u
"\ue8f4"},
51 {
"format-justify-center"_L1, u
"\ue8e3"},
53 {
"format-justify-left"_L1, u
"\ue8e4"},
54 {
"format-justify-right"_L1, u
"\ue8e2"},
57 {
"format-text-bold"_L1, u
"\ue8dd"},
58 {
"format-text-italic"_L1, u
"\ue8db"},
59 {
"format-text-underline"_L1, u
"\ue8dc"},
60 {
"format-text-strikethrough"_L1, u
"\uede0"},
62 {
"go-down"_L1,u
"\ue74b"},
64 {
"go-home"_L1, u
"\ue80f"},
67 {
"go-next"_L1, u
"\ue893"},
68 {
"go-previous"_L1, u
"\ue892"},
70 {
"go-up"_L1, u
"\ue74a"},
71 {
"help-about"_L1, u
"\ue946"},
73 {
"help-faq"_L1, u
"\ue897"},
74 {
"insert-image"_L1, u
"\ue946"},
75 {
"insert-link"_L1, u
"\ue71b"},
78 {
"list-add"_L1, u
"\ue710"},
79 {
"list-remove"_L1, u
"\ue738"},
80 {
"mail-forward"_L1, u
"\ue89c"},
84 {
"mail-mark-read"_L1, u
"\ue8c3"},
86 {
"mail-message-new"_L1, u
"\ue70f"},
87 {
"mail-reply-all"_L1, u
"\ue8c2"},
88 {
"mail-reply-sender"_L1, u
"\ue8ca"},
89 {
"mail-send"_L1, u
"\ue724"},
91 {
"media-eject"_L1, u
"\uf847"},
92 {
"media-playback-pause"_L1, u
"\ue769"},
93 {
"media-playback-start"_L1, u
"\ue768"},
94 {
"media-playback-stop"_L1, u
"\ue71a"},
95 {
"media-record"_L1, u
"\ue7c8"},
96 {
"media-seek-backward"_L1, u
"\ueb9e"},
97 {
"media-seek-forward"_L1, u
"\ueb9d"},
98 {
"media-skip-backward"_L1, u
"\ue892"},
99 {
"media-skip-forward"_L1, u
"\ue893"},
102 {
"object-rotate-left"_L1, u
"\ue80c"},
103 {
"object-rotate-right"_L1, u
"\ue80d"},
105 {
"system-lock-screen"_L1, u
"\uee3f"},
106 {
"system-log-out"_L1, u
"\uf3b1"},
108 {
"system-search"_L1, u
"\ue721"},
109 {
"system-reboot"_L1, u
"\ue777"},
110 {
"system-shutdown"_L1, u
"\ue7e8"},
111 {
"tools-check-spelling"_L1, u
"\uf87b"},
112 {
"view-fullscreen"_L1, u
"\ue740"},
113 {
"view-refresh"_L1, u
"\ue72c"},
114 {
"view-restore"_L1, u
"\ue777"},
117 {
"window-close"_L1, u
"\ue8bb"},
118 {
"window-new"_L1, u
"\ue78b"},
119 {
"zoom-fit-best"_L1, u
"\ue9a6"},
120 {
"zoom-in"_L1, u
"\ue8a3"},
122 {
"zoom-out"_L1, u
"\ue71f"},
124 {
"process-working"_L1, u
"\ue9f3"},
126 {
"accessories-calculator"_L1, u
"\ue8ef"},
127 {
"accessories-character-map"_L1, u
"\uf2b7"},
128 {
"accessories-dictionary"_L1, u
"\ue82d"},
130 {
"help-browser"_L1, u
"\ue897"},
131 {
"multimedia-volume-control"_L1, u
"\ue767"},
132 {
"preferences-desktop-accessibility"_L1, u
"\ue776"},
133 {
"preferences-desktop-font"_L1, u
"\ue8d2"},
134 {
"preferences-desktop-keyboard"_L1, u
"\ue765"},
135 {
"preferences-desktop-locale"_L1, u
"\uf2b7"},
137 {
"preferences-desktop-screensaver"_L1, u
"\uf182"},
140 {
"system-file-manager"_L1, u
"\uec50"},
142 {
"system-software-update"_L1, u
"\uecc5"},
143 {
"utilities-system-monitor"_L1, u
"\ue7f4"},
147 {
"applications-development"_L1, u
"\uec7a"},
149 {
"applications-games"_L1, u
"\ue7fc"},
151 {
"applications-internet"_L1, u
"\ue774"},
152 {
"applications-multimedia"_L1, u
"\uea69"},
156 {
"applications-system"_L1, u
"\ue770"},
164 {
"system-help"_L1, u
"\ue946"},
166 {
"audio-card"_L1, u
"\ue8d6"},
167 {
"audio-input-microphone"_L1, u
"\ue720"},
168 {
"battery"_L1, u
"\ue83f"},
169 {
"camera-photo"_L1, u
"\ue722"},
170 {
"camera-video"_L1, u
"\ue714"},
171 {
"camera-web"_L1, u
"\ue8b8"},
172 {
"computer"_L1, u
"\ue7f8"},
173 {
"drive-harddisk"_L1, u
"\ueda2"},
174 {
"drive-optical"_L1, u
"\ue958"},
177 {
"input-keyboard"_L1, u
"\ue92e"},
178 {
"input-mouse"_L1, u
"\ue962"},
179 {
"input-tablet"_L1, u
"\ue70a"},
180 {
"media-flash"_L1, u
"\ue88e"},
182 {
"media-optical"_L1, u
"\ue958"},
183 {
"media-tape"_L1, u
"\ue96a"},
186 {
"network-wired"_L1, u
"\ue968"},
187 {
"network-wireless"_L1, u
"\ue701"},
189 {
"phone"_L1, u
"\ue717"},
190 {
"printer"_L1, u
"\ue749"},
191 {
"scanner"_L1, u
"\ue8fe"},
194 {
"emblem-default"_L1, u
"\uf56d"},
195 {
"emblem-documents"_L1, u
"\ue8a5"},
196 {
"emblem-downloads"_L1, u
"\ue896"},
197 {
"emblem-favorite"_L1, u
"\ue734"},
198 {
"emblem-important"_L1, u
"\ue8c9"},
199 {
"emblem-mail"_L1, u
"\ue715"},
200 {
"emblem-photos"_L1, u
"\ue91b"},
202 {
"emblem-shared"_L1, u
"\ue902"},
203 {
"emblem-symbolic-link"_L1, u
"\ue71b"},
204 {
"emblem-synchronized"_L1, u
"\uedab"},
205 {
"emblem-system"_L1, u
"\ue770"},
208 {
"folder"_L1, u
"\ue8b7"},
212 {
"start-here"_L1, u
"\ue8fc"},
213 {
"user-bookmarks"_L1, u
"\ue8a4"},
215 {
"user-home"_L1, u
"\ue80f"},
216 {
"user-trash"_L1, u
"\ue74d"},
220 {
"audio-volume-high"_L1, u
"\ue995"},
221 {
"audio-volume-low"_L1, u
"\ue993"},
222 {
"audio-volume-medium"_L1, u
"\ue994"},
223 {
"audio-volume-muted"_L1, u
"\ue992"},
225 {
"battery-low"_L1, u
"\ue851"},
226 {
"dialog-error"_L1, u
"\ue783"},
227 {
"dialog-information"_L1, u
"\ue946"},
229 {
"dialog-question"_L1, u
"\uf142"},
230 {
"dialog-warning"_L1, u
"\ue7ba"},
232 {
"folder-open"_L1, u
"\ue838"},
236 {
"mail-attachment"_L1, u
"\ue723"},
239 {
"mail-replied"_L1, u
"\ue8ca"},
242 {
"media-playlist-repeat"_L1, u
"\ue8ee"},
243 {
"media-playlist-shuffle"_L1, u
"\ue8b1"},
246 {
"network-offline"_L1, u
"\uf384"},
257 {
"sync-error"_L1, u
"\uea6a"},
258 {
"sync-synchronizing"_L1, u
"\ue895"},
261 {
"user-available"_L1, u
"\ue8cf"},
267 {
"weather-clear"_L1, u
"\ue706"},
272 {
"weather-overcast"_L1, u
"\ue753"},
280 const auto it = std::find_if(std::begin(glyphMap), std::end(glyphMap), [
this](
const auto &
c){
281 return c.first == m_iconName;
284 return it != std::end(glyphMap) ?
it->second.toString()
292 return isWindows11 ? u
"Segoe Fluent Icons"_s
293 : u
"Segoe MDL2 Assets"_s;
298 : m_iconName(iconName), m_iconFont(iconFontFamily())
313 return u
"QWindowsIconEngine"_s;
326 const QChar c0 = m_glyphs.
at(0);
328 if (c0.category() == QChar::Other_Surrogate && m_glyphs.
size() > 1)
329 return !
fontMetrics.inFontUcs4(QChar::surrogateToUcs4(c0, m_glyphs.
at(1)));
335 return {{16, 16}, {24, 24}, {48, 48}, {128, 128}};
370 QFont renderFont(m_iconFont);
371 renderFont.setPixelSize(
rect.height());
\reentrant \inmodule QtGui
The QIconEngine class provides an abstract base class for QIcon renderers.
virtual QSize actualSize(const QSize &size, QIcon::Mode mode, QIcon::State state)
Returns the actual size of the icon the engine provides for the requested size, mode and state.
Mode
This enum type describes the mode for which a pixmap is intended to be used.
State
This enum describes the state for which a pixmap is intended to be used.
static Q_CORE_EXPORT QOperatingSystemVersionBase current()
static constexpr QOperatingSystemVersionBase Windows11
\variable QOperatingSystemVersion::Windows11
The QPainter class performs low-level painting on widgets and other paint devices.
void setPen(const QColor &color)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void restore()
Restores the current painter state (pops a saved state off the stack).
void save()
Saves the current painter state (pushes the state onto a stack).
void setFont(const QFont &f)
Sets the painter's font to the given font.
void drawText(const QPointF &p, const QString &s)
Draws the given text with the currently defined text direction, beginning at the given position.
The QPalette class contains color groups for each widget state.
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
QSize size() const
Returns the size of the pixmap.
void setDevicePixelRatio(qreal scaleFactor)
Sets the device pixel ratio for the pixmap.
void fill(const QColor &fillColor=Qt::white)
Fills the pixmap with the given color.
qreal devicePixelRatio() const
Returns the device pixel ratio for the pixmap.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool isEmpty() const noexcept
Returns true if the string has no characters; otherwise returns false.
qsizetype size() const noexcept
Returns the number of characters in this string.
const QChar at(qsizetype i) const
Returns the character at the given index position in the string.
qsizetype length() const noexcept
Returns the number of characters in this string.
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.
QIconEngine * clone() const override
Reimplement this method to return a clone of this icon engine.
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.
QString iconName() override
QList< QSize > availableSizes(QIcon::Mode, QIcon::State) override
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.
QString key() const override
\variable QIconEngine::ScaledPixmapArgument::size
QWindowsIconEngine(const QString &iconName)
QPixmap scaledPixmap(const QSize &size, QIcon::Mode mode, QIcon::State state, qreal scale) override
QSet< QString >::iterator it
Combined button and popup list for selecting options.
static QByteArray cacheKey(Args &&...args)
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLenum GLenum GLenum GLenum scale
unsigned long long quint64