QStyleOptionFrameV2 Class Reference

#include <qstyleoption.h>

Inheritance diagram for QStyleOptionFrameV2:

Inheritance graph
[legend]
Collaboration diagram for QStyleOptionFrameV2:

Collaboration graph
[legend]
List of all members.

Detailed Description

the line width for drawing the framethe mid-line width for drawing the frameThe QStyleOptionFrameV2 class is used to describe the parameters necessary for drawing a frame in Qt 4.1 or above.

Since:
4.1
QStyleOptionFrameV2 inherits QStyleOptionFrame which is used for drawing several built-in Qt widgets, including QFrame, QGroupBox, QLineEdit, and QMenu.

An instance of the QStyleOptionFrameV2 class has type SO_Frame and version 2. 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. 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.

If you create your own QStyle subclass, you should handle both QStyleOptionFrame and QStyleOptionFrameV2. One way to achieve this is to use the QStyleOptionFrameV2 copy constructor. For example:

snippets/qstyleoption/main.cpp MyStyle() QStyleOptionFrame }

In the example above: If the frameOption's version is 1, FrameFeature is set to None for frameOptionV2. If frameOption's version is 2, the constructor will simply copy the frameOption's FrameFeature value.

For an example demonstrating how style options can be used, see the {widgets/styles}{Styles} example.

See also:
QStyleOptionFrame, QStyleOption

Definition at line 109 of file qstyleoption.h.

Public Types

enum  StyleOptionVersion
enum  FrameFeature

Public Member Functions

 QStyleOptionFrameV2 ()
 QStyleOptionFrameV2 (const QStyleOptionFrameV2 &other)
 QStyleOptionFrameV2 (const QStyleOptionFrame &other)
QStyleOptionFrameV2operator= (const QStyleOptionFrame &other)

Public Attributes

FrameFeatures features

Protected Member Functions

 QStyleOptionFrameV2 (int version)


Member Enumeration Documentation

enum QStyleOptionFrameV2::StyleOptionVersion

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

Version 2

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 QStyleOptionFrame.

Definition at line 112 of file qstyleoption.h.

00112 { Version = 2 };

enum QStyleOptionFrameV2::FrameFeature

This enum describles the different types of features a frame can have.

None Indicates a normal frame. Flat Indicates a flat frame.

Definition at line 113 of file qstyleoption.h.

00113                       {
00114         None = 0x00,
00115         Flat = 0x01
00116     };


Constructor & Destructor Documentation

QStyleOptionFrameV2::QStyleOptionFrameV2 (  ) 

Constructs a QStyleOptionFrameV2 object.

Definition at line 565 of file qstyleoption.cpp.

00566     : QStyleOptionFrame(Version), features(None)
00567 {
00568 }

QStyleOptionFrameV2::QStyleOptionFrameV2 ( const QStyleOptionFrameV2 other  )  [inline]

Constructs a QStyleOptionFrameV2 copy of the other style option.

Definition at line 121 of file qstyleoption.h.

00121 : QStyleOptionFrame(Version) { *this = other; }

QStyleOptionFrameV2::QStyleOptionFrameV2 ( const QStyleOptionFrame other  ) 

Constructs a QStyleOptionFrameV2 copy of the other style option which can be either of the QStyleOptionFrameV2 or QStyleOptionFrame types.

If the other style option's version is 1, the new style option's FrameFeature value is set to QStyleOptionFrameV2::None. If its version is 2, its FrameFeature value is simply copied to the new style option.

See also:
version

Definition at line 596 of file qstyleoption.cpp.

References features, None, QStyleOption::operator=(), Version, and QStyleOption::version.

00597 {
00598     QStyleOptionFrame::operator=(other);
00599 
00600     const QStyleOptionFrameV2 *f2 = qstyleoption_cast<const QStyleOptionFrameV2 *>(&other);
00601     features = f2 ? f2->features : FrameFeatures(QStyleOptionFrameV2::None);
00602     version = Version;
00603 }

Here is the call graph for this function:

QStyleOptionFrameV2::QStyleOptionFrameV2 ( int  version  )  [protected]

Definition at line 579 of file qstyleoption.cpp.

00580     : QStyleOptionFrame(version), features(None)
00581 {
00582 }


Member Function Documentation

QStyleOptionFrameV2 & QStyleOptionFrameV2::operator= ( const QStyleOptionFrame other  ) 

Assigns the other style option to this style option. The other style option can be either of the QStyleOptionFrameV2 or QStyleOptionFrame types.

If the {other} style option's version is 1, this style option's FrameFeature value is set to QStyleOptionFrameV2::None. If its version is 2, its FrameFeature value is simply copied to this style option.

Definition at line 615 of file qstyleoption.cpp.

References features, None, QStyleOption::operator=(), Version, and QStyleOption::version.

00616 {
00617     QStyleOptionFrame::operator=(other);
00618 
00619     const QStyleOptionFrameV2 *f2 = qstyleoption_cast<const QStyleOptionFrameV2 *>(&other);
00620     features = f2 ? f2->features : FrameFeatures(QStyleOptionFrameV2::None);
00621     version = Version;
00622     return *this;
00623 }

Here is the call graph for this function:


Member Data Documentation

FrameFeatures QStyleOptionFrameV2::features

Definition at line 118 of file qstyleoption.h.

Referenced by QCommonStyle::drawComplexControl(), QCleanlooksStyle::drawComplexControl(), QCommonStyle::drawPrimitive(), QWindowsXPStyle::drawPrimitive(), QPlastiqueStyle::drawPrimitive(), operator=(), and QStyleOptionFrameV2().


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