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
src_gui_kernel_qaction.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
5QApplication app(argc, argv);
6app.setAttribute(Qt::AA_DontShowIconsInMenus); // Icons are *no longer shown* in menus
7// ...
9// ...
10myAction->setIcon(SomeIcon);
11myAction->setIconVisibleInMenu(true); // Icon *will* be shown in menus for *this* action.
The QAction class provides an abstraction for user commands that can be added to different user inter...
Definition qaction.h:30
void setIconVisibleInMenu(bool visible)
Definition qaction.cpp:1240
void setIcon(const QIcon &icon)
Definition qaction.cpp:547
The QApplication class manages the GUI application's control flow and main settings.
static void setAttribute(Qt::ApplicationAttribute attribute, bool on=true)
Sets the attribute attribute if on is true; otherwise clears the attribute.
@ AA_DontShowIconsInMenus
Definition qnamespace.h:427
QAction * myAction
QApplication app(argc, argv)
[0]