Q3CanvasText Class Reference |
Q3CanvasText ( Q3Canvas * canvas ) | |
Q3CanvasText ( const QString & t, Q3Canvas * canvas ) | |
Q3CanvasText ( const QString & t, QFont f, Q3Canvas * canvas ) | |
virtual | ~Q3CanvasText () |
QColor | color () const |
QFont | font () const |
void | setColor ( const QColor & c ) |
void | setFont ( const QFont & f ) |
void | setText ( const QString & t ) |
void | setTextFlags ( int f ) |
QString | text () const |
int | textFlags () const |
virtual QRect | boundingRect () const |
virtual bool | collidesWith ( const Q3CanvasItem * i ) const |
virtual void | moveBy ( double dx, double dy ) |
virtual int | rtti () const |
virtual void | draw ( QPainter & painter ) |
The Q3CanvasText class provides a text object on a Q3Canvas.
A canvas text item has text with font, color and alignment attributes. The text and font can be set in the constructor or set or changed later with setText() and setFont(). The color is set with setColor() and the alignment with setTextFlags(). The text item's bounding rectangle is retrieved with boundingRect().
The text can be drawn on a painter with draw().
Like any other canvas item text items can be moved with Q3CanvasItem::move() and Q3CanvasItem::moveBy(), or by setting coordinates with Q3CanvasItem::setX(), Q3CanvasItem::setY() and Q3CanvasItem::setZ().
See also QtCanvas and Porting to Graphics View.
Constructs a Q3CanvasText with the text "<text>", on canvas.
Constructs a Q3CanvasText with the text t, on canvas canvas.
Constructs a Q3CanvasText with the text t and font f, on the canvas canvas.
Destroys the canvas text item.
Reimplemented from Q3CanvasItem::boundingRect().
Returns the bounding rectangle of the text.
Reimplemented from Q3CanvasItem::collidesWith().
Returns the color of the text.
See also setColor().
Reimplemented from Q3CanvasItem::draw().
Draws the text using the painter painter.
Returns the font in which the text is drawn.
See also setFont().
Reimplemented from Q3CanvasItem::moveBy().
Reimplemented from Q3CanvasItem::rtti().
Returns 3 (Q3CanvasItem::Rtti_Text).
See also Q3CanvasItem::rtti().
Sets the color of the text to the color c.
See also color() and setFont().
Sets the font in which the text is drawn to font f.
See also font().
Sets the text item's text to t. The text may contain newlines.
See also text(), setFont(), setColor(), and setTextFlags().
Sets the alignment flags to f. These are a bitwise OR of the flags available to QPainter::drawText() -- see the Qt::AlignmentFlags.
See also textFlags(), setFont(), and setColor().
Returns the text item's text.
See also setText().
Returns the currently set alignment flags.
See also setTextFlags() and Qt::AlignmentFlag.
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