![]() |
Qt 6.x
The Qt SDK
|
\variable QStyleOption::palette More...
#include <qstyleoption.h>
Public Types | |
enum | StyleOptionType { Type = SO_FocusRect } |
This enum is used to hold information about the type of the style option, and is defined for each QStyleOption 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 QStyleOption subclass. More... | |
![]() | |
enum | OptionType { SO_Default , SO_FocusRect , SO_Button , SO_Tab , SO_MenuItem , SO_Frame , SO_ProgressBar , SO_ToolBox , SO_Header , SO_DockWidget , SO_ViewItem , SO_TabWidgetFrame , SO_TabBarBase , SO_RubberBand , SO_ToolBar , SO_GraphicsItem , SO_Complex = 0xf0000 , SO_Slider , SO_SpinBox , SO_ToolButton , SO_ComboBox , SO_TitleBar , SO_GroupBox , SO_SizeGrip , SO_CustomBase = 0xf00 , SO_ComplexCustomBase = 0xf000000 } |
This enum is used internally by QStyleOption, its subclasses, and qstyleoption_cast() to determine the type of style option. More... | |
enum | StyleOptionType { Type = SO_Default } |
This enum is used to hold information about the type of the style option, and is defined for each QStyleOption 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 QStyleOption subclass. More... | |
Public Member Functions | |
QStyleOptionFocusRect () | |
Constructs a QStyleOptionFocusRect, initializing the members variables to their default values. | |
QStyleOptionFocusRect (const QStyleOptionFocusRect &other) | |
Constructs a copy of the other style option. | |
QStyleOptionFocusRect & | operator= (const QStyleOptionFocusRect &)=default |
![]() | |
QStyleOption (int version=QStyleOption::Version, int type=SO_Default) | |
Constructs a QStyleOption with the specified version and type. | |
QStyleOption (const QStyleOption &other) | |
Constructs a copy of other. | |
~QStyleOption () | |
Destroys this style option object. | |
void | initFrom (const QWidget *w) |
QStyleOption & | operator= (const QStyleOption &other) |
Assign other to this QStyleOption. | |
Public Attributes | |
QColor | backgroundColor |
![]() | |
int | version |
int | type |
QStyle::State | state |
Qt::LayoutDirection | direction |
QRect | rect |
QFontMetrics | fontMetrics |
QPalette | palette |
QObject * | styleObject |
Protected Member Functions | |
QStyleOptionFocusRect (int version) | |
Additional Inherited Members | |
![]() | |
template< typename T > T | qstyleoption_cast (const QStyleOption *option) |
\variable QStyleOptionTitleBar::text | |
template< typename T > T | qstyleoption_cast (QStyleOption *option) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
\variable QStyleOption::palette
the palette that should be used when painting the control
By default, the application's default palette is used.
\variable QStyleOption::direction
the text layout direction that should be used when drawing text in the control
By default, the layout direction is Qt::LeftToRight.
\variable QStyleOption::fontMetrics
the font metrics that should be used when drawing text in the control
By default, the application's default font is used.
\variable QStyleOption::styleObject
the object being styled
The built-in styles support the following types: QWidget, QGraphicsObject and QQuickItem.
\variable QStyleOption::rect
the area that should be used for various calculations and painting
This can have different meanings for different types of elements. For example, for a \l QStyle::CE_PushButton element it would be the rectangle for the entire button, while for a \l QStyle::CE_PushButtonLabel element it would be just the area for the push button label.
The default value is a null rectangle, i.e. a rectangle with both the width and the height set to 0.
\variable QStyleOption::state
the style flags that are used when drawing the control
The default value is QStyle::State_None.
\variable QStyleOption::type
the option type of the style option
The default value is SO_Default.
\variable QStyleOption::version
the version of the style option
This value can be used by subclasses to implement extensions without breaking compatibility. If you use the qstyleoption_cast() function, you normally do not need to check it.
The default value is 1.
The QStyleOptionFocusRect class is used to describe the parameters for drawing a focus rectangle with QStyle.
\inmodule QtWidgets
For performance reasons, there are few member functions and the access to the member variables is direct (i.e., using the . or
->
operator). This makes the structures straightforward to use and emphasizes that these are simply parameters used by the style functions.
Definition at line 74 of file qstyleoption.h.
This enum is used to hold information about the type of the style option, and is defined for each QStyleOption subclass.
\value Type The type of style option provided (\l{SO_FocusRect} 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.
Enumerator | |
---|---|
Type |
Definition at line 77 of file qstyleoption.h.
This enum is used to hold information about the version of the style option, and is defined for each QStyleOption subclass.
\value Version 1
The version is used by QStyleOption subclasses to implement extensions without breaking compatibility. If you use qstyleoption_cast(), you normally do not need to check it.
Enumerator | |
---|---|
Version |
Definition at line 78 of file qstyleoption.h.
QStyleOptionFocusRect::QStyleOptionFocusRect | ( | ) |
Constructs a QStyleOptionFocusRect, initializing the members variables to their default values.
Definition at line 337 of file qstyleoption.cpp.
|
inline |
Constructs a copy of the other style option.
Definition at line 83 of file qstyleoption.h.
References other().
|
protected |
Definition at line 345 of file qstyleoption.cpp.
References QStyleOption::state, and QStyle::State_KeyboardFocusChange.
|
default |
QColor QStyleOptionFocusRect::backgroundColor |
Definition at line 80 of file qstyleoption.h.