Logo Search packages:      
Sourcecode: qt4-x11 version File versions

QGraphicsPolygonItem Class Reference

Inheritance diagram for QGraphicsPolygonItem:

QAbstractGraphicsShapeItem QGraphicsItem DiagramItem DiagramItem

List of all members.


Detailed Description

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

Since:
4.2

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.

See also:
QGraphicsPathItem, QGraphicsRectItem, QGraphicsEllipseItem, QGraphicsTextItem, QGraphicsLineItem, QGraphicsPixmapItem, {The Graphics View Framework}

Definition at line 602 of file qgraphicsitem.h.

QBrush brush () const
Qt::FillRule fillRule () const
void installSceneEventFilter (QGraphicsItem *filterItem)
QPen pen () const
 QGraphicsPolygonItem (const QPolygonF &polygon, QGraphicsItem *parent=0, QGraphicsScene *scene=0)
 QGraphicsPolygonItem (QGraphicsItem *parent=0, QGraphicsScene *scene=0)
void removeSceneEventFilter (QGraphicsItem *filterItem)
void setPolygon (const QPolygonF &polygon)
 ~QGraphicsPolygonItem ()
void addToIndex ()
virtual void dragMoveEvent (QGraphicsSceneDragDropEvent *event)
virtual void hoverMoveEvent (QGraphicsSceneHoverEvent *event)
void prepareGeometryChange ()
void removeFromIndex ()
virtual bool sceneEvent (QEvent *event)
bool _qt_movableAncestorIsSelected (const QGraphicsItem *item)
 openExternalLinks
QDebug operator<< (QDebug debug, QGraphicsItem::GraphicsItemChange change)
QDebug operator<< (QDebug debug, QGraphicsItem *item)
 QGraphicsEllipseItem (qreal x, qreal y, qreal width, qreal height, QGraphicsItem *parent)
qgraphicsitem_cast (QGraphicsItem *item)
 QGraphicsRectItem (qreal x, qreal y, qreal width, qreal height, QGraphicsItem *parent)
static void qt_graphicsItem_highlightSelected (QGraphicsItem *item, QPainter *painter, const QStyleOptionGraphicsItem *option)
void setShapeMode (ShapeMode mode)
static QRectF setupTextLayout (QTextLayout *layout)
 textCursor

Public Types

enum  { Type = 1, UserType = 65536 }
enum  { Type = 5 }
enum  CacheMode { NoCache, ItemCoordinateCache, DeviceCoordinateCache }
enum  GraphicsItemChange {
  ItemPositionChange, ItemMatrixChange, ItemVisibleChange, ItemEnabledChange,
  ItemSelectedChange, ItemParentChange, ItemChildAddedChange, ItemChildRemovedChange,
  ItemTransformChange, ItemPositionHasChanged, ItemTransformHasChanged, ItemSceneChange,
  ItemVisibleHasChanged, ItemEnabledHasChanged, ItemSelectedHasChanged, ItemParentHasChanged,
  ItemSceneHasChanged, ItemCursorChange, ItemCursorHasChanged, ItemToolTipChange,
  ItemToolTipHasChanged, ItemFlagsChange, ItemFlagsHaveChanged, ItemZValueChange,
  ItemZValueHasChanged
}
enum  GraphicsItemFlag {
  ItemIsMovable = 0x1, ItemIsSelectable = 0x2, ItemIsFocusable = 0x4, ItemClipsToShape = 0x8,
  ItemClipsChildrenToShape = 0x10, ItemIgnoresTransformations = 0x20
}

Public Member Functions

bool acceptDrops () const
Qt::MouseButtons acceptedMouseButtons () const
bool acceptHoverEvents () const
bool acceptsHoverEvents () const
virtual void advance (int phase)
QRectF boundingRect () const
QRegion boundingRegion (const QTransform &itemToDeviceTransform) const
qreal boundingRegionGranularity () const
CacheMode cacheMode () const
QList< QGraphicsItem * > childItems () const
QList< QGraphicsItem * > children () const
QRectF childrenBoundingRect () const
void clearFocus ()
virtual bool collidesWithItem (const QGraphicsItem *other, Qt::ItemSelectionMode mode=Qt::IntersectsItemShape) const
virtual bool collidesWithPath (const QPainterPath &path, Qt::ItemSelectionMode mode=Qt::IntersectsItemShape) const
QList< QGraphicsItem * > collidingItems (Qt::ItemSelectionMode mode=Qt::IntersectsItemShape) const
QGraphicsItemcommonAncestorItem (const QGraphicsItem *other) const
bool contains (const QPointF &point) const
QCursor cursor () const
QVariant data (int key) const
QTransform deviceTransform (const QTransform &viewportTransform) const
void ensureVisible (qreal x, qreal y, qreal w, qreal h, int xmargin=50, int ymargin=50)
void ensureVisible (const QRectF &rect=QRectF(), int xmargin=50, int ymargin=50)
GraphicsItemFlags flags () const
void grabKeyboard ()
void grabMouse ()
QGraphicsItemGroupgroup () const
bool handlesChildEvents () const
bool hasCursor () const
bool hasFocus () const
void hide ()
bool isAncestorOf (const QGraphicsItem *child) const
bool isEnabled () const
bool isObscured (qreal x, qreal y, qreal w, qreal h) const
bool isObscured (const QRectF &rect) const
bool isObscured () const
bool isObscuredBy (const QGraphicsItem *item) const
bool isSelected () const
bool isUnderMouse () const
bool isVisible () const
bool isVisibleTo (const QGraphicsItem *parent) const
bool isWidget () const
bool isWindow () const
QPolygonF mapFromItem (const QGraphicsItem *item, qreal x, qreal y, qreal w, qreal h) const
QPointF mapFromItem (const QGraphicsItem *item, qreal x, qreal y) const
QPainterPath mapFromItem (const QGraphicsItem *item, const QPainterPath &path) const
QPolygonF mapFromItem (const QGraphicsItem *item, const QPolygonF &polygon) const
QPolygonF mapFromItem (const QGraphicsItem *item, const QRectF &rect) const
QPointF mapFromItem (const QGraphicsItem *item, const QPointF &point) const
QPolygonF mapFromParent (qreal x, qreal y, qreal w, qreal h) const
QPointF mapFromParent (qreal x, qreal y) const
QPainterPath mapFromParent (const QPainterPath &path) const
QPolygonF mapFromParent (const QPolygonF &polygon) const
QPolygonF mapFromParent (const QRectF &rect) const
QPointF mapFromParent (const QPointF &point) const
QPolygonF mapFromScene (qreal x, qreal y, qreal w, qreal h) const
QPointF mapFromScene (qreal x, qreal y) const
QPainterPath mapFromScene (const QPainterPath &path) const
QPolygonF mapFromScene (const QPolygonF &polygon) const
QPolygonF mapFromScene (const QRectF &rect) const
QPointF mapFromScene (const QPointF &point) const
QPolygonF mapToItem (const QGraphicsItem *item, qreal x, qreal y, qreal w, qreal h) const
QPointF mapToItem (const QGraphicsItem *item, qreal x, qreal y) const
QPainterPath mapToItem (const QGraphicsItem *item, const QPainterPath &path) const
QPolygonF mapToItem (const QGraphicsItem *item, const QPolygonF &polygon) const
QPolygonF mapToItem (const QGraphicsItem *item, const QRectF &rect) const
QPointF mapToItem (const QGraphicsItem *item, const QPointF &point) const
QPolygonF mapToParent (qreal x, qreal y, qreal w, qreal h) const
QPointF mapToParent (qreal x, qreal y) const
QPainterPath mapToParent (const QPainterPath &path) const
QPolygonF mapToParent (const QPolygonF &polygon) const
QPolygonF mapToParent (const QRectF &rect) const
QPointF mapToParent (const QPointF &point) const
QPolygonF mapToScene (qreal x, qreal y, qreal w, qreal h) const
QPointF mapToScene (qreal x, qreal y) const
QPainterPath mapToScene (const QPainterPath &path) const
QPolygonF mapToScene (const QPolygonF &polygon) const
QPolygonF mapToScene (const QRectF &rect) const
QPointF mapToScene (const QPointF &point) const
QMatrix matrix () const
void moveBy (qreal dx, qreal dy)
QPainterPath opaqueArea () const
void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
QGraphicsItemparentItem () const
QGraphicsWidgetparentWidget () const
QPolygonF polygon () const
QPointF pos () const
void resetMatrix ()
void resetTransform ()
void rotate (qreal angle)
void scale (qreal sx, qreal sy)
QGraphicsScenescene () const
QRectF sceneBoundingRect () const
QMatrix sceneMatrix () const
QPointF scenePos () const
QTransform sceneTransform () const
void scroll (qreal dx, qreal dy, const QRectF &rect=QRectF())
void setAcceptDrops (bool on)
void setAcceptedMouseButtons (Qt::MouseButtons buttons)
void setAcceptHoverEvents (bool enabled)
void setAcceptsHoverEvents (bool enabled)
void setBoundingRegionGranularity (qreal granularity)
void setBrush (const QBrush &brush)
void setCacheMode (CacheMode mode, const QSize &cacheSize=QSize())
void setCursor (const QCursor &cursor)
void setData (int key, const QVariant &value)
void setEnabled (bool enabled)
void setFillRule (Qt::FillRule rule)
void setFlag (GraphicsItemFlag flag, bool enabled=true)
void setFlags (GraphicsItemFlags flags)
void setFocus (Qt::FocusReason focusReason=Qt::OtherFocusReason)
void setGroup (QGraphicsItemGroup *group)
void setHandlesChildEvents (bool enabled)
void setMatrix (const QMatrix &matrix, bool combine=false)
void setParentItem (QGraphicsItem *parent)
void setPen (const QPen &pen)
void setPos (qreal x, qreal y)
void setPos (const QPointF &pos)
void setSelected (bool selected)
void setToolTip (const QString &toolTip)
void setTransform (const QTransform &matrix, bool combine=false)
void setVisible (bool visible)
void setZValue (qreal z)
QPainterPath shape () const
void shear (qreal sh, qreal sv)
void show ()
QString toolTip () const
QGraphicsItemtopLevelItem () const
QGraphicsWidgettopLevelWidget () const
QTransform transform () const
void translate (qreal dx, qreal dy)
int type () const
void ungrabKeyboard ()
void ungrabMouse ()
void unsetCursor ()
void update (qreal x, qreal y, qreal width, qreal height)
void update (const QRectF &rect=QRectF())
QGraphicsWidgetwindow () const
qreal x () const
qreal y () const
qreal zValue () const

Protected Types

enum  Extension { UserExtension = 0x80000000 }

Protected Member Functions

virtual void contextMenuEvent (QGraphicsSceneContextMenuEvent *event)
virtual void dragEnterEvent (QGraphicsSceneDragDropEvent *event)
virtual void dragLeaveEvent (QGraphicsSceneDragDropEvent *event)
virtual void dropEvent (QGraphicsSceneDragDropEvent *event)
QVariant extension (const QVariant &variant) const
virtual void focusInEvent (QFocusEvent *event)
virtual void focusOutEvent (QFocusEvent *event)
virtual void hoverEnterEvent (QGraphicsSceneHoverEvent *event)
virtual void hoverLeaveEvent (QGraphicsSceneHoverEvent *event)
virtual void inputMethodEvent (QInputMethodEvent *event)
virtual QVariant inputMethodQuery (Qt::InputMethodQuery query) const
virtual QVariant itemChange (GraphicsItemChange change, const QVariant &value)
virtual void keyPressEvent (QKeyEvent *event)
virtual void keyReleaseEvent (QKeyEvent *event)
virtual void mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event)
virtual void mouseMoveEvent (QGraphicsSceneMouseEvent *event)
virtual void mousePressEvent (QGraphicsSceneMouseEvent *event)
virtual void mouseReleaseEvent (QGraphicsSceneMouseEvent *event)
virtual bool sceneEventFilter (QGraphicsItem *watched, QEvent *event)
void setExtension (Extension extension, const QVariant &variant)
bool supportsExtension (Extension extension) const
virtual void wheelEvent (QGraphicsSceneWheelEvent *event)

Protected Attributes

QGraphicsItemPrivate * d_ptr

Friends

class ::tst_QGraphicsItem

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index