Movatterモバイル変換


[0]ホーム

URL:


We bake cookies in your browser for a better experience. Using this site means that you consent.Read More

Menu

Qt Documentation

QGraphicsPathItem Class

TheQGraphicsPathItem class provides a path item that you can add to aQGraphicsScene.More...

Header:#include <QGraphicsPathItem>
Since: Qt 4.2
Inherits:QAbstractGraphicsShapeItem

Public Functions

QGraphicsPathItem(QGraphicsItem * parent = 0)
QGraphicsPathItem(const QPainterPath & path, QGraphicsItem * parent = 0)
~QGraphicsPathItem()
QPainterPathpath() const
voidsetPath(const QPainterPath & path)

Reimplemented Public Functions

virtual QRectFboundingRect() const
virtual boolcontains(const QPointF & point) const
virtual boolisObscuredBy(const QGraphicsItem * item) const
virtual QPainterPathopaqueArea() const
virtual voidpaint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0)
virtual QPainterPathshape() const
virtual inttype() const

Additional Inherited Members

Detailed Description

TheQGraphicsPathItem class provides a path item that you can add to aQGraphicsScene.

To set the item's path, pass aQPainterPath toQGraphicsPathItem's constructor, or call thesetPath() function. Thepath() function returns the current path.

QGraphicsPathItem uses the path to provide a reasonable implementation ofboundingRect(),shape(), andcontains(). Thepaint() function draws the path using the item's associated pen and brush, which you can set by calling thesetPen() andsetBrush() functions.

See alsoQGraphicsRectItem,QGraphicsEllipseItem,QGraphicsPolygonItem,QGraphicsTextItem,QGraphicsLineItem,QGraphicsPixmapItem, andGraphics View Framework.

Member Function Documentation

QGraphicsPathItem::QGraphicsPathItem(QGraphicsItem * parent = 0)

Constructs a QGraphicsPath.parent is passed toQAbstractGraphicsShapeItem's constructor.

See alsoQGraphicsScene::addItem().

QGraphicsPathItem::QGraphicsPathItem(constQPainterPath & path,QGraphicsItem * parent = 0)

Constructs a QGraphicsPath item usingpath as the default path.parent is passed toQAbstractGraphicsShapeItem's constructor.

See alsoQGraphicsScene::addItem().

QGraphicsPathItem::~QGraphicsPathItem()

Destroys theQGraphicsPathItem.

[virtual]QRectF QGraphicsPathItem::boundingRect() const

Reimplemented fromQGraphicsItem::boundingRect().

[virtual]bool QGraphicsPathItem::contains(constQPointF & point) const

Reimplemented fromQGraphicsItem::contains().

[virtual]bool QGraphicsPathItem::isObscuredBy(constQGraphicsItem * item) const

Reimplemented fromQGraphicsItem::isObscuredBy().

[virtual]QPainterPath QGraphicsPathItem::opaqueArea() const

Reimplemented fromQGraphicsItem::opaqueArea().

[virtual]void QGraphicsPathItem::paint(QPainter * painter, constQStyleOptionGraphicsItem * option,QWidget * widget = 0)

Reimplemented fromQGraphicsItem::paint().

QPainterPath QGraphicsPathItem::path() const

Returns the item's path as aQPainterPath. If no item has been set, an emptyQPainterPath is returned.

See alsosetPath().

void QGraphicsPathItem::setPath(constQPainterPath & path)

Sets the item's path to be the givenpath.

See alsopath().

[virtual]QPainterPath QGraphicsPathItem::shape() const

Reimplemented fromQGraphicsItem::shape().

[virtual]int QGraphicsPathItem::type() const

Reimplemented fromQGraphicsItem::type().

© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of theGNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.


[8]ページ先頭

©2009-2025 Movatter.jp