CopperSpice API  1.9.2
QStyleHintReturn Class Reference

The QStyleHintReturn class provides style hints which return more than basic data types. More...

Inheritance diagram for QStyleHintReturn:
QStyleHintReturnMask QStyleHintReturnVariant

Public Types

enum  HintReturnType
 
enum  StyleOptionType
 
enum  StyleOptionVersion
 

Public Methods

 QStyleHintReturn (int version=QStyleOption::Version, int type=SH_Default)
 

Related Functions

These are not member functions

qstyleoption_cast (const QStyleHintReturn *hint)
 
qstyleoption_cast (QStyleHintReturn *hint)
 

Detailed Description

The QStyleHintReturn class provides style hints which return more than basic data types.

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.

See also
StyleOptionVersion

Member Enumeration Documentation

ConstantValueDescription
QStyleHintReturn::SH_Default0xf000QStyleHintReturn
QStyleHintReturn::SH_Mask?QStyle::SH_RubberBand_Mask QStyle::SH_FocusFrame_Mask
QStyleHintReturn::SH_Variant?QStyle::SH_TextControl_FocusIndicatorTextCharFormat

This enum is used to hold information about the type of the style option and is defined for each QStyleHintReturn subclass.

ConstantValueDescription
QStyleHintReturn::TypeSH_Default The type of style option provided (SH_Default for this class).
See also
StyleOptionVersion, qstyleoption_cast()

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

ConstantValueDescription
QStyleHintReturn::Version11
See also
StyleOptionType, qstyleoption_cast()

Constructor & Destructor Documentation

QStyleHintReturn::QStyleHintReturn ( int  version = QStyleOption::Version,
int  type = SH_Default 
)

Constructs a QStyleHintReturn with version and type. The version has no special meaning for QStyleHintReturn however it can be used by a subclass to distinguish between different version of the same hint type.

See also
QStyleOption::version, QStyleOption::type

Friends And Related Function Documentation

T qstyleoption_cast ( const QStyleHintReturn *  hint)
related

Returns a T or nullptr depending on the type and version of hint.

int MyStyle::styleHint(StyleHint stylehint, const QStyleOption *option, const QWidget *widget, QStyleHintRetur *styleHintReturn) const;
{
if (stylehint == SH_RubberBand_Mask) {
const QStyleHintReturnMask *maskReturn = qstyleoption_cast<const QStyleHintReturnMask *>(hint);
if (maskReturn) {
// ...
}
}
// ...
}
See also
QStyleHintReturn::StyleOptionType, QStyleHintReturn::StyleOptionVersion
T qstyleoption_cast ( QStyleHintReturn *  hint)
related

Returns a T or nullptr depending on the type of hint.