From 98293ba71d20574e4ec6635e33120dffd3714ef4 Mon Sep 17 00:00:00 2001 From: Yuhang Zhao <2546789017@qq.com> Date: Mon, 5 Sep 2022 10:03:03 +0800 Subject: [PATCH] Doc: Add missing since 6.2 to QImage and QPixmap The deviceIndependentSize() function of QImage and QPixmap was added in Qt 6.2 but their docs are missing this information, so add them. And it seems the QImage docs were copied from QPixmap, so it still reference to pixmap, not image, fix it as a drive-by. Change-Id: Ic3d0a2019b5e9b89bd8723d994d7ae54f2cb5257 Reviewed-by: Volker Hilsheimer (cherry picked from commit 0d20e6e4957b3842b659522f330b8a201ef8e505) Reviewed-by: Qt Cherry-pick Bot --- src/gui/image/qimage.cpp | 8 +++++--- src/gui/image/qpixmap.cpp | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 26fbb7205a7..c8ce42f4b98 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -1499,12 +1499,14 @@ void QImage::setDevicePixelRatio(qreal scaleFactor) } /*! - Returns the size of the pixmap in device independent pixels. + Returns the size of the image in device independent pixels. - This value should be used when using the pixmap size in user interface + This value should be used when using the image size in user interface size calculations. - The return value is equivalent to pixmap.size() / pixmap.devicePixelRatio(), + The return value is equivalent to image.size() / image.devicePixelRatio(). + + \since 6.2 */ QSizeF QImage::deviceIndependentSize() const { diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index 89fd62305b0..d5373121db6 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -654,7 +654,9 @@ void QPixmap::setDevicePixelRatio(qreal scaleFactor) This value should be used when using the pixmap size in user interface size calculations. - The return value is equivalent to pixmap.size() / pixmap.devicePixelRatio(), + The return value is equivalent to pixmap.size() / pixmap.devicePixelRatio(). + + \since 6.2 */ QSizeF QPixmap::deviceIndependentSize() const {