summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/code/src_gui_kernel_qaction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src/snippets/code/src_gui_kernel_qaction.cpp')
-rw-r--r--doc/src/snippets/code/src_gui_kernel_qaction.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/doc/src/snippets/code/src_gui_kernel_qaction.cpp b/doc/src/snippets/code/src_gui_kernel_qaction.cpp
new file mode 100644
index 0000000..b052feb
--- /dev/null
+++ b/doc/src/snippets/code/src_gui_kernel_qaction.cpp
@@ -0,0 +1,9 @@
+//! [0]
+QApplication app(argc, argv);
+app.setAttribute(Qt::AA_DontShowIconsInMenus); // Icons are *no longer shown* in menus
+// ...
+QAction *myAction = new QAction();
+// ...
+myAction->setIcon(SomeIcon);
+myAction->setIconVisibleInMenu(true); // Icon *will* be shown in menus for *this* action.
+//! [0]