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


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 QStyleOptionProgressBar and QStyleOptionProgressBarV2. One way to achieve this is to use the QStyleOptionProgressBarV2 copy constructor. For example:
snippets/qstyleoption/main.cpp MyStyle::MyStyle() *progressBarOption }
In the example above: If the progressBarOption's version is 1, the extra members ( orientation, invertedAppearance, and bottomToTop) are set to default values for progressBarV2. If the progressBarOption's version is 2, the constructor will simply copy the extra members to progressBarV2.
For an example demonstrating how style options can be used, see the {widgets/styles}{Styles} example.
Definition at line 322 of file qstyleoption.h.
Public Types | |
| enum | StyleOptionType |
| enum | StyleOptionVersion |
Public Member Functions | |
| QStyleOptionProgressBarV2 () | |
| QStyleOptionProgressBarV2 (const QStyleOptionProgressBar &other) | |
| QStyleOptionProgressBarV2 (const QStyleOptionProgressBarV2 &other) | |
| QStyleOptionProgressBarV2 & | operator= (const QStyleOptionProgressBar &other) |
Public Attributes | |
| Qt::Orientation | orientation |
| bool | invertedAppearance |
| bool | bottomToTop |
Protected Member Functions | |
| QStyleOptionProgressBarV2 (int version) | |
the progress bar's orientation (horizontal or vertical); the default orentation is Qt::Horizontalwhether the progress bar's appearance is invertedwhether the text reads from bottom to top when the progress bar is vertical
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_ProgressBar} 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 QStyleOptionProgressBar.
Definition at line 325 of file qstyleoption.h.
00325 { Type = SO_ProgressBar };
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.
Reimplemented from QStyleOptionProgressBar.
Definition at line 326 of file qstyleoption.h.
00326 { Version = 2 };
| QStyleOptionProgressBarV2::QStyleOptionProgressBarV2 | ( | ) |
Constructs a QStyleOptionProgressBarV2, initializing he members variables to their default values.
Definition at line 1888 of file qstyleoption.cpp.
01889 : QStyleOptionProgressBar(2), 01890 orientation(Qt::Horizontal), invertedAppearance(false), bottomToTop(false) 01891 { 01892 }
| QStyleOptionProgressBarV2::QStyleOptionProgressBarV2 | ( | const QStyleOptionProgressBar & | other | ) |
Constructs a copy of the other style option which can be either of the QStyleOptionProgressBar and QStyleOptionProgressBarV2 types.
If the {other} style option's version is 1, the extra members ( orientation, invertedAppearance, and bottomToTop) are set to default values for the new style option. If {other}'s version is 2, the extra members are simply copied.
Definition at line 1915 of file qstyleoption.cpp.
01916 : QStyleOptionProgressBar(2), orientation(Qt::Horizontal), invertedAppearance(false), bottomToTop(false) 01917 { 01918 const QStyleOptionProgressBarV2 *pb2 = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(&other); 01919 if (pb2) 01920 *this = *pb2; 01921 else 01922 *((QStyleOptionProgressBar *)this) = other; 01923 }
| QStyleOptionProgressBarV2::QStyleOptionProgressBarV2 | ( | const QStyleOptionProgressBarV2 & | other | ) |
Constructs a copy of the other style option.
Definition at line 1928 of file qstyleoption.cpp.
01929 : QStyleOptionProgressBar(2), orientation(Qt::Horizontal), invertedAppearance(false), bottomToTop(false) 01930 { 01931 *this = other; 01932 }
| QStyleOptionProgressBarV2::QStyleOptionProgressBarV2 | ( | int | version | ) | [protected] |
Definition at line 1897 of file qstyleoption.cpp.
01898 : QStyleOptionProgressBar(version), 01899 orientation(Qt::Horizontal), invertedAppearance(false), bottomToTop(false) 01900 { 01901 }
| QStyleOptionProgressBarV2 & QStyleOptionProgressBarV2::operator= | ( | const QStyleOptionProgressBar & | other | ) |
Assigns the other style option to this style option. The other style option can be either of the QStyleOptionProgressBarV2 or QStyleOptionProgressBar types.
If the {other} style option's version is 1, the extra members ( orientation, invertedAppearance, and bottomToTop) are set to default values for this style option. If {other}'s version is 2, the extra members are simply copied to this style option.
Definition at line 1945 of file qstyleoption.cpp.
References bottomToTop, Qt::Horizontal, invertedAppearance, QStyleOption::operator=(), and orientation.
01946 { 01947 QStyleOptionProgressBar::operator=(other); 01948 01949 const QStyleOptionProgressBarV2 *pb2 = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(&other); 01950 orientation = pb2 ? pb2->orientation : Qt::Horizontal; 01951 invertedAppearance = pb2 ? pb2->invertedAppearance : false; 01952 bottomToTop = pb2 ? pb2->bottomToTop : false; 01953 return *this; 01954 }
Here is the call graph for this function:

Definition at line 327 of file qstyleoption.h.
Referenced by QMotifStyle::drawControl(), QWindowsStyle::drawControl(), QCommonStyle::drawControl(), QProgressBarPrivate::getStyleOption(), operator=(), and QProgressBar::sizeHint().
Definition at line 328 of file qstyleoption.h.
Referenced by QMotifStyle::drawControl(), QWindowsStyle::drawControl(), QCommonStyle::drawControl(), QProgressBarPrivate::getStyleOption(), and operator=().
Definition at line 329 of file qstyleoption.h.
Referenced by QProgressBarPrivate::getStyleOption(), and operator=().
1.5.1