Qt 4.8
Public Functions | Properties | Friends | Related Functions | List of all members
QPointF Class Reference

The QPointF class defines a point in the plane using floating point precision. More...

#include <qpoint.h>

Public Functions

bool isNull () const
 Returns true if both the x and y coordinates are set to +0. More...
 
qreal manhattanLength () const
 Returns the sum of the absolute values of x() and y(), traditionally known as the "Manhattan length" of the vector from the origin to the point. More...
 
QPointFoperator*= (qreal c)
 Multiplies this point's coordinates by the given factor, and returns a reference to this point. More...
 
QPointFoperator+= (const QPointF &p)
 Adds the given point to this point and returns a reference to this point. More...
 
QPointFoperator-= (const QPointF &p)
 Subtracts the given point from this point and returns a reference to this point. More...
 
QPointFoperator/= (qreal c)
 Divides both x and y by the given divisor, and returns a reference to this point. More...
 
 QPointF ()
 Constructs a null point, i. More...
 
 QPointF (const QPoint &p)
 Constructs a copy of the given point. More...
 
 QPointF (qreal xpos, qreal ypos)
 Constructs a point with the given coordinates (x, y). More...
 
qrealrx ()
 Returns a reference to the x coordinate of this point. More...
 
qrealry ()
 Returns a reference to the y coordinate of this point. More...
 
void setX (qreal x)
 Sets the x coordinate of this point to the given x coordinate. More...
 
void setY (qreal y)
 Sets the y coordinate of this point to the given y coordinate. More...
 
QPoint toPoint () const
 Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rounded coordinates. More...
 
qreal x () const
 Returns the x-coordinate of this point. More...
 
qreal y () const
 Returns the y-coordinate of this point. More...
 

Properties

qreal xp
 
qreal yp
 

Friends

bool operator!= (const QPointF &, const QPointF &)
 Returns true if p1 is not equal to p2; otherwise returns false. More...
 
const QPointF operator* (qreal, const QPointF &)
 
const QPointF operator* (const QPointF &, qreal)
 
const QPointF operator+ (const QPointF &, const QPointF &)
 Returns a QPointF object that is the sum of the given points, p1 and p2; each component is added separately. More...
 
const QPointF operator- (const QPointF &, const QPointF &)
 Returns a QPointF object that is formed by subtracting p2 from p1; each component is subtracted separately. More...
 
const QPointF operator- (const QPointF &)
 Returns a QPointF object that is formed by changing the sign of both components of the given point. More...
 
const QPointF operator/ (const QPointF &, qreal)
 Returns the QPointF object formed by dividing both components of the given point by the given divisor. More...
 
bool operator== (const QPointF &, const QPointF &)
 Returns true if p1 is equal to p2; otherwise returns false. More...
 
class QMatrix
 
class QTransform
 

Related Functions

(Note that these are not member functions.)

QDataStreamoperator<< (QDataStream &stream, const QPointF &point)
 Writes the given point to the given stream and returns a reference to the stream. More...
 
QDataStreamoperator>> (QDataStream &stream, QPointF &point)
 Reads a point from the given stream into the given point and returns a reference to the stream. More...
 

Detailed Description

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 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:

p.setX(p.x() + 1.0);
p += QPointF(1.0, 0.0);
p.rx()++;

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 214 of file qpoint.h.

Constructors and Destructors

◆ QPointF() [1/3]

QPointF::QPointF ( )
inline

Constructs a null point, i.

e. with coordinates (0.0, 0.0)

\sa isNull()

Definition at line 271 of file qpoint.h.

Referenced by operator*(), operator+(), operator-(), and operator/().

271 : xp(0), yp(0) { }
qreal xp
Definition: qpoint.h:253
qreal yp
Definition: qpoint.h:254

◆ QPointF() [2/3]

QPointF::QPointF ( const QPoint point)
inline

Constructs a copy of the given point.

See also
toPoint()

Definition at line 275 of file qpoint.h.

275 : xp(p.x()), yp(p.y()) { }
qreal xp
Definition: qpoint.h:253
qreal yp
Definition: qpoint.h:254

◆ QPointF() [3/3]

QPointF::QPointF ( qreal  x,
qreal  y 
)
inline

Constructs a point with the given coordinates (x, y).

See also
setX(), setY()

Definition at line 273 of file qpoint.h.

273 : xp(xpos), yp(ypos) { }
qreal xp
Definition: qpoint.h:253
qreal yp
Definition: qpoint.h:254

Functions

◆ isNull()

bool QPointF::isNull ( ) const
inline

Returns true if both the x and y coordinates are set to +0.

0; otherwise returns false.

Note
Since this function treats +0.0 and -0.0 differently, points with zero-valued coordinates where either or both values have a negative sign are not defined to be null points.

Definition at line 277 of file qpoint.h.

Referenced by QGraphicsItemGroup::addToGroup(), QGraphicsItemPrivate::childrenBoundingRectHelper(), QTextControl::createStandardContextMenu(), QVGPixmapConvolutionFilter::draw(), QVGPixmapColorizeFilter::draw(), QVGPixmapDropShadowFilter::draw(), QVGPixmapBlurFilter::draw(), QSvgUse::draw(), QGraphicsScenePrivate::drawItemHelper(), QVGPaintEngine::drawPixmapFragments(), QWin32PrintEngine::drawTiledPixmap(), drawVGImage(), QAbstractScrollArea::event(), QPlainTextEdit::event(), printPage(), QGraphicsItemGroup::removeFromGroup(), and QPolygonF::translate().

278 {
279  return qIsNull(xp) && qIsNull(yp);
280 }
static bool qIsNull(double d)
Definition: qglobal.h:2061
qreal xp
Definition: qpoint.h:253
qreal yp
Definition: qpoint.h:254

◆ manhattanLength()

qreal QPointF::manhattanLength ( ) const

Returns the sum of the absolute values of x() and y(), traditionally known as the "Manhattan length" of the vector from the origin to the point.

Since
4.6
See also
QPoint::manhattanLength()

Definition at line 603 of file qpoint.cpp.

Referenced by QmlJSDebugger::ZoomTool::mouseMoveEvent().

604 {
605  return qAbs(x())+qAbs(y());
606 }
Q_DECL_CONSTEXPR T qAbs(const T &t)
Definition: qglobal.h:1201
qreal x() const
Returns the x-coordinate of this point.
Definition: qpoint.h:282
qreal y() const
Returns the y-coordinate of this point.
Definition: qpoint.h:287

◆ operator*=()

QPointF & QPointF::operator*= ( qreal  factor)
inline

Multiplies this point's coordinates by the given factor, and returns a reference to this point.

For example:

QPointF p(-1.1, 4.1);
p *= 2.5; // p becomes (-2.75, 10.25)
See also
operator/=()

Definition at line 324 of file qpoint.h.

325 {
326  xp*=c; yp*=c; return *this;
327 }
unsigned char c[8]
Definition: qnumeric_p.h:62
qreal xp
Definition: qpoint.h:253
qreal yp
Definition: qpoint.h:254

◆ operator+=()

QPointF & QPointF::operator+= ( const QPointF point)
inline

Adds the given point to this point and returns a reference to this point.

For example:

QPointF p( 3.1, 7.1);
QPointF q(-1.0, 4.1);
p += q; // p becomes (2.1, 11.2)
See also
operator-=()

Definition at line 312 of file qpoint.h.

313 {
314  xp+=p.xp;
315  yp+=p.yp;
316  return *this;
317 }
qreal xp
Definition: qpoint.h:253
qreal yp
Definition: qpoint.h:254

◆ operator-=()

QPointF & QPointF::operator-= ( const QPointF point)
inline

Subtracts the given point from this point and returns a reference to this point.

For example:

QPointF p( 3.1, 7.1);
QPointF q(-1.0, 4.1);
p -= q; // p becomes (4.1, 3.0)
See also
operator+=()

Definition at line 319 of file qpoint.h.

320 {
321  xp-=p.xp; yp-=p.yp; return *this;
322 }
qreal xp
Definition: qpoint.h:253
qreal yp
Definition: qpoint.h:254

◆ operator/=()

QPointF & QPointF::operator/= ( qreal  divisor)
inline

Divides both x and y by the given divisor, and returns a reference to this point.

For example:

QPointF p(-2.75, 10.25);
p /= 2.5; // p becomes (-1.1, 4.1)
See also
operator*=()

Definition at line 364 of file qpoint.h.

365 {
366  xp/=c;
367  yp/=c;
368  return *this;
369 }
unsigned char c[8]
Definition: qnumeric_p.h:62
qreal xp
Definition: qpoint.h:253
qreal yp
Definition: qpoint.h:254

◆ rx()

qreal & QPointF::rx ( )
inline

◆ ry()

qreal & QPointF::ry ( )
inline

◆ setX()

void QPointF::setX ( qreal  x)
inline

Sets the x coordinate of this point to the given x coordinate.

See also
x() setY()

Definition at line 292 of file qpoint.h.

Referenced by QTriangulator< T >::ComplexToSimple::Event::operator<(), operator>>(), QDeclarativePointFValueType::setX(), and sign().

293 {
294  xp = xpos;
295 }
qreal xp
Definition: qpoint.h:253

◆ setY()

void QPointF::setY ( qreal  y)
inline

Sets the y coordinate of this point to the given y coordinate.

See also
y(), setX()

Definition at line 297 of file qpoint.h.

Referenced by QTriangulator< T >::ComplexToSimple::Event::operator<(), operator>>(), QDeclarativePointFValueType::setY(), and sign().

298 {
299  yp = ypos;
300 }
qreal yp
Definition: qpoint.h:254

◆ toPoint()

QPoint QPointF::toPoint ( ) const
inline

Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rounded coordinates.

See also
QPointF()

Definition at line 376 of file qpoint.h.

Referenced by QPainter::brushOrigin(), QGraphicsProxyWidget::contextMenuEvent(), QGestureManager::deliverEvents(), QGraphicsProxyWidget::dragEnterEvent(), QGraphicsProxyWidget::dragMoveEvent(), QTextDocumentLayoutPrivate::drawListItem(), QWidget::event(), QPlainTextEdit::inputMethodQuery(), QTextEdit::inputMethodQuery(), QGraphicsTextItem::inputMethodQuery(), QGraphicsProxyWidgetPrivate::inputMethodQueryHelper(), QOpenGLPaintEnginePrivate::isFastRect(), QGraphicsView::mapFromScene(), QWidget::mapToGlobal(), QGestureEvent::mapToGraphicsScene(), QmlJSDebugger::LiveSelectionTool::mouseMoveEvent(), QTextControlPrivate::mouseMoveEvent(), QTextControlPrivate::mousePressEvent(), QmlJSDebugger::LiveSelectionTool::mouseReleaseEvent(), QGraphicsEffectSource::pixmap(), QGraphicsItemEffectSourcePrivate::pixmap(), QCursor::pos(), QLineControl::processEvent(), qt_mac_handleTabletEvent(), QSwipeGestureRecognizer::recognize(), QTapGestureRecognizer::recognize(), QTapAndHoldGestureRecognizer::recognize(), QDeclarativePathView::sendMouseEvent(), QDeclarativeMouseArea::sendMouseEvent(), QDeclarativeFlickable::sendMouseEvent(), QDeclarativePinchArea::sendMouseEvent(), QGraphicsScenePrivate::sendTouchBeginEvent(), QGraphicsProxyWidgetPrivate::sendWidgetMouseEvent(), QLineF::toLine(), QGraphicsScenePrivate::touchEventHandler(), QApplicationPrivate::translateRawTouchEvent(), QETWidget::translateTabletEvent(), QGraphicsPixmapItemPrivate::updateShape(), QApplicationPrivate::updateTouchPointsForWidget(), QGraphicsProxyWidget::wheelEvent(), QGraphicsWidgetPrivate::windowFrameHoverMoveEvent(), and QGraphicsWidgetPrivate::windowFrameMouseReleaseEvent().

377 {
378  return QPoint(qRound(xp), qRound(yp));
379 }
qreal xp
Definition: qpoint.h:253
qreal yp
Definition: qpoint.h:254
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
Q_DECL_CONSTEXPR int qRound(qreal d)
Definition: qglobal.h:1203

◆ x()

qreal QPointF::x ( ) const
inline

Returns the x-coordinate of this point.

See also
setX(), rx()

Definition at line 282 of file qpoint.h.

Referenced by QFreetypeFace::addBitmapToPath(), QPdfEnginePrivate::addBrushPattern(), addCircle(), QPainterPath::addEllipse(), addGlyphToPath(), addLineTo(), QGL2PEXVertexArray::addPath(), QPathSegments::addPath(), QPainterPath::addPolygon(), QPainterPath::addText(), QGraphicsItemGroup::addToGroup(), QStyleHelper::angle(), QLineF::angle(), boundingRect(), QPolygonF::boundingRect(), QSvgLine::bounds(), QRasterPaintEnginePrivate::brushMatrix(), QGraphicsView::centerOn(), QAccessibleTextWidget::characterRect(), comparePoints(), component(), computeAngle(), QRectF::contains(), QOutlineMapper::convertElements(), QPainter::PixmapFragment::create(), QTriangulatingStroker::cubicTo(), QPainterPath::cubicTo(), QOutlineMapper::curveTo(), QCoreGraphicsPaintEnginePrivate::devicePixelSize(), QGraphicsItem::deviceTransform(), QDeclarativeParentChangePrivate::doChange(), dot(), QDeclarativeTextLayout::draw(), QPixmapConvolutionFilter::draw(), QSvgText::draw(), QTextLine::draw(), draw_text_item_win(), QRasterPaintEngine::drawBitmap(), QPaintEnginePrivate::drawBoxTextItem(), QVGPaintEngine::drawCachedGlyphs(), QRasterPaintEngine::drawCachedGlyphs(), QTextLayout::drawCursor(), QStyleHelper::drawDial(), QPainter::drawEllipse(), QTextDocumentLayoutPrivate::drawFrame(), QX11PaintEngine::drawFreetype(), QVGPaintEngine::drawImage(), QRasterPaintEngine::drawImage(), QRasterPaintEnginePrivate::drawImage(), QPainter::drawImage(), QGraphicsScenePrivate::drawItemHelper(), QCosmeticStroker::drawLine(), QCoreGraphicsPaintEngine::drawLines(), QVGPaintEngine::drawLines(), QOpenGLPaintEngine::drawLines(), QGLEllipseMaskGenerator::drawMask(), QCosmeticStroker::drawPath(), QWin32PrintEngine::drawPixmap(), QPainter::drawPixmap(), QCoreGraphicsPaintEngine::drawPoints(), QX11PaintEngine::drawPoints(), QCosmeticStroker::drawPoints(), QOpenGLPaintEngine::drawPoints(), QVGPaintEngine::drawPoints(), QPaintEngine::drawPoints(), QPaintEngineEx::drawPoints(), QVGPaintEngine::drawPolygon(), QOpenGLPaintEngine::drawPolygon(), QSvgPaintEngine::drawPolygon(), QPaintBufferEngine::drawPolygon(), QVGPaintEngine::drawRects(), QPainter::drawStaticText(), QPainter::drawText(), QEmulationPaintEngine::drawTextItem(), QAlphaPaintEngine::drawTextItem(), QCoreGraphicsPaintEngine::drawTextItem(), QPicturePaintEngine::drawTextItem(), QGL2PaintEngineEx::drawTextItem(), QOpenGLPaintEngine::drawTextItem(), QPdfEnginePrivate::drawTextItem(), QSvgPaintEngine::drawTextItem(), QPaintEngine::drawTextItem(), QRasterPaintEngine::drawTextItem(), QPdfBaseEnginePrivate::drawTextItem(), QPainter::drawTextItem(), drawTextItemDecoration(), QOpenGLPaintEnginePrivate::drawTiledImageAsPath(), QPSPrintEngine::drawTiledPixmap(), QCoreGraphicsPaintEngine::drawTiledPixmap(), QDirectFBPaintEnginePrivate::drawTiledPixmap(), QX11PaintEngine::drawTiledPixmap(), QOpenGLPaintEngine::drawTiledPixmap(), QVGPaintEngine::drawTiledPixmap(), QPaintEngine::drawTiledPixmap(), QRasterPaintEngine::drawTiledPixmap(), QPaintEngineEx::drawTiledPixmap(), QPainter::drawTiledPixmap(), drawVGImage(), QX11PaintEngine::drawXLFD(), QLineF::dx(), QOutlineMapper::endOutline(), epsilonCompare(), QAbstractScrollArea::event(), QPlainTextEdit::event(), QPicture::exec(), QTextControlPrivate::extendWordwiseSelection(), QBlitterPaintEngine::fillRect(), QDirectFBPaintEngine::fillRect(), QVGPaintEngine::fillRect(), findCrossings(), flipPoint(), QFixedPoint::fromPointF(), QBezier::fromPoints(), QGLRectMaskGenerator::generateTrapezoids(), QDeclarativeCompiler::genLiteralAssignment(), QStaticTextPrivate::get(), good_offset(), QDeclarativePathViewPrivate::handleMouseMoveEvent(), QDeclarativeFlickablePrivate::handleMouseMoveEvent(), QDeclarativePathViewPrivate::handleMousePressEvent(), QDeclarativeFlickablePrivate::handleMouseReleaseEvent(), QIntersectionFinder::hasIntersections(), QTextDocumentLayout::hitTest(), QPlainTextEditControl::hitTest(), QTextDocumentLayoutPrivate::hitTest(), QGraphicsSceneBspTree::initialize(), QTriangulator< T >::initialize(), QLineF::intersect(), QWingedEdge::isInside(), QLineF::isNull(), QGraphicsItem::itemTransform(), QStroker::joinPoints(), QTextDocumentLayoutPrivate::layoutBlock(), QLineF::length(), QIntersectionFinder::linesIntersect(), QPainterPath::lineTo(), QOutlineMapper::lineTo(), QMatrix::map(), QTransform::map(), QDeclarativeItem::mapFromItem(), QGraphicsItem::mapFromScene(), mapHomogeneous(), QMatrix4x4::mapRect(), QDeclarativeItem::mapToItem(), QGraphicsItem::mapToScene(), QGraphicsViewPrivate::mapToViewRect(), QBezier::midTangent(), QDeclarativeTextInput::mouseDoubleClickEvent(), QTextControlPrivate::mouseMoveEvent(), QDeclarativeMouseArea::mouseMoveEvent(), QDeclarativeTextInput::mouseMoveEvent(), QGraphicsItem::mouseMoveEvent(), QTextControlPrivate::mousePressEvent(), QDeclarativeTextInput::mousePressEvent(), QmlJSDebugger::ZoomTool::mouseReleaseEvent(), QRectF::moveBottomLeft(), QRectF::moveBottomRight(), QRectF::moveCenter(), QPainterPath::moveTo(), QOutlineMapper::moveTo(), QRectF::moveTo(), QRectF::moveTopLeft(), QRectF::moveTopRight(), QKdPointFinder::operator()(), operator*(), QTriangulator< T >::ComplexToSimple::Event::operator<(), QPdf::ByteStream::operator<<(), operator<<(), QVGPaintEnginePrivate::painterPathToVGPath(), QPlainTextEdit::paintEvent(), parsePathDataFast(), QPdf::patternForBrush(), QPaintBufferEngine::penChanged(), QLineF::pointAt(), QDeclarativePathViewPrivate::pointNear(), PointToVector(), QGraphicsItemAnimation::posAt(), printPage(), QDashedStrokeProcessor::process(), QDashStroker::processCurrentSubpath(), QTextControl::processEvent(), QConicalGradient::QConicalGradient(), QKdPointFinder::QKdPointFinder(), QLinearGradient::QLinearGradient(), qMapGradientToRect(), QPainterPath::QPainterPath(), QRadialGradient::QRadialGradient(), QRectF::QRectF(), qt_find_ellipse_coords(), qt_isExtendedRadialGradient(), qt_mac_compose_path(), qt_painterpath_check_crossing(), qt_painterpath_isect_curve(), qt_painterpath_isect_line(), qt_polygon_isect_line(), qt_stroke_side(), qt_vg_drawVGImageStencil(), QTextLineItemIterator::QTextLineItemIterator(), QPainterPath::quadTo(), QRasterizer::rasterizeLine(), QPanGestureRecognizer::recognize(), QSwipeGestureRecognizer::recognize(), QTextControlPrivate::rectForPosition(), QGraphicsItemGroup::removeFromGroup(), QCosmeticStroker::renderCubic(), QMacPinchGestureRecognizer::reset(), QDeclarativeFlickable::resizeContent(), QSvgPaintEngine::saveLinearGradientBrush(), QSvgPaintEngine::saveRadialGradientBrush(), QmlJSDebugger::ZoomTool::scaleView(), QGLEllipseMaskGenerator::screenRect(), QDeclarativeTextInputPrivate::sendMouseEventToInputContext(), QLineF::setAngle(), QRectF::setBottomLeft(), QRectF::setBottomRight(), QVGPaintEnginePrivate::setBrush(), QPainter::setBrushOrigin(), QVGPaintEnginePrivate::setBrushTransform(), QRadialGradient::setCenter(), QConicalGradient::setCenter(), QPrintPreviewWidgetPrivate::setCurrentPage(), QCoreGraphicsPaintEnginePrivate::setFillBrush(), QLinearGradient::setFinalStop(), QRadialGradient::setFocalPoint(), QLineF::setLength(), QGraphicsItemAnimation::setPosAt(), QGraphicsItemPrivate::setPosHelper(), QDeclarativeItemPrivate::setPosHelper(), QTextLine::setPosition(), QmlJSDebugger::LiveSelectionRectangle::setRect(), QLinearGradient::setStart(), QRectF::setTopLeft(), QRectF::setTopRight(), QGraphicsItem::setTransformOriginPoint(), QGLShaderProgram::setUniformValue(), QSpanData::setup(), QDeclarativeTextPrivate::setupTextLayout(), QDeclarativePointFValueType::setValue(), QGraphicsItem::setY(), snapTo26Dot6Grid(), splitPolygon(), QPaintEngineEx::stroke(), QRasterPaintEngine::stroke(), QStrokerOps::strokeEllipse(), QStrokerOps::strokePath(), QStrokerOps::strokePolygon(), QTessellator::tessellateRect(), QTest::toString(), QDeclarativeParentAnimation::transition(), QPainterPath::translate(), QPainter::translate(), QRectF::translate(), QGLTrapezoid::translated(), QPainterPath::translated(), QRectF::translated(), QApplicationPrivate::translateTouchEvent(), QLineF::unitVector(), QX11PaintEngine::updateBrush(), QGL2PaintEngineExPrivate::updateBrushUniforms(), QOpenGLPaintEnginePrivate::updateGradient(), QDeclarativePathViewPrivate::updateItem(), QDeclarativePinchArea::updatePinch(), QDeclarativeFlipablePrivate::updateSceneTransformFromParent(), QGraphicsPixmapItemPrivate::updateShape(), QVGPaintEnginePrivate::vectorPathToVGPath(), QCommonStylePrivate::viewItemDrawText(), QGraphicsWidget::windowFrameSectionAt(), QGraphicsItem::x(), QLineF::x1(), QLineF::x2(), and QGraphicsDropShadowEffect::xOffset().

283 {
284  return xp;
285 }
qreal xp
Definition: qpoint.h:253

◆ y()

qreal QPointF::y ( ) const
inline

Returns the y-coordinate of this point.

See also
setY(), ry()

Definition at line 287 of file qpoint.h.

Referenced by QFreetypeFace::addBitmapToPath(), QPdfEnginePrivate::addBrushPattern(), addCircle(), QPainterPath::addEllipse(), addGlyphToPath(), addLineTo(), QGL2PEXVertexArray::addPath(), QPathSegments::addPath(), QPainterPath::addPolygon(), addSelectedRegionsToPath(), QPainterPath::addText(), QGraphicsItemGroup::addToGroup(), QStyleHelper::angle(), QLineF::angle(), QPlainTextEditControl::blockBoundingRect(), boundingRect(), QPolygonF::boundingRect(), QSvgLine::bounds(), QRasterPaintEnginePrivate::brushMatrix(), QGraphicsView::centerOn(), QAccessibleTextWidget::characterRect(), QTessellatorPrivate::collectAndSortVertices(), comparePoints(), component(), computeAngle(), QRectF::contains(), QOutlineMapper::convertElements(), QPainter::PixmapFragment::create(), QTriangulatingStroker::cubicTo(), QPainterPath::cubicTo(), QOutlineMapper::curveTo(), QCoreGraphicsPaintEnginePrivate::devicePixelSize(), QGraphicsItem::deviceTransform(), QDeclarativeParentChangePrivate::doChange(), dot(), QDeclarativeTextLayout::draw(), QPixmapConvolutionFilter::draw(), QTextLayout::draw(), QSvgText::draw(), QTextLine::draw(), draw_text_item_win(), QRasterPaintEngine::drawBitmap(), QPaintEnginePrivate::drawBoxTextItem(), QVGPaintEngine::drawCachedGlyphs(), QRasterPaintEngine::drawCachedGlyphs(), QTextLayout::drawCursor(), QStyleHelper::drawDial(), QPainter::drawEllipse(), QTextDocumentLayoutPrivate::drawFrame(), QX11PaintEngine::drawFreetype(), QVGPaintEngine::drawImage(), QRasterPaintEngine::drawImage(), QRasterPaintEnginePrivate::drawImage(), QPainter::drawImage(), QGraphicsScenePrivate::drawItemHelper(), QCosmeticStroker::drawLine(), QCoreGraphicsPaintEngine::drawLines(), QVGPaintEngine::drawLines(), QOpenGLPaintEngine::drawLines(), QGLEllipseMaskGenerator::drawMask(), QCosmeticStroker::drawPath(), QWin32PrintEngine::drawPixmap(), QPainter::drawPixmap(), QCoreGraphicsPaintEngine::drawPoints(), QX11PaintEngine::drawPoints(), QCosmeticStroker::drawPoints(), QOpenGLPaintEngine::drawPoints(), QVGPaintEngine::drawPoints(), QPaintEngine::drawPoints(), QPaintEngineEx::drawPoints(), QPainter::drawPoints(), QVGPaintEngine::drawPolygon(), QOpenGLPaintEngine::drawPolygon(), QSvgPaintEngine::drawPolygon(), QPaintBufferEngine::drawPolygon(), QVGPaintEngine::drawRects(), QPainter::drawStaticText(), QPainter::drawText(), QEmulationPaintEngine::drawTextItem(), QAlphaPaintEngine::drawTextItem(), QCoreGraphicsPaintEngine::drawTextItem(), QPicturePaintEngine::drawTextItem(), QGL2PaintEngineEx::drawTextItem(), QOpenGLPaintEngine::drawTextItem(), QPdfEnginePrivate::drawTextItem(), QSvgPaintEngine::drawTextItem(), QPaintEngine::drawTextItem(), QRasterPaintEngine::drawTextItem(), QPdfBaseEnginePrivate::drawTextItem(), QPainter::drawTextItem(), drawTextItemDecoration(), QOpenGLPaintEnginePrivate::drawTiledImageAsPath(), QPSPrintEngine::drawTiledPixmap(), QCoreGraphicsPaintEngine::drawTiledPixmap(), QDirectFBPaintEnginePrivate::drawTiledPixmap(), QX11PaintEngine::drawTiledPixmap(), QOpenGLPaintEngine::drawTiledPixmap(), QVGPaintEngine::drawTiledPixmap(), QPaintEngine::drawTiledPixmap(), QRasterPaintEngine::drawTiledPixmap(), QPaintEngineEx::drawTiledPixmap(), QPainter::drawTiledPixmap(), drawVGImage(), QX11PaintEngine::drawXLFD(), QLineF::dy(), QOutlineMapper::endOutline(), QPlainTextEditPrivate::ensureVisible(), epsilonCompare(), QAbstractScrollArea::event(), QPlainTextEdit::event(), QPicture::exec(), QBlitterPaintEngine::fillRect(), QDirectFBPaintEngine::fillRect(), QVGPaintEngine::fillRect(), findCrossings(), flipPoint(), flowPosition(), QFixedPoint::fromPointF(), QBezier::fromPoints(), QGLRectMaskGenerator::generateTrapezoids(), QDeclarativeCompiler::genLiteralAssignment(), QStaticTextPrivate::get(), good_offset(), QDeclarativePathViewPrivate::handleMouseMoveEvent(), QDeclarativeFlickablePrivate::handleMouseMoveEvent(), QDeclarativePathViewPrivate::handleMousePressEvent(), QDeclarativeFlickablePrivate::handleMouseReleaseEvent(), QIntersectionFinder::hasIntersections(), QTextDocumentLayout::hitTest(), QPlainTextEditControl::hitTest(), QTextDocumentLayoutPrivate::hitTest(), QGraphicsSceneBspTree::initialize(), QTriangulator< T >::initialize(), QLineF::intersect(), isAbove(), QWingedEdge::isInside(), QLineF::isNull(), QGraphicsItem::itemTransform(), QStroker::joinPoints(), QTextDocumentLayoutPrivate::layoutBlock(), QLineF::length(), QIntersectionFinder::linesIntersect(), QPainterPath::lineTo(), QOutlineMapper::lineTo(), QMatrix::map(), QTransform::map(), QDeclarativeItem::mapFromItem(), QGraphicsItem::mapFromScene(), mapHomogeneous(), QMatrix4x4::mapRect(), QDeclarativeItem::mapToItem(), QGraphicsItem::mapToScene(), QGraphicsViewPrivate::mapToViewRect(), QBezier::midTangent(), QDeclarativeMouseArea::mouseMoveEvent(), QGraphicsItem::mouseMoveEvent(), QmlJSDebugger::ZoomTool::mouseReleaseEvent(), QRectF::moveBottomLeft(), QRectF::moveBottomRight(), QRectF::moveCenter(), QPainterPath::moveTo(), QOutlineMapper::moveTo(), QRectF::moveTo(), QRectF::moveTopLeft(), QRectF::moveTopRight(), QKdPointFinder::operator()(), operator*(), QTriangulator< T >::ComplexToSimple::Event::operator<(), QPdf::ByteStream::operator<<(), operator<<(), QVGPaintEnginePrivate::painterPathToVGPath(), QPlainTextEdit::paintEvent(), parsePathDataFast(), QPdf::patternForBrush(), QLineF::pointAt(), QDeclarativePathViewPrivate::pointNear(), PointToVector(), QGraphicsItemAnimation::posAt(), printPage(), QDashedStrokeProcessor::process(), QDashStroker::processCurrentSubpath(), QTextControl::processEvent(), QConicalGradient::QConicalGradient(), QKdPointFinder::QKdPointFinder(), QLinearGradient::QLinearGradient(), QPainterPath::QPainterPath(), QRadialGradient::QRadialGradient(), QRectF::QRectF(), qt_find_ellipse_coords(), qt_isExtendedRadialGradient(), qt_mac_compose_path(), qt_painterpath_check_crossing(), qt_painterpath_isect_curve(), qt_painterpath_isect_line(), qt_polygon_isect_line(), qt_stroke_side(), qt_vg_drawVGImageStencil(), QPainterPath::quadTo(), QRasterizer::rasterizeLine(), QPanGestureRecognizer::recognize(), QSwipeGestureRecognizer::recognize(), QTextControlPrivate::rectForPosition(), QGraphicsItemGroup::removeFromGroup(), QCosmeticStroker::renderCubic(), QMacPinchGestureRecognizer::reset(), QDeclarativeFlickable::resizeContent(), QSvgPaintEngine::saveLinearGradientBrush(), QSvgPaintEngine::saveRadialGradientBrush(), QmlJSDebugger::ZoomTool::scaleView(), QGLEllipseMaskGenerator::screenRect(), QTextEdit::scrollToAnchor(), QLineF::setAngle(), QRectF::setBottomLeft(), QRectF::setBottomRight(), QPainter::setBrushOrigin(), QVGPaintEnginePrivate::setBrushTransform(), QRadialGradient::setCenter(), QConicalGradient::setCenter(), QPrintPreviewWidgetPrivate::setCurrentPage(), QCoreGraphicsPaintEnginePrivate::setFillBrush(), QLinearGradient::setFinalStop(), QRadialGradient::setFocalPoint(), QLineF::setLength(), QGraphicsItemAnimation::setPosAt(), QGraphicsItemPrivate::setPosHelper(), QDeclarativeItemPrivate::setPosHelper(), QTextLine::setPosition(), QmlJSDebugger::LiveSelectionRectangle::setRect(), QLinearGradient::setStart(), QRectF::setTopLeft(), QRectF::setTopRight(), QGraphicsItem::setTransformOriginPoint(), QGLShaderProgram::setUniformValue(), QSpanData::setup(), QDeclarativeTextPrivate::setupTextLayout(), QDeclarativePointFValueType::setValue(), QGraphicsItem::setX(), snapTo26Dot6Grid(), splitPolygon(), QPaintEngineEx::stroke(), QRasterPaintEngine::stroke(), QStrokerOps::strokeEllipse(), QStrokerOps::strokePath(), QStrokerOps::strokePolygon(), QTessellator::tessellateRect(), QBezier::tForY(), QTest::toString(), QDeclarativeParentAnimation::transition(), QPainterPath::translate(), QPainter::translate(), QRectF::translate(), QGLTrapezoid::translated(), QPainterPath::translated(), QRectF::translated(), QApplicationPrivate::translateTouchEvent(), QLineF::unitVector(), QX11PaintEngine::updateBrush(), QGL2PaintEngineExPrivate::updateBrushUniforms(), QOpenGLPaintEnginePrivate::updateGradient(), QDeclarativePathViewPrivate::updateItem(), QDeclarativePinchArea::updatePinch(), QDeclarativeFlipablePrivate::updateSceneTransformFromParent(), QGraphicsPixmapItemPrivate::updateShape(), QVGPaintEnginePrivate::vectorPathToVGPath(), QCommonStylePrivate::viewItemDrawText(), QGraphicsWidget::windowFrameSectionAt(), QGraphicsItem::y(), QLineF::y1(), QLineF::y2(), and QGraphicsDropShadowEffect::yOffset().

288 {
289  return yp;
290 }
qreal yp
Definition: qpoint.h:254

Friends and Related Functions

◆ operator!=

bool operator!= ( const QPointF p1,
const QPointF p2 
)
friend

Returns true if p1 is not equal to p2; otherwise returns false.

Definition at line 334 of file qpoint.h.

335 {
336  return !qFuzzyIsNull(p1.xp - p2.xp) || !qFuzzyIsNull(p1.yp - p2.yp);
337 }
qreal xp
Definition: qpoint.h:253
qreal yp
Definition: qpoint.h:254
static Q_DECL_CONSTEXPR bool qFuzzyIsNull(double d)
Definition: qglobal.h:2043

◆ operator* [1/2]

const QPointF operator* ( qreal  factor,
const QPointF point 
)
friend

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 factor.

Definition at line 354 of file qpoint.h.

355 {
356  return QPointF(p.xp*c, p.yp*c);
357 }
unsigned char c[8]
Definition: qnumeric_p.h:62
QPointF()
Constructs a null point, i.
Definition: qpoint.h:271

◆ operator* [2/2]

const QPointF operator* ( const QPointF point,
qreal  factor 
)
friend

Returns a copy of the given point, multiplied by the given factor.

See also
QPointF::operator*=()

Definition at line 349 of file qpoint.h.

350 {
351  return QPointF(p.xp*c, p.yp*c);
352 }
unsigned char c[8]
Definition: qnumeric_p.h:62
QPointF()
Constructs a null point, i.
Definition: qpoint.h:271

◆ operator+

const QPointF operator+ ( const QPointF p1,
const QPointF p2 
)
friend

Returns a QPointF object that is the sum of the given points, p1 and p2; each component is added separately.

See also
QPointF::operator+=()

Definition at line 339 of file qpoint.h.

340 {
341  return QPointF(p1.xp+p2.xp, p1.yp+p2.yp);
342 }
qreal xp
Definition: qpoint.h:253
qreal yp
Definition: qpoint.h:254
QPointF()
Constructs a null point, i.
Definition: qpoint.h:271

◆ operator- [1/2]

const QPointF operator- ( const QPointF p1,
const QPointF p2 
)
friend

Returns a QPointF object that is formed by subtracting p2 from p1; each component is subtracted separately.

See also
QPointF::operator-=()

Definition at line 344 of file qpoint.h.

345 {
346  return QPointF(p1.xp-p2.xp, p1.yp-p2.yp);
347 }
qreal xp
Definition: qpoint.h:253
qreal yp
Definition: qpoint.h:254
QPointF()
Constructs a null point, i.
Definition: qpoint.h:271

◆ operator- [2/2]

const QPointF operator- ( const QPointF point)
friend

Returns a QPointF object that is formed by changing the sign of both components of the given point.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Equivalent to {QPointF(0,0) - point}.

Definition at line 359 of file qpoint.h.

360 {
361  return QPointF(-p.xp, -p.yp);
362 }
QPointF()
Constructs a null point, i.
Definition: qpoint.h:271

◆ operator/

const QPointF operator/ ( const QPointF point,
qreal  divisor 
)
friend

Returns the QPointF object formed by dividing both components of the given point by the given divisor.

See also
QPointF::operator/=()

Definition at line 371 of file qpoint.h.

372 {
373  return QPointF(p.xp/c, p.yp/c);
374 }
unsigned char c[8]
Definition: qnumeric_p.h:62
QPointF()
Constructs a null point, i.
Definition: qpoint.h:271

◆ operator<<()

QDataStream & operator<< ( QDataStream stream,
const QPointF point 
)
related

Writes the given point to the given stream and returns a reference to the stream.

See also
{Serializing Qt Data Types}

Definition at line 849 of file qpoint.cpp.

Referenced by toPoint().

850 {
851  s << double(p.x()) << double(p.y());
852  return s;
853 }

◆ operator==

bool operator== ( const QPointF p1,
const QPointF p2 
)
friend

Returns true if p1 is equal to p2; otherwise returns false.

Definition at line 329 of file qpoint.h.

330 {
331  return qFuzzyIsNull(p1.xp - p2.xp) && qFuzzyIsNull(p1.yp - p2.yp);
332 }
qreal xp
Definition: qpoint.h:253
qreal yp
Definition: qpoint.h:254
static Q_DECL_CONSTEXPR bool qFuzzyIsNull(double d)
Definition: qglobal.h:2043

◆ operator>>()

QDataStream & operator>> ( QDataStream stream,
QPointF point 
)
related

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

See also
{Serializing Qt Data Types}

Definition at line 868 of file qpoint.cpp.

869 {
870  double x, y;
871  s >> x;
872  s >> y;
873  p.setX(qreal(x));
874  p.setY(qreal(y));
875  return s;
876 }
double qreal
Definition: qglobal.h:1193
qreal x() const
Returns the x-coordinate of this point.
Definition: qpoint.h:282
qreal y() const
Returns the y-coordinate of this point.
Definition: qpoint.h:287

◆ QMatrix

friend class QMatrix
friend

Definition at line 250 of file qpoint.h.

◆ QTransform

friend class QTransform
friend

Definition at line 251 of file qpoint.h.

Properties

◆ xp

qreal QPointF::xp
private

◆ yp

qreal QPointF::yp
private

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