Qt:Документация 4.3.2/qline
Материал из Wiki.crossplatform.ru
![]() | Внимание: Актуальная версия перевода документации находится здесь |
__NOTOC__
Главная · Все классы · Основные классы · Классы по группам · Модули · Функции |
[править] QLine Class Reference
[модуль QtCore ]
The QLine class provides a two-dimensional vector using integer precision. Далее...
#include <QLine>
[править] Открытые функции
- QLine ()
- QLine ( const QPoint & p1, const QPoint & p2 )
- QLine ( int x1, int y1, int x2, int y2 )
- QPoint p1 () const
- QPoint p2 () const
- int x1 () const
- int x2 () const
- int y1 () const
- int y2 () const
- int dx () const
- int dy () const
- bool isNull () const
- void translate ( const QPoint & offset )
- void translate ( int dx, int dy )
- bool operator!= ( const QLine & line ) const
- bool operator== ( const QLine & line ) const
[править] Связанные не-члены
- QDataStream & operator<< ( QDataStream & stream, const QLine & line )
- QDataStream & operator>> ( QDataStream & stream, QLine & line )
[править] Подробное описание
The QLine class provides a two-dimensional vector using integer precision.
A QLine describes a finite length line (or a line segment) on a two-dimensional surface. The start and end points of the line are specified using integer point accuracy for coordinates. Use the QLineF constructor to retrieve a floating point copy.
Файл:Qline-point.png | Файл:Qline-coordinates.png |
The positions of the line's start and end points can be retrieved using the p1(), x1(), y1(), p2(), x2(), and y2() functions. The dx() and dy() functions return the horizontal and vertical components of the line. Use isNull() to determine whether the QLine represents a valid line or a null line.
Finally, the line can be translated a given offset using the translate() function.
See also QLineF, QPolygon, and QRect.
[править] Описание функций-членов
[править] QLine::QLine ()
Constructs a null line.
[править] QLine::QLine ( const QPoint & p1, const QPoint & p2 )
Constructs a line object that represents the line between p1 and p2.
[править] QLine::QLine ( int x1, int y1, int x2, int y2 )
Constructs a line object that represents the line between (x1, y1) and (x2, y2).
[править] QPoint QLine::p1 () const
Returns the line's start point.
See also x1(), y1(), and p2().
[править] QPoint QLine::p2 () const
Returns the line's end point.
See also x2(), y2(), and p1().
[править] int QLine::x1 () const
Returns the x-coordinate of the line's start point.
See also p1().
[править] int QLine::x2 () const
Returns the x-coordinate of the line's end point.
See also p2().
[править] int QLine::y1 () const
Returns the y-coordinate of the line's start point.
See also p1().
[править] int QLine::y2 () const
Returns the y-coordinate of the line's end point.
See also p2().
[править] int QLine::dx () const
Returns the horizontal component of the line's vector.
See also dy().
[править] int QLine::dy () const
Returns the vertical component of the line's vector.
See also dx().
[править] bool QLine::isNull () const
Returns true if the line is not set up with valid start and end point; otherwise returns false.
[править] void QLine::translate ( const QPoint & offset )
Translates this line by the given offset.
[править] void QLine::translate ( int dx, int dy )
Эта перегруженная функция предоставлена для удобства.
Translates this line the distance specified by dx and dy.
[править] bool QLine::operator!= ( const QLine & line ) const
Returns true if the given line is not the same as this line.
A line is different from another line if any of their start or end points differ, or the internal order of the points is different.
[править] bool QLine::operator== ( const QLine & line ) const
Returns true if the given line is the same as this line.
A line is identical to another line if the start and end points are identical, and the internal order of the points is the same.
[править] Связанные не-члены
[править] QDataStream & operator<< ( QDataStream & stream, const QLine & line )
Эта перегруженная функция предоставлена для удобства.
Writes the given line to the given stream and returns a reference to the stream.
Смотрите также Формат операторов QDataStream.
[править] QDataStream & operator>> ( QDataStream & stream, QLine & line )
Эта перегруженная функция предоставлена для удобства.
Reads a line from the given stream into the given line and returns a reference to the stream.
Смотрите также Формат операторов QDataStream.
Copyright © 2007 Trolltech | Trademarks | Qt 4.3.2
|