Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

QStyleOptionMenuItem Class Reference
[QtGui module]

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

#include <QStyleOptionMenuItem>

Inherits QStyleOption.

Public Types

  • enum CheckType { NotCheckable, Exclusive, NonExclusive }
  • enum MenuItemType { Normal, DefaultItem, Separator, SubMenu, ..., EmptyArea }

Public Functions

Public Variables

Static Public Members


Detailed Description

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.


Member Type Documentation

enum QStyleOptionMenuItem::CheckType

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.

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 QAction::checkable, QAction::checked, and QActionGroup::exclusive.

enum QStyleOptionMenuItem::MenuItemType

These values indicate 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.

Member Function Documentation

QStyleOptionMenuItem::QStyleOptionMenuItem ()

Constructs a QStyleOptionMenuItem. The members variables are initialized to default values.

QStyleOptionMenuItem::QStyleOptionMenuItem ( const QStyleOptionMenuItem & other )

Constructs a copy of the other style option.


Member Variable Documentation

const int QStyleOptionMenuItem::Type

Equals SO_MenuItem.

const int QStyleOptionMenuItem::Version

Equals 1.

CheckType QStyleOptionMenuItem::checkType

This variable holds the type of checkmark of the menu item.

See also CheckType.

bool QStyleOptionMenuItem::checked

This variable holds whether the menu item is checked or not.

QFont QStyleOptionMenuItem::font

This variable 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.

QIcon QStyleOptionMenuItem::icon

This variable holds the icon for the menu item.

int QStyleOptionMenuItem::maxIconWidth

This variable 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.

bool QStyleOptionMenuItem::menuHasCheckableItems

This variable 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.

MenuItemType QStyleOptionMenuItem::menuItemType

This variable holds the type of menu item.

See also MenuItemType.

QRect QStyleOptionMenuItem::menuRect

This variable holds the rectangle for the entire menu.

int QStyleOptionMenuItem::tabWidth

This variable holds the tab width for the menu item.

The tab width is the distance between the text of the menu item and the shortcut.

QString QStyleOptionMenuItem::text

This variable 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.

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 4.0
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web