QGraphicsLineItem Class Reference |
QGraphicsLineItem ( QGraphicsItem * parent = 0 ) | |
QGraphicsLineItem ( const QLineF & line, QGraphicsItem * parent = 0 ) | |
QGraphicsLineItem ( qreal x1, qreal y1, qreal x2, qreal y2, QGraphicsItem * parent = 0 ) | |
~QGraphicsLineItem () | |
QLineF | line () const |
QPen | pen () const |
void | setLine ( const QLineF & line ) |
void | setLine ( qreal x1, qreal y1, qreal x2, qreal y2 ) |
void | setPen ( const QPen & pen ) |
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 = 0 ) |
virtual QPainterPath | shape () const |
virtual int | type () const |
The QGraphicsLineItem class provides a line item that you can add to a QGraphicsScene.
To set the item's line, pass a QLineF to QGraphicsLineItem's constructor, or call the setLine() function. The line() function returns the current line. By default the line is black with a width of 0, but you can change this by calling setPen().
QGraphicsLineItem uses the line and the pen width to provide a reasonable implementation of boundingRect(), shape(), and contains(). The paint() function draws the line using the item's associated pen.
See also QGraphicsPathItem, QGraphicsRectItem, QGraphicsEllipseItem, QGraphicsTextItem, QGraphicsPolygonItem, QGraphicsPixmapItem, and The Graphics View Framework.
Constructs a QGraphicsLineItem. parent is passed to QGraphicsItem's constructor.
See also QGraphicsScene::addItem().
Constructs a QGraphicsLineItem, using line as the default line. parent is passed to QGraphicsItem's constructor.
See also QGraphicsScene::addItem().
Constructs a QGraphicsLineItem, using the line between (x1, y1) and (x2, y2) as the default line. parent is passed to QGraphicsItem's constructor.
See also QGraphicsScene::addItem().
Destroys the QGraphicsLineItem.
Reimplemented from QGraphicsItem::boundingRect().
Reimplemented from QGraphicsItem::contains().
Reimplemented from QGraphicsItem::isObscuredBy().
Returns the item's line, or a null line if no line has been set.
See also setLine().
Reimplemented from QGraphicsItem::opaqueArea().
Reimplemented from QGraphicsItem::paint().
Returns the item's pen, or a black solid 0-width pen if no pen has been set.
See also setPen().
Sets the item's line to be the given line.
See also line().
This is an overloaded function.
Sets the item's line to be the line between (x1, y1) and (x2, y2).
This is the same as calling setLine(QLineF(x1, y1, x2, y2)).
Sets the item's pen to pen. If no pen is set, the line will be painted using a black solid 0-width pen.
See also pen().
Reimplemented from QGraphicsItem::shape().
Reimplemented from QGraphicsItem::type().
Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. | Qt 4.6 | |
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD. | ||
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP ! |
Copyright © 2000-2012 - www.developpez.com