summaryrefslogtreecommitdiffstats
path: root/src/gui/doc/snippets/code
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2023-12-06 17:11:48 +0100
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2023-12-07 16:43:17 +0000
commit9bbfdd6844f986de861336c0a5e3c43dbc8d1898 (patch)
treef1bf14aceef4646f7efc6cb1ba5f8c92c266fa18 /src/gui/doc/snippets/code
parent850fe6bea51d700892a67e0f4a53c7279f12a189 (diff)
QIcon: turn platform engines on by default
They are used when an icon is constructed via QIcon::fromTheme, unless an application-defined theme provides the requested icon. Update the documentation. For now we don't provide a way to "opt out". This might change, depending on the feedback during the Qt 6.7 beta phase. [ChangeLog][QtGui][QIcon] Qt now has implementations of native icon engines for macOS, iOS, Windows 10, Windows 11, and Android. These engines provide access to the native icon libraries and fonts, mapping standard icons to the corresponding native icon asset. Icons from application-defined themes take precedence, but the last-resort fallback icon passed as the second parameter into the QIcon::fromTheme(QString, QIcon) overload is only used if the icon is not available from the native library. See the QIcon documentation for details. Change-Id: I618e5c137c40f8e6309c0e4d4219a5a2759a475d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/gui/doc/snippets/code')
-rw-r--r--src/gui/doc/snippets/code/src_gui_image_qicon.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/doc/snippets/code/src_gui_image_qicon.cpp b/src/gui/doc/snippets/code/src_gui_image_qicon.cpp
index f7875b7c7cf..a7f27a7fdd2 100644
--- a/src/gui/doc/snippets/code/src_gui_image_qicon.cpp
+++ b/src/gui/doc/snippets/code/src_gui_image_qicon.cpp
@@ -45,15 +45,15 @@ void MyWidget::drawIcon(QPainter *painter, const QRect &rect)
void wrapper1() {
-//! [3]
-QIcon undoicon = QIcon::fromTheme("edit-undo");
-//! [3]
+//! [fromTheme]
+QIcon undoicon = QIcon::fromTheme(QIcon::ThemeIcon::EditUndo);
+//! [fromTheme]
} // wrapper1
//! [4]
-QIcon undoicon = QIcon::fromTheme("edit-undo", QIcon(":/undo.png"));
+QIcon undoicon = QIcon::fromTheme(QIcon::ThemeIcon::EditUndo, QIcon(":/undo.png"));
//! [4]