QtBase
v6.3.1
|
The QStyleOptionGraphicsItem class is used to describe the parameters needed to draw a QGraphicsItem. More...
#include <qstyleoption.h>
Public Types | |
enum | StyleOptionType { Type = SO_GraphicsItem } |
enum | StyleOptionVersion { Version = 1 } |
Public Types inherited from QStyleOption | |
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 } |
enum | StyleOptionType { Type = SO_Default } |
enum | StyleOptionVersion { Version = 1 } |
Public Member Functions | |
QStyleOptionGraphicsItem () | |
QStyleOptionGraphicsItem (const QStyleOptionGraphicsItem &other) | |
QStyleOptionGraphicsItem & | operator= (const QStyleOptionGraphicsItem &)=default |
Public Member Functions inherited from QStyleOption | |
QStyleOption (int version=QStyleOption::Version, int type=SO_Default) | |
QStyleOption (const QStyleOption &other) | |
~QStyleOption () | |
void | initFrom (const QWidget *w) |
QStyleOption & | operator= (const QStyleOption &other) |
Static Public Member Functions | |
static qreal | levelOfDetailFromTransform (const QTransform &worldTransform) |
Public Attributes | |
QRectF | exposedRect |
Public Attributes inherited from QStyleOption | |
int | version |
int | type |
QStyle::State | state |
Qt::LayoutDirection | direction |
QRect | rect |
QFontMetrics | fontMetrics |
QPalette | palette |
QObject * | styleObject |
Protected Member Functions | |
QStyleOptionGraphicsItem (int version) | |
Additional Inherited Members | |
Related Functions inherited from QStyleOption | |
template< typename T > T | qstyleoption_cast (const QStyleOption *option) |
the text of the title bar More... | |
template< typename T > T | qstyleoption_cast (QStyleOption *option) |
The QStyleOptionGraphicsItem class is used to describe the parameters needed to draw a QGraphicsItem.
\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.
For an example demonstrating how style options can be used, see the \l {widgets/styles}{Styles} example.
Definition at line 683 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_GraphicsItem 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 686 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 687 of file qstyleoption.h.
QStyleOptionGraphicsItem::QStyleOptionGraphicsItem | ( | ) |
Constructs a QStyleOptionGraphicsItem.
Definition at line 3646 of file qstyleoption.cpp.
|
inline |
Constructs a copy of other.
Definition at line 692 of file qstyleoption.h.
|
protected |
Definition at line 3654 of file qstyleoption.cpp.
|
static |
Returns the level of detail from the worldTransform.
Its value represents the maximum value of the height and width of a unity rectangle, mapped using the worldTransform of the painter used to draw the item. By default, if no transformations are applied, its value is 1. If zoomed out 1:2, the level of detail will be 0.5, and if zoomed in 2:1, its value is 2.
Definition at line 3672 of file qstyleoption.cpp.
|
default |
QRectF QStyleOptionGraphicsItem::exposedRect |
Definition at line 689 of file qstyleoption.h.