Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

Q3CanvasText Class Reference
[Qt3Support module]

The Q3CanvasText class provides a text object on a Q3Canvas. More...

 #include <Q3CanvasText>

This class is part of the Qt 3 support library. It is provided to keep old source code working. We strongly advise against using it in new code. See Porting to Qt 4 for more information.

Note to Qt Desktop Light Edition users: This class is only available in the Qt Desktop Edition.

Inherits Q3CanvasItem.

Public Functions

Protected Functions

  • virtual void draw ( QPainter & painter )

Detailed Description

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.


Member Function Documentation

Q3CanvasText::Q3CanvasText ( Q3Canvas * canvas )

Constructs a Q3CanvasText with the text "<text>", on canvas.

Q3CanvasText::Q3CanvasText ( const QString & t, Q3Canvas * canvas )

Constructs a Q3CanvasText with the text t, on canvas canvas.

Q3CanvasText::Q3CanvasText ( const QString & t, QFont f, Q3Canvas * canvas )

Constructs a Q3CanvasText with the text t and font f, on the canvas canvas.

Q3CanvasText::~Q3CanvasText ()   [virtual]

Destroys the canvas text item.

QRect Q3CanvasText::boundingRect () const   [virtual]

Returns the bounding rectangle of the text.

Reimplemented from Q3CanvasItem.

QColor Q3CanvasText::color () const

Returns the color of the text.

See also setColor().

void Q3CanvasText::draw ( QPainter & painter )   [virtual protected]

Draws the text using the painter painter.

Reimplemented from Q3CanvasItem.

QFont Q3CanvasText::font () const

Returns the font in which the text is drawn.

See also setFont().

int Q3CanvasText::rtti () const   [virtual]

Returns 3 (Q3CanvasItem::Rtti_Text).

Reimplemented from Q3CanvasItem.

See also Q3CanvasItem::rtti().

void Q3CanvasText::setColor ( const QColor & c )

Sets the color of the text to the color c.

See also color() and setFont().

void Q3CanvasText::setFont ( const QFont & f )

Sets the font in which the text is drawn to font f.

See also font().

void Q3CanvasText::setText ( const QString & t )

Sets the text item's text to t. The text may contain newlines.

See also text(), setFont(), setColor(), and setTextFlags().

void Q3CanvasText::setTextFlags ( int f )

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().

QString Q3CanvasText::text () const

Returns the text item's text.

See also setText().

int Q3CanvasText::textFlags () const

Returns the currently set alignment flags.

See also setTextFlags() and Qt::AlignmentFlag.

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année

Le Qt Quarterly au hasard

Logo

Des apparences personnalisées utilisant les feuilles de style

Qt Quarterly est la revue trimestrielle proposée par Nokia et à destination des développeurs Qt. Ces articles d'une grande qualité technique sont rédigés par des experts Qt. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

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.2
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 !
 
 
 
 
Partenaires

Hébergement Web