QStyleOptionButton Class Reference

#include <qstyleoption.h>

Inheritance diagram for QStyleOptionButton:

Inheritance graph
[legend]
Collaboration diagram for QStyleOptionButton:

Collaboration graph
[legend]
List of all members.

Detailed Description

The QStyleOptionButton class is used to describe the parameters for drawing buttons.

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.

See also:
QStyleOption, QStyleOptionToolButton

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)


Member Enumeration Documentation

enum QStyleOptionButton::StyleOptionType

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.

See also:
StyleOptionVersion

Reimplemented from QStyleOption.

Definition at line 204 of file qstyleoption.h.

00204 { Type = SO_Button };

enum QStyleOptionButton::StyleOptionVersion

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.

See also:
StyleOptionType

Reimplemented from QStyleOption.

Definition at line 205 of file qstyleoption.h.

00205 { Version = 1 };

enum QStyleOptionButton::ButtonFeature

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.

See also:
features

Definition at line 207 of file qstyleoption.h.

00207                        { None = 0x00, Flat = 0x01, HasMenu = 0x02, DefaultButton = 0x04,
00208                          AutoDefaultButton = 0x08 };


Constructor & Destructor Documentation

QStyleOptionButton::QStyleOptionButton (  ) 

Constructs a QStyleOptionButton, initializing the members variables to their default values.

Definition at line 1115 of file qstyleoption.cpp.

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 }


Member Data Documentation

ButtonFeatures QStyleOptionButton::features

Definition at line 211 of file qstyleoption.h.

Referenced by ColorButton::drawButton(), QStyleSheetStyle::drawControl(), NorwegianWoodStyle::drawPrimitive(), and QPushButtonPrivate::getStyleOption().

QString QStyleOptionButton::text

Definition at line 212 of file qstyleoption.h.

Referenced by QPushButtonPrivate::getStyleOption(), getStyleOption(), and QCheckBoxPrivate::getStyleOption().

QIcon QStyleOptionButton::icon

Definition at line 213 of file qstyleoption.h.

Referenced by QPushButtonPrivate::getStyleOption(), getStyleOption(), QCheckBoxPrivate::getStyleOption(), QCheckBox::sizeHint(), and QRadioButton::sizeHint().

QSize QStyleOptionButton::iconSize

Definition at line 214 of file qstyleoption.h.

Referenced by QPushButtonPrivate::getStyleOption(), getStyleOption(), QCheckBoxPrivate::getStyleOption(), QCheckBox::sizeHint(), QPushButton::sizeHint(), and QRadioButton::sizeHint().


The documentation for this class was generated from the following files:
Generated on Thu Mar 15 19:10:14 2007 for Qt 4.2 User's Guide by  doxygen 1.5.1