6.0.0-rc4Source

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>
CMaketarget_link_libraries(app PRIVATE Nt::Widgets)
ModuleNt Widgets C++ Classes
InheritsQStyleOption

List of all members, including inherited members

Public Types

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.

ConstantDescription
QStyleOptionMenuItem::NotCheckableNo check box.
QStyleOptionMenuItem::ExclusiveA check box of an action in an exclusive group; Fusion draws it as it does for a non-exclusive one.
QStyleOptionMenuItem::NonExclusiveA check box that is on or off by itself.

This enum says what kind of entry a menu has.

ConstantDescription
QStyleOptionMenuItem::NormalAn entry that triggers an action.
QStyleOptionMenuItem::SeparatorA line between groups of entries.
QStyleOptionMenuItem::SubMenuAn 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.

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.