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  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

Q3CanvasEllipse Class Reference
[Qt3Support module]

The Q3CanvasEllipse class provides an ellipse or ellipse segment on a Q3Canvas. More...

 #include <Q3CanvasEllipse>

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.

Inherits Q3CanvasPolygonalItem.

Public Functions

Protected Functions


Detailed Description

The Q3CanvasEllipse class provides an ellipse or ellipse segment on a Q3Canvas.

A canvas item that paints an ellipse or ellipse segment with a QBrush. The ellipse's height, width, start angle and angle length can be set at construction time. The size can be changed at runtime with setSize(), and the angles can be changed (if you're displaying an ellipse segment rather than a whole ellipse) with setAngles().

Note that angles are specified in 16ths of a degree.

Ellipse

If a start angle and length angle are set then an ellipse segment will be drawn. The start angle is the angle that goes from zero in a counter-clockwise direction (shown in green in the diagram). The length angle is the angle from the start angle in a counter-clockwise direction (shown in blue in the diagram). The blue segment is the segment of the ellipse that would be drawn. If no start angle and length angle are specified the entire ellipse is drawn.

The ellipse can be drawn on a painter with drawShape().

Like any other canvas item ellipses can be moved with move() and moveBy(), or by setting coordinates with setX(), setY() and setZ().

Note: Q3CanvasEllipse does not use the pen.

See also QtCanvas and Porting to Graphics View.


Member Function Documentation

Q3CanvasEllipse::Q3CanvasEllipse ( Q3Canvas * canvas )

Constructs a 32x32 ellipse, centered at (0, 0) on canvas.

Q3CanvasEllipse::Q3CanvasEllipse ( int width, int height, Q3Canvas * canvas )

Constructs a width by height pixel ellipse, centered at (0, 0) on canvas.

Q3CanvasEllipse::Q3CanvasEllipse ( int width, int height, int startangle, int angle, Q3Canvas * canvas )

Constructs a width by height pixel ellipse, centered at (0, 0) on canvas. Only a segment of the ellipse is drawn, starting at angle startangle, and extending for angle angle (the angle length).

Note that angles are specified in sixteenths of a degree.

Q3CanvasEllipse::~Q3CanvasEllipse ()

Destroys the ellipse.

int Q3CanvasEllipse::angleLength () const

Returns the length angle (the extent of the ellipse segment) in 16ths of a degree. Initially this will be 360 * 16 (a complete ellipse).

See also setAngles() and angleStart().

int Q3CanvasEllipse::angleStart () const

Returns the start angle in 16ths of a degree. Initially this will be 0.

See also setAngles() and angleLength().

void Q3CanvasEllipse::drawShape ( QPainter & p )   [virtual protected]

Draws the ellipse, centered at x(), y() using the painter p.

Note that Q3CanvasEllipse does not support an outline (the pen is always NoPen).

Reimplemented from Q3CanvasPolygonalItem.

int Q3CanvasEllipse::height () const

Returns the height of the ellipse.

int Q3CanvasEllipse::rtti () const   [virtual]

Returns 6 (Q3CanvasItem::Rtti_Ellipse).

Reimplemented from Q3CanvasItem.

See also Q3CanvasItem::rtti().

void Q3CanvasEllipse::setAngles ( int start, int length )

Sets the angles for the ellipse. The start angle is start and the extent of the segment is length (the angle length) from the start. The angles are specified in 16ths of a degree. By default the ellipse will start at 0 and have an angle length of 360 * 16 (a complete ellipse).

See also angleStart() and angleLength().

void Q3CanvasEllipse::setSize ( int width, int height )

Sets the width and height of the ellipse.

int Q3CanvasEllipse::width () const

Returns the width of the ellipse.

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année

Le Qt Labs au hasard

Logo

QLocale : à propos du temps (et des dates, et des langues, et des...)

Les Qt Labs sont les laboratoires des développeurs de Qt, où ils peuvent partager des impressions sur le framework, son utilisation, ce que pourrait être son futur. 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 qtextended4.4
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