![]() |
Home · All Classes · Main Classes · Annotated · Grouped Classes · Functions | ![]() |
The QStyleOptionMenuItem class is used to describe the parameter necessary for drawing a menu item. More...
#include <QStyleOptionMenuItem>
Part of the QtGui module.
Inherits QStyleOption.
|
|
The QStyleOptionMenuItem class is used to describe the parameter necessary for drawing a menu item.
The QStyleOptionMenuItem is used for drawing menu items from QMenu. It is also used for drawing other menu-related widgets.
These enums are used to indicate whether or not a check mark should be drawn for the item, or even if it should be drawn at all.
Constant | Value | Description |
---|---|---|
QStyleOptionMenuItem::NotCheckable | 0 | The item is not checkable. |
QStyleOptionMenuItem::Exclusive | 1 | The item is an exclusive check item (like a radio button). |
QStyleOptionMenuItem::NonExclusive | 2 | The item is a non-exclusive check item (like a check box). |
See also QAction::checkable, QAction::checked, and QActionGroup::exculsive.
These values indicate the type of menu item that the structure describes.
Constant | Value | Description |
---|---|---|
QStyleOptionMenuItem::Normal | 0 | A normal menu item. |
QStyleOptionMenuItem::DefaultItem | 1 | A menu item that is the default action |
QStyleOptionMenuItem::Separator | 2 | A menu separator. |
QStyleOptionMenuItem::SubMenu | 3 | Indicates the menu item points to a sub-menu. |
QStyleOptionMenuItem::Scroller | 4 | A popup menu scroller (currently only used on Mac OS X). |
QStyleOptionMenuItem::TearOff | 5 | A tear-off handle for the menu. |
QStyleOptionMenuItem::Margin | 6 | The margin of the menu. |
QStyleOptionMenuItem::EmptyArea | 7 | The empty area of the menu. |
See also QMenu::defaultAction() and ..
This property holds the type of checkmark of the menu item.
See also CheckType.
This property holds whether the menu item is checked or not.
This property holds the font used for the menu item text.
This is the font that should be used for drawing the menu text minus the shortcut. The shortcut is usually drawn using the painter's font.
This property holds the icon for the menu item.
This property holds the maximum icon width for the icon in the menu item.
This can be used for drawing the icon into the correct place or properly aligning items. The variable must be set regardless of whether or not the menu item has an icon.
This property holds whether the menu as a whole has checkable items or not.
If this option is set to false, then the menu has no checkable items. This makes it possible for GUI styles to save some horizontal space that would normally be used for the check column.
This property holds the type of menu item.
See also MenuItemType.
This property holds the rectangle for the entire menu.
This property holds the tab width for the menu item.
The tab width is the distance between the text of the menu item and the shortcut.
This property holds the text for the menu item.
Note that the text format is something like this "Menu text\tShortcut".
If the menu item doesn't have a shortcut, it will just contain the menu item's text.
Constructs a QStyleOptionMenuItem. The members variables are initialized to default values.
Copyright © 2005 Trolltech | Trademarks | Qt 4.0.0-b2 |