diff options
author | Sze Howe Koh <szehowe.koh@gmail.com> | 2019-09-14 18:47:13 +0800 |
---|---|---|
committer | Sze Howe Koh <szehowe.koh@gmail.com> | 2020-01-26 01:19:55 +0800 |
commit | e79a6253813cd67954e371805da547c48ea32d3d (patch) | |
tree | a2533ec61c10c74dfab49af6fff0121af98f6ebb /src/gui/kernel/qcursor.h | |
parent | 114ff44f3c42e2575c60e6b5c8459acfea2dc60d (diff) |
QCursor: Allow bitmap() and mask() 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][QtGui][QCursor] QCursor::bitmap() and QCursor::mask()
can now return by-value instead of by-pointer.
Task-number: QTBUG-48701
Change-Id: I3ca4f0c28d5c831727a60309facfb49c74673bb7
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/gui/kernel/qcursor.h')
-rw-r--r-- | src/gui/kernel/qcursor.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/gui/kernel/qcursor.h b/src/gui/kernel/qcursor.h index 7966e35840..7a11fe59ee 100644 --- a/src/gui/kernel/qcursor.h +++ b/src/gui/kernel/qcursor.h @@ -97,8 +97,19 @@ public: Qt::CursorShape shape() const; void setShape(Qt::CursorShape newShape); - const QBitmap *bitmap() const; - const QBitmap *mask() const; +#if QT_DEPRECATED_SINCE(5, 15) + QT_DEPRECATED_VERSION_X(5, 15, "Use the other overload which returns QBitmap by-value") + const QBitmap *bitmap() const; // ### Qt 7: Remove function + + QT_DEPRECATED_VERSION_X(5, 15, "Use the other overload which returns QBitmap by-value") + const QBitmap *mask() const; // ### Qt 7: Remove function + + QBitmap bitmap(Qt::ReturnByValue_t) const; + QBitmap mask(Qt::ReturnByValue_t) const; +#else + QBitmap bitmap(Qt::ReturnByValue_t = Qt::ReturnByValue) const; // ### Qt 7: Remove arg + QBitmap mask(Qt::ReturnByValue_t = Qt::ReturnByValue) const; // ### Qt 7: Remove arg +#endif // QT_DEPRECATED_SINCE(5, 15) QPixmap pixmap() const; QPoint hotSpot() const; |