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

\inmodule QtCore More...

#include <qsize.h>

+ Collaboration diagram for QSizeF:

Public Member Functions

constexpr QSizeF () noexcept
 Constructs an invalid size.
 
constexpr QSizeF (const QSize &sz) noexcept
 Constructs a size with floating point accuracy from the given size.
 
constexpr QSizeF (qreal w, qreal h) noexcept
 Constructs a size with the given finite width and height.
 
bool isNull () const noexcept
 Returns true if both the width and height are 0.0 (ignoring the sign); otherwise returns false.
 
constexpr bool isEmpty () const noexcept
 Returns true if either of the width and height is less than or equal to 0; otherwise returns false.
 
constexpr bool isValid () const noexcept
 Returns true if both the width and height are equal to or greater than 0; otherwise returns false.
 
constexpr qreal width () const noexcept
 Returns the width.
 
constexpr qreal height () const noexcept
 Returns the height.
 
constexpr void setWidth (qreal w) noexcept
 Sets the width to the given finite width.
 
constexpr void setHeight (qreal h) noexcept
 Sets the height to the given finite height.
 
void transpose () noexcept
 Swaps the width and height values.
 
constexpr QSizeF transposed () const noexcept
 
void scale (qreal w, qreal h, Qt::AspectRatioMode mode) noexcept
 Scales the size to a rectangle with the given width and height, according to the specified mode.
 
void scale (const QSizeF &s, Qt::AspectRatioMode mode) noexcept
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Scales the size to a rectangle with the given size, according to the specified mode.
 
QSizeF scaled (qreal w, qreal h, Qt::AspectRatioMode mode) const noexcept
 
QSizeF scaled (const QSizeF &s, Qt::AspectRatioMode mode) const noexcept
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
constexpr QSizeF expandedTo (const QSizeF &) const noexcept
 Returns a size holding the maximum width and height of this size and the given otherSize.
 
constexpr QSizeF boundedTo (const QSizeF &) const noexcept
 Returns a size holding the minimum width and height of this size and the given otherSize.
 
constexpr QSizeF grownBy (QMarginsF m) const noexcept
 
constexpr QSizeF shrunkBy (QMarginsF m) const noexcept
 
constexpr qrealrwidth () noexcept
 Returns a reference to the width.
 
constexpr qrealrheight () noexcept
 Returns a reference to the height.
 
constexpr QSizeFoperator+= (const QSizeF &) noexcept
 Adds the given size to this size and returns a reference to this size.
 
constexpr QSizeFoperator-= (const QSizeF &) noexcept
 Subtracts the given size from this size and returns a reference to this size.
 
constexpr QSizeFoperator*= (qreal c) noexcept
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Multiplies both the width and height by the given finite factor and returns a reference to the size.
 
QSizeFoperator/= (qreal c)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Divides both the width and height by the given divisor and returns a reference to the size.
 
constexpr QSize toSize () const noexcept
 Returns an integer based copy of this size.
 

Friends

QT_WARNING_PUSH QT_WARNING_DISABLE_FLOAT_COMPARE friend constexpr bool operator== (const QSizeF &s1, const QSizeF &s2)
 Returns true if s1 and s2 are approximately equal; otherwise returns false.
 
QT_WARNING_POP friend constexpr bool operator!= (const QSizeF &s1, const QSizeF &s2)
 Returns true if s1 and s2 are sufficiently different; otherwise returns false.
 
constexpr QSizeF operator+ (const QSizeF &s1, const QSizeF &s2) noexcept
 Returns the sum of s1 and s2; each component is added separately.
 
constexpr QSizeF operator- (const QSizeF &s1, const QSizeF &s2) noexcept
 Returns s2 subtracted from s1; each component is subtracted separately.
 
constexpr QSizeF operator* (const QSizeF &s, qreal c) noexcept
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Multiplies the given size by the given finite factor and returns the result.
 
constexpr QSizeF operator* (qreal c, const QSizeF &s) noexcept
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Multiplies the given size by the given finite factor and returns the result.
 
QSizeF operator/ (const QSizeF &s, qreal c)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Divides the given size by the given divisor and returns the result.
 
template<std::size_t I, typename S , std::enable_if_t<(I< 2), bool > = true, std::enable_if_t< std::is_same_v< q20::remove_cvref_t< S >, QSizeF >, bool > = true>
constexpr decltype(auto) get (S &&s) noexcept
 

Related Symbols

(Note that these are not member symbols.)

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

Detailed Description

\inmodule QtCore

The QSizeF class defines the size of a two-dimensional object using floating point precision.

A size is specified by a width() and a height(). It can be set in the constructor and changed using the setWidth(), setHeight(), or scale() functions, or using arithmetic operators. A size can also be manipulated directly by retrieving references to the width and height using the rwidth() and rheight() functions. Finally, the width and height can be swapped using the transpose() function.

The isValid() function determines if a size is valid. A valid size has both width and height greater than or equal to zero. The isEmpty() function returns true if either of the width and height is less than (or equal to) zero, while the isNull() function returns true only if both the width and the height is zero.

Use the expandedTo() function to retrieve a size which holds the maximum height and width of this size and a given size. Similarly, the boundedTo() function returns a size which holds the minimum height and width of this size and a given size.

The QSizeF class also provides the toSize() function returning a QSize copy of this size, constructed by rounding the width and height to the nearest integers.

QSizeF objects can be streamed as well as compared.

See also
QSize, QPointF, QRectF

Definition at line 206 of file qsize.h.

Constructor & Destructor Documentation

◆ QSizeF() [1/3]

constexpr QSizeF::QSizeF ( )
inlineconstexprnoexcept

Constructs an invalid size.

See also
isValid()

Definition at line 306 of file qsize.h.

Referenced by transposed().

+ Here is the caller graph for this function:

◆ QSizeF() [2/3]

constexpr QSizeF::QSizeF ( const QSize & size)
inlineconstexprnoexcept

Constructs a size with floating point accuracy from the given size.

See also
toSize(), QSize::toSizeF()

Definition at line 308 of file qsize.h.

◆ QSizeF() [3/3]

constexpr QSizeF::QSizeF ( qreal w,
qreal h )
inlineconstexprnoexcept

Constructs a size with the given finite width and height.

Definition at line 310 of file qsize.h.

Member Function Documentation

◆ boundedTo()

constexpr QSizeF QSizeF::boundedTo ( const QSizeF & otherSize) const
inlineconstexprnoexcept

Returns a size holding the minimum width and height of this size and the given otherSize.

See also
expandedTo(), scale()

Definition at line 385 of file qsize.h.

References qMin().

Referenced by QGraphicsView::sizeHint().

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

◆ expandedTo()

constexpr QSizeF QSizeF::expandedTo ( const QSizeF & otherSize) const
inlineconstexprnoexcept

Returns a size holding the maximum width and height of this size and the given otherSize.

See also
boundedTo(), scale()

Definition at line 380 of file qsize.h.

References qMax().

Referenced by QQuickStackLayout::rearrange(), QGraphicsLayoutItem::setGeometry(), and QQuickStackLayout::sizeHint().

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

◆ grownBy()

QSizeF QSizeF::grownBy ( QMarginsF margins) const
inlineconstexprnoexcept
Since
5.14

Returns the size that results from growing this size by margins.

See also
shrunkBy()

Definition at line 232 of file qsize.h.

◆ height()

constexpr qreal QSizeF::height ( ) const
inlineconstexprnoexcept

Returns the height.

See also
width(), setHeight()

Definition at line 324 of file qsize.h.

Referenced by QEglFSKmsScreen::QEglFSKmsScreen(), QQuickSelectionRectanglePrivate::QQuickSelectionRectanglePrivate(), _q_boundGeometryToSizeConstraints(), QPdfBookmarkModelPrivate::appendChildNode(), QQuickLayoutPrivate::applySizeHints(), QQuickBorderImagePrivate::calculateRects(), QQuickTableViewPrivate::calculateTopLeft(), QQuickTableViewPrivate::canLoadTableEdge(), centerOffset(), closestAcceptableSize(), combineImplicitHints(), QQuickPaintedItem::contentsBoundingRect(), QQuickStyleItem::contentSize(), QQuickPopup::contentSizeChange(), QQuickScrollView::contentSizeChange(), QGraphicsTextItemPrivate::controlOffset(), QScrollerPrivate::createScrollingSegments(), QQuickRow::doPositioning(), QQuickFlow::doPositioning(), QTextDocumentLayoutPrivate::drawFrame(), QTextDocumentLayoutPrivate::drawTableCell(), QQuickLayout::dumpLayoutTreeRecursive(), QTextDocumentLayout::dynamicPageCount(), QGridLayoutItem::effectiveMaxSize(), QGraphicsLayoutItemPrivate::effectiveSizeHints(), QQuickLayout::effectiveSizeHints_helper(), QScroller::ensureVisible(), getSize(), QQuickNinePatchNode::initialize(), QTextDocumentLayoutPrivate::layoutCell(), QTextDocumentLayoutPrivate::layoutFlow(), QTextDocumentLayoutPrivate::layoutFrame(), QQuickTableViewPrivate::layoutHorizontalEdge(), QTextDocumentLayoutPrivate::layoutTable(), marginsOffset(), QGraphicsLayoutItem::maximumHeight(), QQuickPdfDocument::maxPageHeight(), QPaintDeviceWindow::metric(), QWidget::metric(), QOpenGLWidget::metric(), QGraphicsLayoutItem::minimumHeight(), operator<<(), operator<<(), operator<<(), QSGSoftwareSpriteNode::paint(), QPagePreview::paintEvent(), QScreen::physicalDotsPerInchY(), QtWayland::TouchExtensionGlobal::postTouchEvent(), QGraphicsLayoutItem::preferredHeight(), QQuickBasePositioner::prePositioning(), QWindowsPrintDevice::printableMargins(), QSGOpenVGHelpers::qDrawBorderImage(), qt_convertUnits(), QSvgIOHandler::read(), QPdfIOHandler::read(), QSGSoftwareSpriteNode::rect(), QtGraphicsAnchorLayout::AnchorData::refreshSizeHints(), QQuickTableViewPrivate::relayoutTableItems(), QSGOpenVGSpriteNode::render(), QQuickTableViewPrivate::scrollTowardsSelectionPoint(), QQuickStyleItem::setContentHeight(), QScrollerPrivate::setContentPositionHelperDragging(), QPageLayoutPrivate::setDefaultMargins(), QWasmWindow::setGeometry(), QQuickLayoutAttached::setMaximumImplicitSize(), QQuickLayoutAttached::setMinimumImplicitSize(), QPageLayout::setOrientation(), QQuickTextPrivate::signalSizeChange(), QLabelPrivate::sizeForWidth(), QGridLayoutEngine::sizeHint(), QQuickLayoutAttached::sizeHint(), QQuickTableViewPrivate::updateAverageRowHeight(), QQuickTextInputPrivate::updateBaselineOffset(), QQuickMultiEffectPrivate::updateBlurItemSizes(), QQuickTableViewPrivate::updateContentHeight(), QQuickTableViewPrivate::updateExtents(), QQuickNinePatchImagePrivate::updatePatches(), QWasmScreen::updateQScreenAndCanvasRenderSize(), and QQuickTextInputPrivate::updateVerticalScroll().

◆ isEmpty()

constexpr bool QSizeF::isEmpty ( ) const
inlineconstexprnoexcept

Returns true if either of the width and height is less than or equal to 0; otherwise returns false.

See also
isNull(), isValid()

Definition at line 315 of file qsize.h.

Referenced by QXcbScreen::QXcbScreen(), QQC2::QWindowsXPStyle::drawComplexControl(), QWindowsVistaStyle::drawComplexControl(), operator<<(), QEglFSKmsScreen::physicalSize(), QXcbScreen::setMonitor(), QXcbScreen::updateGeometry(), and QGraphicsVideoItemPrivate::updateRects().

+ Here is the caller graph for this function:

◆ isNull()

bool QSizeF::isNull ( ) const
inlinenoexcept

Returns true if both the width and height are 0.0 (ignoring the sign); otherwise returns false.

See also
isValid(), isEmpty()

Definition at line 312 of file qsize.h.

References qIsNull().

Referenced by QQuickStackLayout::rearrange(), and QTextEdit::resizeEvent().

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

◆ isValid()

constexpr bool QSizeF::isValid ( ) const
inlineconstexprnoexcept

Returns true if both the width and height are equal to or greater than 0; otherwise returns false.

See also
isNull(), isEmpty()

Definition at line 318 of file qsize.h.

Referenced by QGraphicsWidget::adjustSize(), QGraphicsLayoutItem::effectiveSizeHint(), QQuickStackLayout::rearrange(), and QQuickNinePatchImage::updatePaintNode().

+ Here is the caller graph for this function:

◆ operator*=()

constexpr QSizeF & QSizeF::operator*= ( qreal factor)
inlineconstexprnoexcept

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Multiplies both the width and height by the given finite factor and returns a reference to the size.

See also
scale()

Definition at line 365 of file qsize.h.

◆ operator+=()

constexpr QSizeF & QSizeF::operator+= ( const QSizeF & size)
inlineconstexprnoexcept

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

For example:

QSizeF s( 3, 7);
QSizeF r(-1, 4);
s += r;
// s becomes (2,11)

Definition at line 351 of file qsize.h.

◆ operator-=()

constexpr QSizeF & QSizeF::operator-= ( const QSizeF & size)
inlineconstexprnoexcept

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

For example:

QSizeF s( 3, 7);
QSizeF r(-1, 4);
s -= r;
// s becomes (4,3)
void scale(int w, int h, Qt::AspectRatioMode mode) noexcept
Scales the size to a rectangle with the given width and height, according to the specified mode:
Definition qsize.h:144
@ KeepAspectRatioByExpanding
@ IgnoreAspectRatio
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t1
[4]
QSize t3(10, 12)
QSize r(-1, 4)
QSize t1(10, 12)
[0]
QSize size(100, 10)
[0]
QSize t2(10, 12)
QSize s(3, 7)
[2]

Definition at line 358 of file qsize.h.

◆ operator/=()

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

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Divides both the width and height by the given divisor and returns a reference to the size.

The divisor must not be either zero or NaN.

See also
scale()

Definition at line 372 of file qsize.h.

References Q_ASSERT, qFuzzyIsNull(), and qIsFinite().

+ Here is the call graph for this function:

◆ rheight()

constexpr qreal & QSizeF::rheight ( )
inlineconstexprnoexcept

Returns a reference to the height.

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

QSizeF size(100, 10.2);
size.rheight() += 5.5;
// size becomes (100,15.7)
See also
rwidth(), setHeight()

Definition at line 348 of file qsize.h.

Referenced by QGraphicsLayoutItemPrivate::effectiveSizeHints(), QQuickLayout::effectiveSizeHints_helper(), QGraphicsLayoutItemPrivate::setSizeComponent(), and QQuickTableViewPrivate::updateExtents().

+ Here is the caller graph for this function:

◆ rwidth()

constexpr qreal & QSizeF::rwidth ( )
inlineconstexprnoexcept

Returns a reference to the width.

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

QSizeF size(100.3, 10);
size.rwidth() += 20.5;
// size becomes (120.8,10)
See also
rheight(), setWidth()

Definition at line 345 of file qsize.h.

Referenced by QGraphicsLayoutItemPrivate::effectiveSizeHints(), QQuickLayout::effectiveSizeHints_helper(), QTextDocument::print(), and QQuickTableViewPrivate::updateExtents().

+ Here is the caller graph for this function:

◆ scale() [1/2]

void QSizeF::scale ( const QSizeF & s,
Qt::AspectRatioMode mode )
inlinenoexcept

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Scales the size to a rectangle with the given size, according to the specified mode.

Definition at line 339 of file qsize.h.

References scaled().

+ Here is the call graph for this function:

◆ scale() [2/2]

void QSizeF::scale ( qreal width,
qreal height,
Qt::AspectRatioMode mode )
inlinenoexcept

Scales the size to a rectangle with the given width and height, according to the specified mode.

\list

  • If mode is Qt::IgnoreAspectRatio, the size is set to (width, height).
  • If mode is Qt::KeepAspectRatio, the current size is scaled to a rectangle as large as possible inside (width, height), preserving the aspect ratio.
  • If mode is Qt::KeepAspectRatioByExpanding, the current size is scaled to a rectangle as small as possible outside (width, height), preserving the aspect ratio. \endlist

Example:

QSizeF t1(10, 12);
t1.scale(60, 60, Qt::IgnoreAspectRatio);
// t1 is (60, 60)
QSizeF t2(10, 12);
// t2 is (50, 60)
QSizeF t3(10, 12);
// t3 is (60, 72)
See also
setWidth(), setHeight(), scaled()

Definition at line 336 of file qsize.h.

Referenced by QGraphicsVideoItemPrivate::updateRects().

+ Here is the caller graph for this function:

◆ scaled() [1/2]

QSizeF QSizeF::scaled ( const QSizeF & s,
Qt::AspectRatioMode mode ) const
noexcept

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

Since
5.0

Returns a size scaled to a rectangle with the given size s, according to the specified mode.

Definition at line 640 of file qsize.cpp.

References Qt::IgnoreAspectRatio, Qt::KeepAspectRatio, and qIsNull().

+ Here is the call graph for this function:

◆ scaled() [2/2]

QSizeF QSizeF::scaled ( qreal width,
qreal height,
Qt::AspectRatioMode mode ) const
inlinenoexcept
Since
5.0

Returns a size scaled to a rectangle with the given width and height, according to the specified mode.

See also
scale()

Definition at line 342 of file qsize.h.

References scaled().

+ Here is the call graph for this function:

◆ setHeight()

constexpr void QSizeF::setHeight ( qreal height)
inlineconstexprnoexcept

◆ setWidth()

constexpr void QSizeF::setWidth ( qreal width)
inlineconstexprnoexcept

◆ shrunkBy()

QSizeF QSizeF::shrunkBy ( QMarginsF margins) const
inlineconstexprnoexcept
Since
5.14

Returns the size that results from shrinking this size by margins.

See also
grownBy()

Definition at line 234 of file qsize.h.

◆ toSize()

constexpr QSize QSizeF::toSize ( ) const
inlineconstexprnoexcept

Returns an integer based copy of this size.

Note that the coordinates in the returned size will be rounded to the nearest integer.

See also
QSizeF(), QSize::toSizeF()

Definition at line 390 of file qsize.h.

References qRound().

Referenced by QWhatsThat::QWhatsThat(), QPdfIOHandler::currentImageRect(), QQuickCanvasItem::geometryChange(), QQuickStyleItem::imageSize(), QQuickCanvasItem::loadImage(), QWatermarkLabel::minimumSizeHint(), QtWaylandClient::QWaylandAdwaitaDecoration::paint(), QPagePreview::paintEvent(), qt_convertUnitsToPoints(), QDeclarativeGeoMapCopyrightNotice::rasterizeHtmlAndUpdate(), QPdfIOHandler::read(), QQuickDesignerSupport::refFromEffectItem(), QSplashScreen::setPixmap(), QWaylandWlShellSurface::sizeForResize(), QWindowsVistaStyle::standardIcon(), QShapedPixmapWindow::updateGeometry(), and QQuickWidgetPrivate::updateSize().

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

◆ transpose()

void QSizeF::transpose ( )
noexcept

Swaps the width and height values.

See also
setWidth(), setHeight(), transposed()

Definition at line 581 of file qsize.cpp.

References qSwap().

+ Here is the call graph for this function:

◆ transposed()

constexpr QSizeF QSizeF::transposed ( ) const
inlineconstexprnoexcept
Since
5.0

Returns the size with width and height values swapped.

See also
transpose()

Definition at line 333 of file qsize.h.

References QSizeF().

Referenced by QXcbScreen::updateGeometry().

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

◆ width()

constexpr qreal QSizeF::width ( ) const
inlineconstexprnoexcept

Returns the width.

See also
height(), setWidth()

Definition at line 321 of file qsize.h.

Referenced by QEglFSKmsScreen::QEglFSKmsScreen(), QQuickSelectionRectanglePrivate::QQuickSelectionRectanglePrivate(), _q_boundGeometryToSizeConstraints(), QQuickLayoutPrivate::applySizeHints(), QQuickBorderImagePrivate::calculateRects(), QQuickTableViewPrivate::calculateTopLeft(), QQuickTableViewPrivate::canLoadTableEdge(), centerOffset(), closestAcceptableSize(), combineImplicitHints(), QQuickPaintedItem::contentsBoundingRect(), QQuickStyleItem::contentSize(), QQuickPopup::contentSizeChange(), QQuickScrollView::contentSizeChange(), QScrollerPrivate::createScrollingSegments(), QQuickColumn::doPositioning(), QQuickRow::doPositioning(), QQuickFlow::doPositioning(), QTextDocumentLayoutPrivate::drawBlock(), QMacStyle::drawControl(), QQuickLayout::dumpLayoutTreeRecursive(), QGridLayoutItem::effectiveMaxSize(), QGraphicsLayoutItemPrivate::effectiveSizeHints(), QScroller::ensureVisible(), getSize(), QQuickNinePatchNode::initialize(), QStyle::itemPixmapRect(), QTextDocumentLayoutPrivate::layoutBlock(), QTextDocumentLayoutPrivate::layoutFrame(), QQuickTableViewPrivate::layoutVerticalEdge(), marginsOffset(), QGraphicsLayoutItem::maximumWidth(), QQuickPdfDocument::maxPageWidth(), QPaintDeviceWindow::metric(), QWidget::metric(), QOpenGLWidget::metric(), QGraphicsLayoutItem::minimumWidth(), operator<<(), operator<<(), operator<<(), QSGSoftwareSpriteNode::paint(), QPagePreview::paintEvent(), QScreen::physicalDotsPerInchX(), QtWayland::TouchExtensionGlobal::postTouchEvent(), QGraphicsLayoutItem::preferredWidth(), QQuickBasePositioner::prePositioning(), QWindowsPrintDevice::printableMargins(), QSGOpenVGHelpers::qDrawBorderImage(), qt_convertUnits(), QSvgIOHandler::read(), QPdfIOHandler::read(), QSGSoftwareSpriteNode::rect(), QtGraphicsAnchorLayout::AnchorData::refreshSizeHints(), QQuickTableViewPrivate::relayoutTableItems(), QSGOpenVGSpriteNode::render(), QQuickTableViewPrivate::scrollTowardsSelectionPoint(), QScrollerPrivate::setContentPositionHelperDragging(), QQuickStyleItem::setContentWidth(), QPageLayoutPrivate::setDefaultMargins(), QWasmWindow::setGeometry(), QQuickLayoutAttached::setMaximumImplicitSize(), QQuickLayoutAttached::setMinimumImplicitSize(), QPageLayout::setOrientation(), QQuickTextPrivate::signalSizeChange(), QLabelPrivate::sizeForWidth(), QGridLayoutEngine::sizeHint(), QQuickLayoutAttached::sizeHint(), QQuickTableViewPrivate::updateAverageColumnWidth(), QQuickMultiEffectPrivate::updateBlurItemSizes(), QQuickTableViewPrivate::updateContentWidth(), QQuickTableViewPrivate::updateExtents(), QQuickNinePatchImagePrivate::updatePatches(), QWasmScreen::updateQScreenAndCanvasRenderSize(), and QSvgVisitorImpl::visitTextNode().

Friends And Related Symbol Documentation

◆ get

template<std::size_t I, typename S , std::enable_if_t<(I< 2), bool > = true, std::enable_if_t< std::is_same_v< q20::remove_cvref_t< S >, QSizeF >, bool > = true>
constexpr decltype(auto) get ( S && s)
friend

Definition at line 281 of file qsize.h.

◆ operator!=

bool QSizeF::operator!= ( const QSizeF & s1,
const QSizeF & s2 )
friend

Returns true if s1 and s2 are sufficiently different; otherwise returns false.

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

Definition at line 253 of file qsize.h.

◆ operator* [1/2]

QSizeF QSizeF::operator* ( const QSizeF & size,
qreal factor )
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Multiplies the given size by the given finite factor and returns the result.

See also
QSizeF::scale()

Definition at line 259 of file qsize.h.

◆ operator* [2/2]

QSizeF QSizeF::operator* ( qreal c,
const QSizeF & s )
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Multiplies the given size by the given finite factor and returns the result.

Definition at line 261 of file qsize.h.

◆ operator+

QSizeF QSizeF::operator+ ( const QSizeF & s1,
const QSizeF & s2 )
friend

Returns the sum of s1 and s2; each component is added separately.

Definition at line 255 of file qsize.h.

◆ operator-

QSizeF QSizeF::operator- ( const QSizeF & s1,
const QSizeF & s2 )
friend

Returns s2 subtracted from s1; each component is subtracted separately.

Definition at line 257 of file qsize.h.

◆ operator/

QSizeF QSizeF::operator/ ( const QSizeF & size,
qreal divisor )
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Divides the given size by the given divisor and returns the result.

The divisor must not be either zero or NaN.

See also
QSizeF::scale()

Definition at line 263 of file qsize.h.

◆ operator<<()

QDataStream & operator<< ( QDataStream & stream,
const QSizeF & size )
related

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

See also
{Serializing Qt Data Types}

Definition at line 827 of file qsize.cpp.

References height(), and width().

+ Here is the call graph for this function:

◆ operator==

bool QSizeF::operator== ( const QSizeF & s1,
const QSizeF & s2 )
friend

Returns true if s1 and s2 are approximately equal; otherwise returns false.

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

Definition at line 247 of file qsize.h.

◆ operator>>()

QDataStream & operator>> ( QDataStream & stream,
QSizeF & size )
related

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

See also
{Serializing Qt Data Types}

Definition at line 843 of file qsize.cpp.

References setHeight(), and setWidth().

+ Here is the call graph for this function:

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