Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QStyleHintReturn Class Reference

\variable QStyleOptionGraphicsItem::exposedRect More...

#include <qstyleoption.h>

+ Inheritance diagram for QStyleHintReturn:
+ Collaboration diagram for QStyleHintReturn:

Public Types

enum  HintReturnType { SH_Default =0xf000 , SH_Mask , SH_Variant }
 \value SH_Default QStyleHintReturn \value SH_Mask \l QStyle::SH_RubberBand_Mask QStyle::SH_FocusFrame_Mask \value SH_Variant \l QStyle::SH_TextControl_FocusIndicatorTextCharFormat More...
 
enum  StyleOptionType { Type = SH_Default }
 This enum is used to hold information about the type of the style option, and is defined for each QStyleHintReturn subclass. More...
 
enum  StyleOptionVersion { Version = 1 }
 This enum is used to hold information about the version of the style option, and is defined for each QStyleHintReturn subclass. More...
 

Public Member Functions

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

Public Attributes

int version
 
int type
 

Related Symbols

(Note that these are not member symbols.)

template< typename T > T qstyleoption_cast (const QStyleHintReturn *hint)
 Returns a T or \nullptr depending on the \l{QStyleHintReturn::type}{type} and \l{QStyleHintReturn::version}{version} of hint.
 
template< typename T > T qstyleoption_cast (QStyleHintReturn *hint)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 

Detailed Description

\variable QStyleOptionGraphicsItem::exposedRect

the exposed rectangle, in item coordinates

Make use of this rectangle to speed up item drawing when only parts of the item are exposed. If the whole item is exposed, this rectangle will be the same as QGraphicsItem::boundingRect().

This member is only initialized for items that have the QGraphicsItem::ItemUsesExtendedStyleOption flag set.

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

\inmodule QtWidgets

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.

Definition at line 689 of file qstyleoption.h.

Member Enumeration Documentation

◆ HintReturnType

\value SH_Default QStyleHintReturn \value SH_Mask \l QStyle::SH_RubberBand_Mask QStyle::SH_FocusFrame_Mask \value SH_Variant \l QStyle::SH_TextControl_FocusIndicatorTextCharFormat

Enumerator
SH_Default 
SH_Mask 
SH_Variant 

Definition at line 691 of file qstyleoption.h.

◆ StyleOptionType

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

\value Type The type of style option provided (\l 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.

See also
StyleOptionVersion
Enumerator
Type 

Definition at line 695 of file qstyleoption.h.

◆ StyleOptionVersion

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

\value Version 1

The version is used by QStyleHintReturn subclasses to implement extensions without breaking compatibility. If you use qstyleoption_cast(), you normally do not need to check it.

See also
StyleOptionType
Enumerator
Version 

Definition at line 696 of file qstyleoption.h.

Constructor & Destructor Documentation

◆ QStyleHintReturn()

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

\variable QStyleHintReturn::type

the type of the style hint container

See also
HintReturnType

\variable QStyleHintReturn::version

the version of the style hint return container

This value can be used by subclasses to implement extensions without breaking compatibility. If you use qstyleoption_cast<T>(), you normally do not need to check it.

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.

See also
QStyleOption::version, QStyleOption::type

Definition at line 3676 of file qstyleoption.cpp.

◆ ~QStyleHintReturn()

QStyleHintReturn::~QStyleHintReturn ( )

Definition at line 3685 of file qstyleoption.cpp.

Friends And Related Symbol Documentation

◆ qstyleoption_cast() [1/2]

template< typename T > T qstyleoption_cast< T > ( const QStyleHintReturn * hint)
related

Returns a T or \nullptr depending on the \l{QStyleHintReturn::type}{type} and \l{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) {
...
}
}
...
}
The QStyleHintReturnMask class provides style hints that return a QRegion.
virtual int styleHint(StyleHint stylehint, const QStyleOption *opt=nullptr, const QWidget *widget=nullptr, QStyleHintReturn *returnData=nullptr) const =0
Returns an integer representing the specified style hint for the given widget described by the provid...
QStyleOptionButton opt
See also
QStyleHintReturn::type, QStyleHintReturn::version

Definition at line 728 of file qstyleoption.h.

References hint(), and SH_Default.

+ Here is the call graph for this function:

◆ qstyleoption_cast() [2/2]

template< typename T > 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 \nullptr depending on the type of hint.

Definition at line 738 of file qstyleoption.h.

References hint(), and SH_Default.

+ Here is the call graph for this function:

Member Data Documentation

◆ type

int QStyleHintReturn::type

Definition at line 702 of file qstyleoption.h.

◆ version

int QStyleHintReturn::version

Definition at line 701 of file qstyleoption.h.


The documentation for this class was generated from the following files: