|
constexpr | QPointF () noexcept |
| Constructs a null point, i.e.
|
|
constexpr | QPointF (const QPoint &p) noexcept |
| Constructs a copy of the given point.
|
|
constexpr | QPointF (qreal xpos, qreal ypos) noexcept |
| Constructs a point with the given coordinates (xpos, ypos).
|
|
constexpr qreal | manhattanLength () const |
|
bool | isNull () const noexcept |
| Returns true if both the x and y coordinates are set to 0.0 (ignoring the sign); otherwise returns false .
|
|
constexpr qreal | x () const noexcept |
| Returns the x coordinate of this point.
|
|
constexpr qreal | y () const noexcept |
| Returns the y coordinate of this point.
|
|
constexpr void | setX (qreal x) noexcept |
| Sets the x coordinate of this point to the given finite x coordinate.
|
|
constexpr void | setY (qreal y) noexcept |
| Sets the y coordinate of this point to the given finite y coordinate.
|
|
constexpr QPointF | transposed () const noexcept |
|
constexpr qreal & | rx () noexcept |
| Returns a reference to the x coordinate of this point.
|
|
constexpr qreal & | ry () noexcept |
| Returns a reference to the y coordinate of this point.
|
|
constexpr QPointF & | operator+= (const QPointF &p) |
| Adds the given point to this point and returns a reference to this point.
|
|
constexpr QPointF & | operator-= (const QPointF &p) |
| Subtracts the given point from this point and returns a reference to this point.
|
|
constexpr QPointF & | operator*= (qreal c) |
| Multiplies this point's coordinates by the given finite factor, and returns a reference to this point.
|
|
constexpr QPointF & | operator/= (qreal c) |
| Divides both x and y by the given divisor, and returns a reference to this point.
|
|
constexpr QPoint | toPoint () const |
| Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rounded coordinates.
|
|
|
class | QTransform |
|
QT_WARNING_PUSH QT_WARNING_DISABLE_FLOAT_COMPARE friend constexpr bool | qFuzzyCompare (const QPointF &p1, const QPointF &p2) noexcept |
|
QT_WARNING_POP friend constexpr bool | qFuzzyIsNull (const QPointF &point) noexcept |
|
constexpr bool | comparesEqual (const QPointF &p1, const QPointF &p2) noexcept |
|
constexpr bool | comparesEqual (const QPointF &p1, const QPoint &p2) noexcept |
|
constexpr QPointF | operator+ (const QPointF &p1, const QPointF &p2) |
| Returns a QPointF object that is the sum of the given points, p1 and p2; each component is added separately.
|
|
constexpr QPointF | operator- (const QPointF &p1, const QPointF &p2) |
| Returns a QPointF object that is formed by subtracting p2 from p1; each component is subtracted separately.
|
|
constexpr QPointF | operator* (const QPointF &p, qreal c) |
| Returns a copy of the given point, multiplied by the given finite factor.
|
|
constexpr QPointF | operator* (qreal c, const QPointF &p) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a copy of the given point, multiplied by the given finite factor.
|
|
constexpr QPointF | operator+ (const QPointF &p) |
|
constexpr QPointF | operator- (const QPointF &p) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a QPointF object that is formed by changing the sign of each component of the given point.
|
|
constexpr QPointF | operator/ (const QPointF &p, qreal divisor) |
| Returns the QPointF object formed by dividing each component of the given point by the given divisor.
|
|
template<std::size_t I, typename P , std::enable_if_t<(I< 2), bool > = true, std::enable_if_t< std::is_same_v< q20::remove_cvref_t< P >, QPointF >, bool > = true> |
constexpr decltype(auto) | get (P &&p) noexcept |
|
\inmodule QtCore
\reentrant
\compares equality \compareswith equality QPoint \endcompareswith
The QPointF class defines a point in the plane using floating point precision.
A point is specified by a x coordinate and an y coordinate which can be accessed using the x() and y() functions. The coordinates of the point are specified using finite floating point numbers for accuracy. The isNull() function returns true
if both x and y are set to 0.0. The coordinates can be set (or altered) using the setX() and setY() functions, or alternatively the rx() and ry() functions which return references to the coordinates (allowing direct manipulation).
Given a point p, the following statements are all equivalent:
A QPointF object can also be used as a vector: Addition and subtraction are defined as for vectors (each component is added separately). A QPointF object can also be divided or multiplied by an int
or a qreal
.
In addition, the QPointF class provides a constructor converting a QPoint object into a QPointF object, and a corresponding toPoint() function which returns a QPoint copy of this point. Finally, QPointF objects can be streamed as well as compared.
- See also
- QPoint, QPolygonF
Definition at line 216 of file qpoint.h.