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
QRectF Class Reference

\inmodule QtCore\reentrant More...

#include <qrect.h>

+ Inheritance diagram for QRectF:
+ Collaboration diagram for QRectF:

Public Member Functions

constexpr QRectF () noexcept
 Constructs a null rectangle.
 
constexpr QRectF (const QPointF &topleft, const QSizeF &size) noexcept
 Constructs a rectangle with the given topLeft corner and the given size.
 
constexpr QRectF (const QPointF &topleft, const QPointF &bottomRight) noexcept
 
constexpr QRectF (qreal left, qreal top, qreal width, qreal height) noexcept
 Constructs a rectangle with (x, y) as its top-left corner and the given width and height.
 
constexpr QRectF (const QRect &rect) noexcept
 Constructs a QRectF rectangle from the given QRect rectangle.
 
constexpr bool isNull () const noexcept
 Returns true if the rectangle is a null rectangle, otherwise returns false.
 
constexpr bool isEmpty () const noexcept
 Returns true if the rectangle is empty, otherwise returns false.
 
constexpr bool isValid () const noexcept
 Returns true if the rectangle is valid, otherwise returns false.
 
QRectF normalized () const noexcept
 Returns a normalized rectangle; i.e., a rectangle that has a non-negative width and height.
 
constexpr qreal left () const noexcept
 Returns the x-coordinate of the rectangle's left edge.
 
constexpr qreal top () const noexcept
 Returns the y-coordinate of the rectangle's top edge.
 
constexpr qreal right () const noexcept
 Returns the x-coordinate of the rectangle's right edge.
 
constexpr qreal bottom () const noexcept
 Returns the y-coordinate of the rectangle's bottom edge.
 
constexpr qreal x () const noexcept
 Returns the x-coordinate of the rectangle's left edge.
 
constexpr qreal y () const noexcept
 Returns the y-coordinate of the rectangle's top edge.
 
constexpr void setLeft (qreal pos) noexcept
 Sets the left edge of the rectangle to the given finite x coordinate.
 
constexpr void setTop (qreal pos) noexcept
 Sets the top edge of the rectangle to the given finite y coordinate.
 
constexpr void setRight (qreal pos) noexcept
 Sets the right edge of the rectangle to the given finite x coordinate.
 
constexpr void setBottom (qreal pos) noexcept
 Sets the bottom edge of the rectangle to the given finite y coordinate.
 
constexpr void setX (qreal pos) noexcept
 Sets the left edge of the rectangle to the given finite x coordinate.
 
constexpr void setY (qreal pos) noexcept
 Sets the top edge of the rectangle to the given finite y coordinate.
 
constexpr QPointF topLeft () const noexcept
 Returns the position of the rectangle's top-left corner.
 
constexpr QPointF bottomRight () const noexcept
 Returns the position of the rectangle's bottom-right corner.
 
constexpr QPointF topRight () const noexcept
 Returns the position of the rectangle's top-right corner.
 
constexpr QPointF bottomLeft () const noexcept
 Returns the position of the rectangle's bottom-left corner.
 
constexpr QPointF center () const noexcept
 Returns the center point of the rectangle.
 
constexpr void setTopLeft (const QPointF &p) noexcept
 Set the top-left corner of the rectangle to the given position.
 
constexpr void setBottomRight (const QPointF &p) noexcept
 Set the bottom-right corner of the rectangle to the given position.
 
constexpr void setTopRight (const QPointF &p) noexcept
 Set the top-right corner of the rectangle to the given position.
 
constexpr void setBottomLeft (const QPointF &p) noexcept
 Set the bottom-left corner of the rectangle to the given position.
 
constexpr void moveLeft (qreal pos) noexcept
 Moves the rectangle horizontally, leaving the rectangle's left edge at the given finite x coordinate.
 
constexpr void moveTop (qreal pos) noexcept
 Moves the rectangle vertically, leaving the rectangle's top line at the given finite y coordinate.
 
constexpr void moveRight (qreal pos) noexcept
 Moves the rectangle horizontally, leaving the rectangle's right edge at the given finite x coordinate.
 
constexpr void moveBottom (qreal pos) noexcept
 Moves the rectangle vertically, leaving the rectangle's bottom edge at the given finite y coordinate.
 
constexpr void moveTopLeft (const QPointF &p) noexcept
 Moves the rectangle, leaving the top-left corner at the given position.
 
constexpr void moveBottomRight (const QPointF &p) noexcept
 Moves the rectangle, leaving the bottom-right corner at the given position.
 
constexpr void moveTopRight (const QPointF &p) noexcept
 Moves the rectangle, leaving the top-right corner at the given position.
 
constexpr void moveBottomLeft (const QPointF &p) noexcept
 Moves the rectangle, leaving the bottom-left corner at the given position.
 
constexpr void moveCenter (const QPointF &p) noexcept
 Moves the rectangle, leaving the center point at the given position.
 
constexpr void translate (qreal dx, qreal dy) noexcept
 Moves the rectangle dx along the x-axis and dy along the y-axis, relative to the current position.
 
constexpr void translate (const QPointF &p) noexcept
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Moves the rectangle {offset}.
 
constexpr QRectF translated (qreal dx, qreal dy) const noexcept
 Returns a copy of the rectangle that is translated dx along the x axis and dy along the y axis, relative to the current position.
 
constexpr QRectF translated (const QPointF &p) const noexcept
 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 rectangle that is translated {offset}.
 
constexpr QRectF transposed () const noexcept
 
constexpr void moveTo (qreal x, qreal y) noexcept
 Moves the rectangle, leaving the top-left corner at the given position (x, y).
 
constexpr void moveTo (const QPointF &p) noexcept
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Moves the rectangle, leaving the top-left corner at the given position.
 
constexpr void setRect (qreal x, qreal y, qreal w, qreal h) noexcept
 Sets the coordinates of the rectangle's top-left corner to (x, y), and its size to the given width and height.
 
constexpr void getRect (qreal *x, qreal *y, qreal *w, qreal *h) const
 Extracts the position of the rectangle's top-left corner to *x and y, and its dimensions to *width and *height.
 
constexpr void setCoords (qreal x1, qreal y1, qreal x2, qreal y2) noexcept
 Sets the coordinates of the rectangle's top-left corner to (x1, y1), and the coordinates of its bottom-right corner to (x2, y2).
 
constexpr void getCoords (qreal *x1, qreal *y1, qreal *x2, qreal *y2) const
 Extracts the position of the rectangle's top-left corner to *x1 and *y1, and the position of the bottom-right corner to *x2 and y2.
 
constexpr void adjust (qreal x1, qreal y1, qreal x2, qreal y2) noexcept
 Adds dx1, dy1, dx2 and dy2 respectively to the existing coordinates of the rectangle.
 
constexpr QRectF adjusted (qreal x1, qreal y1, qreal x2, qreal y2) const noexcept
 Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of this rectangle.
 
constexpr QSizeF size () const noexcept
 Returns the size of the rectangle.
 
constexpr qreal width () const noexcept
 Returns the width of the rectangle.
 
constexpr qreal height () const noexcept
 Returns the height of the rectangle.
 
constexpr void setWidth (qreal w) noexcept
 Sets the width of the rectangle to the given finite width.
 
constexpr void setHeight (qreal h) noexcept
 Sets the height of the rectangle to the given finite height.
 
constexpr void setSize (const QSizeF &s) noexcept
 Sets the size of the rectangle to the given finite size.
 
QRectF operator| (const QRectF &r) const noexcept
 Returns the bounding rectangle of this rectangle and the given rectangle.
 
QRectF operator& (const QRectF &r) const noexcept
 Returns the intersection of this rectangle and the given rectangle.
 
QRectFoperator|= (const QRectF &r) noexcept
 Unites this rectangle with the given rectangle.
 
QRectFoperator&= (const QRectF &r) noexcept
 Intersects this rectangle with the given rectangle.
 
bool contains (const QRectF &r) const noexcept
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns true if the given rectangle is inside this rectangle; otherwise returns false.
 
bool contains (const QPointF &p) const noexcept
 Returns true if the given point is inside or on the edge of the rectangle; otherwise returns false.
 
bool contains (qreal x, qreal y) const noexcept
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns true if the point (x, y) is inside or on the edge of the rectangle; otherwise returns false.
 
QRectF united (const QRectF &other) const noexcept
 
QRectF intersected (const QRectF &other) const noexcept
 
bool intersects (const QRectF &r) const noexcept
 Returns true if this rectangle intersects with the given rectangle (i.e.
 
constexpr QRectF marginsAdded (const QMarginsF &margins) const noexcept
 
constexpr QRectF marginsRemoved (const QMarginsF &margins) const noexcept
 
constexpr QRectFoperator+= (const QMarginsF &margins) noexcept
 
constexpr QRectFoperator-= (const QMarginsF &margins) noexcept
 
constexpr QRect toRect () const noexcept
 Returns a QRect based on the values of this rectangle.
 
QRect toAlignedRect () const noexcept
 

Friends

constexpr bool operator== (const QRectF &r1, const QRectF &r2) noexcept
 Returns true if the rectangles r1 and r2 are approximately equal, otherwise returns false.
 
constexpr bool operator!= (const QRectF &r1, const QRectF &r2) noexcept
 Returns true if the rectangles r1 and r2 are sufficiently different, otherwise returns false.
 

Related Symbols

(Note that these are not member symbols.)

QRectF operator+ (const QRectF &lhs, const QMarginsF &rhs)
 
QRectF operator- (const QRectF &lhs, const QMarginsF &rhs)
 
QRectF operator+ (const QMarginsF &lhs, const QRectF &rhs)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
QDataStreamoperator<< (QDataStream &stream, const QRectF &rectangle)
 Writes the rectangle to the stream, and returns a reference to the stream.
 
QDataStreamoperator>> (QDataStream &stream, QRectF &rectangle)
 Reads a rectangle from the stream, and returns a reference to the stream.
 

Detailed Description

\inmodule QtCore

\reentrant

The QRectF class defines a finite rectangle in the plane using floating point precision.

A rectangle is normally expressed as a top-left corner and a size. The size (width and height) of a QRectF is always equivalent to the mathematical rectangle that forms the basis for its rendering.

A QRectF can be constructed with a set of left, top, width and height coordinates, or from a QPointF and a QSizeF. The following code creates two identical rectangles.

QRectF r1(100.0, 200.1, 11.2, 16.3);
QRectF r2(QPointF(100.0, 200.1), QSizeF(11.2, 16.3));

There is also a third constructor creating a QRectF from a QRect, and a corresponding toRect() function that returns a QRect object based on the values of this rectangle (note that the coordinates in the returned rectangle are rounded to the nearest integer).

The QRectF class provides a collection of functions that return the various rectangle coordinates, and enable manipulation of these. QRectF also provides functions to move the rectangle relative to the various coordinates. In addition there is a moveTo() function that moves the rectangle, leaving its top left corner at the given coordinates. Alternatively, the translate() function moves the rectangle the given offset relative to the current position, and the translated() function returns a translated copy of this rectangle.

The size() function returns the rectangle's dimensions as a QSizeF. The dimensions can also be retrieved separately using the width() and height() functions. To manipulate the dimensions use the setSize(), setWidth() or setHeight() functions. Alternatively, the size can be changed by applying either of the functions setting the rectangle coordinates, for example, setBottom() or setRight().

The contains() function tells whether a given point is inside the rectangle or not, and the intersects() function returns true if this rectangle intersects with a given rectangle (otherwise false). The QRectF class also provides the intersected() function which returns the intersection rectangle, and the united() function which returns the rectangle that encloses the given rectangle and this:

\table \row

The isEmpty() function returns true if the rectangle's width or height is less than, or equal to, 0. Note that an empty rectangle is not valid: The isValid() function returns true if both width and height is larger than 0. A null rectangle (isNull() == true) on the other hand, has both width and height set to 0.

Note that due to the way QRect and QRectF are defined, an empty QRectF is defined in essentially the same way as QRect.

Finally, QRectF objects can be streamed as well as compared.

Definition at line 482 of file qrect.h.

Constructor & Destructor Documentation

◆ QRectF() [1/5]

QRectF::QRectF ( )
inlineconstexprnoexcept

Constructs a null rectangle.

See also
isNull()

Definition at line 485 of file qrect.h.

◆ QRectF() [2/5]

constexpr QRectF::QRectF ( const QPointF & topLeft,
const QSizeF & size )
inlineconstexprnoexcept

Constructs a rectangle with the given topLeft corner and the given size.

See also
setTopLeft(), setSize()

Definition at line 625 of file qrect.h.

◆ QRectF() [3/5]

constexpr QRectF::QRectF ( const QPointF & topLeft,
const QPointF & bottomRight )
inlineconstexprnoexcept
Since
4.3

Constructs a rectangle with the given topLeft and bottomRight corners.

See also
setTopLeft(), setBottomRight()

Definition at line 631 of file qrect.h.

◆ QRectF() [4/5]

constexpr QRectF::QRectF ( qreal x,
qreal y,
qreal width,
qreal height )
inlineconstexprnoexcept

Constructs a rectangle with (x, y) as its top-left corner and the given width and height.

All parameters must be finite.

See also
setRect()

Definition at line 620 of file qrect.h.

◆ QRectF() [5/5]

constexpr QRectF::QRectF ( const QRect & rectangle)
inlineconstexprnoexcept

Constructs a QRectF rectangle from the given QRect rectangle.

Note
This function, like QRect::toRectF(), preserves the size() of rectangle, not its bottomRight() corner.
See also
toRect(), QRect::toRectF()

Definition at line 636 of file qrect.h.

Member Function Documentation

◆ adjust()

constexpr void QRectF::adjust ( qreal dx1,
qreal dy1,
qreal dx2,
qreal dy2 )
inlineconstexprnoexcept

Adds dx1, dy1, dx2 and dy2 respectively to the existing coordinates of the rectangle.

All parameters must be finite.

See also
adjusted(), setRect()

Definition at line 791 of file qrect.h.

Referenced by QPlainTextDocumentLayout::blockBoundingRect(), cellClipTest(), QWindows11Style::drawComplexControl(), QTextDocumentLayoutPrivate::drawFrameDecoration(), QWindows11Style::drawPrimitive(), QSGBasicInternalRectangleNode::updateGeometry(), and QQuickShapeSoftwareRenderer::updateNode().

+ Here is the caller graph for this function:

◆ adjusted()

constexpr QRectF QRectF::adjusted ( qreal dx1,
qreal dy1,
qreal dx2,
qreal dy2 ) const
inlineconstexprnoexcept

Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of this rectangle.

All parameters must be finite.

See also
adjust()

Definition at line 799 of file qrect.h.

Referenced by QGraphicsTextItemPrivate::_q_mouseOnEdge(), QQuickTextNodeEngine::addFrameDecorations(), QMacStylePrivate::CocoaControl::adjustedControlFrame(), QAbstractTextDocumentLayout::blockWithMarkerAt(), QGraphicsPixmapItem::boundingRect(), QMacStylePrivate::comboboxEditBounds(), QGraphicsLayoutItem::contentsRect(), convolute(), QWidgetTextControlPrivate::cursorRectPlusUnicodeDirectionMarkers(), QTextDocumentLayout::draw(), QWindows11Style::drawComplexControl(), QQC2_NAMESPACE::QMacStyle::drawControl(), QMacStyle::drawControl(), QWindows11Style::drawControl(), QGraphicsScenePrivate::drawItemHelper(), QTextDocumentLayoutPrivate::drawListItem(), QWindows11Style::drawPrimitive(), QQC2::QWindowsXPStyle::drawPrimitive(), QWidgetTextControl::ensureCursorVisible(), QGraphicsView::fitInView(), QtWaylandClient::QWaylandBradientDecoration::paint(), QGraphicsWidget::paintWindowFrame(), QPlainTextEditPrivate::repaintContents(), QQuickDialogButtonBoxPrivate::resizeContent(), QPaintEngineEx::stroke(), QOpenGL2PaintEngineExPrivate::stroke(), QQC2_NAMESPACE::QMacStyle::subControlRect(), QQuickTextArea::updatePaintNode(), QQuickTextEdit::updatePaintNode(), QGeoMapPolylineGeometry::updateSourcePoints(), QGraphicsWidget::windowFrameGeometry(), and QGraphicsWidget::windowFrameRect().

+ Here is the caller graph for this function:

◆ bottom()

qreal QRectF::bottom ( ) const
inlineconstexprnoexcept

Returns the y-coordinate of the rectangle's bottom edge.

See also
setBottom(), bottomLeft(), bottomRight()

Definition at line 499 of file qrect.h.

Referenced by _q_boundGeometryToSizeConstraints(), QPlainTextEditPrivate::append(), QQuickTableViewPrivate::canLoadTableEdge(), QQuickTableViewPrivate::canUnloadTableEdge(), QQuickTableViewPrivate::clampedCellAtPos(), QBlitterPaintEnginePrivate::clipAndDrawPixmap(), QScrollerPrivate::createScrollingSegments(), QSGInternalTextNode::doAddTextLayout(), QPdfEngine::drawHyperlink(), QRasterPaintEngine::drawImage(), QTextDocumentLayoutPrivate::drawTableCell(), QQuickTextAreaPrivate::ensureCursorVisible(), QPlainTextEditPrivate::ensureVisible(), QIntersectionFinder::hasIntersections(), QPainterPath::intersects(), QScrollerPrivate::nextSnapPos(), QPlainTextEditPrivate::pageUpDown(), QSGSoftwareInternalImageNode::paint(), QDashStroker::processCurrentSubpath(), qClipLine(), qsgsimpletexturenode_update(), qt_isect_curve_horizontal(), qt_isect_curve_vertical(), qt_transform_image(), QRasterizer::rasterize(), QSGNinePatchNode::rebuildGeometry(), QQuickPopupPositioner::reposition(), QOpenGL2PaintEngineExPrivate::resetClipIfNeeded(), QScrollerPrivate::scrollingSegmentsValid(), QQuickTableViewPrivate::scrollTowardsSelectionPoint(), QQuickTableViewPrivate::selectionRectangle(), QQuickTextEditPrivate::transformChanged(), QPdfLinkModelPrivate::update(), QQuickTableViewPrivate::updateContentHeight(), QQuickTableViewPrivate::updateExtents(), QSGBasicInternalImageNode::updateGeometry(), QSGBasicInternalRectangleNode::updateGeometry(), QSGBasicInternalImageNode::updateGeometry(), and visibleGlyphRange().

+ Here is the caller graph for this function:

◆ bottomLeft()

QPointF QRectF::bottomLeft ( ) const
inlineconstexprnoexcept

Returns the position of the rectangle's bottom-left corner.

See also
setBottomLeft(), bottom(), left()

Definition at line 513 of file qrect.h.

Referenced by QtPrivate::PageItem::paint(), and QSGOpenVGRectangleNode::render().

+ Here is the caller graph for this function:

◆ bottomRight()

QPointF QRectF::bottomRight ( ) const
inlineconstexprnoexcept

Returns the position of the rectangle's bottom-right corner.

See also
setBottomRight(), bottom(), right()

Definition at line 511 of file qrect.h.

Referenced by QPlainTextDocumentLayout::blockBoundingRect(), QtPrivate::PageItem::paint(), QSGOpenVGRectangleNode::render(), and QQuickTextEdit::updatePaintNode().

+ Here is the caller graph for this function:

◆ center()

◆ contains() [1/3]

bool QRectF::contains ( const QPointF & point) const
noexcept

Returns true if the given point is inside or on the edge of the rectangle; otherwise returns false.

See also
intersects()

Definition at line 1939 of file qrect.cpp.

◆ contains() [2/3]

bool QRectF::contains ( const QRectF & r) const
noexcept

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns true if the given rectangle is inside this rectangle; otherwise returns false.

Definition at line 1985 of file qrect.cpp.

References r1, r2, and t2.

Referenced by QmlJSDebugger::collectItemsAt(), QGraphicsTextItem::contains(), QQuickParticleExtruder::contains(), QQuickEllipseExtruder::contains(), QQuickRectangleExtruder::contains(), QPixmapConvolutionFilter::draw(), QPainter::drawPixmapFragments(), QOutlineMapper::endOutline(), QtPrivate::intersect_point(), QtPrivate::intersect_rect(), QmlJSDebugger::itemAt(), QQuickPointerHandler::parentContains(), QMenuSloppyState::processMouseEvent(), and QApplicationPrivate::sendMouseEvent().

+ Here is the caller graph for this function:

◆ contains() [3/3]

bool QRectF::contains ( qreal x,
qreal y ) const
inlinenoexcept

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns true if the point (x, y) is inside or on the edge of the rectangle; otherwise returns false.

Definition at line 816 of file qrect.h.

References contains().

+ Here is the call graph for this function:

◆ getCoords()

constexpr void QRectF::getCoords ( qreal * x1,
qreal * y1,
qreal * x2,
qreal * y2 ) const
inlineconstexpr

Extracts the position of the rectangle's top-left corner to *x1 and *y1, and the position of the bottom-right corner to *x2 and y2.

See also
setCoords(), getRect()

Definition at line 775 of file qrect.h.

◆ getRect()

constexpr void QRectF::getRect ( qreal * x,
qreal * y,
qreal * width,
qreal * height ) const
inlineconstexpr

Extracts the position of the rectangle's top-left corner to *x and y, and its dimensions to *width and *height.

See also
setRect(), getCoords()

Definition at line 759 of file qrect.h.

◆ height()

constexpr qreal QRectF::height ( ) const
inlineconstexprnoexcept

Returns the height of the rectangle.

See also
setHeight(), width(), size()

Definition at line 718 of file qrect.h.

Referenced by QSvgImage::QSvgImage(), _q_boundGeometryToSizeConstraints(), QPathSegments::addPath(), QOpenGL2PEXVertexArray::addPath(), alignedRect(), QQuickTextPrivate::anchorAt(), QQuickMaterialRipple::anchorPoint(), QPlainTextEditControl::blockBoundingRect(), QWaylandViewporterPrivate::Viewport::checkCommittedState(), QQuickTableViewPrivate::clampedCellAtPos(), QQuickEllipseExtruder::contains(), QQuickMaskExtruder::contains(), correctMVPForScissor(), QPainter::PixmapFragment::create(), createMaskNode(), createPatternNode(), createRectNode(), QTextLayout::draw(), QWindowsVistaStylePrivate::drawBackgroundThruNativeBuffer(), QQC2::QWindowsXPStylePrivate::drawBackgroundThruNativeBuffer(), QQC2_NAMESPACE::QMacStyle::drawControl(), QMacStyle::drawControl(), QPdfEngine::drawImage(), QPainter::drawImage(), QGraphicsScenePrivate::drawItemHelper(), QPdfEngine::drawPixmap(), QPainter::drawRects(), QPdfEngine::drawRects(), QTextDocumentLayoutPrivate::drawTableCell(), QOutlineMapper::endOutline(), QPlainTextEditPrivate::ensureVisible(), QGraphicsView::fitInView(), QQuickItem::geometryChange(), QQuickPopup::geometryChange(), QQuickFlickable::geometryChange(), QQuickGridView::geometryChange(), QQuickListView::geometryChange(), QQuickText::geometryChange(), QQuickTextEdit::geometryChange(), QQuickTextInput::geometryChange(), QQuickControl::geometryChange(), QQuickMenuBarItem::geometryChange(), QQuickStackView::geometryChange(), QQuickTableViewPrivate::getAlignmentContentY(), QQuickTableViewPrivate::getEffectiveRowHeight(), QScrollerPrivate::handleDrag(), QQuickTextMetrics::height(), QPlainTextEditControl::hitTest(), QSSGLayerRenderPreparationResult::isLayerVisible(), QQuickScrollBarAttachedPrivate::itemGeometryChanged(), QQuickScrollIndicatorAttachedPrivate::itemGeometryChanged(), QQuickListViewPrivate::itemGeometryChanged(), QQuickMultiEffectPrivate::itemRect(), QTextDocumentLayoutPrivate::layoutBlock(), QLabelPrivate::layoutRect(), QScrollerPrivate::moveWhilePressed(), QPlainTextEditPrivate::pageUpDown(), QSGSoftwareInternalImageNode::paint(), QQuickBasicDial::paint(), QScrollerPrivate::prepareScrolling(), QTextDocument::print(), printPage(), QDashedStrokeProcessor::process(), qDrawBorder(), QSGOpenVGHelpers::qDrawBorderImage(), QSGOpenVGHelpers::qDrawSubImage(), qsgsimpletexturenode_update(), qt_drawImage(), qt_isect_curve_horizontal(), qt_isect_curve_vertical(), qt_painterpath_isect_curve(), qt_scale_image_argb32_on_argb32(), qt_scale_image_argb32_on_rgb16(), qt_scale_image_rgb16_on_rgb16(), qt_scale_image_rgb32_on_rgb32(), QVideoWindowPrivate::render(), QSGOpenVGGlyphNode::render(), QSGOpenVGInternalImageNode::render(), QSGOpenVGInternalRectangleNode::render(), QSGOpenVGRectangleNode::render(), QSGOpenVGImageNode::render(), QSGOpenVGSpriteNode::render(), QGraphicsScene::render(), QEvdevTouchScreenData::reportPoints(), QQuickPopupPositioner::reposition(), QScrollerPrivate::setContentPositionHelperDragging(), QSvgSymbolLike::setPainterToRectAndAdjustment(), QSvgNode::shouldDrawNode(), QQuickMaterialProgressBarNode::sync(), QQuickUniversalProgressBarNode::sync(), QQuickTableViewPrivate::tableLayoutToString(), QSvgRectF::translationRelativeToBoundingBox(), QQuickTableViewPrivate::updateAverageRowHeight(), QQuickMultiEffectPrivate::updateCenterOffset(), QQuickMaterialRippleWaveNode::updateCurrentTime(), QSGBasicInternalImageNode::updateGeometry(), QSGBasicInternalRectangleNode::updateGeometry(), QWavefrontMesh::updateGeometry(), QQuickBorderImageMesh::updateGeometry(), QQuickImage::updatePaintNode(), QQuickPaintedItem::updatePaintNode(), QQuickShaderEffectSource::updatePaintNode(), QQuickStyleItem::updatePaintNode(), QWaylandQuickItem::updatePaintNode(), QGeoMapMapboxGLPrivate::updateSceneGraph(), QQuickMultiEffectPrivate::updateSourcePadding(), and QQuick3DTexture::updateSpatialNode().

◆ intersected()

QRectF QRectF::intersected ( const QRectF & rectangle) const
inlinenoexcept
Since
4.2

Returns the intersection of this rectangle and the given rectangle. Note that {r.intersected(s)} is equivalent to {r & s}.

See also
intersects(), united(), operator&=()

Definition at line 833 of file qrect.h.

Referenced by QTextLayout::draw(), QPainterPrivate::draw_helper(), QSvgFeFilterPrimitive::localFilterBoundingBox(), QTextEditPrivate::repaintContents(), QQuickPopupPositioner::reposition(), and QWaylandTextInputPrivate::sendInputPanelState().

+ Here is the caller graph for this function:

◆ intersects()

bool QRectF::intersects ( const QRectF & rectangle) const
noexcept

Returns true if this rectangle intersects with the given rectangle (i.e.

there is a non-empty area of overlap between them), otherwise returns false.

The intersection rectangle can be retrieved using the intersected() function.

See also
contains()

Definition at line 2263 of file qrect.cpp.

References r1, r2, and t2.

Referenced by QQuickTextNodeEngine::addTextBlock(), cellClipTest(), QtPrivate::intersect_point(), QtPrivate::intersect_rect(), QQuickItemViewTransitionableItem::prepareTransition(), qgeotiledmapscene_isTileInViewport_rotationTilt(), qgeotiledmapscene_isTileInViewport_Straight(), QQuickTableViewPrivate::scheduleRebuildIfFastFlick(), QGraphicsItem::scroll(), and QQuickTextEditPrivate::transformChanged().

+ Here is the caller graph for this function:

◆ isEmpty()

constexpr bool QRectF::isEmpty ( ) const
inlineconstexprnoexcept

Returns true if the rectangle is empty, otherwise returns false.

An empty rectangle has width() <= 0 or height() <= 0. An empty rectangle is not valid (i.e., isEmpty() == !isValid()).

Use the normalized() function to retrieve a rectangle where the corners are swapped.

See also
isNull(), isValid(), normalized()

Definition at line 647 of file qrect.h.

Referenced by QBlitterPaintEnginePrivate::clipAndDrawPixmap(), createMaskNode(), createPatternNode(), createRectNode(), QPdfEngine::drawImage(), QPdfEngine::drawPixmap(), QGraphicsView::fitInView(), QQuickTableViewPrivate::loadInitialTable(), QDashStroker::processCurrentSubpath(), QGraphicsScenePrivate::processDirtyItemsRecursive(), QQuickTableViewPrivate::relayoutTableItems(), QQuickTableViewPrivate::setCurrentIndexFromKeyEvent(), QDeclarativeGeoMap::setVisibleArea(), QQuickCanvasItem::toImage(), QSvgNode::transformedBounds(), QSGBasicInternalImageNode::updateGeometry(), QGfxSourceProxy::updatePolish(), and QGeoMapMapboxGLPrivate::updateSceneGraph().

+ Here is the caller graph for this function:

◆ isNull()

QT_WARNING_PUSH QT_WARNING_DISABLE_FLOAT_COMPARE constexpr bool QRectF::isNull ( ) const
inlineconstexprnoexcept

Returns true if the rectangle is a null rectangle, otherwise returns false.

A null rectangle has both the width and the height set to 0. A null rectangle is also empty, and hence not valid.

See also
isEmpty(), isValid()

Definition at line 644 of file qrect.h.

Referenced by QPainterPath::addEllipse(), QGlyphRun::boundingRect(), centerOffset(), convolute(), QGeoCameraTilesPrivate::createFrustum(), QSGInternalTextNode::doAddTextLayout(), QTextLayout::draw(), QGraphicsItem::isObscured(), parseSymbolLikeAttributes(), QQuickItemViewTransitionableItem::prepareTransition(), QScrollerPrivate::pressWhileInactive(), QGraphicsScene::render(), QGeoTiledMapScenePrivate::setupCamera(), QPaintEngineEx::stroke(), and QSvgTinyDocument::viewBox().

+ Here is the caller graph for this function:

◆ isValid()

QT_WARNING_POP constexpr bool QRectF::isValid ( ) const
inlineconstexprnoexcept

Returns true if the rectangle is valid, otherwise returns false.

A valid rectangle has a width() > 0 and height() > 0. Note that non-trivial operations like intersections are not defined for invalid rectangles. A valid rectangle is not empty (i.e., isValid() == !isEmpty()).

See also
isNull(), isEmpty(), normalized()

Definition at line 652 of file qrect.h.

Referenced by QTextLayoutStruct::addUpdateRectForFloat(), clipIfValid(), QTextDocumentLayout::documentChanged(), QWidgetTextControlPrivate::dragLeaveEvent(), QWidgetTextControlPrivate::dragMoveEvent(), QTextLayout::draw(), QPlainTextEditPrivate::ensureVisible(), QQuickWindowContainer::geometryChange(), QTextDocumentLayoutPrivate::layoutFlow(), QPlainTextEditPrivate::repaintContents(), QTextEditPrivate::repaintContents(), QSvgSymbolLike::setPainterToRectAndAdjustment(), QDeclarativeGeoMap::setVisibleArea(), and QWaylandQuickItem::updatePaintNode().

+ Here is the caller graph for this function:

◆ left()

qreal QRectF::left ( ) const
inlineconstexprnoexcept

Returns the x-coordinate of the rectangle's left edge.

Equivalent to x().

See also
setLeft(), topLeft(), bottomLeft()

Definition at line 496 of file qrect.h.

Referenced by _q_boundGeometryToSizeConstraints(), QQuickTextNodeEngine::addToSceneGraph(), QQuickTableViewPrivate::canLoadTableEdge(), QQuickTableViewPrivate::canUnloadTableEdge(), QBlitterPaintEnginePrivate::clipAndDrawPixmap(), QScrollerPrivate::createScrollingSegments(), QQC2_NAMESPACE::QMacStyle::drawControl(), QMacStyle::drawControl(), QPdfEngine::drawHyperlink(), QTextDocumentLayoutPrivate::drawTableCell(), QQuickTextAreaPrivate::ensureCursorVisible(), QIntersectionFinder::hasIntersections(), QQuickTextNodeEngine::BinaryTreeNode::insert(), QPainterPath::intersects(), QScrollerPrivate::nextSnapPos(), QtWaylandClient::QWaylandBradientDecoration::paint(), QSGSoftwareInternalImageNode::paint(), printPage(), QDashStroker::processCurrentSubpath(), qClipLine(), qDrawBorder(), QSGOpenVGHelpers::qDrawBorderImage(), qsgsimpletexturenode_update(), qt_isect_curve_horizontal(), qt_isect_curve_vertical(), qt_transform_image(), QSGNinePatchNode::rebuildGeometry(), QSGOpenVGInternalImageNode::render(), QGraphicsScene::render(), QQuickPopupPositioner::reposition(), QOpenGL2PaintEngineExPrivate::resetClipIfNeeded(), QScrollerPrivate::scrollingSegmentsValid(), QQuickTableViewPrivate::scrollTowardsSelectionPoint(), QWidgetTextControl::selectionRect(), QQuickTableViewPrivate::selectionRectangle(), QGraphicsAnchorLayoutPrivate::setItemsGeometries(), QSvgSymbolLike::setPainterToRectAndAdjustment(), QPdfLinkModelPrivate::update(), QQuickTableViewPrivate::updateExtents(), QSGBasicInternalImageNode::updateGeometry(), QSGBasicInternalRectangleNode::updateGeometry(), QSGBasicInternalImageNode::updateGeometry(), QWavefrontMesh::updateGeometry(), visibleGlyphRange(), and visualRect().

+ Here is the caller graph for this function:

◆ marginsAdded()

constexpr QRectF QRectF::marginsAdded ( const QMarginsF & margins) const
inlineconstexprnoexcept
Since
5.3

Returns a rectangle grown by the margins.

See also
operator+=(), marginsRemoved(), operator-=()

Definition at line 875 of file qrect.h.

◆ marginsRemoved()

constexpr QRectF QRectF::marginsRemoved ( const QMarginsF & margins) const
inlineconstexprnoexcept
Since
5.3

Removes the margins from the rectangle, shrinking it.

See also
marginsAdded(), operator+=(), operator-=()

Definition at line 881 of file qrect.h.

Referenced by QWindows11Style::drawControl(), QWindows11Style::drawPrimitive(), and QSGOpenVGNinePatchNode::render().

+ Here is the caller graph for this function:

◆ moveBottom()

constexpr void QRectF::moveBottom ( qreal y)
inlineconstexprnoexcept

Moves the rectangle vertically, leaving the rectangle's bottom edge at the given finite y coordinate.

The rectangle's size is unchanged.

See also
bottom(), setBottom(), moveTop()

Definition at line 697 of file qrect.h.

References pos.

Referenced by QQuickTableViewPrivate::updateExtents().

+ Here is the caller graph for this function:

◆ moveBottomLeft()

constexpr void QRectF::moveBottomLeft ( const QPointF & position)
inlineconstexprnoexcept

Moves the rectangle, leaving the bottom-left corner at the given position.

The rectangle's size is unchanged.

See also
setBottomLeft(), moveBottom(), moveLeft()

Definition at line 706 of file qrect.h.

Referenced by QBlittablePlatformPixmap::markRasterOverlay().

+ Here is the caller graph for this function:

◆ moveBottomRight()

constexpr void QRectF::moveBottomRight ( const QPointF & position)
inlineconstexprnoexcept

Moves the rectangle, leaving the bottom-right corner at the given position.

The rectangle's size is unchanged.

See also
setBottomRight(), moveBottom(), moveRight()

Definition at line 709 of file qrect.h.

◆ moveCenter()

constexpr void QRectF::moveCenter ( const QPointF & position)
inlineconstexprnoexcept

Moves the rectangle, leaving the center point at the given position.

The rectangle's size is unchanged.

See also
center()

Definition at line 712 of file qrect.h.

Referenced by QEvdevTouchScreenData::addTouchPoint(), QWindows11Style::drawPrimitive(), QtWaylandClient::QWaylandInputDevice::handleTouchPoint(), QLibInputTouch::processTouchMotion(), QEvdevTouchScreenData::reportPoints(), QtWaylandClient::QWaylandTouchExtension::touch_extension_touch(), and QGraphicsVideoItemPrivate::updateRects().

+ Here is the caller graph for this function:

◆ moveLeft()

constexpr void QRectF::moveLeft ( qreal x)
inlineconstexprnoexcept

Moves the rectangle horizontally, leaving the rectangle's left edge at the given finite x coordinate.

The rectangle's size is unchanged.

See also
left(), setLeft(), moveRight()

Definition at line 688 of file qrect.h.

References pos.

Referenced by QQuickTableViewPrivate::relayoutTableItems(), QGridLayoutEngine::setGeometries(), and QQuickTableViewPrivate::updateExtents().

+ Here is the caller graph for this function:

◆ moveRight()

constexpr void QRectF::moveRight ( qreal x)
inlineconstexprnoexcept

Moves the rectangle horizontally, leaving the rectangle's right edge at the given finite x coordinate.

The rectangle's size is unchanged.

See also
right(), setRight(), moveLeft()

Definition at line 694 of file qrect.h.

References pos.

Referenced by QQuickTableViewPrivate::updateExtents(), and visualRect().

+ Here is the caller graph for this function:

◆ moveTo() [1/2]

constexpr void QRectF::moveTo ( const QPointF & p)
inlineconstexprnoexcept

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Moves the rectangle, leaving the top-left corner at the given position.

Definition at line 742 of file qrect.h.

◆ moveTo() [2/2]

constexpr void QRectF::moveTo ( qreal x,
qreal y )
inlineconstexprnoexcept

Moves the rectangle, leaving the top-left corner at the given position (x, y).

The rectangle's size is unchanged. Both parameters must be finite.

See also
translate(), moveTopLeft()

Definition at line 736 of file qrect.h.

Referenced by QWindowsVistaStylePrivate::drawBackgroundThruNativeBuffer(), QQC2::QWindowsXPStylePrivate::drawBackgroundThruNativeBuffer(), and QQuickContext2D::moveTo().

+ Here is the caller graph for this function:

◆ moveTop()

constexpr void QRectF::moveTop ( qreal y)
inlineconstexprnoexcept

Moves the rectangle vertically, leaving the rectangle's top line at the given finite y coordinate.

The rectangle's size is unchanged.

See also
top(), setTop(), moveBottom()

Definition at line 691 of file qrect.h.

References pos.

Referenced by QQuickTableViewPrivate::relayoutTableItems(), QGridLayoutEngine::setGeometries(), QQuickTextPrivate::setupTextLayout(), QQuickMaterialProgressBarNode::sync(), QQuickUniversalProgressBarNode::sync(), and QQuickTableViewPrivate::updateExtents().

+ Here is the caller graph for this function:

◆ moveTopLeft()

constexpr void QRectF::moveTopLeft ( const QPointF & position)
inlineconstexprnoexcept

Moves the rectangle, leaving the top-left corner at the given position.

The rectangle's size is unchanged.

See also
setTopLeft(), moveTop(), moveLeft()

Definition at line 700 of file qrect.h.

Referenced by QQuickTableViewPrivate::shiftLoadedTableRect().

+ Here is the caller graph for this function:

◆ moveTopRight()

constexpr void QRectF::moveTopRight ( const QPointF & position)
inlineconstexprnoexcept

Moves the rectangle, leaving the top-right corner at the given position.

The rectangle's size is unchanged.

See also
setTopRight(), moveTop(), moveRight()

Definition at line 703 of file qrect.h.

◆ normalized()

QRectF QRectF::normalized ( ) const
noexcept

Returns a normalized rectangle; i.e., a rectangle that has a non-negative width and height.

If width() < 0 the function swaps the left and right corners, and it swaps the top and bottom corners if height() < 0.

See also
isValid(), isEmpty()

Definition at line 1514 of file qrect.cpp.

Referenced by QPainterPath::addRoundedRect(), QPainter::drawArc(), QPainter::drawChord(), QRasterPaintEngine::drawImage(), QPainter::drawPie(), QRasterPaintEngine::drawRects(), QWindowsDirect2DPaintEngine::drawRects(), QSvgPaintEngine::drawRects(), QRasterPaintEngine::drawTiledPixmap(), QRasterPaintEngine::fill(), QWindowsDirect2DPaintEngine::fillRect(), QPainterPath::intersects(), and QRasterPaintEnginePrivate::isUnclipped().

+ Here is the caller graph for this function:

◆ operator&()

QRectF QRectF::operator& ( const QRectF & rectangle) const
noexcept

Returns the intersection of this rectangle and the given rectangle.

Returns an empty rectangle if there is no intersection.

See also
operator&=(), intersected()

Definition at line 2185 of file qrect.cpp.

References qMax(), qMin(), r1, r2, and t2.

+ Here is the call graph for this function:

◆ operator&=()

QRectF & QRectF::operator&= ( const QRectF & rectangle)
inlinenoexcept

Intersects this rectangle with the given rectangle.

See also
intersected(), operator&()

Definition at line 827 of file qrect.h.

◆ operator+=()

constexpr QRectF & QRectF::operator+= ( const QMarginsF & margins)
inlineconstexprnoexcept
Since
5.3

Adds the margins to the rectangle, growing it.

See also
marginsAdded(), marginsRemoved(), operator-=()

Definition at line 887 of file qrect.h.

◆ operator-=()

constexpr QRectF & QRectF::operator-= ( const QMarginsF & margins)
inlineconstexprnoexcept
Since
5.3

Returns a rectangle shrunk by the margins.

See also
marginsRemoved(), operator+=(), marginsAdded()

Definition at line 893 of file qrect.h.

◆ operator|()

QRectF QRectF::operator| ( const QRectF & rectangle) const
noexcept

Returns the bounding rectangle of this rectangle and the given rectangle.

See also
united(), operator|=()

Definition at line 2123 of file qrect.cpp.

References qMax(), and qMin().

+ Here is the call graph for this function:

◆ operator|=()

QRectF & QRectF::operator|= ( const QRectF & rectangle)
inlinenoexcept

Unites this rectangle with the given rectangle.

See also
united(), operator|()

Definition at line 821 of file qrect.h.

◆ right()

qreal QRectF::right ( ) const
inlineconstexprnoexcept

Returns the x-coordinate of the rectangle's right edge.

See also
setRight(), topRight(), bottomRight()

Definition at line 498 of file qrect.h.

Referenced by _q_boundGeometryToSizeConstraints(), QQuickTableViewPrivate::canLoadTableEdge(), QQuickTableViewPrivate::canUnloadTableEdge(), QQuickTableViewPrivate::clampedCellAtPos(), QBlitterPaintEnginePrivate::clipAndDrawPixmap(), QScrollerPrivate::createScrollingSegments(), QQC2_NAMESPACE::QMacStyle::drawControl(), QMacStyle::drawControl(), QPdfEngine::drawHyperlink(), QRasterPaintEngine::drawImage(), QQuickTextAreaPrivate::ensureCursorVisible(), QIntersectionFinder::hasIntersections(), QPainterPath::intersects(), QScrollerPrivate::nextSnapPos(), QSGSoftwareInternalImageNode::paint(), QDashStroker::processCurrentSubpath(), qClipLine(), qsgsimpletexturenode_update(), qt_isect_curve_horizontal(), qt_isect_curve_vertical(), qt_transform_image(), QSGNinePatchNode::rebuildGeometry(), QQuickPopupPositioner::reposition(), QOpenGL2PaintEngineExPrivate::resetClipIfNeeded(), QScrollerPrivate::scrollingSegmentsValid(), QQuickTableViewPrivate::scrollTowardsSelectionPoint(), QWidgetTextControl::selectionRect(), QQuickTableViewPrivate::selectionRectangle(), QGraphicsAnchorLayoutPrivate::setItemsGeometries(), QPdfLinkModelPrivate::update(), QQuickTableViewPrivate::updateContentWidth(), QQuickTableViewPrivate::updateExtents(), QSGBasicInternalImageNode::updateGeometry(), QSGBasicInternalRectangleNode::updateGeometry(), QSGBasicInternalImageNode::updateGeometry(), visibleGlyphRange(), and visualRect().

+ Here is the caller graph for this function:

◆ setBottom()

constexpr void QRectF::setBottom ( qreal y)
inlineconstexprnoexcept

Sets the bottom edge of the rectangle to the given finite y coordinate.

May change the height, but will never change the top edge of the rectangle.

See also
bottom(), moveBottom()

Definition at line 670 of file qrect.h.

References pos.

Referenced by qsgsimpletexturenode_update().

+ Here is the caller graph for this function:

◆ setBottomLeft()

constexpr void QRectF::setBottomLeft ( const QPointF & position)
inlineconstexprnoexcept

Set the bottom-left corner of the rectangle to the given position.

May change the size, but will never change the top-right corner of the rectangle.

See also
bottomLeft(), moveBottomLeft()

Definition at line 679 of file qrect.h.

◆ setBottomRight()

constexpr void QRectF::setBottomRight ( const QPointF & position)
inlineconstexprnoexcept

Set the bottom-right corner of the rectangle to the given position.

May change the size, but will never change the top-left corner of the rectangle.

See also
bottomRight(), moveBottomRight()

Definition at line 682 of file qrect.h.

◆ setCoords()

constexpr void QRectF::setCoords ( qreal x1,
qreal y1,
qreal x2,
qreal y2 )
inlineconstexprnoexcept

Sets the coordinates of the rectangle's top-left corner to (x1, y1), and the coordinates of its bottom-right corner to (x2, y2).

All parameters must be finite.

See also
getCoords(), setRect()

Definition at line 783 of file qrect.h.

◆ setHeight()

constexpr void QRectF::setHeight ( qreal height)
inlineconstexprnoexcept

Sets the height of the rectangle to the given finite height.

The bottom edge is changed, but not the top one.

See also
height(), setSize()

Definition at line 807 of file qrect.h.

Referenced by QSvgImage::QSvgImage(), QScrollerPrivate::prepareScrolling(), QQuickTableViewPrivate::relayoutTableItems(), QQuickTextPrivate::setupTextLayout(), QQuickMaterialProgressBarNode::sync(), QQuickUniversalProgressBarNode::sync(), QQuickStyleItem::updatePaintNode(), and QQuick3DTexture::updateSpatialNode().

+ Here is the caller graph for this function:

◆ setLeft()

constexpr void QRectF::setLeft ( qreal x)
inlineconstexprnoexcept

Sets the left edge of the rectangle to the given finite x coordinate.

May change the width, but will never change the right edge of the rectangle.

Equivalent to setX().

See also
left(), moveLeft()

Definition at line 661 of file qrect.h.

References pos.

Referenced by QPrintPreviewWidgetPrivate::_q_fit(), QWindows11Style::drawPrimitive(), and qsgsimpletexturenode_update().

+ Here is the caller graph for this function:

◆ setRect()

constexpr void QRectF::setRect ( qreal x,
qreal y,
qreal width,
qreal height )
inlineconstexprnoexcept

Sets the coordinates of the rectangle's top-left corner to (x, y), and its size to the given width and height.

All parameters must be finite.

See also
getRect(), setCoords()

Definition at line 767 of file qrect.h.

Referenced by createPatternNode(), and QGraphicsScene::render().

+ Here is the caller graph for this function:

◆ setRight()

constexpr void QRectF::setRight ( qreal x)
inlineconstexprnoexcept

Sets the right edge of the rectangle to the given finite x coordinate.

May change the width, but will never change the left edge of the rectangle.

See also
right(), moveRight()

Definition at line 664 of file qrect.h.

References pos.

Referenced by QWidgetTextControlPrivate::_q_updateBlock(), QTextLayout::draw(), and qsgsimpletexturenode_update().

+ Here is the caller graph for this function:

◆ setSize()

constexpr void QRectF::setSize ( const QSizeF & size)
inlineconstexprnoexcept

Sets the size of the rectangle to the given finite size.

The top-left corner is not moved.

See also
size(), setWidth(), setHeight()

Definition at line 810 of file qrect.h.

Referenced by QGraphicsTextItemPrivate::_q_updateBoundingRect(), QGraphicsSvgItemPrivate::updateDefaultSize(), and QQuickStyleItem::updatePaintNode().

+ Here is the caller graph for this function:

◆ setTop()

constexpr void QRectF::setTop ( qreal y)
inlineconstexprnoexcept

Sets the top edge of the rectangle to the given finite y coordinate.

May change the height, but will never change the bottom edge of the rectangle.

Equivalent to setY().

See also
top(), moveTop()

Definition at line 667 of file qrect.h.

References pos.

Referenced by getLinks_helper(), and qsgsimpletexturenode_update().

+ Here is the caller graph for this function:

◆ setTopLeft()

constexpr void QRectF::setTopLeft ( const QPointF & position)
inlineconstexprnoexcept

Set the top-left corner of the rectangle to the given position.

May change the size, but will never change the bottom-right corner of the rectangle.

See also
topLeft(), moveTopLeft()

Definition at line 673 of file qrect.h.

◆ setTopRight()

constexpr void QRectF::setTopRight ( const QPointF & position)
inlineconstexprnoexcept

Set the top-right corner of the rectangle to the given position.

May change the size, but will never change the bottom-left corner of the rectangle.

See also
topRight(), moveTopRight()

Definition at line 676 of file qrect.h.

◆ setWidth()

constexpr void QRectF::setWidth ( qreal width)
inlineconstexprnoexcept

Sets the width of the rectangle to the given finite width.

The right edge is changed, but not the left one.

See also
width(), setSize()

Definition at line 804 of file qrect.h.

Referenced by QSvgImage::QSvgImage(), QPlainTextDocumentLayout::blockBoundingRect(), QTextDocumentLayoutPrivate::drawFrameDecoration(), QSvgMarker::drawMarkersForNode(), QWindows11Style::drawPrimitive(), QPlainTextEdit::paintEvent(), QScrollerPrivate::prepareScrolling(), QQuickTableViewPrivate::relayoutTableItems(), QQuickUniversalProgressBarNode::sync(), QQuickStyleItem::updatePaintNode(), and QQuick3DTexture::updateSpatialNode().

+ Here is the caller graph for this function:

◆ setX()

void QRectF::setX ( qreal x)
inlineconstexprnoexcept

Sets the left edge of the rectangle to the given finite x coordinate.

May change the width, but will never change the right edge of the rectangle.

Equivalent to setLeft().

See also
x(), setY(), setTopLeft()

Definition at line 507 of file qrect.h.

References pos.

Referenced by QSvgRectF::combinedWithLocalRect(), QSvgRectF::combinedWithLocalRect(), and QScrollerPrivate::handleDrag().

+ Here is the caller graph for this function:

◆ setY()

void QRectF::setY ( qreal y)
inlineconstexprnoexcept

Sets the top edge of the rectangle to the given finite y coordinate.

May change the height, but will never change the bottom edge of the rectangle.

Equivalent to setTop().

See also
y(), setX(), setTopLeft()

Definition at line 508 of file qrect.h.

References pos.

Referenced by QQuickDrawerPrivate::resizeDimmer().

+ Here is the caller graph for this function:

◆ size()

constexpr QSizeF QRectF::size ( ) const
inlineconstexprnoexcept

Returns the size of the rectangle.

See also
setSize(), width(), height()

Definition at line 721 of file qrect.h.

Referenced by QGraphicsTextItemPrivate::_q_updateBoundingRect(), alignedRect(), QBlitterPaintEnginePrivate::clipAndDrawPixmap(), QAndroidStyle::Android9PatchDrawable::draw(), QWindowsVistaStylePrivate::drawBackgroundThruNativeBuffer(), QQC2::QWindowsXPStylePrivate::drawBackgroundThruNativeBuffer(), QOpenGL2PaintEngineEx::drawPixmap(), QQuickCanvasItem::geometryChange(), QQuickFramebufferObject::geometryChange(), QQuickImage::geometryChange(), QQuickRhiItem::geometryChange(), QQuickIconImage::geometryChange(), QQuickItemGroup::geometryChange(), QQuickLayout::geometryChange(), QDeclarativeGeoMap::geometryChange(), QQuick3DViewport::geometryChange(), QPainterPath::operator==(), QStaticTextPrivate::paintText(), QGraphicsWidget::paintWindowFrame(), QTextDocument::print(), QVideoWindowPrivate::render(), QQuickDialogButtonBoxPrivate::resizeContent(), QQuickAnchorChanges::reverse(), QQuickItemViewFxItem::setGeometry(), QGraphicsWidget::size(), QSvgTinyDocument::size(), QFontMetricsF::size(), QWaylandSurfacePrivate::surface_commit(), QSSGLayerRenderPreparationResult::textureDimensions(), QVideoTextureHelper::SubtitleLayout::toImage(), QQuickMultiEffectPrivate::updateBlurItemSizes(), QGraphicsSvgItemPrivate::updateDefaultSize(), QWin32PrintEnginePrivate::updateMetrics(), QGraphicsVideoItemPrivate::updateRects(), and QVideoWindowPrivate::updateSubtitle().

+ Here is the caller graph for this function:

◆ toAlignedRect()

QRect QRectF::toAlignedRect ( ) const
noexcept
Since
4.3

Returns a QRect based on the values of this rectangle that is the smallest possible integer rectangle that completely contains this rectangle.

See also
toRect()

Definition at line 2330 of file qrect.cpp.

References qCeil(), and qFloor().

Referenced by QFontMetrics::boundingRect(), QtWaylandClient::QWaylandWindow::commit(), convolute(), QtWaylandClient::QWaylandWindow::damage(), QPainterPrivate::draw_helper(), QGraphicsScenePrivate::drawItemHelper(), QPainter::drawText(), QQuickLabsPlatformMenu::open(), QSGAbstractSoftwareRenderer::optimizeRenderList(), QSGDefaultPainterNode::paint(), QLabel::paintEvent(), QTextEditPrivate::repaintContents(), QSGSoftwareInternalRectangleNode::setRect(), and QQuickPaintedItem::update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ top()

qreal QRectF::top ( ) const
inlineconstexprnoexcept

Returns the y-coordinate of the rectangle's top edge.

Equivalent to y().

See also
setTop(), topLeft(), topRight()

Definition at line 497 of file qrect.h.

Referenced by _q_boundGeometryToSizeConstraints(), QQuickTableViewPrivate::canLoadTableEdge(), QQuickTableViewPrivate::canUnloadTableEdge(), QBlitterPaintEnginePrivate::clipAndDrawPixmap(), QScrollerPrivate::createScrollingSegments(), QSGInternalTextNode::doAddTextLayout(), QPdfEngine::drawHyperlink(), QTextDocumentLayoutPrivate::drawTableCell(), QTextDocumentLayoutPrivate::drawTableCellBorder(), QQuickTextAreaPrivate::ensureCursorVisible(), QPlainTextEditPrivate::ensureVisible(), QIntersectionFinder::hasIntersections(), QPainterPath::intersects(), QScrollerPrivate::nextSnapPos(), QTextEditPrivate::pageUpDown(), QPlainTextEditPrivate::pageUpDown(), QSGSoftwareInternalImageNode::paint(), printPage(), QDashStroker::processCurrentSubpath(), qClipLine(), QSGOpenVGHelpers::qDrawBorderImage(), qsgsimpletexturenode_update(), qt_isect_curve_horizontal(), qt_isect_curve_vertical(), qt_transform_image(), QRasterizer::rasterize(), QSGNinePatchNode::rebuildGeometry(), QSGOpenVGInternalImageNode::render(), QGraphicsScene::render(), QQuickPopupPositioner::reposition(), QOpenGL2PaintEngineExPrivate::resetClipIfNeeded(), QScrollerPrivate::scrollingSegmentsValid(), QQuickTableViewPrivate::scrollTowardsSelectionPoint(), QQuickTableViewPrivate::selectionRectangle(), QGraphicsAnchorLayoutPrivate::setItemsGeometries(), QSvgSymbolLike::setPainterToRectAndAdjustment(), QQuickTextEditPrivate::transformChanged(), QPdfLinkModelPrivate::update(), QQuickTableViewPrivate::updateExtents(), QSGBasicInternalImageNode::updateGeometry(), QSGBasicInternalRectangleNode::updateGeometry(), QSGBasicInternalImageNode::updateGeometry(), QWavefrontMesh::updateGeometry(), QQuickTextInputPrivate::updateVerticalScroll(), and visibleGlyphRange().

+ Here is the caller graph for this function:

◆ topLeft()

◆ topRight()

QPointF QRectF::topRight ( ) const
inlineconstexprnoexcept

Returns the position of the rectangle's top-right corner.

See also
setTopRight(), top(), right()

Definition at line 512 of file qrect.h.

Referenced by QQuickTextNodeEngine::addImage(), QtPrivate::PageItem::paint(), and QSGOpenVGRectangleNode::render().

+ Here is the caller graph for this function:

◆ toRect()

constexpr QRect QRectF::toRect ( ) const
inlineconstexprnoexcept

Returns a QRect based on the values of this rectangle.

Note that the coordinates in the returned rectangle are rounded to the nearest integer.

See also
QRectF(), toAlignedRect(), QRect::toRectF()

Definition at line 845 of file qrect.h.

References qRound().

Referenced by QSvgFeColorMatrix::apply(), QSvgFeGaussianBlur::apply(), QSvgFeComposite::apply(), QSGAbstractSoftwareRenderer::backgroundRect(), BorderPaginator::clipRect(), QPixmapConvolutionFilter::draw(), QWindowsVistaStylePrivate::drawBackgroundThruNativeBuffer(), QQC2::QWindowsXPStylePrivate::drawBackgroundThruNativeBuffer(), QQC2_NAMESPACE::QMacStyle::drawControl(), QMacStyle::drawControl(), QRasterPaintEngine::drawImage(), QTextDocumentLayoutPrivate::drawTableCell(), QRasterPaintEngine::drawTiledPixmap(), QGraphicsWidget::initStyleOption(), QGraphicsItemPrivate::initStyleOption(), QLabelPrivate::layoutPoint(), QTransform::mapRect(), QSGAbstractSoftwareRenderer::markDirty(), QSGAbstractSoftwareRenderer::optimizeRenderList(), QSGSoftwareInternalImageNode::paint(), QSGSoftwareNinePatchNode::paint(), QSGAbstractSoftwareRenderer::setBackgroundRect(), QQC2_NAMESPACE::QMacStyle::subElementRect(), QSGSoftwareRenderableNode::update(), and QSGSoftwareRenderableNodeUpdater::visit().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ translate() [1/2]

constexpr void QRectF::translate ( const QPointF & offset)
inlineconstexprnoexcept

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

\l{QPointF::x()}{x()} along the x axis and {offset}.\l{QPointF::y()}{y()} along the y axis, relative to the current position.

Definition at line 730 of file qrect.h.

◆ translate() [2/2]

constexpr void QRectF::translate ( qreal dx,
qreal dy )
inlineconstexprnoexcept

Moves the rectangle dx along the x-axis and dy along the y-axis, relative to the current position.

Positive values move the rectangle to the right and downwards. Both parameters must be finite.

See also
moveTopLeft(), moveTo(), translated()

Definition at line 724 of file qrect.h.

Referenced by QMacStylePrivate::CocoaControl::adjustedControlFrame(), QGlyphRun::boundingRect(), QTextDocumentLayoutPrivate::drawBlock(), QMacStylePrivate::drawFocusRing(), QTextDocumentLayoutPrivate::drawFrame(), QRasterPaintEngine::drawImage(), QRasterPaintEngine::drawTiledPixmap(), QTextDocumentLayoutPrivate::hitTest(), QQuickTextNodeEngine::BinaryTreeNode::insert(), QTextDocumentLayoutPrivate::layoutFlow(), QPlainTextEditPrivate::pageUpDown(), QGraphicsItem::sceneBoundingRect(), QGraphicsItemPrivate::sceneEffectiveBoundingRect(), QGraphicsItem::scroll(), and QPaintEngineEx::stroke().

+ Here is the caller graph for this function:

◆ translated() [1/2]

constexpr QRectF QRectF::translated ( const QPointF & offset) const
inlineconstexprnoexcept

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 rectangle that is translated {offset}.

\l{QPointF::x()}{x()} along the x axis and {offset}.\l{QPointF::y()}{y()} along the y axis, relative to the current position.

Definition at line 753 of file qrect.h.

◆ translated() [2/2]

constexpr QRectF QRectF::translated ( qreal dx,
qreal dy ) const
inlineconstexprnoexcept

Returns a copy of the rectangle that is translated dx along the x axis and dy along the y axis, relative to the current position.

Positive values move the rectangle to the right and down. Both parameters must be finite.

See also
translate()

Definition at line 748 of file qrect.h.

Referenced by QMacStylePrivate::CocoaControl::adjustedControlFrame(), QTextLayout::draw(), QQC2_NAMESPACE::QMacStyle::drawComplexControl(), QMacStyle::drawComplexControl(), QQC2_NAMESPACE::QMacStyle::drawControl(), QMacStyle::drawControl(), QRasterPaintEngine::drawPixmap(), QGraphicsScenePrivate::drawSubtreeRecursive(), QPlainTextEditPrivate::ensureVisible(), QWindowsDirect2DWindow::flush(), QPlainTextEdit::inputMethodQuery(), QTextEdit::inputMethodQuery(), QtPrivate::intersect_path(), QtPrivate::intersect_point(), QtPrivate::intersect_rect(), QGraphicsItem::mapRectFromParent(), QGraphicsItem::mapRectFromScene(), QGraphicsItem::mapRectToParent(), QGraphicsItem::mapRectToScene(), QGraphicsViewPrivate::mapToViewRect(), QPlainTextEditPrivate::pageUpDown(), QPlainTextEdit::paintEvent(), QWaylandTextInputPrivate::sendInputPanelState(), QSGOpenVGGlyphNode::setGlyphs(), QQC2_NAMESPACE::QMacStyle::subControlRect(), QMacStyle::subControlRect(), QTextDocumentLayout::tableCellBoundingRect(), QQuickTextArea::updatePaintNode(), QGeoMapPolylineGeometry::updateSourcePoints(), QGeoMapPolygonGeometry::updateSourcePoints(), and QGraphicsWidgetPrivate::windowFrameHoverMoveEvent().

+ Here is the caller graph for this function:

◆ transposed()

constexpr QRectF QRectF::transposed ( ) const
inlineconstexprnoexcept
Since
5.7

Returns a copy of the rectangle that has its width and height exchanged:

QRectF r = {1.5, 5.1, 4.2, 2.4};
r = r.transposed(); // r == {1.5, 5.1, 2.4, 4.2}
constexpr QRectF transposed() const noexcept
Definition qrect.h:756
constexpr QRect transposed() const noexcept
Definition qrect.h:266
QRect r1(100, 200, 11, 16)
[0]
QRect r2(QPoint(100, 200), QSize(11, 16))
See also
QSizeF::transposed()

Definition at line 756 of file qrect.h.

◆ united()

QRectF QRectF::united ( const QRectF & rectangle) const
inlinenoexcept
Since
4.2

Returns the bounding rectangle of this rectangle and the given rectangle.

See also
intersected()

Definition at line 838 of file qrect.h.

Referenced by QWaylandViewporterPrivate::Viewport::checkCommittedState(), QTextLayout::glyphRuns(), and QQuickTextPrivate::setupTextLayout().

+ Here is the caller graph for this function:

◆ width()

constexpr qreal QRectF::width ( ) const
inlineconstexprnoexcept

Returns the width of the rectangle.

See also
setWidth(), height(), size()

Definition at line 715 of file qrect.h.

Referenced by QSvgImage::QSvgImage(), _q_boundGeometryToSizeConstraints(), QPathSegments::addPath(), QOpenGL2PEXVertexArray::addPath(), QPainterPath::addRoundedRect(), QQuickTextNodeEngine::addTextBlock(), alignedRect(), QQuickTextPrivate::anchorAt(), QQuickMaterialRipple::anchorPoint(), QPlainTextDocumentLayout::blockBoundingRect(), QWaylandViewporterPrivate::Viewport::checkCommittedState(), QQuickTableViewPrivate::clampedCellAtPos(), QQuickEllipseExtruder::contains(), QQuickMaskExtruder::contains(), correctMVPForScissor(), QPainter::PixmapFragment::create(), createMaskNode(), createPatternNode(), createRectNode(), QWindowsVistaStylePrivate::drawBackgroundThruNativeBuffer(), QQC2::QWindowsXPStylePrivate::drawBackgroundThruNativeBuffer(), QQC2_NAMESPACE::QMacStyle::drawControl(), QMacStyle::drawControl(), QRasterPaintEngine::drawImage(), QPdfEngine::drawImage(), QPainter::drawImage(), QGraphicsScenePrivate::drawItemHelper(), QPdfEngine::drawPixmap(), QWindows11Style::drawPrimitive(), QPainter::drawRects(), QPdfEngine::drawRects(), QTextDocumentLayoutPrivate::drawTableCell(), QOutlineMapper::endOutline(), QGraphicsView::fitInView(), QQuickItem::geometryChange(), QQuickPopup::geometryChange(), QQuickFlickable::geometryChange(), QQuickGridView::geometryChange(), QQuickListView::geometryChange(), QQuickText::geometryChange(), QQuickTextEdit::geometryChange(), QQuickTextInput::geometryChange(), QQuickControl::geometryChange(), QQuickStackView::geometryChange(), QQuickSwipeDelegate::geometryChange(), QQuickTumbler::geometryChange(), QQuickTableViewPrivate::getAlignmentContentX(), QQuickTableViewPrivate::getEffectiveColumnWidth(), QScrollerPrivate::handleDrag(), QSSGLayerRenderPreparationResult::isLayerVisible(), QQuickScrollBarAttachedPrivate::itemGeometryChanged(), QQuickScrollIndicatorAttachedPrivate::itemGeometryChanged(), QQuickListViewPrivate::itemGeometryChanged(), QQuickMultiEffectPrivate::itemRect(), QLabelPrivate::layoutRect(), QScrollerPrivate::moveWhilePressed(), QSGSoftwareInternalImageNode::paint(), QQuickBasicDial::paint(), QtPrivate::PageItem::paint(), QScrollerPrivate::prepareScrolling(), QTextDocument::print(), printPage(), QDashedStrokeProcessor::process(), qDrawBorder(), QSGOpenVGHelpers::qDrawBorderImage(), QSGOpenVGHelpers::qDrawSubImage(), qsgsimpletexturenode_update(), qt_drawImage(), qt_isect_curve_horizontal(), qt_isect_curve_vertical(), qt_painterpath_isect_curve(), qt_scale_image_argb32_on_argb32(), qt_scale_image_argb32_on_rgb16(), qt_scale_image_rgb16_on_rgb16(), qt_scale_image_rgb32_on_rgb32(), QVideoWindowPrivate::render(), QSGOpenVGGlyphNode::render(), QSGOpenVGInternalImageNode::render(), QSGOpenVGInternalRectangleNode::render(), QSGOpenVGRectangleNode::render(), QSGOpenVGImageNode::render(), QSGOpenVGSpriteNode::render(), QGraphicsScene::render(), QEvdevTouchScreenData::reportPoints(), QQuickPopupPositioner::reposition(), QScrollerPrivate::setContentPositionHelperDragging(), QSvgSymbolLike::setPainterToRectAndAdjustment(), QSvgNode::shouldDrawNode(), QQuickUniversalProgressBarNode::sync(), QQuickTableViewPrivate::tableLayoutToString(), QSvgRectF::translationRelativeToBoundingBox(), QQuickTableViewPrivate::updateAverageColumnWidth(), QQuickMultiEffectPrivate::updateCenterOffset(), QQuickMaterialRippleWaveNode::updateCurrentTime(), QSGBasicInternalImageNode::updateGeometry(), QSGBasicInternalRectangleNode::updateGeometry(), QWavefrontMesh::updateGeometry(), QQuickBorderImageMesh::updateGeometry(), QQuickImage::updatePaintNode(), QQuickPaintedItem::updatePaintNode(), QQuickShaderEffectSource::updatePaintNode(), QQuickStyleItem::updatePaintNode(), QWaylandQuickItem::updatePaintNode(), QGeoMapMapboxGLPrivate::updateSceneGraph(), QQuickMultiEffectPrivate::updateSourcePadding(), QQuick3DTexture::updateSpatialNode(), and QQuickTextMetrics::width().

◆ x()

constexpr qreal QRectF::x ( ) const
inlineconstexprnoexcept

Returns the x-coordinate of the rectangle's left edge.

Equivalent to left().

See also
setX(), y(), topLeft()

Definition at line 655 of file qrect.h.

Referenced by QQuickTextNodeEngine::addTextBlock(), alignedRect(), alignedRect(), QQuickTableViewPrivate::calculateTopLeft(), QQuickTableViewPrivate::canUnloadTableEdge(), QQuickTableViewPrivate::checkForVisibilityChanges(), QQuickTableViewPrivate::clampedCellAtPos(), QPainter::PixmapFragment::create(), QQC2_NAMESPACE::QMacStyle::drawControl(), QMacStyle::drawControl(), QRasterPaintEngine::drawImage(), QPdfEngine::drawImage(), QPainter::drawImage(), QPdfEngine::drawPixmap(), QPaintEngineEx::drawRects(), QPdfEngine::drawRects(), QSvgPaintEngine::drawRects(), QOutlineMapper::endOutline(), QQuickItem::geometryChange(), QQuickMouseArea::geometryChange(), QQuickTableViewPrivate::getEffectiveColumnX(), QQuickListViewPrivate::itemGeometryChanged(), QLabelPrivate::layoutRect(), QSGSoftwareInternalImageNode::paint(), qDrawBorder(), QSGOpenVGHelpers::qDrawSubImage(), qt_drawImage(), qt_scale_image_argb32_on_argb32(), qt_scale_image_argb32_on_rgb16(), qt_scale_image_rgb16_on_rgb16(), qt_scale_image_rgb32_on_rgb32(), QQuickTableViewPrivate::relayoutTableItems(), QSGOpenVGInternalImageNode::render(), QSGOpenVGRectangleNode::render(), QSGOpenVGImageNode::render(), QSGOpenVGSpriteNode::render(), QQuickTableViewPrivate::scheduleRebuildIfFastFlick(), QQuickTableViewPrivate::scrollTowardsSelectionPoint(), QGridLayoutEngine::setGeometries(), QQuickTableViewPrivate::tableLayoutToString(), QQuickMultiEffectPrivate::updateCenterOffset(), QSGBasicInternalImageNode::updateGeometry(), QQuickBorderImageMesh::updateGeometry(), QQuickImage::updatePaintNode(), QWaylandQuickItem::updatePaintNode(), QGfxSourceProxy::updatePolish(), QGeoMapMapboxGLPrivate::updateSceneGraph(), and QQuickMultiEffectPrivate::updateSourcePadding().

+ Here is the caller graph for this function:

◆ y()

constexpr qreal QRectF::y ( ) const
inlineconstexprnoexcept

Returns the y-coordinate of the rectangle's top edge.

Equivalent to top().

See also
setY(), x(), topLeft()

Definition at line 658 of file qrect.h.

Referenced by QQuickTextNodeEngine::addTextBlock(), alignedRect(), alignedRect(), QQuickTableViewPrivate::calculateTopLeft(), QQuickTableViewPrivate::canUnloadTableEdge(), QQuickTableViewPrivate::checkForVisibilityChanges(), QQuickTableViewPrivate::clampedCellAtPos(), QPainter::PixmapFragment::create(), QTextLayout::draw(), QQC2_NAMESPACE::QMacStyle::drawControl(), QMacStyle::drawControl(), QRasterPaintEngine::drawImage(), QPdfEngine::drawImage(), QPainter::drawImage(), QPdfEngine::drawPixmap(), QPainter::drawRects(), QPdfEngine::drawRects(), QOutlineMapper::endOutline(), QQuickTextAreaPrivate::ensureCursorVisible(), QQuickItem::geometryChange(), QQuickMouseArea::geometryChange(), QQuickTableViewPrivate::getEffectiveRowY(), QQuickListViewPrivate::itemGeometryChanged(), QLabelPrivate::layoutRect(), QSGSoftwareInternalImageNode::paint(), qDrawBorder(), QSGOpenVGHelpers::qDrawSubImage(), qt_drawImage(), qt_painterpath_isect_curve(), qt_scale_image_argb32_on_argb32(), qt_scale_image_argb32_on_rgb16(), qt_scale_image_rgb16_on_rgb16(), qt_scale_image_rgb32_on_rgb32(), QQuickTableViewPrivate::relayoutTableItems(), QSGOpenVGInternalImageNode::render(), QSGOpenVGRectangleNode::render(), QSGOpenVGImageNode::render(), QSGOpenVGSpriteNode::render(), QQuickTableViewPrivate::scheduleRebuildIfFastFlick(), QQuickTableViewPrivate::scrollTowardsSelectionPoint(), QGridLayoutEngine::setGeometries(), QQuickMaterialProgressBarNode::sync(), QQuickTableViewPrivate::tableLayoutToString(), QQuickMultiEffectPrivate::updateCenterOffset(), QSGBasicInternalImageNode::updateGeometry(), QQuickBorderImageMesh::updateGeometry(), QQuickImage::updatePaintNode(), QWaylandQuickItem::updatePaintNode(), QGfxSourceProxy::updatePolish(), QGeoMapMapboxGLPrivate::updateSceneGraph(), and QQuickMultiEffectPrivate::updateSourcePadding().

Friends And Related Symbol Documentation

◆ operator!=

bool QRectF::operator!= ( const QRectF & r1,
const QRectF & r2 )
friend

Returns true if the rectangles r1 and r2 are sufficiently different, otherwise returns false.

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

Definition at line 580 of file qrect.h.

◆ operator+() [1/2]

QRectF operator+ ( const QMarginsF & lhs,
const QRectF & rhs )
related

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

Since
5.3

Returns the lhs rectangle grown by the rhs margins.

Definition at line 863 of file qrect.h.

◆ operator+() [2/2]

QRectF operator+ ( const QRectF & lhs,
const QMarginsF & rhs )
related
Since
5.3

Returns the lhs rectangle grown by the rhs margins.

Definition at line 857 of file qrect.h.

◆ operator-()

QRectF operator- ( const QRectF & lhs,
const QMarginsF & rhs )
related
Since
5.3

Returns the lhs rectangle shrunk by the rhs margins.

Definition at line 869 of file qrect.h.

◆ operator<<()

QDataStream & operator<< ( QDataStream & stream,
const QRectF & rectangle )
related

Writes the rectangle to the stream, and returns a reference to the stream.

See also
{Serializing Qt Data Types}

Definition at line 2447 of file qrect.cpp.

◆ operator==

bool QRectF::operator== ( const QRectF & r1,
const QRectF & r2 )
friend

Returns true if the rectangles r1 and r2 are approximately equal, otherwise returns false.

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

Definition at line 575 of file qrect.h.

◆ operator>>()

QDataStream & operator>> ( QDataStream & stream,
QRectF & rectangle )
related

Reads a rectangle from the stream, and returns a reference to the stream.

See also
{Serializing Qt Data Types}

Definition at line 2464 of file qrect.cpp.


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