#include <qstyleoption.h>
Inheritance diagram for QStyleOptionButton:


QStyleOptionButton contains all the information that QStyle functions need to draw graphical elements like QPushButton, QCheckBox, and QRadioButton.
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.
For an example demonstrating how style options can be used, see the {widgets/styles}{Styles} example.
Definition at line 201 of file qstyleoption.h.
Public Types | |
| enum | StyleOptionType |
| enum | StyleOptionVersion |
| enum | ButtonFeature |
Public Member Functions | |
| QStyleOptionButton () | |
| QStyleOptionButton (const QStyleOptionButton &other) | |
Public Attributes | |
| ButtonFeatures | features |
| QString | text |
| QIcon | icon |
| QSize | iconSize |
Protected Member Functions | |
| QStyleOptionButton (int version) | |
This enum is used to hold information about the type of the style option, and is defined for each QStyleOption subclass.
Type The type of style option provided ({SO_Button} 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.
Reimplemented from QStyleOption.
Definition at line 204 of file qstyleoption.h.
This enum is used to hold information about the version of the style option, and is defined for each QStyleOption subclass.
Version 1
The version is used by QStyleOption subclasses to implement extensions without breaking compatibility. If you use qstyleoption_cast(), you normally don't need to check it.
Reimplemented from QStyleOption.
Definition at line 205 of file qstyleoption.h.
00205 { Version = 1 };
This enum describles the different types of features a push button can have.
None Indicates a normal push button. Flat Indicates a flat push button. HasMenu Indicates that the button has a drop down menu. DefaultButton Indicates that the button is a default button. AutoDefaultButton Indicates that the button is an auto default button.
Definition at line 207 of file qstyleoption.h.
00207 { None = 0x00, Flat = 0x01, HasMenu = 0x02, DefaultButton = 0x04, 00208 AutoDefaultButton = 0x08 };
| QStyleOptionButton::QStyleOptionButton | ( | ) |
Constructs a QStyleOptionButton, initializing the members variables to their default values.
Definition at line 1115 of file qstyleoption.cpp.
01116 : QStyleOption(QStyleOptionButton::Version, SO_Button), features(None) 01117 { 01118 }
| QStyleOptionButton::QStyleOptionButton | ( | const QStyleOptionButton & | other | ) | [inline] |
Constructs a copy of the other style option.
Definition at line 217 of file qstyleoption.h.
00217 : QStyleOption(Version, Type) { *this = other; }
| QStyleOptionButton::QStyleOptionButton | ( | int | version | ) | [protected] |
Definition at line 1123 of file qstyleoption.cpp.
01124 : QStyleOption(version, SO_Button), features(None) 01125 { 01126 }
| ButtonFeatures QStyleOptionButton::features |
Definition at line 211 of file qstyleoption.h.
Referenced by ColorButton::drawButton(), QStyleSheetStyle::drawControl(), NorwegianWoodStyle::drawPrimitive(), and QPushButtonPrivate::getStyleOption().
Definition at line 212 of file qstyleoption.h.
Referenced by QPushButtonPrivate::getStyleOption(), getStyleOption(), and QCheckBoxPrivate::getStyleOption().
Definition at line 213 of file qstyleoption.h.
Referenced by QPushButtonPrivate::getStyleOption(), getStyleOption(), QCheckBoxPrivate::getStyleOption(), QCheckBox::sizeHint(), and QRadioButton::sizeHint().
Definition at line 214 of file qstyleoption.h.
Referenced by QPushButtonPrivate::getStyleOption(), getStyleOption(), QCheckBoxPrivate::getStyleOption(), QCheckBox::sizeHint(), QPushButton::sizeHint(), and QRadioButton::sizeHint().
1.5.1