Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QPointF Class Reference

\inmodule QtCore\reentrant More...

#include <qpoint.h>

+ Collaboration diagram for QPointF:

Public Member Functions

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 qrealrx () noexcept
 Returns a reference to the x coordinate of this point.
 
constexpr qrealry () noexcept
 Returns a reference to the y coordinate of this point.
 
constexpr QPointFoperator+= (const QPointF &p)
 Adds the given point to this point and returns a reference to this point.
 
constexpr QPointFoperator-= (const QPointF &p)
 Subtracts the given point from this point and returns a reference to this point.
 
constexpr QPointFoperator*= (qreal c)
 Multiplies this point's coordinates by the given finite factor, and returns a reference to this point.
 
constexpr QPointFoperator/= (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.
 

Static Public Member Functions

static constexpr qreal dotProduct (const QPointF &p1, const QPointF &p2)
 

Friends

class QTransform
 
QT_WARNING_PUSH QT_WARNING_DISABLE_FLOAT_COMPARE friend constexpr bool operator== (const QPointF &p1, const QPointF &p2)
 Returns true if p1 is approximately equal to p2; otherwise returns false.
 
constexpr bool operator!= (const QPointF &p1, const QPointF &p2)
 Returns true if p1 is sufficiently different from p2; otherwise returns false.
 
QT_WARNING_POP friend 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
 

Related Symbols

(Note that these are not member symbols.)

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

Detailed Description

\inmodule QtCore

\reentrant

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:

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

Constructor & Destructor Documentation

◆ QPointF() [1/3]

constexpr QPointF::QPointF ( )
inlineconstexprnoexcept

Constructs a null point, i.e.

with coordinates (0.0, 0.0)

See also
isNull()

Definition at line 317 of file qpoint.h.

◆ QPointF() [2/3]

constexpr QPointF::QPointF ( const QPoint & point)
inlineconstexprnoexcept

Constructs a copy of the given point.

See also
toPoint(), QPoint::toPointF()

Definition at line 321 of file qpoint.h.

◆ QPointF() [3/3]

constexpr QPointF::QPointF ( qreal xpos,
qreal ypos )
inlineconstexprnoexcept

Constructs a point with the given coordinates (xpos, ypos).

See also
setX(), setY()

Definition at line 319 of file qpoint.h.

Member Function Documentation

◆ dotProduct()

static qreal QPointF::dotProduct ( const QPointF & p1,
const QPointF & p2 )
inlinestaticconstexpr
Since
5.1
QPointF p( 3.1, 7.1);
QPointF q(-1.0, 4.1);
qreal dotProduct = QPointF::dotProduct(p, q); // dotProduct becomes 26.01
static constexpr qreal dotProduct(const QPointF &p1, const QPointF &p2)
Definition qpoint.h:239
static constexpr int dotProduct(const QPoint &p1, const QPoint &p2)
Definition qpoint.h:51
constexpr int manhattanLength() const
Returns the sum of the absolute values of x() and y(), traditionally known as the "Manhattan length" ...
Definition qpoint.h:147
constexpr void setX(int x) noexcept
Sets the x coordinate of this point to the given x coordinate.
Definition qpoint.h:137
virtual void mouseMoveEvent(QMouseEvent *event)
This event handler, for event event, can be reimplemented in a subclass to receive mouse move events ...
Definition qwidget.cpp:9454
QPoint q(-1, 4)
QPoint oldPosition
[6]
QPoint p
[0]
double trueLength
[7]

Returns the dot product of p1 and p2.

Definition at line 239 of file qpoint.h.

References p1, and p2.

Referenced by QQuickContext2D::addArcTo(), QStroker::joinPoints(), qt_scoreQuadratic(), and qt_toQuadratics().

+ Here is the caller graph for this function:

◆ isNull()

◆ manhattanLength()

constexpr qreal QPointF::manhattanLength ( ) const
inlineconstexpr
Since
4.6

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.

See also
QPoint::manhattanLength()

Definition at line 323 of file qpoint.h.

References qAbs(), x(), and y().

+ Here is the call graph for this function:

◆ operator*=()

constexpr QPointF & QPointF::operator*= ( qreal factor)
inlineconstexpr

Multiplies this point's coordinates by the given finite 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 377 of file qpoint.h.

◆ operator+=()

constexpr QPointF & QPointF::operator+= ( const QPointF & point)
inlineconstexpr

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

◆ operator-=()

constexpr QPointF & QPointF::operator-= ( const QPointF & point)
inlineconstexpr

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

◆ operator/=()

constexpr QPointF & QPointF::operator/= ( qreal divisor)
inlineconstexpr

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)

The divisor must not be zero or NaN.

See also
operator*=()

Definition at line 384 of file qpoint.h.

References Q_ASSERT.

◆ rx()

constexpr qreal & QPointF::rx ( )
inlineconstexprnoexcept

Returns a reference to the x coordinate of this point.

Using a reference makes it possible to directly manipulate x. For example:

QPointF p(1.1, 2.5);
p.rx()--; // p becomes (0.1, 2.5)
See also
x(), setX()

Definition at line 353 of file qpoint.h.

Referenced by QQuickSelectionRectanglePrivate::QQuickSelectionRectanglePrivate(), QQuickTextPrivate::anchorAt(), QQuickTableViewPrivate::calculateTopLeft(), QQuickTableViewPrivate::clampedCellAtPos(), QPlainTextEdit::event(), ViewportTransformHelper::map(), QGraphicsView::mapFromScene(), QGraphicsViewPrivate::mapToScene(), qClipLine(), QLineF::setAngle(), QQuickTableViewPrivate::updateExtents(), QGraphicsWidgetPrivate::windowFrameHoverMoveEvent(), and QGraphicsWidgetPrivate::windowFrameMouseReleaseEvent().

+ Here is the caller graph for this function:

◆ ry()

constexpr qreal & QPointF::ry ( )
inlineconstexprnoexcept

Returns a reference to the y coordinate of this point.

Using a reference makes it possible to directly manipulate y. For example:

QPointF p(1.1, 2.5);
p.ry()++; // p becomes (1.1, 3.5)
See also
y(), setY()

Definition at line 358 of file qpoint.h.

Referenced by QQuickSelectionRectanglePrivate::QQuickSelectionRectanglePrivate(), ViewportTransformHelper::map(), qClipLine(), QRasterizer::rasterizeLine(), QLineF::setAngle(), QQuickTableViewPrivate::updateExtents(), QGraphicsWidgetPrivate::windowFrameHoverMoveEvent(), and QGraphicsWidgetPrivate::windowFrameMouseReleaseEvent().

+ Here is the caller graph for this function:

◆ setX()

◆ setY()

◆ toPoint()

constexpr QPoint QPointF::toPoint ( ) const
inlineconstexpr

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

See also
QPointF(), QPoint::toPointF()

Definition at line 394 of file qpoint.h.

References qRound().

Referenced by QGraphicsViewPrivate::_q_unsetViewportCursor(), QPainter::brushOrigin(), QGraphicsProxyWidget::contextMenuEvent(), QQuickDragAttachedPrivate::deliverEnterEvent(), QQuickDragAttachedPrivate::deliverMoveEvent(), QTextDocumentLayoutPrivate::drawFrame(), QItemDelegate::editorEvent(), QStyledItemDelegate::editorEvent(), QTabBar::event(), QMainWindow::event(), QToolBar::event(), QTipLabel::eventFilter(), QWhatsThisPrivate::eventFilter(), QWidgetResizeHandler::eventFilter(), QMdiSubWindow::eventFilter(), QColorDialogPrivate::handleColorPickingMouseButtonRelease(), QColorDialogPrivate::handleColorPickingMouseMove(), QWidgetWindow::handleEnterLeaveEvent(), QtWaylandClient::QWaylandWindow::handleMouse(), QtWaylandClient::QWaylandInputDevice::handleTouchPoint(), QGraphicsTextItem::inputMethodQuery(), lineTo_clipped(), QQuickVisualTestUtils::mapCenterToWindow(), QWidget::mapFrom(), QWidget::mapFromGlobal(), QGraphicsView::mapFromScene(), QWidget::mapTo(), QWidget::mapToGlobal(), QQuickVisualTestUtils::mapToWindow(), QLineEdit::mouseDoubleClickEvent(), QHeaderView::mouseDoubleClickEvent(), QMenuPrivate::mouseEventTaken(), QWidgetTextControlPrivate::mouseMoveEvent(), QWhatsThat::mouseMoveEvent(), QCheckBox::mouseMoveEvent(), QLineEdit::mouseMoveEvent(), QMenu::mouseMoveEvent(), QMenuBar::mouseMoveEvent(), QPushButton::mouseMoveEvent(), QRadioButton::mouseMoveEvent(), QScrollBar::mouseMoveEvent(), QSizeGrip::mouseMoveEvent(), QSplitterHandle::mouseMoveEvent(), QWidgetResizeHandler::mouseMoveEvent(), QtPrivate::QColorWell::mouseMoveEvent(), QtPrivate::QColorShowLabel::mouseMoveEvent(), QHeaderView::mouseMoveEvent(), QListView::mouseMoveEvent(), QTipLabel::mouseMoveEvent(), QAbstractButton::mouseMoveEvent(), QComboBoxPrivateScroller::mouseMoveEvent(), QPlainTextEdit::mouseMoveEvent(), QTextEdit::mouseMoveEvent(), QDial::mouseMoveEvent(), QMdiSubWindow::mouseMoveEvent(), QtPrivate::QWellArray::mousePressEvent(), QWhatsThat::mousePressEvent(), QLineEdit::mousePressEvent(), QMenu::mousePressEvent(), QMenuBar::mousePressEvent(), QScrollBar::mousePressEvent(), QSizeGrip::mousePressEvent(), QSplitterHandle::mousePressEvent(), QToolButton::mousePressEvent(), QtPrivate::QColorWell::mousePressEvent(), QtPrivate::QColorShowLabel::mousePressEvent(), QHeaderView::mousePressEvent(), QAbstractButton::mousePressEvent(), QComboBoxPrivateContainer::mousePressEvent(), QQuickTextControlPrivate::mousePressEvent(), QDial::mousePressEvent(), QMdiSubWindow::mousePressEvent(), QWhatsThat::mouseReleaseEvent(), QLineEdit::mouseReleaseEvent(), QMenu::mouseReleaseEvent(), QMenuBar::mouseReleaseEvent(), QSplitterHandle::mouseReleaseEvent(), QHeaderView::mouseReleaseEvent(), QAbstractButton::mouseReleaseEvent(), QPlainTextEdit::mouseReleaseEvent(), QTextEdit::mouseReleaseEvent(), QDial::mouseReleaseEvent(), QMdiSubWindow::mouseReleaseEvent(), QtWaylandClient::QWaylandInputDevice::FrameData::pixelDelta(), QGraphicsEffectSource::pixmap(), QFbCursor::pointerEvent(), QHighDpi::position(), PressDelayHandler::pressed(), QGuiApplicationPrivate::processTabletEvent(), QTapAndHoldGestureRecognizer::recognize(), QFlickGestureRecognizer::recognize(), QLineEditPrivate::sendMouseEventToInputContext(), QGraphicsProxyWidgetPrivate::sendWidgetMouseEvent(), QComboBoxPrivate::showPopupFromMouseEvent(), QtWaylandClient::QWaylandXdgSurface::showWindowMenu(), QQuickDragAttachedPrivate::startDrag(), QGuiApplicationPrivate::QLastCursorPosition::toPoint(), QtWaylandClient::QWaylandTouchExtension::touch_extension_touch(), QGraphicsWidgetPrivate::windowFrameHoverMoveEvent(), QGraphicsWidgetPrivate::windowFrameMouseReleaseEvent(), and QtWaylandClient::QWaylandTabletToolV2::zwp_tablet_tool_v2_frame().

+ Here is the call graph for this function:

◆ transposed()

QPointF::transposed ( ) const
inlineconstexprnoexcept
Since
5.14

Returns a point with x and y coordinates exchanged:

QPointF{1.0, 2.0}.transposed() // {2.0, 1.0}
\inmodule QtCore\reentrant
Definition qpoint.h:214
constexpr QPointF transposed() const noexcept
Definition qpoint.h:229
See also
x(), y(), setX(), setY()

Definition at line 229 of file qpoint.h.

◆ x()

constexpr qreal QPointF::x ( ) const
inlineconstexprnoexcept

Returns the x coordinate of this point.

See also
setX(), rx()

Definition at line 333 of file qpoint.h.

Referenced by QConicalGradient::QConicalGradient(), QLinearGradient::QLinearGradient(), QPainterPathPrivate::QPainterPathPrivate(), QRadialGradient::QRadialGradient(), QRadialGradient::QRadialGradient(), QRadialGradient::QRadialGradient(), QFreetypeFace::addBitmapToPath(), QPdfEnginePrivate::addBrushPattern(), addCircle(), addLineTo(), QOpenGL2PEXVertexArray::addPath(), QPainterPath::addText(), QGraphicsItemGroup::addToGroup(), QQuickPathCatmullRomCurve::addToPath(), QQuickPathArc::addToPath(), QQuickItemPrivate::adjustedPosForTransform(), QQuickAttractorAffector::affectParticle(), QQuickTurbulenceAffector::affectSystem(), QDeclarativeGeoMap::alignCoordinateToPoint(), QQuickTextPrivate::anchorAt(), QQuickMaterialRipple::anchorPoint(), QLineF::angle(), QSvgFeGaussianBlur::apply(), QWindowsDirect2DPaintEnginePrivate::applyBrushOrigin(), QRasterPaintEnginePrivate::blitImage(), QPolygonF::boundingRect(), boundingRect(), QQuickShapeRadialGradient::centerX(), QQuickShapeConicalGradient::centerX(), QQuickTableViewPrivate::checkForVisibilityChanges(), QQuickDialPrivate::circularPositionAt(), QGraphicsItemPrivate::combineTransformFromParent(), QGraphicsItemPrivate::combineTransformToParent(), QQuickImageParticle::commit(), component(), QWaylandQtShellChromePrivate::constrainPoint(), QQuickItem::contains(), QQuickMaskExtruder::contains(), QOutlineMapper::convertElements(), QGeoCameraTilesPrivate::createFrustum(), QQuickPath::createPath(), QScrollerPrivate::createScrollingSegments(), QScrollerPrivate::createScrollingSegments(), QScrollerPrivate::createScrollToSegments(), QQuickPath::createShapePath(), QPainterPath::cubicTo(), QOutlineMapper::curveTo(), QQuickParentChangePrivate::doChange(), QQuickFlickablePrivate::drag(), QQuickPointerHandlerPrivate::dragOverThreshold(), QTextLayout::drawCursor(), QSvgPaintEngine::drawEllipse(), QTextDocumentLayoutPrivate::drawFrame(), QRasterPaintEngine::drawImage(), QRasterPaintEnginePrivate::drawImage(), QSvgMarker::drawMarkersForNode(), QCoreGraphicsPaintEnginePrivate::drawPath(), QWin32PrintEngine::drawPixmap(), QSvgPaintEngine::drawPolygon(), QSvgPaintEngine::drawTextItem(), QQuickParticleEmitter::emitWindow(), QQuickTrailEmitter::emitWindow(), QSvgText::fastBounds(), QX11PaintEnginePrivate::fillPolygon_dev(), QApplicationPrivate::findClosestTouchPointTarget(), QQuickShapeRadialGradient::focalX(), QQuickDrawerPrivate::grabMouse(), QtWaylandClient::QWaylandAdwaitaDecoration::handleMouse(), QtWaylandClient::QWaylandBradientDecoration::handleMouse(), QWaylandMouseTrackerPrivate::handleMousePos(), QQuickPathViewPrivate::handleMousePressEvent(), QQuickPinchHandler::handlePointerEventImpl(), QQuickSplitViewPrivate::handlePress(), QQuickScrollBarPrivate::handleRelease(), QQuickDrawerPrivate::handleRelease(), QQuickFlickablePrivate::handleReleaseEvent(), QtWaylandClient::QWaylandBradientDecoration::handleTouch(), QOpenXRItem::handleVirtualTouch(), QTextDocumentLayout::hitTest(), BezierEase::init(), QLineEdit::inputMethodQuery(), QQuickPageIndicatorPrivate::itemAt(), QQuickItemPrivate::itemToParentTransform(), QGraphicsItem::itemTransform(), QQuickItemViewTransitionableItem::itemX(), QQuickSplitViewPrivate::layoutResizeSplitItems(), QQuickDialPrivate::linearPositionAt(), QOutlineMapper::lineTo(), manhattanLength(), QMatrix4x4::map(), QGraphicsItem::mapFromScene(), QtWaylandClient::QWaylandWindow::mapFromWlSurface(), QMatrix4x4::mapRect(), QDoubleMatrix4x4::mapRect(), QGraphicsItem::mapToScene(), QWaylandQuickItem::mapToSurface(), marginsOffset(), QBezier::midTangent(), QWidgetTextControlPrivate::mouseMoveEvent(), QGraphicsItem::mouseMoveEvent(), QQuickWidget::mouseMoveEvent(), QQuickPressHandler::mouseMoveEvent(), QQuickMouseArea::mouseMoveEvent(), QQuickSwitch::mouseMoveEvent(), QQuickSwitchDelegate::mouseMoveEvent(), QQuickTextControlPrivate::mouseMoveEvent(), QQuickPressHandler::mousePressEvent(), QQuickPressHandler::mouseReleaseEvent(), QOutlineMapper::moveTo(), QWindowsDirect2DPaintEnginePrivate::negateCurrentBrushOrigin(), QSubpathFlatIterator::next(), QKdPointFinder::operator()(), operator<<(), QmlJSDebugger::SelectionHighlight::paint(), QQuickMaterialTextContainer::paint(), QQuickSvgParser::parsePathDataFast(), parsePathDataFast(), QQuickPathViewPrivate::pointNear(), pointOnEdge(), QGraphicsItemAnimation::posAt(), QQuickDrawerPrivate::positionAt(), QQuickScrollBarPrivate::positionAt(), QQuickSliderPrivate::positionAt(), QQuickSwitchPrivate::positionAt(), QQuickSwitchDelegatePrivate::positionAt(), QQuickTextInputPrivate::positionAt(), positionAt(), QtWayland::TouchExtensionGlobal::postTouchEvent(), QQuickItemParticle::prepareNextFrame(), QQuickItemViewTransitionableItem::prepareTransition(), QDashedStrokeProcessor::process(), QQuickTextControl::processEvent(), QWidgetTextControl::processEvent(), QGuiApplicationPrivate::processMouseEvent(), QSGOpenVGHelpers::qPainterPathToVGPath(), qt_getInflectionPoints(), qt_isExtendedRadialGradient(), qt_painterpath_isect_curve(), qt_stroke_side(), QPainterPath::quadTo(), QGeoProjectionWebMercator::quickItemTransformation(), QRasterizer::rasterizeLine(), QWidgetTextControlPrivate::rectForPosition(), QQuickTextControlPrivate::rectForPosition(), QScrollerPrivate::releaseWhileDragging(), QGraphicsItemGroup::removeFromGroup(), QSGOpenVGRectangleNode::render(), QEvdevTouchScreenData::reportPoints(), QQuickPopupPositioner::reposition(), QQuickTargetDirection::sample(), QSvgPaintEngine::saveLinearGradientBrush(), QSvgPaintEngine::saveRadialGradientBrush(), QWhatsThisPrivate::say(), QWindowsTabletDeviceData::scaleCoordinates(), QScrollerPrivate::scrollingSegmentsEndPos(), QLineF::setAngle(), QRadialGradient::setCenter(), QConicalGradient::setCenter(), QQuickShapeRadialGradient::setCenterX(), QQuickShapeConicalGradient::setCenterX(), QScrollerPrivate::setContentPositionHelperDragging(), QScrollerPrivate::setContentPositionHelperScrolling(), QPrintPreviewWidgetPrivate::setCurrentPage(), QQnxCamera::setCustomFocusPoint(), QAVFCameraBase::setCustomFocusPoint(), QCoreGraphicsPaintEnginePrivate::setFillBrush(), QLinearGradient::setFinalStop(), QQuickShapeRadialGradient::setFocalX(), QSGOpenVGGlyphNode::setGlyphs(), QSGDistanceFieldGlyphCache::setGlyphsPosition(), QQuickAbstractButtonPrivate::setMovePoint(), QSvgSymbolLike::setPainterToRectAndAdjustment(), QQuickPinchHandler::setPersistentTranslation(), QGraphicsItemPrivate::setPosHelper(), QQuickMouseEvent::setPosition(), QOpenGLShaderProgram::setUniformValue(), QSpanData::setup(), QGeoTiledMapScenePrivate::setupCamera(), QQuickShapeLinearGradient::setX1(), QQuickShapeLinearGradient::setX2(), QGraphicsItem::setY(), shift(), QQuickParticleAffector::shouldAffect(), QComboBox::showPopup(), QWaylandXdgToplevel::sizeForResize(), QWaylandWlShellSurface::sizeForResize(), QOpenGLTextureBlitter::sourceTransform(), sourceTransform(), splitPolygon(), QQuickItemViewTransitionJob::startTransition(), QPaintEngineEx::stroke(), QStrokerOps::strokePath(), QStrokerOps::strokePolygon(), tcbToBezier(), QQuickPressHandler::timerEvent(), QGuiApplicationPrivate::QLastCursorPosition::toPoint(), QPdfLink::toString(), QQuickVectorImageGenerator::Utils::toSvgString(), QQuickParentAnimation::transition(), QWindowsMouseHandler::translateTouchEvent(), QLineF::unitVector(), QX11PaintEngine::updateBrush(), QOpenGL2PaintEngineExPrivate::updateBrushUniforms(), QQuickMaterialRippleWaveNode::updateCurrentTime(), QWaylandQtShellChromePrivate::updateDecorationInteraction(), QQuickWindowPrivate::updateDirtyNode(), QQuickTableViewResizeHandler::updateDrag(), QQuickTableViewPrivate::updateExtents(), QSGDistanceFieldGlyphNode::updateGeometry(), QQuickPathViewPrivate::updateItem(), updateNodeTransform(), QQuickTextEdit::updatePaintNode(), QGraphicsItemPrivate::updateSceneTransformFromParent(), QQuickFlipablePrivate::updateSide(), QQuickTableViewResizeHandler::updateState(), QQuickMultiPointTouchArea::updateTouchData(), QQuickMultiPointTouchArea::updateTouchPoint(), QQuickShapeLinearGradientRhiShader::updateUniformData(), QQuickShapeConicalGradientRhiShader::updateUniformData(), QScrollerPrivate::updateVelocity(), QGraphicsWidget::windowFrameSectionAt(), QQuickDropAreaDrag::x(), QQuickShapeLinearGradient::x1(), and QQuickShapeLinearGradient::x2().

◆ y()

constexpr qreal QPointF::y ( ) const
inlineconstexprnoexcept

Returns the y coordinate of this point.

See also
setY(), ry()

Definition at line 338 of file qpoint.h.

Referenced by QConicalGradient::QConicalGradient(), QLinearGradient::QLinearGradient(), QPainterPathPrivate::QPainterPathPrivate(), QRadialGradient::QRadialGradient(), QRadialGradient::QRadialGradient(), QRadialGradient::QRadialGradient(), QFreetypeFace::addBitmapToPath(), QPdfEnginePrivate::addBrushPattern(), addCircle(), addLineTo(), QOpenGL2PEXVertexArray::addPath(), QPainterPath::addText(), QGraphicsItemGroup::addToGroup(), QQuickPathCatmullRomCurve::addToPath(), QQuickPathArc::addToPath(), QQuickItemPrivate::adjustedPosForTransform(), QQuickAttractorAffector::affectParticle(), QQuickTurbulenceAffector::affectSystem(), QDeclarativeGeoMap::alignCoordinateToPoint(), QQuickMaterialRipple::anchorPoint(), QLineF::angle(), QWindowsDirect2DPaintEnginePrivate::applyBrushOrigin(), QRasterPaintEnginePrivate::blitImage(), QPolygonF::boundingRect(), boundingRect(), QQuickShapeRadialGradient::centerY(), QQuickShapeConicalGradient::centerY(), QQuickTableViewPrivate::checkForVisibilityChanges(), QQuickDialPrivate::circularPositionAt(), QGraphicsItemPrivate::combineTransformFromParent(), QGraphicsItemPrivate::combineTransformToParent(), QQuickImageParticle::commit(), component(), QWaylandQtShellChromePrivate::constrainPoint(), QQuickItem::contains(), QQuickMaskExtruder::contains(), QOutlineMapper::convertElements(), QGeoCameraTilesPrivate::createFrustum(), QQuickPath::createPath(), QScrollerPrivate::createScrollingSegments(), QScrollerPrivate::createScrollingSegments(), QScrollerPrivate::createScrollToSegments(), QQuickPath::createShapePath(), QPainterPath::cubicTo(), QOutlineMapper::curveTo(), QQuickParentChangePrivate::doChange(), QQuickFlickablePrivate::drag(), QQuickPointerHandlerPrivate::dragOverThreshold(), QTextLayout::draw(), QTextLayout::drawCursor(), QTextDocumentLayoutPrivate::drawFrame(), QRasterPaintEngine::drawImage(), QRasterPaintEnginePrivate::drawImage(), QSvgMarker::drawMarkersForNode(), QCoreGraphicsPaintEnginePrivate::drawPath(), QWin32PrintEngine::drawPixmap(), QSvgPaintEngine::drawPolygon(), QSvgPaintEngine::drawTextItem(), QQuickParticleEmitter::emitWindow(), QQuickTrailEmitter::emitWindow(), QPixmapStyle::eventFilter(), QSvgText::fastBounds(), QX11PaintEnginePrivate::fillPolygon_dev(), QApplicationPrivate::findClosestTouchPointTarget(), QQuickShapeRadialGradient::focalY(), QQuickDrawerPrivate::grabMouse(), QQuickTableViewHoverHandler::handleEventPoint(), QtWaylandClient::QWaylandAdwaitaDecoration::handleMouse(), QtWaylandClient::QWaylandBradientDecoration::handleMouse(), QWaylandMouseTrackerPrivate::handleMousePos(), QQuickPathViewPrivate::handleMousePressEvent(), QQuickPinchHandler::handlePointerEventImpl(), QQuickSplitViewPrivate::handlePress(), QQuickScrollBarPrivate::handleRelease(), QQuickDrawerPrivate::handleRelease(), QQuickFlickablePrivate::handleReleaseEvent(), QtWaylandClient::QWaylandAdwaitaDecoration::handleTouch(), QtWaylandClient::QWaylandBradientDecoration::handleTouch(), QOpenXRItem::handleVirtualTouch(), QTextDocumentLayout::hitTest(), QPlainTextEditControl::hitTest(), BezierEase::init(), QLineEdit::inputMethodQuery(), QLineF::intersects(), QQuickPageIndicatorPrivate::itemAt(), QQuickItemPrivate::itemToParentTransform(), QGraphicsItem::itemTransform(), QQuickItemViewTransitionableItem::itemY(), QTextDocumentLayoutPrivate::layoutBlock(), QQuickSplitViewPrivate::layoutResizeSplitItems(), QQuickDialPrivate::linearPositionAt(), QOutlineMapper::lineTo(), manhattanLength(), QMatrix4x4::map(), QGraphicsItem::mapFromScene(), QtWaylandClient::QWaylandWindow::mapFromWlSurface(), QMatrix4x4::mapRect(), QDoubleMatrix4x4::mapRect(), QGraphicsItem::mapToScene(), QWaylandQuickItem::mapToSurface(), marginsOffset(), QBezier::midTangent(), QGraphicsItem::mouseMoveEvent(), QQuickWidget::mouseMoveEvent(), QQuickMouseArea::mouseMoveEvent(), QQuickPressHandler::mousePressEvent(), QQuickPressHandler::mouseReleaseEvent(), QOutlineMapper::moveTo(), QWindowsDirect2DPaintEnginePrivate::negateCurrentBrushOrigin(), QSubpathFlatIterator::next(), operator<<(), QmlJSDebugger::SelectionHighlight::paint(), QQuickMaterialTextContainer::paint(), QQuickSvgParser::parsePathDataFast(), parsePathDataFast(), QQuickPathViewPrivate::pointNear(), pointOnEdge(), QMenuPrivate::popup(), QGraphicsItemAnimation::posAt(), QQuickDrawerPrivate::positionAt(), QQuickScrollBarPrivate::positionAt(), QQuickSliderPrivate::positionAt(), QQuickTextInputPrivate::positionAt(), positionAt(), QtWayland::TouchExtensionGlobal::postTouchEvent(), QQuickItemParticle::prepareNextFrame(), QQuickItemViewTransitionableItem::prepareTransition(), QDashedStrokeProcessor::process(), QQuickTextControl::processEvent(), QWidgetTextControl::processEvent(), QMenuSloppyState::processMouseEvent(), QGuiApplicationPrivate::processMouseEvent(), QSGOpenVGHelpers::qPainterPathToVGPath(), qt_getInflectionPoints(), qt_isExtendedRadialGradient(), qt_painterpath_isect_curve(), qt_stroke_side(), QPainterPath::quadTo(), QGeoProjectionWebMercator::quickItemTransformation(), QRasterizer::rasterizeLine(), QWidgetTextControlPrivate::rectForPosition(), QQuickTextControlPrivate::rectForPosition(), QScrollerPrivate::releaseWhileDragging(), QGraphicsItemGroup::removeFromGroup(), QSGOpenVGRectangleNode::render(), QEvdevTouchScreenData::reportPoints(), QQuickTargetDirection::sample(), QSvgPaintEngine::saveLinearGradientBrush(), QSvgPaintEngine::saveRadialGradientBrush(), QScrollerPrivate::scrollingSegmentsEndPos(), QLineF::setAngle(), QRadialGradient::setCenter(), QConicalGradient::setCenter(), QQuickShapeRadialGradient::setCenterY(), QQuickShapeConicalGradient::setCenterY(), QScrollerPrivate::setContentPositionHelperDragging(), QScrollerPrivate::setContentPositionHelperScrolling(), QPrintPreviewWidgetPrivate::setCurrentPage(), QQnxCamera::setCustomFocusPoint(), QAVFCameraBase::setCustomFocusPoint(), QCoreGraphicsPaintEnginePrivate::setFillBrush(), QLinearGradient::setFinalStop(), QQuickShapeRadialGradient::setFocalY(), QSGOpenVGGlyphNode::setGlyphs(), QSGDistanceFieldGlyphCache::setGlyphsPosition(), QQuickAbstractButtonPrivate::setMovePoint(), QSvgSymbolLike::setPainterToRectAndAdjustment(), QQuickPinchHandler::setPersistentTranslation(), QGraphicsItemPrivate::setPosHelper(), QQuickMouseEvent::setPosition(), QOpenGLShaderProgram::setUniformValue(), QSpanData::setup(), QGeoTiledMapScenePrivate::setupCamera(), QGraphicsItem::setX(), QQuickShapeLinearGradient::setY1(), QQuickShapeLinearGradient::setY2(), QQuickParticleAffector::shouldAffect(), QWaylandXdgToplevel::sizeForResize(), QWaylandWlShellSurface::sizeForResize(), QOpenGLTextureBlitter::sourceTransform(), sourceTransform(), splitPolygon(), QQuickItemViewTransitionJob::startTransition(), QPaintEngineEx::stroke(), QStrokerOps::strokePath(), QStrokerOps::strokePolygon(), tcbToBezier(), QBezier::tForY(), QQuickPressHandler::timerEvent(), QPdfLink::toString(), QQuickVectorImageGenerator::Utils::toSvgString(), QQuickParentAnimation::transition(), QWindowsMouseHandler::translateTouchEvent(), QLineF::unitVector(), QX11PaintEngine::updateBrush(), QOpenGL2PaintEngineExPrivate::updateBrushUniforms(), QQuickMaterialRippleWaveNode::updateCurrentTime(), QWaylandQtShellChromePrivate::updateDecorationInteraction(), QQuickWindowPrivate::updateDirtyNode(), QQuickTableViewResizeHandler::updateDrag(), QQuickTableViewPrivate::updateExtents(), QSGDistanceFieldGlyphNode::updateGeometry(), QQuickPathViewPrivate::updateItem(), updateNodeTransform(), QQuickTextEdit::updatePaintNode(), QGraphicsItemPrivate::updateSceneTransformFromParent(), QQuickFlipablePrivate::updateSide(), QQuickTextPrivate::updateSize(), QQuickTableViewResizeHandler::updateState(), QQuickMultiPointTouchArea::updateTouchData(), QQuickMultiPointTouchArea::updateTouchPoint(), QQuickShapeLinearGradientRhiShader::updateUniformData(), QQuickShapeConicalGradientRhiShader::updateUniformData(), QScrollerPrivate::updateVelocity(), QGraphicsWidget::windowFrameSectionAt(), QQuickDropAreaDrag::y(), QQuickShapeLinearGradient::y1(), and QQuickShapeLinearGradient::y2().

Friends And Related Symbol Documentation

◆ get

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)
friend

Definition at line 292 of file qpoint.h.

◆ operator!=

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

Returns true if p1 is sufficiently different from p2; otherwise returns false.

Warning
This function does not check for strict inequality; instead, it uses a fuzzy comparison to compare the points' coordinates.
See also
qFuzzyCompare

Definition at line 251 of file qpoint.h.

◆ operator* [1/2]

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

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

See also
QPointF::operator*=()

Definition at line 261 of file qpoint.h.

◆ operator* [2/2]

QPointF QPointF::operator* ( qreal c,
const QPointF & p )
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 finite factor.

Definition at line 263 of file qpoint.h.

◆ operator+ [1/2]

QPointF QPointF::operator+ ( const QPointF & point)
friend
Since
5.0

Returns point unmodified.

Definition at line 265 of file qpoint.h.

◆ operator+ [2/2]

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

◆ operator- [1/2]

QPointF QPointF::operator- ( 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 QPointF object that is formed by changing the sign of each component of the given point.

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

Definition at line 267 of file qpoint.h.

◆ operator- [2/2]

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

◆ operator/

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

Returns the QPointF object formed by dividing each component of the given point by the given divisor.

The divisor must not be zero or NaN.

See also
QPointF::operator/=()

Definition at line 269 of file qpoint.h.

◆ 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 767 of file qpoint.cpp.

◆ operator==

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

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

Warning
This function does not check for strict equality; instead, it uses a fuzzy comparison to compare the points' coordinates.
See also
qFuzzyCompare

Definition at line 246 of file qpoint.h.

◆ 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 783 of file qpoint.cpp.

◆ QTransform

friend class QTransform
friend

Definition at line 283 of file qpoint.h.


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