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

\inmodule QtCore More...

#include <qsize.h>

+ Collaboration diagram for QSize:

Public Member Functions

constexpr QSize () noexcept
 Constructs a size with an invalid width and height (i.e., isValid() returns false).
 
constexpr QSize (int w, int h) noexcept
 Constructs a size with the given width and height.
 
constexpr bool isNull () const noexcept
 Returns true if both the width and height is 0; 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 is equal to or greater than 0; otherwise returns false.
 
constexpr int width () const noexcept
 Returns the width.
 
constexpr int height () const noexcept
 Returns the height.
 
constexpr void setWidth (int w) noexcept
 Sets the width to the given width.
 
constexpr void setHeight (int h) noexcept
 Sets the height to the given height.
 
void transpose () noexcept
 Swaps the width and height values.
 
constexpr QSize transposed () const noexcept
 
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:
 
void scale (const QSize &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.
 
QSize scaled (int w, int h, Qt::AspectRatioMode mode) const noexcept
 
QSize scaled (const QSize &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 QSize expandedTo (const QSize &) const noexcept
 Returns a size holding the maximum width and height of this size and the given otherSize.
 
constexpr QSize boundedTo (const QSize &) const noexcept
 Returns a size holding the minimum width and height of this size and the given otherSize.
 
constexpr QSize grownBy (QMargins m) const noexcept
 
constexpr QSize shrunkBy (QMargins m) const noexcept
 
constexpr int & rwidth () noexcept
 Returns a reference to the width.
 
constexpr int & rheight () noexcept
 Returns a reference to the height.
 
constexpr QSizeoperator+= (const QSize &) noexcept
 Adds the given size to this size, and returns a reference to this size.
 
constexpr QSizeoperator-= (const QSize &) noexcept
 Subtracts the given size from this size, and returns a reference to this size.
 
constexpr QSizeoperator*= (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 factor, and returns a reference to the size.
 
QSizeoperator/= (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 QSizeF toSizeF () const noexcept
 

Friends

constexpr bool operator== (const QSize &s1, const QSize &s2) noexcept
 Returns true if s1 and s2 are equal; otherwise returns false.
 
constexpr bool operator!= (const QSize &s1, const QSize &s2) noexcept
 Returns true if s1 and s2 are different; otherwise returns false.
 
constexpr QSize operator+ (const QSize &s1, const QSize &s2) noexcept
 Returns the sum of s1 and s2; each component is added separately.
 
constexpr QSize operator- (const QSize &s1, const QSize &s2) noexcept
 Returns s2 subtracted from s1; each component is subtracted separately.
 
constexpr QSize operator* (const QSize &s, qreal c) noexcept
 Multiplies the given size by the given factor, and returns the result rounded to the nearest integer.
 
constexpr QSize operator* (qreal c, const QSize &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 factor, and returns the result rounded to the nearest integer.
 
QSize operator/ (const QSize &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 rounded to the nearest integer.
 
constexpr size_t qHash (const QSize &, size_t) noexcept
 
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 >, QSize >, bool > = true>
constexpr decltype(auto) get (S &&s) noexcept
 

Related Symbols

(Note that these are not member symbols.)

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

Detailed Description

\inmodule QtCore

The QSize class defines the size of a two-dimensional object using integer 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.

QSize objects can be streamed as well as compared.

See also
QSizeF, QPoint, QRect

Definition at line 24 of file qsize.h.

Constructor & Destructor Documentation

◆ QSize() [1/2]

constexpr QSize::QSize ( )
inlineconstexprnoexcept

Constructs a size with an invalid width and height (i.e., isValid() returns false).

See also
isValid()

Definition at line 116 of file qsize.h.

Referenced by transposed().

+ Here is the caller graph for this function:

◆ QSize() [2/2]

constexpr QSize::QSize ( int width,
int height )
inlineconstexprnoexcept

Constructs a size with the given width and height.

See also
setWidth(), setHeight()

Definition at line 118 of file qsize.h.

Member Function Documentation

◆ boundedTo()

constexpr QSize QSize::boundedTo ( const QSize & 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 196 of file qsize.h.

References qMin().

Referenced by QFormLayoutPrivate::arrangeWidgets(), QLayout::closestAcceptableSize(), QDockAreaLayout::getGrid(), QTabWidget::heightForWidth(), QBoxLayout::maximumSize(), QWidgetItem::setGeometry(), QWaylandXdgToplevel::sizeForResize(), QtPrivate::QWellArray::sizeHint(), QScrollArea::sizeHint(), QTabWidget::sizeHint(), QOpenGLTextureUploader::textureImage(), and QOpenGL2PaintEngineExPrivate::updateBrushTexture().

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

◆ expandedTo()

◆ grownBy()

QSize QSize::grownBy ( QMargins m) const
inlineconstexprnoexcept

Definition at line 49 of file qsize.h.

◆ height()

constexpr int QSize::height ( ) const
inlineconstexprnoexcept

Returns the height.

See also
width(), setHeight()

Definition at line 132 of file qsize.h.

Referenced by DrmEglServerBuffer::DrmEglServerBuffer(), LibHybrisEglServerBuffer::LibHybrisEglServerBuffer(), QSGRhiAtlasTexture::Manager::Manager(), QtPrivate::PageItem::PageItem(), QEGLPbuffer::QEGLPbuffer(), QGLXPbuffer::QGLXPbuffer(), QOpenVGOffscreenSurface::QOpenVGOffscreenSurface(), QQnxScreen::QQnxScreen(), QRollEffect::QRollEffect(), QWasmOffscreenSurface::QWasmOffscreenSurface(), _q_boundGeometryToSizeConstraints(), QAbstractFileIconEngine::actualSize(), QPixmapIconEngine::actualSize(), QSSGRenderReflectionMap::addReflectionMapEntry(), QLayout::alignmentRect(), QAndroidCameraSession::applyResolution(), QWindowGeometrySpecification::applyTo(), QWindowsGeometryHint::applyToMinMaxInfo(), QMacStylePrivate::aquaSizeConstrain(), avfVideoSettings(), basicSize(), QOpenGL2PaintEngineEx::begin(), QOpenGL2PaintEngineEx::beginNativePainting(), QQuickContext2DImageTexture::beginPainting(), QtWaylandClient::DecorationsBlitter::blit(), QPlatformGraphicsBuffer::byteCount(), QMenuBarPrivate::calcActionRects(), QQuickBorderImagePrivate::calculateRects(), QQuickTableViewPrivate::calculateTopLeft(), QQuickContext2DTexture::canvasChanged(), QQuickTableViewPrivate::cellAtModelIndex(), QEglFSKmsGbmCursor::changeCursor(), QSSGRhiContext::checkAndAdjustForNPoT(), QGeoMapPrivate::clampVisibleArea(), QWidgetWindowPrivate::closestAcceptableGeometry(), QLayout::closestAcceptableSize(), QSGPlainTexture::commitTextureOperations(), QFFmpegVideoBuffer::convertSWFrame(), QXcbWindow::create(), QD3D11RenderBuffer::create(), QMetalRenderBuffer::create(), QVkTextureRenderTarget::create(), QGeoCameraTilesPrivate::createFrustum(), QEglFSOpenWFDIntegration::createNativeWindow(), QD3D11SwapChain::createOrResize(), QMetalSwapChain::createOrResize(), QVkSwapChain::createOrResize(), createRhiRenderTargetMultiView(), createRhiRenderTargetWithDepthTexture(), QQuickContext2DTexture::createTiles(), QRhiVulkan::createTransientImage(), QIconModeViewBase::dataChanged(), QQuickScreenInfo::desktopAvailableHeight(), QItemDelegate::doLayout(), QXcbVirtualDesktop::dpi(), QQC2::QWindowsXPStyle::drawComplexControl(), QGraphicsScenePrivate::drawItemHelper(), QWindowsVistaStyle::drawPrimitive(), QRhiD3D11::enqueueResourceUpdates(), QRhiMetal::enqueueSubresUpload(), QSGRhiAtlasTexture::Atlas::enqueueTextureUpload(), QSGRenderThread::ensureRhi(), QRhiWidgetPrivate::ensureTexture(), QFFmpeg::findHwEncoder(), QToolBarAreaLayoutInfo::fitLayout(), QVideoFrameFormat::frameHeight(), QWindowsGeometryHint::frameSizeConstraints(), QSGCompressedAtlasTexture::Atlas::generateTexture(), QQnxWindowGrabberImage::getBuffer(), QQuick3DSceneRenderer::getRayFromViewportPos(), QEglFSScreen::grabWindow(), QWindowsScreen::grabWindow(), QXcbScreen::grabWindow(), QScreen::grabWindow(), QXcbWindow::handleConfigureNotifyEvent(), QWindowsWindow::handleDpiScaledSize(), QWindowsWindow::handleNonClientHitTest(), QQuickScreenInfo::height(), QSGRhiTextureGlyphCache::height(), QVideoFrame::height(), QQuick3DTextureDataFrontend::height(), QSvgTinyDocument::height(), QTableViewPrivate::heightHintForIndex(), QtWaylandClient::QWaylandShmBuffer::imageInsideMargins(), QQuickAnimatedImagePrivate::infoForCurrentFrame(), QOpenGLFramebufferObjectPrivate::initDepthStencilAttachments(), ExampleRhiWidget::initialize(), ExampleRhiItemRenderer::initialize(), QQuickNinePatchNode::initialize(), QStyledItemDelegate::initStyleOption(), QColorDialogPrivate::initWidgets(), QQuickGridLayout::insertLayoutItems(), QQuickTextImageHandler::intrinsicSize(), QWidgetPrivate::invalidateBackingStore_resizeHelper(), QProgressDialogPrivate::layout(), QTabBarPrivate::layoutTabs(), QtWaylandClient::LibHybrisServerBuffer::libhybris_buffer_add_fd(), QPixmapStyle::lineEditSizeFromContents(), QWindowsPrintDevice::loadMinMaxPageSizes(), QQuickImageProviderWithOptions::loadSize(), QSSGLoadedTexture::loadTextureData(), QCocoaPrintDevice::macPaper(), QD3D11TextureVideoBuffer::map(), QWaylandQuickItem::mapToSurface(), QListModeViewBase::mapToViewport(), menuBarHeightForWidth(), QOpenGLPaintDevice::metric(), QMainWindowLayout::minimumSize(), QDialog::minimumSizeHint(), QLabel::minimumSizeHint(), QMenuBar::minimumSizeHint(), QQuickTableViewPrivate::modelIndexAtCell(), QTest::mouseEvent(), QWidgetResizeHandler::mouseMoveEvent(), QRhi::newTexture(), QRhi::newTextureArray(), QQuickTableViewPrivate::nextVisibleEdgeIndex(), operator<<(), operator<<(), operator<<(), QSGOpenVGPainterNode::paint(), QSGSoftwarePainterNode::paint(), QSGDefaultPainterNode::paint(), QSGSoftwarePainterNode::paint(), QtPrivate::PageItem::paint(), QPagePreview::paintEvent(), QScreen::physicalDotsPerInch(), QScreen::physicalDotsPerInchY(), QQC2_NAMESPACE::QMacStyle::pixelMetric(), PixmapEntry::pixmap(), QIconPrivate::pixmapDevicePixelRatio(), printRenderPassDetails(), QQuickTableViewPrivate::processRebuildTable(), QCocoaWindow::propagateSizeHints(), QXcbWindow::propagateSizeHints(), QPixmapStyle::pushButtonSizeFromContents(), Q_TRACE_INSTRUMENT(), qCalculateFrameSize(), qrhi_toTopLeftRenderTargetRect(), qSmartMinSize(), qt_aqua_get_known_size(), QQC2_NAMESPACE::qt_aqua_get_known_size(), QLinuxMediaDevice::CaptureSubDevice::queueBuffer(), QEglFSKmsScreen::rawGeometry(), QImageReader::read(), QTiffHandler::read(), QSvgIOHandler::read(), QPdfIOHandler::read(), read_image_scaled(), read_jpeg_image(), QOpenVGOffscreenSurface::readbackQImage(), QGraphicsViewPrivate::recalculateContentSize(), QComboBoxPrivate::recomputeSizeHint(), QSGOpenVGInternalImageNode::render(), ExampleRhiWidget::render(), ExampleRhiItemRenderer::render(), QQuick3DSceneRenderer::renderToRhiTexture(), QListView::resizeEvent(), QSGRhiTextureGlyphCache::resizeTextureData(), QMdiAreaPrivate::resizeToMinimumTileSize(), DmaBufServerBuffer::resourceForClient(), DrmEglServerBuffer::resourceForClient(), LibHybrisEglServerBuffer::resourceForClient(), RenderHelpers::rhiRenderAoTexture(), QAlphaWidget::run(), QPixmapIconEngine::scaledPixmap(), QAppleIconEngine::scaledPixmap(), QFFmpeg::VideoFrameEncoder::sendFrame(), QWaylandOutputPrivate::sendGeometry(), QSGAreaAllocator::serialize(), QBlittablePlatformPixmap::setBlittable(), QQnxPlatformCamera::setCameraFormat(), QQuickTableViewPrivate::setCurrentIndexFromKeyEvent(), setDisplayMetrics(), EvrVideoWindowControl::setDisplayRect(), QSplitterPrivate::setGeo(), QWidgetItem::setGeometry(), QWindowPrivate::setMinOrMaxSize(), QMdiSubWindowPrivate::setNewGeometry(), QQuickVideoOutput::setOrientation(), QEglFSKmsGbmCursor::setPos(), QGstCaps::setResolution(), QQnxScreen::setRotation(), QListView::setSelection(), QQuickTableViewPrivate::setSelectionEndPos(), QSGDefaultSpriteNode::setSheetSize(), QtWaylandClient::QWaylandXdgSurface::setSizeHints(), QSGDefaultSpriteNode::setSourceA(), QSGDefaultSpriteNode::setSourceB(), QSGDefaultSpriteNode::setSpriteSize(), QWizardHeader::setup(), setup_qt(), QGeoTiledMapScenePrivate::setupCamera(), QBoxLayoutPrivate::setupGeom(), QFormLayoutPrivate::setupHfwLayoutData(), QWasmVideoOutput::setVideoSize(), QMdiSubWindowPrivate::setWindowFlags(), QCocoaMenu::showPopup(), QSvgTinyDocument::size(), QPageSizePrivate::size(), QDockWidgetLayout::sizeFromContent(), QAndroidStyle::AndroidControl::sizeFromContents(), QAndroidStyle::AndroidProgressBarControl::sizeFromContents(), QQC2_NAMESPACE::QMacStyle::sizeFromContents(), QQC2::QWindowsStyle::sizeFromContents(), QAndroidStyle::sizeFromContents(), QMacStyle::sizeFromContents(), QCommonStyle::sizeFromContents(), QQC2::QWindowsXPStyle::sizeFromContents(), QWindowsVistaStyle::sizeFromContents(), QDialog::sizeHint(), QCheckBox::sizeHint(), QDockWidgetTitleButton::sizeHint(), QMenuBar::sizeHint(), QPushButton::sizeHint(), QRadioButton::sizeHint(), QScrollArea::sizeHint(), QToolBoxButton::sizeHint(), QSSGParticleBuffer::sliceCount(), QOpenGLTextureBlitter::sourceTransform(), sourceTransform(), QSSGRhiContextStats::stop(), QQC2_NAMESPACE::QMacStyle::subElementRect(), QQC2::QCommonStyle::subElementRect(), QMacStyle::subElementRect(), QCommonStyle::subElementRect(), QQuickRhiItemNode::sync(), QSGRenderThread::sync(), QSGRenderThread::syncAndRender(), QQuick3DSceneRenderer::synchronize(), QQuickTableViewPrivate::syncSyncView(), QTabBar::tabSizeHint(), SharedTextureFactory::textureByteCount(), QOpenGLTextureUploader::textureImage(), QtWaylandClient::DmaBufServerBuffer::toOpenGlTexture(), QtWaylandClient::DrmServerBuffer::toOpenGlTexture(), QtWaylandClient::LibHybrisServerBuffer::toOpenGlTexture(), QtWaylandClient::ShmServerBuffer::toOpenGlTexture(), VulkanServerBuffer::toOpenGlTexture(), LinuxDmabufClientBuffer::toOpenGlTexture(), WaylandEglClientBuffer::toOpenGlTexture(), QSGSoftwareRenderableNode::update(), QVideoTextureHelper::SubtitleLayout::update(), QMenuPrivate::updateActionRects(), QQuickTableViewPrivate::updateAverageRowHeight(), QOpenGL2PaintEngineExPrivate::updateBrushTexture(), QQuickTableViewPrivate::updateContentHeight(), QWaylandQtShellChromePrivate::updateDecorationInteraction(), QQuickTableViewPrivate::updateExtents(), QTableView::updateGeometries(), QQuickGridMesh::updateGeometry(), QCommonListViewBase::updateHorizontalScrollBar(), QWizardPrivate::updateMinMaxSizes(), QQuickShaderEffectSource::updatePaintNode(), QWaylandQuickItem::updatePaintNode(), AndroidCameraPrivate::updatePreviewSize(), QGeoMapMapboxGLPrivate::updateSceneGraph(), QTreeViewPrivate::updateScrollBars(), QMessageBoxPrivate::updateSize(), QQuick3DTexture::updateSpatialNode(), QVideoTextureHelper::updateUniformData(), QCommonListViewBase::updateVerticalScrollBar(), QListModeViewBase::updateVerticalScrollBar(), videoFramePlaneAsImage(), QListView::viewportSizeHint(), QEglFSKmsEglDeviceScreen::waitForFlip(), QTest::wheelEvent(), QSSGMesh::MeshInternal::writeMeshData(), QWaylandXdgToplevelPrivate::xdg_toplevel_set_max_size(), QWaylandXdgToplevelPrivate::xdg_toplevel_set_min_size(), and QWaylandXdgOutputV1Private::zxdg_output_v1_bind_resource().

◆ isEmpty()

constexpr bool QSize::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 123 of file qsize.h.

Referenced by QtWaylandClient::QWaylandWlShellSurface::applyConfigure(), QAndroidCameraSession::applyResolution(), QOpenGLFramebufferObject::blitFramebuffer(), QMenuBarPrivate::calcActionRects(), QQuickTableViewPrivate::calculateTopLeft(), QD3D11RenderBuffer::create(), QGles2RenderBuffer::create(), QMetalRenderBuffer::create(), QNullTexture::create(), QVkRenderBuffer::create(), QD3D11SwapChain::createOrResize(), QGraphicsScenePrivate::drawItemHelper(), QRhiD3D11::enqueueResourceUpdates(), QRhiGles2::enqueueResourceUpdates(), QRhiVulkan::enqueueResourceUpdates(), QRhiD3D11::enqueueSubresUpload(), QRhiGles2::enqueueSubresUpload(), QRhiMetal::enqueueSubresUpload(), QRhiWidgetPrivate::ensureTexture(), QOffscreenBackingStore::flush(), QXcbBackingStore::flush(), QXcbWindow::handleConfigureNotifyEvent(), QWindowsWindow::handleNonClientHitTest(), QQnxRasterWindow::hasBuffers(), QTextureFileData::isValid(), QQuickImageProviderWithOptions::loadSize(), QPdfEnginePrivate::newPage(), QHaikuRasterBackingStore::paintDevice(), QtWaylandClient::QWaylandScreen::physicalSize(), QSvgIconEngine::pixmap(), QD3D11Texture::prepareCreate(), QGles2Texture::prepareCreate(), QMetalTexture::prepareCreate(), QVkTexture::prepareCreate(), QRhiVulkan::prepareUploadSubres(), QCocoaWindow::propagateSizeHints(), qImageFromVideoFrame(), QImageReader::read(), QSvgIOHandler::read(), read_image_scaled(), read_jpeg_image(), QQuickWidget::resizeEvent(), QOpenGLWidget::resizeEvent(), QRhiWidget::resizeEvent(), QXcbBackingStore::rhiFlush(), QEglFSX11Integration::screenSize(), QQnxWindow::setBufferSize(), QQnxPlatformCamera::setCameraFormat(), QGstreamerImageCapture::setImageSettings(), QSSGRhiEffectSystem::setup(), setup_qt(), QRhiNull::simulateTextureCopy(), QRhiNull::simulateTextureUpload(), QSvgTinyDocument::size(), QAndroidStyle::AndroidControl::sizeFromContents(), QQC2_NAMESPACE::QMacStyle::sizeFromContents(), QQC2::QWindowsStyle::sizeFromContents(), QMacStyle::sizeFromContents(), QQC2::QWindowsXPStyle::sizeFromContents(), QWindows11Style::sizeFromContents(), QWindowsVistaStyle::sizeFromContents(), QQuickView::sizeHint(), QQuickWidget::sizeHint(), QQuickRhiItemNode::sync(), QQuickTableViewPrivate::syncSyncView(), QOpenGLTextureUploader::textureImage(), QMenuPrivate::updateActionRects(), QQuickShaderEffectSource::updatePaintNode(), and QGeoMapMapboxGLPrivate::updateSceneGraph().

◆ isNull()

◆ isValid()

constexpr bool QSize::isValid ( ) const
inlineconstexprnoexcept

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

See also
isNull(), isEmpty()

Definition at line 126 of file qsize.h.

Referenced by QPageSizePrivate::QPageSizePrivate(), QPageSizePrivate::QPageSizePrivate(), QPageSizePrivate::QPageSizePrivate(), QtWaylandClient::QWaylandShmBackingStore::QWaylandShmBackingStore(), QtWaylandClient::QWaylandQtSurface::applyConfigure(), QFormLayoutPrivate::arrangeWidgets(), createVideoProfile(), QIconModeViewBase::dataChanged(), QGraphicsScenePrivate::drawItemHelper(), QScreen::grabWindow(), QListModeViewBase::indexToListViewItem(), QFileDialogPrivate::init(), QCocoaWindow::isFixedSize(), QPageSizePrivate::isValid(), QVideoFrameFormat::isValid(), QListViewPrivate::itemSize(), QMainWindowLayout::minimumSize(), QSplitter::minimumSizeHint(), QFFmpegImageCapture::newVideoFrame(), QCocoaWindow::propagateSizeHints(), QXcbWindow::propagateSizeHints(), qt_unique_device_formats(), QImageReader::read(), QSvgIOHandler::read(), QPdfIOHandler::read(), read_jpeg_image(), QPngHandlerPrivate::readPngImage(), QComboBoxPrivate::recomputeSizeHint(), QSGOpenVGInternalImageNode::render(), QQnxWindow::setBufferSize(), QMainWindow::setIconSize(), QToolBar::setIconSize(), QMdiSubWindowPrivate::setMaximizeMode(), QAndroidMediaPlayer::setMedia(), QGstCaps::setResolution(), QGstreamerVideoOutput::setVideoSink(), QWidgetRepaintManager::sync(), AndroidCameraPrivate::updatePreviewSize(), QGraphicsProxyWidgetPrivate::updateProxyGeometryFromWidget(), QTreeViewPrivate::updateScrollBars(), QQuickViewPrivate::updateSize(), QQuickWidgetPrivate::updateSize(), QGstreamerVideoDevices::videoDevices(), QListView::viewportSizeHint(), QWaylandViewporterPrivate::Viewport::wp_viewport_set_destination(), QWaylandXdgToplevelPrivate::xdg_toplevel_set_max_size(), and QWaylandXdgToplevelPrivate::xdg_toplevel_set_min_size().

+ Here is the caller graph for this function:

◆ operator*=()

constexpr QSize & QSize::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 factor, and returns a reference to the size.

Note that the result is rounded to the nearest integer.

See also
scale()

Definition at line 173 of file qsize.h.

References qRound().

+ Here is the call graph for this function:

◆ operator+=()

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

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

For example:

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

Definition at line 159 of file qsize.h.

◆ operator-=()

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

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

For example:

QSize s( 3, 7);
QSize r(-1, 4);
s -= r;
// s becomes (4,3)

Definition at line 166 of file qsize.h.

◆ operator/=()

QSize & QSize::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.

Note that the result is rounded to the nearest integer.

See also
QSize::scale()

Definition at line 183 of file qsize.h.

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

+ Here is the call graph for this function:

◆ rheight()

constexpr int & QSize::rheight ( )
inlineconstexprnoexcept

◆ rwidth()

constexpr int & QSize::rwidth ( )
inlineconstexprnoexcept

Returns a reference to the width.

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

QSize size(100, 10);
size.rwidth() += 20;
// size becomes (120,10)
See also
rheight(), setWidth()

Definition at line 153 of file qsize.h.

Referenced by QFormLayoutPrivate::calcSizeHints(), QItemDelegate::doLayout(), QWindowsGeometryHint::frameSizeConstraints(), NS_IIOF_HELPERS::QIIOFHelper::imageProperty(), QKmsScreenConfig::loadConfig(), QLabel::minimumSizeHint(), operator>>(), QComboBoxPrivate::recomputeSizeHint(), QQC2_NAMESPACE::QMacStyle::sizeFromContents(), QAndroidStyle::sizeFromContents(), QMacStyle::sizeFromContents(), QQC2::QWindowsXPStyle::sizeFromContents(), QWindowsVistaStyle::sizeFromContents(), QQuickShaderEffectSource::updatePaintNode(), QMdiAreaPrivate::updateScrollBars(), and QQuick3DTexture::updateSpatialNode().

+ Here is the caller graph for this function:

◆ scale() [1/2]

void QSize::scale ( const QSize & 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 147 of file qsize.h.

References scaled().

+ Here is the call graph for this function:

◆ scale() [2/2]

void QSize::scale ( int width,
int 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:

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

Definition at line 144 of file qsize.h.

Referenced by QAbstractFileIconEngine::actualSize(), QPixmapIconEngine::actualSize(), PixmapEntry::pixmap(), QSvgIconEngine::pixmap(), QPixmapIconEngine::scaledPixmap(), EvrVideoWindowControl::setDisplayRect(), and QVideoTextureHelper::updateUniformData().

+ Here is the caller graph for this function:

◆ scaled() [1/2]

QSize QSize::scaled ( const QSize & 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

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

Definition at line 189 of file qsize.cpp.

References Qt::IgnoreAspectRatio, and Qt::KeepAspectRatio.

◆ scaled() [2/2]

QSize QSize::scaled ( int width,
int height,
Qt::AspectRatioMode mode ) const
inlinenoexcept
Since
5.0

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

See also
scale()

Definition at line 150 of file qsize.h.

References scaled().

Referenced by createBitmapCursor(), QPagePreview::paintEvent(), and QRhiNull::simulateTextureGenMips().

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

◆ setHeight()

constexpr void QSize::setHeight ( int height)
inlineconstexprnoexcept

Sets the height to the given height.

See also
rheight(), height(), setWidth()

Definition at line 138 of file qsize.h.

Referenced by QAndroidStyle::AndroidImageDrawable::AndroidImageDrawable(), QAndroidStyle::AndroidProgressBarControl::AndroidProgressBarControl(), QLayout::activate(), QWidgetPrivate::adjustedSize(), QItemDelegate::doLayout(), QRhiWidgetPrivate::ensureTexture(), QWindowsGeometryHint::frameSizeConstraints(), QProgressDialogPrivate::layout(), metaDataValue(), QEglFSOpenWFDIntegration::platformInit(), QEglFSVivIntegration::platformInit(), QEglFSVivWaylandIntegration::platformInit(), QImageReader::read(), QSGNinePatchNode::rebuildGeometry(), QComboBoxPrivate::recomputeSizeHint(), QQuickViewPrivate::rootObjectSize(), QQuickWidgetPrivate::rootObjectSize(), QWidgetItem::setGeometry(), QSvgTinyDocument::setHeight(), QMdiSubWindowPrivate::setMaximizeMode(), QMdiSubWindowPrivate::setNormalMode(), QDockWidgetLayout::sizeFromContent(), QAndroidStyle::AndroidControl::sizeFromContents(), QAndroidStyle::AndroidProgressBarControl::sizeFromContents(), QQC2_NAMESPACE::QMacStyle::sizeFromContents(), QQC2::QCommonStyle::sizeFromContents(), QQC2::QWindowsStyle::sizeFromContents(), QAndroidStyle::sizeFromContents(), QMacStyle::sizeFromContents(), QCommonStyle::sizeFromContents(), QQC2::QWindowsXPStyle::sizeFromContents(), QWindows11Style::sizeFromContents(), QWindowsVistaStyle::sizeFromContents(), QWizard::sizeHint(), QScrollArea::sizeHint(), QQuickRhiItemNode::sync(), QOpenGLTextureUploader::textureImage(), QMenuPrivate::updateActionRects(), QOpenGL2PaintEngineExPrivate::updateBrushTexture(), QWizardPrivate::updateMinMaxSizes(), and QListView::viewportSizeHint().

+ Here is the caller graph for this function:

◆ setWidth()

constexpr void QSize::setWidth ( int width)
inlineconstexprnoexcept

Sets the width to the given width.

See also
rwidth(), width(), setHeight()

Definition at line 135 of file qsize.h.

Referenced by QAndroidStyle::AndroidImageDrawable::AndroidImageDrawable(), QAndroidStyle::AndroidProgressBarControl::AndroidProgressBarControl(), QLayout::activate(), QLayout::alignmentRect(), QWindowsVistaStyle::drawPrimitive(), QRhiWidgetPrivate::ensureTexture(), QWindowsGeometryHint::frameSizeConstraints(), QToolBarAreaLayout::minimumSize(), QMenuBar::minimumSizeHint(), QSvgPattern::patternImage(), QEglFSOpenWFDIntegration::platformInit(), QEglFSVivIntegration::platformInit(), QEglFSVivWaylandIntegration::platformInit(), QImageReader::read(), QComboBoxPrivate::recomputeSizeHint(), QQuickViewPrivate::rootObjectSize(), QQuickWidgetPrivate::rootObjectSize(), QWidgetItem::setGeometry(), QMdiSubWindowPrivate::setMaximizeMode(), QMdiSubWindowPrivate::setNormalMode(), QSvgTinyDocument::setWidth(), QDockWidgetLayout::sizeFromContent(), QAndroidStyle::AndroidControl::sizeFromContents(), QAndroidStyle::AndroidProgressBarControl::sizeFromContents(), QQC2_NAMESPACE::QMacStyle::sizeFromContents(), QQC2::QWindowsStyle::sizeFromContents(), QAndroidStyle::sizeFromContents(), QMacStyle::sizeFromContents(), QQC2::QWindowsXPStyle::sizeFromContents(), QWindows11Style::sizeFromContents(), QWindowsVistaStyle::sizeFromContents(), QWizard::sizeHint(), QFontComboBox::sizeHint(), QMenuBar::sizeHint(), QScrollArea::sizeHint(), QToolButton::sizeHint(), QToolBarAreaLayout::sizeHint(), QQuickRhiItemNode::sync(), QOpenGLTextureUploader::textureImage(), QMenuPrivate::updateActionRects(), QOpenGL2PaintEngineExPrivate::updateBrushTexture(), QQuickIconImagePrivate::updateIcon(), and QWizardPrivate::updateMinMaxSizes().

+ Here is the caller graph for this function:

◆ shrunkBy()

QSize QSize::shrunkBy ( QMargins m) const
inlineconstexprnoexcept

Definition at line 51 of file qsize.h.

Referenced by QtWaylandClient::QWaylandXdgSurface::setSizeHints(), and QDockWidgetLayout::sizeFromContent().

+ Here is the caller graph for this function:

◆ toSizeF()

constexpr QSizeF QSize::toSizeF ( ) const
inlineconstexprnoexcept
Since
6.4

Returns this size as a size with floating point accuracy.

See also
QSizeF::toSize()

Definition at line 395 of file qsize.h.

◆ transpose()

void QSize::transpose ( )
noexcept

Swaps the width and height values.

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

Definition at line 130 of file qsize.cpp.

References qSwap().

Referenced by QQuickStyleItemScrollBar::calculateGeometry(), QQC2::QWindowsXPStyle::drawComplexControl(), QQuickVideoOutput::setOrientation(), QQC2::QWindowsXPStyle::sizeFromContents(), and QQuickVideoOutput::sourceRect().

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

◆ transposed()

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

Returns a QSize with width and height swapped.

See also
transpose()

Definition at line 141 of file qsize.h.

References QSize().

Referenced by QQnxScreen::QQnxScreen(), QPageLayoutPrivate::fullRectPixels(), QPageLayoutPrivate::fullRectPoints(), QQC2_NAMESPACE::QMacStyle::sizeFromContents(), QMacStyle::sizeFromContents(), QQC2_NAMESPACE::QMacStyle::subElementRect(), QQC2::QCommonStyle::subElementRect(), QMacStyle::subElementRect(), and QCommonStyle::subElementRect().

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

◆ width()

constexpr int QSize::width ( ) const
inlineconstexprnoexcept

Returns the width.

See also
height(), setWidth()

Definition at line 129 of file qsize.h.

Referenced by DrmEglServerBuffer::DrmEglServerBuffer(), LibHybrisEglServerBuffer::LibHybrisEglServerBuffer(), QSGRhiAtlasTexture::Manager::Manager(), QtPrivate::PageItem::PageItem(), QEGLPbuffer::QEGLPbuffer(), QGLXPbuffer::QGLXPbuffer(), QOpenVGOffscreenSurface::QOpenVGOffscreenSurface(), QQnxScreen::QQnxScreen(), QRollEffect::QRollEffect(), QWasmOffscreenSurface::QWasmOffscreenSurface(), _q_boundGeometryToSizeConstraints(), QCalendarWidgetPrivate::_q_yearClicked(), QAbstractFileIconEngine::actualSize(), QPixmapIconEngine::actualSize(), QAppleIconEngine::actualSize(), QSSGRenderReflectionMap::addReflectionMapEntry(), QLayout::alignmentRect(), QWindowGeometrySpecification::applyTo(), QWindowsGeometryHint::applyToMinMaxInfo(), QMacStylePrivate::aquaSizeConstrain(), QFormLayoutPrivate::arrangeWidgets(), avfVideoSettings(), basicSize(), QOpenGL2PaintEngineEx::begin(), QOpenGL2PaintEngineEx::beginNativePainting(), QQuickContext2DImageTexture::beginPainting(), QtWaylandClient::DecorationsBlitter::blit(), QMenuBarPrivate::calcActionRects(), QQuickBorderImagePrivate::calculateRects(), QQuickTableViewPrivate::calculateTopLeft(), QQuickContext2DTexture::canvasChanged(), QQuickTableViewPrivate::cellAtModelIndex(), QEglFSKmsGbmCursor::changeCursor(), QSSGRhiContext::checkAndAdjustForNPoT(), QGeoMapPrivate::clampVisibleArea(), QWidgetWindowPrivate::closestAcceptableGeometry(), closestAcceptableSize(), QLayout::closestAcceptableSize(), QSGPlainTexture::commitTextureOperations(), QComboBoxPrivate::computeWidthHint(), QFFmpegVideoBuffer::convertSWFrame(), QXcbWindow::create(), QD3D11RenderBuffer::create(), QMetalRenderBuffer::create(), QNullTexture::create(), QVkTextureRenderTarget::create(), QGeoCameraTilesPrivate::createFrustum(), QEglFSOpenWFDIntegration::createNativeWindow(), QD3D11SwapChain::createOrResize(), QMetalSwapChain::createOrResize(), QVkSwapChain::createOrResize(), createRhiRenderTargetMultiView(), createRhiRenderTargetWithDepthTexture(), QQuickContext2DTexture::createTiles(), QRhiVulkan::createTransientImage(), QIconModeViewBase::dataChanged(), QQuickScreenInfo::desktopAvailableWidth(), QItemDelegate::doLayout(), QXcbVirtualDesktop::dpi(), QQC2::QWindowsXPStyle::drawComplexControl(), QQC2::QCommonStyle::drawControl(), QCommonStyle::drawControl(), QQC2::QWindowsXPStyle::drawControl(), QWindowsVistaStyle::drawControl(), QGraphicsScenePrivate::drawItemHelper(), QWindowsVistaStyle::drawPrimitive(), QRhiD3D11::enqueueResourceUpdates(), QRhiMetal::enqueueSubresUpload(), QSGRhiAtlasTexture::Atlas::enqueueTextureUpload(), QSGRenderThread::ensureRhi(), QRhiWidgetPrivate::ensureTexture(), QRhiGles2::executeCommandBuffer(), QFFmpeg::findHwEncoder(), QToolBarAreaLayoutInfo::fitLayout(), QWindowsGeometryHint::frameSizeConstraints(), QVideoFrameFormat::frameWidth(), QSGCompressedAtlasTexture::Atlas::generateTexture(), QQnxWindowGrabberImage::getBuffer(), QQuick3DSceneRenderer::getRayFromViewportPos(), QEglFSScreen::grabWindow(), QWindowsScreen::grabWindow(), QXcbScreen::grabWindow(), QScreen::grabWindow(), QXcbWindow::handleConfigureNotifyEvent(), QWindowsWindow::handleDpiScaledSize(), QWindowsWindow::handleNonClientHitTest(), QTabWidget::heightForWidth(), if(), QtWaylandClient::QWaylandShmBuffer::imageInsideMargins(), QListModeViewBase::indexToListViewItem(), QQuickAnimatedImagePrivate::infoForCurrentFrame(), QOpenGLFramebufferObjectPrivate::initDepthStencilAttachments(), ExampleRhiWidget::initialize(), ExampleRhiItemRenderer::initialize(), QQuickNinePatchNode::initialize(), QEglFSKmsVsp2Screen::initQtLayer(), QStyledItemDelegate::initStyleOption(), QColorDialogPrivate::initWidgets(), QQuickGridLayout::insertLayoutItems(), QQuickTextImageHandler::intrinsicSize(), QWidgetPrivate::invalidateBackingStore_resizeHelper(), QProgressDialogPrivate::layout(), QMessageBoxPrivate::layoutMinimumWidth(), QTabBarPrivate::layoutTabs(), QtWaylandClient::LibHybrisServerBuffer::libhybris_buffer_add_fd(), QPixmapStyle::lineEditSizeFromContents(), QWindowsPrintDevice::loadMinMaxPageSizes(), QQuickImageProviderWithOptions::loadSize(), QSSGLoadedTexture::loadTextureData(), QCocoaPrintDevice::macPaper(), QWaylandQuickItem::mapToSurface(), QListModeViewBase::mapToViewport(), QMenuBarPrivate::menuRect(), QOpenGLPaintDevice::metric(), QMainWindowLayout::minimumSize(), QDialog::minimumSizeHint(), QMenuBar::minimumSizeHint(), QTabBar::minimumSizeHint(), QQuickTableViewPrivate::modelIndexAtCell(), QColumnViewGrip::mouseDoubleClickEvent(), QTest::mouseEvent(), QWidgetResizeHandler::mouseMoveEvent(), QQuickTableViewPrivate::nextVisibleEdgeIndex(), operator<<(), operator<<(), operator<<(), QSGOpenVGPainterNode::paint(), QSGSoftwarePainterNode::paint(), QSGDefaultPainterNode::paint(), QSGSoftwarePainterNode::paint(), QmlJSDebugger::SelectionHighlight::paint(), QtPrivate::PageItem::paint(), QFontFamilyDelegate::paint(), QPagePreview::paintEvent(), QFileDialogComboBox::paintEvent(), QScreen::physicalDotsPerInch(), QScreen::physicalDotsPerInchX(), QQC2_NAMESPACE::QMacStyle::pixelMetric(), PixmapEntry::pixmap(), QIconPrivate::pixmapDevicePixelRatio(), QD3D11Texture::prepareCreate(), QGles2Texture::prepareCreate(), QMetalTexture::prepareCreate(), QVkTexture::prepareCreate(), QRhiVulkan::prepareUploadSubres(), printRenderPassDetails(), probeImageData(), QQuickTableViewPrivate::processRebuildTable(), QCocoaWindow::propagateSizeHints(), QXcbWindow::propagateSizeHints(), QPixmapStyle::pushButtonSizeFromContents(), Q_TRACE_INSTRUMENT(), qCalculateFrameSize(), qrhi_toTopLeftRenderTargetRect(), qSmartMinSize(), qt_aqua_get_known_size(), QQC2_NAMESPACE::qt_aqua_get_known_size(), QLinuxMediaDevice::CaptureSubDevice::queueBuffer(), QEglFSKmsScreen::rawGeometry(), QImageReader::read(), QTiffHandler::read(), QSvgIOHandler::read(), QPdfIOHandler::read(), read_image_scaled(), read_jpeg_image(), QOpenVGOffscreenSurface::readbackQImage(), QGraphicsViewPrivate::recalculateContentSize(), QComboBoxPrivate::recomputeSizeHint(), QSGOpenVGInternalImageNode::render(), ExampleRhiWidget::render(), ExampleRhiItemRenderer::render(), QSSGReflectionMapEntry::renderMips(), QQuick3DSceneRenderer::renderToRhiTexture(), QListView::resizeEvent(), QPlainTextEdit::resizeEvent(), QTextEdit::resizeEvent(), QSGRhiTextureGlyphCache::resizeTextureData(), QMdiAreaPrivate::resizeToMinimumTileSize(), DmaBufServerBuffer::resourceForClient(), DrmEglServerBuffer::resourceForClient(), LibHybrisEglServerBuffer::resourceForClient(), RenderHelpers::rhiRenderAoTexture(), QAlphaWidget::run(), QPixmapIconEngine::scaledPixmap(), QAppleIconEngine::scaledPixmap(), QFFmpeg::VideoFrameEncoder::sendFrame(), QWaylandOutputPrivate::sendGeometry(), QSGAreaAllocator::serialize(), QBlittablePlatformPixmap::setBlittable(), QQnxPlatformCamera::setCameraFormat(), QQuickTableViewPrivate::setCurrentIndexFromKeyEvent(), setDisplayMetrics(), EvrVideoWindowControl::setDisplayRect(), QSplitterPrivate::setGeo(), QWidgetItem::setGeometry(), QWindowPrivate::setMinOrMaxSize(), QMdiSubWindowPrivate::setNewGeometry(), QQuickVideoOutput::setOrientation(), QAndroidStyle::AndroidDrawable::setPaddingLeftToSizeWidth(), QEglFSKmsGbmCursor::setPos(), QGstCaps::setResolution(), QQnxScreen::setRotation(), QQuickTableViewPrivate::setSelectionEndPos(), QSGDefaultSpriteNode::setSheetSize(), QtWaylandClient::QWaylandXdgSurface::setSizeHints(), QSGDefaultSpriteNode::setSourceA(), QSGDefaultSpriteNode::setSourceB(), QSGDefaultSpriteNode::setSpriteSize(), setup_qt(), QGeoTiledMapScenePrivate::setupCamera(), QBoxLayoutPrivate::setupGeom(), QFormLayoutPrivate::setupHorizontalLayoutData(), QFormLayoutPrivate::setupVerticalLayoutData(), QWasmVideoOutput::setVideoSize(), QMdiSubWindowPrivate::setWindowFlags(), QRhiNull::simulateTextureUpload(), QSvgTinyDocument::size(), QPageSizePrivate::size(), QWaylandXdgToplevel::sizeForResize(), QWaylandWlShellSurface::sizeForResize(), QDockWidgetLayout::sizeFromContent(), QAndroidStyle::AndroidControl::sizeFromContents(), QAndroidStyle::AndroidProgressBarControl::sizeFromContents(), QQC2_NAMESPACE::QMacStyle::sizeFromContents(), QQC2::QCommonStyle::sizeFromContents(), QQC2::QWindowsStyle::sizeFromContents(), QAndroidStyle::sizeFromContents(), QMacStyle::sizeFromContents(), QCommonStyle::sizeFromContents(), QWindows11Style::sizeFromContents(), QDialog::sizeHint(), QFileDialogTreeView::sizeHint(), QCheckBox::sizeHint(), QDockWidgetTitleButton::sizeHint(), QMenuBar::sizeHint(), QPushButton::sizeHint(), QRadioButton::sizeHint(), QScrollArea::sizeHint(), QToolBoxButton::sizeHint(), QOpenGLTextureBlitter::sourceTransform(), sourceTransform(), QSSGRhiContextStats::stop(), QQC2_NAMESPACE::QMacStyle::subElementRect(), QQC2::QCommonStyle::subElementRect(), QMacStyle::subElementRect(), QCommonStyle::subElementRect(), QQuickRhiItemNode::sync(), QSGRenderThread::sync(), QSGRenderThread::syncAndRender(), QQuick3DSceneRenderer::synchronize(), QQuickTableViewPrivate::syncSyncView(), QTabBar::tabSizeHint(), SharedTextureFactory::textureByteCount(), QOpenGLTextureUploader::textureImage(), QtWaylandClient::DmaBufServerBuffer::toOpenGlTexture(), QtWaylandClient::DrmServerBuffer::toOpenGlTexture(), QtWaylandClient::LibHybrisServerBuffer::toOpenGlTexture(), QtWaylandClient::ShmServerBuffer::toOpenGlTexture(), VulkanServerBuffer::toOpenGlTexture(), LinuxDmabufClientBuffer::toOpenGlTexture(), WaylandEglClientBuffer::toOpenGlTexture(), QSGSoftwareRenderableNode::update(), QVideoTextureHelper::SubtitleLayout::update(), QMenuPrivate::updateActionRects(), QQuickTableViewPrivate::updateAverageColumnWidth(), QOpenGL2PaintEngineExPrivate::updateBrushTexture(), QQuickTableViewPrivate::updateContentWidth(), QWaylandQtShellChromePrivate::updateDecorationInteraction(), QQuickTableViewPrivate::updateExtents(), QMenuBarPrivate::updateGeometries(), QTableView::updateGeometries(), QQuickGridMesh::updateGeometry(), QCommonListViewBase::updateHorizontalScrollBar(), QListModeViewBase::updateHorizontalScrollBar(), QWizardPrivate::updateMinMaxSizes(), QPrintPreviewDialogPrivate::updatePageNumLabel(), QQuickShaderEffectSource::updatePaintNode(), QWaylandQuickItem::updatePaintNode(), AndroidCameraPrivate::updatePreviewSize(), QGeoMapMapboxGLPrivate::updateSceneGraph(), QTreeViewPrivate::updateScrollBars(), QMessageBoxPrivate::updateSize(), QTipLabel::updateSize(), QFormLayoutPrivate::updateSizes(), QQuick3DTexture::updateSpatialNode(), QVideoTextureHelper::updateUniformData(), QCommonListViewBase::updateVerticalScrollBar(), videoFramePlaneAsImage(), QListView::viewportSizeHint(), QEglFSKmsEglDeviceScreen::waitForFlip(), QTest::wheelEvent(), QWidget::width(), QQuickScreenInfo::width(), QSGRhiTextureGlyphCache::width(), QVideoFrame::width(), QQuick3DTextureDataFrontend::width(), QSvgTinyDocument::width(), QTableViewPrivate::widthHintForIndex(), QTreeViewPrivate::widthHintForIndex(), QSSGMesh::MeshInternal::writeMeshData(), QWaylandXdgToplevelPrivate::xdg_toplevel_set_max_size(), QWaylandXdgToplevelPrivate::xdg_toplevel_set_min_size(), and QWaylandXdgOutputV1Private::zxdg_output_v1_bind_resource().

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 >, QSize >, bool > = true>
constexpr decltype(auto) get ( S && s)
friend

Definition at line 92 of file qsize.h.

◆ operator!=

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

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

Definition at line 64 of file qsize.h.

◆ operator* [1/2]

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

Multiplies the given size by the given factor, and returns the result rounded to the nearest integer.

See also
QSize::scale()

Definition at line 70 of file qsize.h.

◆ operator* [2/2]

QSize QSize::operator* ( qreal c,
const QSize & 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 factor, and returns the result rounded to the nearest integer.

Definition at line 72 of file qsize.h.

◆ operator+

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

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

Definition at line 66 of file qsize.h.

◆ operator-

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

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

Definition at line 68 of file qsize.h.

◆ operator/

QSize QSize::operator/ ( const QSize & 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 rounded to the nearest integer.

See also
QSize::scale()

Definition at line 74 of file qsize.h.

◆ operator<<()

QDataStream & operator<< ( QDataStream & stream,
const QSize & 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 393 of file qsize.cpp.

References height(), and width().

+ Here is the call graph for this function:

◆ operator==

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

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

Definition at line 62 of file qsize.h.

◆ operator>>()

QDataStream & operator>> ( QDataStream & stream,
QSize & 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 412 of file qsize.cpp.

References rheight(), and rwidth().

+ Here is the call graph for this function:

◆ qHash

constexpr size_t qHash ( const QSize & s,
size_t seed = 0 )
friend

Definition at line 180 of file qsize.h.


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