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


If you create your own QStyle subclass, you should handle both QStyleOptionTab and QStyleOptionTabV2. One way to achieve this is to use the QStyleOptionTabV2 copy constructor. For example:
snippets/qstyleoption/main.cpp MyStyle::MyStyle() *tabOption }
In the example above: If tabOption's version is 1, the extra member ( iconSize) will be set to an invalid size for tabV2. If tabOption's version is 2, the constructor will simply copy the tab's iconSize.
For an example demonstrating how style options can be used, see the {widgets/styles}{Styles} example.
Definition at line 255 of file qstyleoption.h.
Public Types | |
| enum | StyleOptionVersion |
Public Member Functions | |
| QStyleOptionTabV2 () | |
| QStyleOptionTabV2 (const QStyleOptionTabV2 &other) | |
| QStyleOptionTabV2 (const QStyleOptionTab &other) | |
| QStyleOptionTabV2 & | operator= (const QStyleOptionTab &other) |
Public Attributes | |
| QSize | iconSize |
Protected Member Functions | |
| QStyleOptionTabV2 (int version) | |
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 QStyleOptionTab.
Definition at line 258 of file qstyleoption.h.
00258 { Version = 2 };
| QStyleOptionTabV2::QStyleOptionTabV2 | ( | ) |
the size for the icons
Constructs a QStyleOptionTabV2.
Definition at line 1635 of file qstyleoption.cpp.
01636 : QStyleOptionTab(Version) 01637 { 01638 }
| QStyleOptionTabV2::QStyleOptionTabV2 | ( | const QStyleOptionTabV2 & | other | ) | [inline] |
Constructs a copy of the other style option.
Definition at line 261 of file qstyleoption.h.
00261 : QStyleOptionTab(Version) { *this = other; }
| QStyleOptionTabV2::QStyleOptionTabV2 | ( | const QStyleOptionTab & | other | ) |
Constructs a QStyleOptionTabV2 copy of the other style option which can be either of the QStyleOptionTabV2 or QStyleOptionTab types.
If the other style option's version is 1, the new style option's iconSize is set to an invalid value. If its version is 2, its iconSize value is simply copied to the new style option.
Definition at line 1663 of file qstyleoption.cpp.
References QStyleOption::version, and Version.
01664 : QStyleOptionTab(Version) 01665 { 01666 if (const QStyleOptionTabV2 *tab = qstyleoption_cast<const QStyleOptionTabV2 *>(&other)) { 01667 *this = *tab; 01668 } else { 01669 *((QStyleOptionTab *)this) = other; 01670 version = Version; 01671 } 01672 }
| QStyleOptionTabV2::QStyleOptionTabV2 | ( | int | version | ) | [protected] |
| QStyleOptionTabV2 & QStyleOptionTabV2::operator= | ( | const QStyleOptionTab & | other | ) |
Assigns the other style option to this QStyleOptionTabV2. The other style option can be either of the QStyleOptionTabV2 or QStyleOptionTab types.
If the other style option's version is 1, this style option's iconSize is set to an invalid size. If its version is 2, its iconSize value is simply copied to this style option.
Definition at line 1683 of file qstyleoption.cpp.
References iconSize, and QStyleOption::operator=().
01684 { 01685 QStyleOptionTab::operator=(other); 01686 01687 if (const QStyleOptionTabV2 *tab = qstyleoption_cast<const QStyleOptionTabV2 *>(&other)) 01688 iconSize = tab->iconSize; 01689 else 01690 iconSize = QSize(); 01691 return *this; 01692 }
Here is the call graph for this function:

Definition at line 259 of file qstyleoption.h.
Referenced by QCommonStyle::drawControl(), QTabBarPrivate::getStyleOption(), and operator=().
1.5.1