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

QStyleHintReturn and its subclasses are used to pass information from a style back to the querying widget. This is most useful when the return value from QStyle::styleHint() does not provide enough detail; for example, when a mask is to be returned.
### --Sam
Definition at line 728 of file qstyleoption.h.
Public Types | |
| enum | HintReturnType |
| enum | StyleOptionType |
| enum | StyleOptionVersion |
Public Member Functions | |
| QStyleHintReturn (int version=QStyleOption::Version, int type=SH_Default) | |
| ~QStyleHintReturn () | |
Public Attributes | |
| int | version |
| int | type |
Related Functions | |
| (Note that these are not member functions.) | |
| T | qstyleoption_cast (const QStyleHintReturn *hint) |
| T | qstyleoption_cast (QStyleHintReturn *hint) |
SH_Default QStyleHintReturn SH_Mask QStyle::SH_RubberBand_Mask QStyle::SH_FocusFrame_Mask
Definition at line 730 of file qstyleoption.h.
00730 { 00731 SH_Default=0xf000, SH_Mask 00732 };
This enum is used to hold information about the type of the style option, and is defined for each QStyleHintReturn subclass.
Type The type of style option provided ( SH_Default for this class).
The type is used internally by QStyleHintReturn, 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 QStyleHintReturn subclass and your own styles.
Definition at line 734 of file qstyleoption.h.
00734 { Type = SH_Default };
This enum is used to hold information about the version of the style option, and is defined for each QStyleHintReturn subclass.
Version 1
The version is used by QStyleHintReturn subclasses to implement extensions without breaking compatibility. If you use qstyleoption_cast(), you normally don't need to check it.
Definition at line 735 of file qstyleoption.h.
00735 { Version = 1 };
| QStyleHintReturn::QStyleHintReturn | ( | int | version = QStyleOption::Version, |
|
| int | type = SH_Default | |||
| ) |
the type of the style hint containerthe version of the style hint return container
Constructs a QStyleHintReturn with version version and type type.
The version has no special meaning for QStyleHintReturn; it can be used by subclasses to distinguish between different version of the same hint type.
Definition at line 4325 of file qstyleoption.cpp.
| QStyleHintReturn::~QStyleHintReturn | ( | ) |
| T qstyleoption_cast< T > | ( | const QStyleHintReturn * | hint | ) | [related] |
Returns a T or 0 depending on the {QStyleHintReturn::type}{type} and {QStyleHintReturn::version}{version} of hint.
Example:
int MyStyle::styleHint(StyleHint stylehint, const QStyleOption *opt, const QWidget *widget, QStyleHintReturn* returnData) const; { if (stylehint == SH_RubberBand_Mask) { const QStyleHintReturnMask *maskReturn = qstyleoption_cast<const QStyleHintReturnMask *>(hint); if (maskReturn) { ... } } ... }
Definition at line 755 of file qstyleoption.h.
00756 { 00757 if (hint && hint->version <= static_cast<T>(0)->Version && 00758 (hint->type == static_cast<T>(0)->Type || int(static_cast<T>(0)->Type) == QStyleHintReturn::SH_Default)) 00759 return static_cast<T>(hint); 00760 return 0; 00761 }
| T qstyleoption_cast< T > | ( | QStyleHintReturn * | hint | ) | [related] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Returns a T or 0 depending on the type of hint.
Definition at line 764 of file qstyleoption.h.
00765 { 00766 if (hint && hint->version <= static_cast<T>(0)->Version && 00767 (hint->type == static_cast<T>(0)->Type || int(static_cast<T>(0)->Type) == QStyleHintReturn::SH_Default)) 00768 return static_cast<T>(hint); 00769 return 0; 00770 }
1.5.1