diff options
author | Sze Howe Koh <szehowe.koh@gmail.com> | 2019-09-02 07:32:49 +0800 |
---|---|---|
committer | Sze Howe Koh <szehowe.koh@gmail.com> | 2020-01-26 01:19:38 +0800 |
commit | 114ff44f3c42e2575c60e6b5c8459acfea2dc60d (patch) | |
tree | d4c3b28279a49f079e8886c0aec0c4a2f6088543 /src/widgets/widgets/qlabel.h | |
parent | e9a797799ee7e81d1cd113ba56f62705ae150e5c (diff) |
QLabel: Allow pixmap() and picture() to return by-value
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 <aha_1980@gmx.de>
Diffstat (limited to 'src/widgets/widgets/qlabel.h')
-rw-r--r-- | src/widgets/widgets/qlabel.h | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/widgets/widgets/qlabel.h b/src/widgets/widgets/qlabel.h index 2f5db5a7d3..288022a71e 100644 --- a/src/widgets/widgets/qlabel.h +++ b/src/widgets/widgets/qlabel.h @@ -72,9 +72,25 @@ public: ~QLabel(); QString text() const; - const QPixmap *pixmap() const; + +#if QT_DEPRECATED_SINCE(5,15) + QT_DEPRECATED_VERSION_X(5, 15, "Use the other overload which returns QPixmap by-value") + const QPixmap *pixmap() const; // ### Qt 7: Remove function + + QPixmap pixmap(Qt::ReturnByValue_t) const; +#else + QPixmap pixmap(Qt::ReturnByValue_t = Qt::ReturnByValue) const; // ### Qt 7: Remove arg +#endif // QT_DEPRECATED_SINCE(5,15) + #ifndef QT_NO_PICTURE - const QPicture *picture() const; +# if QT_DEPRECATED_SINCE(5,15) + QT_DEPRECATED_VERSION_X(5, 15, "Use the other overload which returns QPicture by-value") + const QPicture *picture() const; // ### Qt 7: Remove function + + QPicture picture(Qt::ReturnByValue_t) const; +# else + QPicture picture(Qt::ReturnByValue_t = Qt::ReturnByValue) const; // ### Qt 7: Remove arg +# endif // QT_DEPRECATED_SINCE(5,15) #endif #if QT_CONFIG(movie) QMovie *movie() const; |