[][src]Struct qt_widgets::QGraphicsPolygonItem

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

The QGraphicsPolygonItem class provides a polygon item that you can add to a QGraphicsScene.

C++ class: QGraphicsPolygonItem.

C++ documentation:

The QGraphicsPolygonItem class provides a polygon item that you can add to a QGraphicsScene.

To set the item's polygon, pass a QPolygonF to QGraphicsPolygonItem's constructor, or call the setPolygon() function. The polygon() function returns the current polygon.

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

Methods

impl QGraphicsPolygonItem[src]

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

Reimplemented from QGraphicsItem::boundingRect().

Calls C++ function: virtual QRectF QGraphicsPolygonItem::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 QGraphicsPolygonItem::contains(const QPointF& point) const.

C++ documentation:

Reimplemented from QGraphicsItem::contains().

pub unsafe fn fill_rule(&self) -> FillRule[src]

Returns the fill rule of the polygon. The default fill rule is Qt::OddEvenFill.

Calls C++ function: Qt::FillRule QGraphicsPolygonItem::fillRule() const.

C++ documentation:

Returns the fill rule of the polygon. The default fill rule is Qt::OddEvenFill.

See also setFillRule(), QPainterPath::fillRule(), and QPainter::drawPolygon().

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

Reimplemented from QGraphicsItem::isObscuredBy().

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

C++ documentation:

Reimplemented from QGraphicsItem::isObscuredBy().

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

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

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

C++ documentation:

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

See also QGraphicsScene::addItem().

pub unsafe fn from_q_polygon_f_q_graphics_item(
    polygon: impl CastInto<Ref<QPolygonF>>,
    parent: impl CastInto<Ptr<QGraphicsItem>>
) -> CppBox<QGraphicsPolygonItem>
[src]

Constructs a QGraphicsPolygonItem with polygon as the default polygon. parent is passed to QAbstractGraphicsShapeItem's constructor.

Calls C++ function: [constructor] void QGraphicsPolygonItem::QGraphicsPolygonItem(const QPolygonF& polygon, QGraphicsItem* parent = …).

C++ documentation:

Constructs a QGraphicsPolygonItem with polygon as the default polygon. parent is passed to QAbstractGraphicsShapeItem's constructor.

See also QGraphicsScene::addItem().

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

The QGraphicsPolygonItem class provides a polygon item that you can add to a QGraphicsScene.

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

C++ documentation:

The QGraphicsPolygonItem class provides a polygon item that you can add to a QGraphicsScene.

To set the item's polygon, pass a QPolygonF to QGraphicsPolygonItem's constructor, or call the setPolygon() function. The polygon() function returns the current polygon.

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

pub unsafe fn from_q_polygon_f(
    polygon: impl CastInto<Ref<QPolygonF>>
) -> CppBox<QGraphicsPolygonItem>
[src]

Constructs a QGraphicsPolygonItem with polygon as the default polygon. parent is passed to QAbstractGraphicsShapeItem's constructor.

Calls C++ function: [constructor] void QGraphicsPolygonItem::QGraphicsPolygonItem(const QPolygonF& polygon).

C++ documentation:

Constructs a QGraphicsPolygonItem with polygon as the default polygon. 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 QGraphicsPolygonItem::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 QGraphicsPolygonItem::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 QGraphicsPolygonItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* option).

C++ documentation:

Reimplemented from QGraphicsItem::paint().

pub unsafe fn polygon(&self) -> CppBox<QPolygonF>[src]

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

Calls C++ function: QPolygonF QGraphicsPolygonItem::polygon() const.

C++ documentation:

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

See also setPolygon().

pub unsafe fn set_fill_rule(&self, rule: FillRule)[src]

Sets the fill rule of the polygon to rule. The default fill rule is Qt::OddEvenFill.

Calls C++ function: void QGraphicsPolygonItem::setFillRule(Qt::FillRule rule).

C++ documentation:

Sets the fill rule of the polygon to rule. The default fill rule is Qt::OddEvenFill.

See also fillRule(), QPainterPath::fillRule(), and QPainter::drawPolygon().

pub unsafe fn set_polygon(&self, polygon: impl CastInto<Ref<QPolygonF>>)[src]

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

Calls C++ function: void QGraphicsPolygonItem::setPolygon(const QPolygonF& polygon).

C++ documentation:

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

See also polygon().

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

Reimplemented from QGraphicsItem::shape().

Calls C++ function: virtual QPainterPath QGraphicsPolygonItem::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 QGraphicsPolygonItem::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 QGraphicsPolygonItem[src]

unsafe fn delete(&self)[src]

Destroys the QGraphicsPolygonItem.

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

C++ documentation:

Destroys the QGraphicsPolygonItem.

impl Deref for QGraphicsPolygonItem[src]

type Target = QAbstractGraphicsShapeItem

The resulting type after dereferencing.

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

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

impl DynamicCast<QGraphicsPolygonItem> for QAbstractGraphicsShapeItem[src]

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

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

impl DynamicCast<QGraphicsPolygonItem> for QGraphicsItem[src]

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

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

impl StaticDowncast<QGraphicsPolygonItem> for QAbstractGraphicsShapeItem[src]

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

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

impl StaticDowncast<QGraphicsPolygonItem> for QGraphicsItem[src]

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

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

impl StaticUpcast<QAbstractGraphicsShapeItem> for QGraphicsPolygonItem[src]

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

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

impl StaticUpcast<QGraphicsItem> for QGraphicsPolygonItem[src]

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

Calls C++ function: QGraphicsItem* static_cast<QGraphicsItem*>(QGraphicsPolygonItem* 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.