Logo Search packages:      
Sourcecode: qt4-x11 version File versions  Download package

QPolygonF Class Reference

Inheritance diagram for QPolygonF:

QVector< QPointF >

List of all members.

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:

snippets/polygon/polygon.cpp STREAMF QPolygonF QPointF

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 {Implicit Data Sharing}{implicitly shared}.

See also:
QVector, QPolygon, QLineF

Definition at line 117 of file qpolygon.h.

Public Types

typedef const QPointFconst_iterator
typedef const value_typeconst_pointer
typedef const value_typeconst_reference
typedef const_iterator ConstIterator
typedef ptrdiff_t difference_type
typedef iterator Iterator
typedef QPointFiterator
typedef value_typepointer
typedef value_typereference
typedef int size_type
typedef QPointF value_type

Public Member Functions

void append (const QPointF &t)
const QPointFat (int i) const
const_reference back () const
reference back ()
const_iterator begin () const
iterator begin ()
QRectF boundingRect () const
int capacity () const
void clear ()
const_iterator constBegin () const
const QPointFconstData () const
const_iterator constEnd () const
bool contains (const QPointF &t) const
bool containsPoint (const QPointF &pt, Qt::FillRule fillRule) const
int count () const
int count (const QPointF &t) const
const QPointFdata () const
QPointFdata ()
void detach ()
bool empty () const
const_iterator end () const
iterator end ()
iterator erase (iterator pos)
iterator erase (iterator begin, iterator end)
QVector< QPointF > & fill (const QPointF &t, int size=-1)
const QPointFfirst () const
QPointFfirst ()
const_reference front () const
QPointFfront ()
int indexOf (const QPointF &t, int from=0) const
iterator insert (iterator before, const QPointF &x)
iterator insert (iterator before, int n, const QPointF &x)
void insert (int i, int n, const QPointF &t)
void insert (int i, const QPointF &t)
QPolygonF intersected (const QPolygonF &r) const
bool isClosed () const
bool isDetached () const
bool isEmpty () const
const QPointFlast () const
QPointFlast ()
int lastIndexOf (const QPointF &t, int from=-1) const
QVector< QPointFmid (int pos, int length=-1) const
bool operator!= (const QVector< QPointF > &v) const
QVector< QPointFoperator+ (const QVector< QPointF > &l) const
QVector< QPointF > & operator+= (const QPointF &t)
QVector< QPointF > & operator+= (const QVector< QPointF > &l)
QVector< QPointF > & operator<< (const QVector< QPointF > &l)
QVector< QPointF > & operator<< (const QPointF &t)
bool operator== (const QVector< QPointF > &v) const
const QPointFoperator[] (int i) const
QPointFoperator[] (int i)
void pop_back ()
void pop_front ()
void prepend (const QPointF &t)
void push_back (const QPointF &t)
void push_front (const QPointF &t)
 QPolygonF (const QPolygon &a)
 QPolygonF (const QRectF &r)
 QPolygonF (const QVector< QPointF > &v)
 QPolygonF (const QPolygonF &a)
 QPolygonF (int size)
 QPolygonF ()
void remove (int i, int n)
void remove (int i)
void replace (int i, const QPointF &t)
void reserve (int size)
void resize (int size)
void setSharable (bool sharable)
int size () const
void squeeze ()
QPolygonF subtracted (const QPolygonF &r) const
QList< QPointFtoList () const
QPolygon toPolygon () const
std::vector< QPointFtoStdVector () const
void translate (const QPointF &offset)
void translate (qreal dx, qreal dy)
QPolygonF united (const QPolygonF &r) const
QPointF value (int i, const QPointF &defaultValue) const
QPointF value (int i) const
 ~QPolygonF ()

Static Public Member Functions

static QVector< QPointFfromList (const QList< QPointF > &list)
static QVector< QPointFfromStdVector (const std::vector< QPointF > &vector)

Public Attributes

QVectorTypedData< QPointF > * d
QVectorData * p

Related Functions

(Note that these are not member functions.)

QDataStreamoperator<< (QDataStream &stream, const QPolygonF &polygon)
QDataStreamoperator>> (QDataStream &stream, QPolygonF &polygon)

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index