QStyleOptionMenuItem Class
The QStyleOptionMenuItem class describes the parameters for drawing an entry of a menu, or a title of a menu bar. More…
| Header | #include <QtWidgets/qstyleoption.h> |
|---|---|
| CMake | target_link_libraries(app PRIVATE Nt::Widgets) |
| Module | Nt Widgets C++ Classes |
| Inherits | QStyleOption |
List of all members, including inherited members
Public Types
| enum | MenuItemType |
| enum | CheckType |
Public Functions
Public Variables
Detailed Description
See also QStyleOption, QMenu and QMenuBar.
Member Type Documentation
enum QStyleOptionMenuItem::CheckType
This enum says whether an entry of a menu has a check box.
| Constant | Description |
|---|---|
QStyleOptionMenuItem::NotCheckable | No check box. |
QStyleOptionMenuItem::Exclusive | A check box of an action in an exclusive group; Fusion draws it as it does for a non-exclusive one. |
QStyleOptionMenuItem::NonExclusive | A check box that is on or off by itself. |
enum QStyleOptionMenuItem::MenuItemType
This enum says what kind of entry a menu has.
| Constant | Description |
|---|---|
QStyleOptionMenuItem::Normal | An entry that triggers an action. |
QStyleOptionMenuItem::Separator | A line between groups of entries. |
QStyleOptionMenuItem::SubMenu | An entry that opens another menu. |
Member Function Documentation
QStyleOptionMenuItem::QStyleOptionMenuItem()
Constructs an option for an entry of a menu.
Member Variable Documentation
bool QStyleOptionMenuItem::checked
Whether the check box is on.
CheckType QStyleOptionMenuItem::checkType
Whether the entry has a check box.
QFont QStyleOptionMenuItem::font
The font of the text.
MenuItemType QStyleOptionMenuItem::menuItemType
What kind of entry this is.
int QStyleOptionMenuItem::tabWidth
The width of the widest shortcut of the entries before this one in the menu, which a style adds to the width of an entry that has a shortcut.
QString QStyleOptionMenuItem::text
The text of the entry. A & marks the mnemonic, and a tab separates the text from the shortcut that is shown at the right.