CopperSpice API  1.7.2
QStyleOptionMenuItem Class Reference

The QStyleOptionMenuItem class is used to describe the parameter necessary for drawing a menu item. More...

Inheritance diagram for QStyleOptionMenuItem:
QStyleOption

Public Types

enum  CheckType
 
enum  MenuItemType
 
enum  StyleOptionType
 
enum  StyleOptionVersion
 
- Public Types inherited from QStyleOption
enum  OptionType
 
enum  StyleOptionType
 
enum  StyleOptionVersion
 

Public Methods

 QStyleOptionMenuItem ()
 
 QStyleOptionMenuItem (const QStyleOptionMenuItem &other)
 
QStyleOptionMenuItem & operator= (const QStyleOptionMenuItem &other) = default
 
- Public Methods inherited from QStyleOption
 QStyleOption (const QStyleOption &other)
 
 QStyleOption (int version=QStyleOption::Version, int type=SO_Default)
 
 ~QStyleOption ()
 
void initFrom (const QWidget *widget)
 
QStyleOption & operator= (const QStyleOption &other)
 

Additional Inherited Members

Detailed Description

The QStyleOptionMenuItem class is used to describe the parameter necessary for drawing a menu item. QStyleOptionMenuItem contains all the information that QStyle functions need to draw the menu items from QMenu. It is also used for drawing other menu-related widgets.

For performance reasons, the access to the member variables is direct (i.e., using the . or -> operator). This low-level feel makes the structures straightforward to use and emphasizes that these are simply parameters used by the style functions.

See also
QStyleOption

Member Enumeration Documentation

This enum is used to indicate whether or not a check mark should be drawn for the item, or even if it should be drawn at all.

ConstantValueDescription
QStyleOptionMenuItem::NotCheckable0The item is not checkable.
QStyleOptionMenuItem::Exclusive1The item is an exclusive check item (like a radio button).
QStyleOptionMenuItem::NonExclusive2The item is a non-exclusive check item (like a check box).
See also
checkType, QAction::checkable, QAction::checked, QActionGroup::exclusive

This enum indicates the type of menu item that the structure describes.

ConstantValueDescription
QStyleOptionMenuItem::Normal0A normal menu item.
QStyleOptionMenuItem::DefaultItem1A menu item that is the default action as specified with QMenu::defaultAction().
QStyleOptionMenuItem::Separator2A menu separator.
QStyleOptionMenuItem::SubMenu3Indicates the menu item points to a sub-menu.
QStyleOptionMenuItem::Scroller4A popup menu scroller (currently only used on Mac OS X).
QStyleOptionMenuItem::TearOff5A tear-off handle for the menu.
QStyleOptionMenuItem::Margin6The margin of the menu.
QStyleOptionMenuItem::EmptyArea7The empty area of the menu.
See also
menuItemType

This enum is used to hold information about the type of the style option, and is defined for each QStyleOption subclass.

ConstantValueDescription
QStyleOptionMenuItem::TypeSO_MenuItemThe type of style option provided (SO_MenuItem for this class).

The type is used internally by QStyleOption, its subclasses, and qstyleoption_cast() to determine the type of style option. In general you do not need to worry about this unless you want to create your own QStyleOption subclass and your own styles.

See also
StyleOptionVersion

This enum is used to hold information about the version of the style option, and is defined for each QStyleOption subclass.

ConstantValueDescription
QStyleOptionMenuItem::Version11

The version is used by QStyleOption subclasses to implement extensions without breaking compatibility. If you use qstyleoption_cast(), you normally do not need to check it.

See also
StyleOptionType

Constructor & Destructor Documentation

QStyleOptionMenuItem::QStyleOptionMenuItem ( )

Constructs an empty QStyleOptionMenuItem.

QStyleOptionMenuItem::QStyleOptionMenuItem ( const QStyleOptionMenuItem &  other)
inline

Copy constructs a new QStyleOptionMenuItem from other.

Method Documentation

QStyleOptionMenuItem & QStyleOptionMenuItem::operator= ( const QStyleOptionMenuItem &  other)
default

Copy assigns from other and returns a reference to this object.