#[repr(C)]pub struct QStyleOptionGraphicsItem { /* private fields */ }
Expand description
The QStyleOptionGraphicsItem class is used to describe the parameters needed to draw a QGraphicsItem.
C++ class: QStyleOptionGraphicsItem
.
The QStyleOptionGraphicsItem class is used to describe the parameters needed to draw a QGraphicsItem.
For performance reasons, the access to the member variables is direct (i.e., using the .
or ->
operator). This low-level feel makes the structures straightforward to use and emphasizes that these are simply parameters.
For an example demonstrating how style options can be used, see the Styles example.
Implementations§
Source§impl QStyleOptionGraphicsItem
impl QStyleOptionGraphicsItem
Sourcepub unsafe fn copy_from(
&self,
other: impl CastInto<Ref<QStyleOptionGraphicsItem>>,
) -> Ref<QStyleOptionGraphicsItem>
pub unsafe fn copy_from( &self, other: impl CastInto<Ref<QStyleOptionGraphicsItem>>, ) -> Ref<QStyleOptionGraphicsItem>
The QStyleOptionGraphicsItem class is used to describe the parameters needed to draw a QGraphicsItem.
Calls C++ function: QStyleOptionGraphicsItem& QStyleOptionGraphicsItem::operator=(const QStyleOptionGraphicsItem& other)
.
The QStyleOptionGraphicsItem class is used to describe the parameters needed to draw a QGraphicsItem.
For performance reasons, the access to the member variables is direct (i.e., using the .
or ->
operator). This low-level feel makes the structures straightforward to use and emphasizes that these are simply parameters.
For an example demonstrating how style options can be used, see the Styles example.
Sourcepub unsafe fn exposed_rect(&self) -> Ref<QRectF>
pub unsafe fn exposed_rect(&self) -> Ref<QRectF>
Returns a reference to the exposedRect
field.
Sourcepub unsafe fn exposed_rect_mut(&self) -> Ref<QRectF>
pub unsafe fn exposed_rect_mut(&self) -> Ref<QRectF>
Returns a mutable reference to the exposedRect
field.
Sourcepub unsafe fn level_of_detail(&self) -> c_double
pub unsafe fn level_of_detail(&self) -> c_double
Returns the value of the levelOfDetail
field.
Sourcepub unsafe fn level_of_detail_from_transform(
world_transform: impl CastInto<Ref<QTransform>>,
) -> c_double
pub unsafe fn level_of_detail_from_transform( world_transform: impl CastInto<Ref<QTransform>>, ) -> c_double
Returns the level of detail from the worldTransform.
Calls C++ function: static double QStyleOptionGraphicsItem::levelOfDetailFromTransform(const QTransform& worldTransform)
.
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.
This function was introduced in Qt 4.6.
See also QGraphicsScene::minimumRenderSize().
Sourcepub unsafe fn matrix_mut(&self) -> Ref<QMatrix>
pub unsafe fn matrix_mut(&self) -> Ref<QMatrix>
Returns a mutable reference to the matrix
field.
Sourcepub unsafe fn new() -> CppBox<QStyleOptionGraphicsItem>
pub unsafe fn new() -> CppBox<QStyleOptionGraphicsItem>
Constructs a QStyleOptionGraphicsItem.
Calls C++ function: [constructor] void QStyleOptionGraphicsItem::QStyleOptionGraphicsItem()
.
Constructs a QStyleOptionGraphicsItem.
Sourcepub unsafe fn new_copy(
other: impl CastInto<Ref<QStyleOptionGraphicsItem>>,
) -> CppBox<QStyleOptionGraphicsItem>
pub unsafe fn new_copy( other: impl CastInto<Ref<QStyleOptionGraphicsItem>>, ) -> CppBox<QStyleOptionGraphicsItem>
Constructs a copy of other.
Calls C++ function: [constructor] void QStyleOptionGraphicsItem::QStyleOptionGraphicsItem(const QStyleOptionGraphicsItem& other)
.
Constructs a copy of other.
Sourcepub unsafe fn set_exposed_rect(&self, value: impl CastInto<Ref<QRectF>>)
pub unsafe fn set_exposed_rect(&self, value: impl CastInto<Ref<QRectF>>)
Sets the value of the exposedRect
field.
Sourcepub unsafe fn set_level_of_detail(&self, value: c_double)
pub unsafe fn set_level_of_detail(&self, value: c_double)
Sets the value of the levelOfDetail
field.
Sourcepub unsafe fn set_matrix(&self, value: impl CastInto<Ref<QMatrix>>)
pub unsafe fn set_matrix(&self, value: impl CastInto<Ref<QMatrix>>)
Sets the value of the matrix
field.
Methods from Deref<Target = QStyleOption>§
Sourcepub unsafe fn copy_from(
&self,
other: impl CastInto<Ref<QStyleOption>>,
) -> Ref<QStyleOption>
pub unsafe fn copy_from( &self, other: impl CastInto<Ref<QStyleOption>>, ) -> Ref<QStyleOption>
Assign other to this QStyleOption.
Calls C++ function: QStyleOption& QStyleOption::operator=(const QStyleOption& other)
.
Assign other to this QStyleOption.
Sourcepub unsafe fn direction(&self) -> LayoutDirection
pub unsafe fn direction(&self) -> LayoutDirection
Returns the value of the direction
field.
Sourcepub unsafe fn font_metrics(&self) -> Ref<QFontMetrics>
pub unsafe fn font_metrics(&self) -> Ref<QFontMetrics>
Returns a reference to the fontMetrics
field.
Sourcepub unsafe fn font_metrics_mut(&self) -> Ref<QFontMetrics>
pub unsafe fn font_metrics_mut(&self) -> Ref<QFontMetrics>
Returns a mutable reference to the fontMetrics
field.
Sourcepub unsafe fn init(&self, w: impl CastInto<Ptr<QWidget>>)
pub unsafe fn init(&self, w: impl CastInto<Ptr<QWidget>>)
Sourcepub unsafe fn init_from(&self, w: impl CastInto<Ptr<QWidget>>)
pub unsafe fn init_from(&self, w: impl CastInto<Ptr<QWidget>>)
Initializes the state, direction, rect, palette, fontMetrics and styleObject member variables based on the specified widget.
Calls C++ function: void QStyleOption::initFrom(const QWidget* w)
.
Initializes the state, direction, rect, palette, fontMetrics and styleObject member variables based on the specified widget.
This is a convenience function; the member variables can also be initialized manually.
This function was introduced in Qt 4.1.
See also QWidget::layoutDirection(), QWidget::rect(), QWidget::palette(), and QWidget::fontMetrics().
Sourcepub unsafe fn palette_mut(&self) -> Ref<QPalette>
pub unsafe fn palette_mut(&self) -> Ref<QPalette>
Returns a mutable reference to the palette
field.
Sourcepub unsafe fn set_direction(&self, value: LayoutDirection)
pub unsafe fn set_direction(&self, value: LayoutDirection)
Sets the value of the direction
field.
Sourcepub unsafe fn set_font_metrics(&self, value: impl CastInto<Ref<QFontMetrics>>)
pub unsafe fn set_font_metrics(&self, value: impl CastInto<Ref<QFontMetrics>>)
Sets the value of the fontMetrics
field.
Sourcepub unsafe fn set_palette(&self, value: impl CastInto<Ref<QPalette>>)
pub unsafe fn set_palette(&self, value: impl CastInto<Ref<QPalette>>)
Sets the value of the palette
field.
Sourcepub unsafe fn set_rect(&self, value: impl CastInto<Ref<QRect>>)
pub unsafe fn set_rect(&self, value: impl CastInto<Ref<QRect>>)
Sets the value of the rect
field.
Sourcepub unsafe fn set_style_object(&self, value: impl CastInto<Ptr<QObject>>)
pub unsafe fn set_style_object(&self, value: impl CastInto<Ptr<QObject>>)
Sets the value of the styleObject
field.
Sourcepub unsafe fn set_version(&self, value: c_int)
pub unsafe fn set_version(&self, value: c_int)
Sets the value of the version
field.
Sourcepub unsafe fn style_object(&self) -> QPtr<QObject>
pub unsafe fn style_object(&self) -> QPtr<QObject>
Returns the value of the styleObject
field.
Trait Implementations§
Source§impl CppDeletable for QStyleOptionGraphicsItem
impl CppDeletable for QStyleOptionGraphicsItem
Source§unsafe fn delete(&self)
unsafe fn delete(&self)
The QStyleOptionGraphicsItem class is used to describe the parameters needed to draw a QGraphicsItem.
Calls C++ function: [destructor] void QStyleOptionGraphicsItem::~QStyleOptionGraphicsItem()
.
The QStyleOptionGraphicsItem class is used to describe the parameters needed to draw a QGraphicsItem.
For performance reasons, the access to the member variables is direct (i.e., using the .
or ->
operator). This low-level feel makes the structures straightforward to use and emphasizes that these are simply parameters.
For an example demonstrating how style options can be used, see the Styles example.
Source§impl Deref for QStyleOptionGraphicsItem
impl Deref for QStyleOptionGraphicsItem
Source§fn deref(&self) -> &QStyleOption
fn deref(&self) -> &QStyleOption
Calls C++ function: QStyleOption* static_cast<QStyleOption*>(QStyleOptionGraphicsItem* ptr)
.
Source§type Target = QStyleOption
type Target = QStyleOption
Source§impl StaticDowncast<QStyleOptionGraphicsItem> for QStyleOption
impl StaticDowncast<QStyleOptionGraphicsItem> for QStyleOption
Source§unsafe fn static_downcast(
ptr: Ptr<QStyleOption>,
) -> Ptr<QStyleOptionGraphicsItem>
unsafe fn static_downcast( ptr: Ptr<QStyleOption>, ) -> Ptr<QStyleOptionGraphicsItem>
Calls C++ function: QStyleOptionGraphicsItem* static_cast<QStyleOptionGraphicsItem*>(QStyleOption* ptr)
.
Source§impl StaticUpcast<QStyleOption> for QStyleOptionGraphicsItem
impl StaticUpcast<QStyleOption> for QStyleOptionGraphicsItem
Source§unsafe fn static_upcast(ptr: Ptr<QStyleOptionGraphicsItem>) -> Ptr<QStyleOption>
unsafe fn static_upcast(ptr: Ptr<QStyleOptionGraphicsItem>) -> Ptr<QStyleOption>
Calls C++ function: QStyleOption* static_cast<QStyleOption*>(QStyleOptionGraphicsItem* ptr)
.