The QGraphicsPolygonItem class provides a polygon item that you can add to a QGraphicsScene . 更多...
| 頭: | #include <QGraphicsPolygonItem> |
| qmake: | QT += widgets |
| Since: | Qt 4.2 |
| 繼承: | QAbstractGraphicsShapeItem |
| QGraphicsPolygonItem (QGraphicsItem * parent = Q_NULLPTR) | |
| QGraphicsPolygonItem (const QPolygonF & polygon , QGraphicsItem * parent = Q_NULLPTR) | |
| ~QGraphicsPolygonItem () | |
| Qt::FillRule | fillRule () const |
| QPolygonF | polygon () const |
| void | setFillRule (Qt::FillRule rule ) |
| void | setPolygon (const QPolygonF & polygon ) |
| virtual QRectF | boundingRect () const |
| virtual bool | contains (const QPointF & point ) const |
| virtual bool | isObscuredBy (const QGraphicsItem * item ) const |
| virtual QPainterPath | opaqueArea () const |
| virtual void | paint (QPainter * painter , const QStyleOptionGraphicsItem * option , QWidget * widget = Q_NULLPTR) |
| virtual QPainterPath | shape () const |
| virtual int | type () const |
The QGraphicsPolygonItem class provides a polygon item that you can add to a QGraphicsScene .
要設置項的多邊形,傳遞 QPolygonF to QGraphicsPolygonItem 's constructor, or call the setPolygon () 函數。 polygon () 函數返迴當前多邊形。
QGraphicsPolygonItem uses the polygon and the pen width to provide a reasonable implementation of boundingRect (), shape (),和 contains ()。 paint () function draws the polygon using the item's associated pen and brush, which you can set by calling the setPen () 和 setBrush () 函數。
另請參閱 QGraphicsPathItem , QGraphicsRectItem , QGraphicsEllipseItem , QGraphicsTextItem , QGraphicsLineItem , QGraphicsPixmapItem ,和 圖形視圖框架 .
構造 QGraphicsPolygonItem . parent 被傳遞給 QAbstractGraphicsShapeItem 的構造函數。
另請參閱 QGraphicsScene::addItem ().
構造 QGraphicsPolygonItem with polygon 作為默認多邊形。 parent 被傳遞給 QAbstractGraphicsShapeItem 的構造函數。
另請參閱 QGraphicsScene::addItem ().
銷毀 QGraphicsPolygonItem .
[虛擬]
QRectF
QGraphicsPolygonItem::
boundingRect
() const
重實現自 QGraphicsItem::boundingRect ().
[虛擬]
bool
QGraphicsPolygonItem::
contains
(const
QPointF
&
point
) const
重實現自 QGraphicsItem::contains ().
返迴多邊形填充規則。默認填充規則為 Qt::OddEvenFill .
另請參閱 setFillRule (), QPainterPath::fillRule (),和 QPainter::drawPolygon ().
[虛擬]
bool
QGraphicsPolygonItem::
isObscuredBy
(const
QGraphicsItem
*
item
) const
重實現自 QGraphicsItem::isObscuredBy ().
[虛擬]
QPainterPath
QGraphicsPolygonItem::
opaqueArea
() const
重實現自 QGraphicsItem::opaqueArea ().
[虛擬]
void
QGraphicsPolygonItem::
paint
(
QPainter
*
painter
, const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
= Q_NULLPTR)
重實現自 QGraphicsItem::paint ().
Returns the item's polygon, or an empty polygon if no polygon has been set.
另請參閱 setPolygon ().
Sets the fill rule of the polygon to rule . The default fill rule is Qt::OddEvenFill .
另請參閱 fillRule (), QPainterPath::fillRule (),和 QPainter::drawPolygon ().
將項的多邊形設為給定 polygon .
另請參閱 polygon ().
[虛擬]
QPainterPath
QGraphicsPolygonItem::
shape
() const
重實現自 QGraphicsItem::shape ().
[虛擬]
int
QGraphicsPolygonItem::
type
() const
重實現自 QGraphicsItem::type ().