From 114ff44f3c42e2575c60e6b5c8459acfea2dc60d Mon Sep 17 00:00:00 2001 From: Sze Howe Koh Date: Mon, 2 Sep 2019 07:32:49 +0800 Subject: QLabel: Allow pixmap() and picture() to return by-value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous versions of these functions that returned by-pointer are held over from Qt 1 times. They are inconsistent with the rest of the Qt API. [ChangeLog][QtWidgets][QLabel] QLabel::pixmap() and QLabel::picture() can now return by-value instead of by-pointer. Task-number: QTBUG-48701 Change-Id: I23ce319a7b1f757e1f4dec697551bb472e92fabf Reviewed-by: André Hartmann --- src/corelib/global/qnamespace.h | 3 +++ src/corelib/global/qnamespace.qdoc | 10 ++++++++++ 2 files changed, 13 insertions(+) (limited to 'src/corelib/global') diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 5b63daec69..8f40393a7e 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -1767,6 +1767,9 @@ public: PassThrough }; + // QTBUG-48701 + enum ReturnByValue_t { ReturnByValue }; // ### Qt 7: Remove me + #ifndef Q_QDOC // NOTE: Generally, do not add QT_Q_ENUM if a corresponding Q_Q_FLAG exists. QT_Q_ENUM(ScrollBarPolicy) diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 6149281904..169c296bcd 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -3319,3 +3319,13 @@ \value RoundPreferFloor Round up for .75 and above. \value PassThrough Don't round. */ + +/*! + \enum Qt::ReturnByValue_t + \since 5.15 + + This is a dummy type, designed to help users transition from certain deprecated APIs to their replacement APIs. + + \sa QLabel::picture() + \sa QLabel::pixmap() +*/ -- cgit v1.2.3