QStyleOption Class Reference |
Constant | Value | Description |
---|---|---|
QStyleOption::SO_Default | 0 | QStyleOption |
QStyleOption::SO_FocusRect | 1 | QStyleOptionFocusRect |
QStyleOption::SO_Button | 2 | QStyleOptionButton |
QStyleOption::SO_Tab | 3 | QStyleOptionTab |
QStyleOption::SO_TabWidgetFrame | 13 | QStyleOptionTabWidgetFrame |
QStyleOption::SO_TabBarBase | 14 | QStyleOptionTabBarBase |
QStyleOption::SO_MenuItem | 4 | QStyleOptionMenuItem |
QStyleOption::SO_Complex | 0xf0000 | QStyleOptionComplex |
QStyleOption::SO_Slider | QStyleOptionSlider | |
QStyleOption::SO_Frame | 5 | QStyleOptionFrame QStyleOptionFrameV2 |
QStyleOption::SO_GroupBox | QStyleOptionGroupBox | |
QStyleOption::SO_ProgressBar | 6 | QStyleOptionProgressBar QStyleOptionProgressBarV2 |
QStyleOption::SO_Q3ListView | QStyleOptionQ3ListView | |
QStyleOption::SO_Q3ListViewItem | 11 | QStyleOptionQ3ListViewItem |
QStyleOption::SO_Header | 8 | QStyleOptionHeader |
QStyleOption::SO_Q3DockWindow | 9 | QStyleOptionQ3DockWindow |
QStyleOption::SO_DockWidget | 10 | QStyleOptionDockWidget |
QStyleOption::SO_SpinBox | QStyleOptionSpinBox | |
QStyleOption::SO_ToolButton | QStyleOptionToolButton | |
QStyleOption::SO_ComboBox | QStyleOptionComboBox | |
QStyleOption::SO_ToolBox | 7 | QStyleOptionToolBox |
QStyleOption::SO_ToolBar | 16 | QStyleOptionToolBar |
QStyleOption::SO_RubberBand | 15 | QStyleOptionRubberBand |
QStyleOption::SO_TitleBar | QStyleOptionTitleBar | |
QStyleOption::SO_ViewItem | 12 | QStyleOptionViewItem (used in Interviews) |
QStyleOption::SO_CustomBase | 0xf00 | Reserved for custom QStyleOptions; all custom controls values must be above this value |
QStyleOption::SO_ComplexCustomBase | 0xf000000 | Reserved for custom QStyleOptions; all custom complex controls values must be above this value |
Constructs a QStyleOption with version version and type type.
The version has no special meaning for QStyleOption; it can be used by subclasses to distinguish between different version of the same option type.
The state member variable is initialized to QStyle::State_None.
Constructs a copy of other.
Destroys the style option object.
Initializes the state, direction, rect, palette, and fontMetrics member variables based on widget.
This function is provided only for convenience. You can also initialize the variables manually if you want.
This function was introduced in Qt 4.1.
See also QWidget::layoutDirection(), QWidget::rect(), QWidget::palette(), and QWidget::fontMetrics().
Assign other to this QStyleOption.
Equals SO_Default.
Equals 1.
This variable holds the text layout direction that should be used when drawing text in the control.
This variable holds the font metrics that should be used when drawing text in the control.
This variable holds the palette that should be used when painting the control.
This variable holds the area that should be used for various calculations and painting.
This can have different meanings for different types of elements. For example, for QStyle::CE_PushButton it would be the rectangle for the entire button, while for QStyle::CE_PushButtonLabel it would be just the area for the push button label.
This variable holds the style flags that are used when drawing the control.
See also QStyle::drawPrimitive(), QStyle::drawControl(), QStyle::drawComplexControl(), and QStyle::State.
This variable holds the option type of the style option.
See also OptionType.
This variable holds the version of the style option.
This value can be used by subclasses to implement extensions without breaking compatibility. If you use qstyleoption_cast<T>(), you normally don't need to check it.
Returns a T or 0 depending on the type and version of option.
Example:
void MyStyle::drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) { if (element == PE_FocusRect) { const QStyleOptionFocusRect *focusRectOption = qstyleoption_cast<const QStyleOptionFocusRect *>(option); if (focusRectOption) { ... } } ... }
See also QStyleOption::type and QStyleOption::version.
This is an overloaded member function, provided for convenience.
Returns a T or 0 depending on the type of option.
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.1 | |
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 ! |
Copyright © 2000-2012 - www.developpez.com