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>
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 a variety of other menu related things.
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.
QStyleOptionMenuItem::NotCheckable | The item is not checkable. |
QStyleOptionMenuItem::Checked | The item is checked. |
QStyleOptionMenuItem::Unchecked | The item can be checked, but currently is not checked. |
See also QAction::checkable and QAction::checked.
These values indicate the type of menu item that the structure describes.
QStyleOptionMenuItem::Normal | A normal menu item. |
QStyleOptionMenuItem::Separator | A menu separator. |
QStyleOptionMenuItem::SubMenu | Indicates the menu item points to a sub-menu. |
QStyleOptionMenuItem::Scroller | A popup menu scroller (currently only used on Mac OS X). |
QStyleOptionMenuItem::TearOff | A tear-off handle for the menu. |
QStyleOptionMenuItem::Margin | The margin of the menu. |
QStyleOptionMenuItem::EmptyArea | The empty area of the menu. |
This property holds the checkmark state for the structure.
See also CheckState.
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 (if any) 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. maxIconWidth is set regardless of whether or not the menu item has an icon or not.
This property holds the current menuItemType for the structure.
See also MenuItemType.
This property holds the rect 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 if it contains one.
This property holds the text (if any) for the menu item.
Note that the text format is something like this: MenuText<Tab>MenuShortCut
If the menu item does not have a shortcut it will just contain the menu item's text.
Constructs a QStyleOptionMenuItem with version version. The values of the structure are either zero, null, or empty. It is the responsibilty of the developer to make sure these have proper values.
Copyright © 2004 Trolltech. | Trademarks | Qt 4.0.0-tp1 |