[][src]Struct qt_widgets::QGraphicsPathItem

#[repr(C)]pub struct QGraphicsPathItem { /* fields omitted */ }

The QGraphicsPathItem class provides a path item that you can add to a QGraphicsScene.

C++ class: QGraphicsPathItem.

C++ documentation:

The QGraphicsPathItem class provides a path item that you can add to a QGraphicsScene.

To set the item's path, pass a QPainterPath to QGraphicsPathItem's constructor, or call the setPath() function. The path() function returns the current path.

QGraphicsPathItem uses the path to provide a reasonable implementation of boundingRect(), shape(), and contains(). The paint() function draws the path using the item's associated pen and brush, which you can set by calling the setPen() and setBrush() functions.

Methods

impl QGraphicsPathItem[src]

pub unsafe fn bounding_rect(&self) -> CppBox<QRectF>[src]

Reimplemented from QGraphicsItem::boundingRect().

Calls C++ function: virtual QRectF QGraphicsPathItem::boundingRect() const.

C++ documentation:

Reimplemented from QGraphicsItem::boundingRect().

pub unsafe fn contains(&self, point: impl CastInto<Ref<QPointF>>) -> bool[src]

Reimplemented from QGraphicsItem::contains().

Calls C++ function: virtual bool QGraphicsPathItem::contains(const QPointF& point) const.

C++ documentation:

Reimplemented from QGraphicsItem::contains().

pub unsafe fn is_obscured_by(
    &self,
    item: impl CastInto<Ptr<QGraphicsItem>>
) -> bool
[src]

Reimplemented from QGraphicsItem::isObscuredBy().

Calls C++ function: virtual bool QGraphicsPathItem::isObscuredBy(const QGraphicsItem* item) const.

C++ documentation:

Reimplemented from QGraphicsItem::isObscuredBy().

pub unsafe fn from_q_graphics_item(
    parent: impl CastInto<Ptr<QGraphicsItem>>
) -> CppBox<QGraphicsPathItem>
[src]

Constructs a QGraphicsPath. parent is passed to QAbstractGraphicsShapeItem's constructor.

Calls C++ function: [constructor] void QGraphicsPathItem::QGraphicsPathItem(QGraphicsItem* parent = …).

C++ documentation:

Constructs a QGraphicsPath. parent is passed to QAbstractGraphicsShapeItem's constructor.

See also QGraphicsScene::addItem().

pub unsafe fn from_q_painter_path_q_graphics_item(
    path: impl CastInto<Ref<QPainterPath>>,
    parent: impl CastInto<Ptr<QGraphicsItem>>
) -> CppBox<QGraphicsPathItem>
[src]

Constructs a QGraphicsPath item using path as the default path. parent is passed to QAbstractGraphicsShapeItem's constructor.

Calls C++ function: [constructor] void QGraphicsPathItem::QGraphicsPathItem(const QPainterPath& path, QGraphicsItem* parent = …).

C++ documentation:

Constructs a QGraphicsPath item using path as the default path. parent is passed to QAbstractGraphicsShapeItem's constructor.

See also QGraphicsScene::addItem().

pub unsafe fn new() -> CppBox<QGraphicsPathItem>[src]

The QGraphicsPathItem class provides a path item that you can add to a QGraphicsScene.

Calls C++ function: [constructor] void QGraphicsPathItem::QGraphicsPathItem().

C++ documentation:

The QGraphicsPathItem class provides a path item that you can add to a QGraphicsScene.

To set the item's path, pass a QPainterPath to QGraphicsPathItem's constructor, or call the setPath() function. The path() function returns the current path.

QGraphicsPathItem uses the path to provide a reasonable implementation of boundingRect(), shape(), and contains(). The paint() function draws the path using the item's associated pen and brush, which you can set by calling the setPen() and setBrush() functions.

pub unsafe fn from_q_painter_path(
    path: impl CastInto<Ref<QPainterPath>>
) -> CppBox<QGraphicsPathItem>
[src]

Constructs a QGraphicsPath item using path as the default path. parent is passed to QAbstractGraphicsShapeItem's constructor.

Calls C++ function: [constructor] void QGraphicsPathItem::QGraphicsPathItem(const QPainterPath& path).

C++ documentation:

Constructs a QGraphicsPath item using path as the default path. parent is passed to QAbstractGraphicsShapeItem's constructor.

See also QGraphicsScene::addItem().

pub unsafe fn opaque_area(&self) -> CppBox<QPainterPath>[src]

Reimplemented from QGraphicsItem::opaqueArea().

Calls C++ function: virtual QPainterPath QGraphicsPathItem::opaqueArea() const.

C++ documentation:

Reimplemented from QGraphicsItem::opaqueArea().

pub unsafe fn paint_3a(
    &self,
    painter: impl CastInto<Ptr<QPainter>>,
    option: impl CastInto<Ptr<QStyleOptionGraphicsItem>>,
    widget: impl CastInto<Ptr<QWidget>>
)
[src]

Reimplemented from QGraphicsItem::paint().

Calls C++ function: virtual void QGraphicsPathItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = …).

C++ documentation:

Reimplemented from QGraphicsItem::paint().

pub unsafe fn paint_2a(
    &self,
    painter: impl CastInto<Ptr<QPainter>>,
    option: impl CastInto<Ptr<QStyleOptionGraphicsItem>>
)
[src]

Reimplemented from QGraphicsItem::paint().

Calls C++ function: virtual void QGraphicsPathItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* option).

C++ documentation:

Reimplemented from QGraphicsItem::paint().

pub unsafe fn path(&self) -> CppBox<QPainterPath>[src]

Returns the item's path as a QPainterPath. If no item has been set, an empty QPainterPath is returned.

Calls C++ function: QPainterPath QGraphicsPathItem::path() const.

C++ documentation:

Returns the item's path as a QPainterPath. If no item has been set, an empty QPainterPath is returned.

See also setPath().

pub unsafe fn set_path(&self, path: impl CastInto<Ref<QPainterPath>>)[src]

Sets the item's path to be the given path.

Calls C++ function: void QGraphicsPathItem::setPath(const QPainterPath& path).

C++ documentation:

Sets the item's path to be the given path.

See also path().

pub unsafe fn shape(&self) -> CppBox<QPainterPath>[src]

Reimplemented from QGraphicsItem::shape().

Calls C++ function: virtual QPainterPath QGraphicsPathItem::shape() const.

C++ documentation:

Reimplemented from QGraphicsItem::shape().

pub unsafe fn type_(&self) -> c_int[src]

Reimplemented from QGraphicsItem::type().

Calls C++ function: virtual int QGraphicsPathItem::type() const.

C++ documentation:

Reimplemented from QGraphicsItem::type().

Methods from Deref<Target = QAbstractGraphicsShapeItem>

pub unsafe fn brush(&self) -> CppBox<QBrush>[src]

Returns the item's brush, or an empty brush if no brush has been set.

Calls C++ function: QBrush QAbstractGraphicsShapeItem::brush() const.

C++ documentation:

Returns the item's brush, or an empty brush if no brush has been set.

See also setBrush().

pub unsafe fn is_obscured_by(
    &self,
    item: impl CastInto<Ptr<QGraphicsItem>>
) -> bool
[src]

Reimplemented from QGraphicsItem::isObscuredBy().

Calls C++ function: virtual bool QAbstractGraphicsShapeItem::isObscuredBy(const QGraphicsItem* item) const.

C++ documentation:

Reimplemented from QGraphicsItem::isObscuredBy().

pub unsafe fn opaque_area(&self) -> CppBox<QPainterPath>[src]

Reimplemented from QGraphicsItem::opaqueArea().

Calls C++ function: virtual QPainterPath QAbstractGraphicsShapeItem::opaqueArea() const.

C++ documentation:

Reimplemented from QGraphicsItem::opaqueArea().

pub unsafe fn pen(&self) -> CppBox<QPen>[src]

Returns the item's pen. If no pen has been set, this function returns QPen(), a default black solid line pen with 1 width.

Calls C++ function: QPen QAbstractGraphicsShapeItem::pen() const.

C++ documentation:

Returns the item's pen. If no pen has been set, this function returns QPen(), a default black solid line pen with 1 width.

See also setPen().

pub unsafe fn set_brush(&self, brush: impl CastInto<Ref<QBrush>>)[src]

Sets the item's brush to brush.

Calls C++ function: void QAbstractGraphicsShapeItem::setBrush(const QBrush& brush).

C++ documentation:

Sets the item's brush to brush.

The item's brush is used to fill the item.

If you use a brush with a QGradient, the gradient is relative to the item's coordinate system.

See also brush().

pub unsafe fn set_pen(&self, pen: impl CastInto<Ref<QPen>>)[src]

Sets the pen for this item to pen.

Calls C++ function: void QAbstractGraphicsShapeItem::setPen(const QPen& pen).

C++ documentation:

Sets the pen for this item to pen.

The pen is used to draw the item's outline.

See also pen().

Trait Implementations

impl CppDeletable for QGraphicsPathItem[src]

unsafe fn delete(&self)[src]

Destroys the QGraphicsPathItem.

Calls C++ function: virtual [destructor] void QGraphicsPathItem::~QGraphicsPathItem().

C++ documentation:

Destroys the QGraphicsPathItem.

impl Deref for QGraphicsPathItem[src]

type Target = QAbstractGraphicsShapeItem

The resulting type after dereferencing.

fn deref(&self) -> &QAbstractGraphicsShapeItem[src]

Calls C++ function: QAbstractGraphicsShapeItem* static_cast<QAbstractGraphicsShapeItem*>(QGraphicsPathItem* ptr).

impl DynamicCast<QGraphicsPathItem> for QAbstractGraphicsShapeItem[src]

unsafe fn dynamic_cast(
    ptr: Ptr<QAbstractGraphicsShapeItem>
) -> Ptr<QGraphicsPathItem>
[src]

Calls C++ function: QGraphicsPathItem* dynamic_cast<QGraphicsPathItem*>(QAbstractGraphicsShapeItem* ptr).

impl DynamicCast<QGraphicsPathItem> for QGraphicsItem[src]

unsafe fn dynamic_cast(ptr: Ptr<QGraphicsItem>) -> Ptr<QGraphicsPathItem>[src]

Calls C++ function: QGraphicsPathItem* dynamic_cast<QGraphicsPathItem*>(QGraphicsItem* ptr).

impl StaticDowncast<QGraphicsPathItem> for QAbstractGraphicsShapeItem[src]

unsafe fn static_downcast(
    ptr: Ptr<QAbstractGraphicsShapeItem>
) -> Ptr<QGraphicsPathItem>
[src]

Calls C++ function: QGraphicsPathItem* static_cast<QGraphicsPathItem*>(QAbstractGraphicsShapeItem* ptr).

impl StaticDowncast<QGraphicsPathItem> for QGraphicsItem[src]

unsafe fn static_downcast(ptr: Ptr<QGraphicsItem>) -> Ptr<QGraphicsPathItem>[src]

Calls C++ function: QGraphicsPathItem* static_cast<QGraphicsPathItem*>(QGraphicsItem* ptr).

impl StaticUpcast<QAbstractGraphicsShapeItem> for QGraphicsPathItem[src]

unsafe fn static_upcast(
    ptr: Ptr<QGraphicsPathItem>
) -> Ptr<QAbstractGraphicsShapeItem>
[src]

Calls C++ function: QAbstractGraphicsShapeItem* static_cast<QAbstractGraphicsShapeItem*>(QGraphicsPathItem* ptr).

impl StaticUpcast<QGraphicsItem> for QGraphicsPathItem[src]

unsafe fn static_upcast(ptr: Ptr<QGraphicsPathItem>) -> Ptr<QGraphicsItem>[src]

Calls C++ function: QGraphicsItem* static_cast<QGraphicsItem*>(QGraphicsPathItem* ptr).

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.