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  · 

QPolygonF Class Reference
[QtGui module]

The QPolygonF class provides a vector of points using floating point precision. More...

 #include <QPolygonF>

Inherits QVector<QPointF>.

Note: All the functions in this class are reentrant.

Public Functions

  • 62 public functions inherited from QVector

Related Non-Members

  • QDataStream & operator<< ( QDataStream & stream, const QPolygonF & polygon )
  • QDataStream & operator>> ( QDataStream & stream, QPolygonF & polygon )

Additional Inherited Members

  • 2 static public members inherited from QVector

Detailed Description

The QPolygonF class provides a vector of points using floating point precision.

A QPolygonF is a QVector<QPointF>. The easiest way to add points to a QPolygonF is to use its streaming operator, as illustrated below:

         QPolygonF polygon;
         polygon << QPointF(10.4, 20.5) << QPointF(20.2, 30.2);

In addition to the functions provided by QVector, QPolygonF provides the boundingRect() and translate() functions for geometry operations. Use the QMatrix::map() function for more general transformations of QPolygonFs.

QPolygonF also provides the isClosed() function to determine whether a polygon's start and end points are the same, and the toPolygon() function returning an integer precision copy of this polygon.

The QPolygonF class is implicitly shared.

See also QVector, QPolygon, and QLineF.


Member Function Documentation

QPolygonF::QPolygonF ()

Constructs a polygon with no points.

See also QVector::isEmpty().

QPolygonF::QPolygonF ( int size )

Constructs a polygon of the given size. Creates an empty polygon if size == 0.

See also QVector::isEmpty().

QPolygonF::QPolygonF ( const QPolygonF & polygon )

Constructs a copy of the given polygon.

QPolygonF::QPolygonF ( const QVector<QPointF> & points )

Constructs a polygon containing the specified points.

QPolygonF::QPolygonF ( const QRectF & rectangle )

Constructs a closed polygon from the specified rectangle.

The polygon contains the four vertices of the rectangle in clockwise order starting and ending with the top-left vertex.

See also isClosed().

QPolygonF::QPolygonF ( const QPolygon & polygon )

Constructs a float based polygon from the specified integer based polygon.

See also toPolygon().

QPolygonF::~QPolygonF ()

Destroys the polygon.

QRectF QPolygonF::boundingRect () const

Returns the bounding rectangle of the polygon, or QRectF(0,0,0,0) if the polygon is empty.

See also QVector::isEmpty().

bool QPolygonF::isClosed () const

Returns true if the polygon is closed; otherwise returns false.

A polygon is said to be closed if its start point and end point are equal.

See also QVector::first() and QVector::last().

QPolygon QPolygonF::toPolygon () const

Creates and returns a QPolygon by converting each QPointF to a QPoint.

See also QPointF::toPoint().

void QPolygonF::translate ( const QPointF & offset )

Translate all points in the polygon by the given offset.

void QPolygonF::translate ( qreal dx, qreal dy )

This is an overloaded member function, provided for convenience.

Translates all points in the polygon by (dx, dy).


Related Non-Members

QDataStream & operator<< ( QDataStream & stream, const QPolygonF & polygon )

This is an overloaded member function, provided for convenience.

Writes the given polygon to the given stream, and returns a reference to the stream.

See also Format of the QDataStream Operators.

QDataStream & operator>> ( QDataStream & stream, QPolygonF & polygon )

This is an overloaded member function, provided for convenience.

Reads a polygon from the given stream into the given polygon, and returns a reference to the stream.

See also Format of the QDataStream Operators.

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 64
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. BlackBerry 10 : premières images du prochain OS de RIM qui devrait intégrer des widgets et des tuiles inspirées de Windows Phone 0
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. La rubrique Qt a besoin de vous ! 1
Page suivante

Le Qt Developer Network au hasard

Logo

Comment fermer une application

Le Qt Developer Network est un réseau de développeurs Qt anglophone, où ils peuvent partager leur expérience sur le framework. 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