diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-04-17 17:19:24 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-04-27 12:21:29 +0200 |
commit | dccf28b7c344822b7459635099ebe3abdf5fd107 (patch) | |
tree | 3acab7b16c02f87ace113cc2f0cc8d9598e219e4 /src/gui/kernel/qcursor.cpp | |
parent | 4ba25a092065a6422510a9f4afa4fbbabeda686c (diff) |
Remove deprecated members from several QtGui classes
Those can be trivially removed as they have direct replacements, or
are completely unused.
The migration path for QCursor::bitmap and QCursor::mask is
QBitmap *pb = c.bitmap(); // up to 5.15, warns in 5.15
QBitmap vb = c.bitmap(Qt::ReturnByValue); // from 5.15, works in 6
QBitmap b = c.bitmap(); // from 6.0 on
Change-Id: I3b3acd1c7f09c4c8414e98b3ce11986f1ecd5eda
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/gui/kernel/qcursor.cpp')
-rw-r--r-- | src/gui/kernel/qcursor.cpp | 81 |
1 files changed, 19 insertions, 62 deletions
diff --git a/src/gui/kernel/qcursor.cpp b/src/gui/kernel/qcursor.cpp index 1efa28a5af..7ebf59290c 100644 --- a/src/gui/kernel/qcursor.cpp +++ b/src/gui/kernel/qcursor.cpp @@ -565,63 +565,25 @@ void QCursor::setShape(Qt::CursorShape shape) } } -#if QT_DEPRECATED_SINCE(5, 15) /*! - \deprecated - - New code should use the other overload which returns QBitmap by-value. + \fn QBitmap QCursor::bitmap(Qt::ReturnByValueConstant) const + \since 5.15 + \obsolete Use the overload without argument instead. - Returns the cursor bitmap, or \nullptr if it is one of the + Returns the cursor bitmap, or a null bitmap if it is one of the standard cursors. -*/ -const QBitmap *QCursor::bitmap() const -{ - if (!QCursorData::initialized) - QCursorData::initialize(); - return d->bm; -} -/*! - \deprecated - - New code should use the other overload which returns QBitmap by-value. - - Returns the cursor bitmap mask, or \nullptr if it is one of the - standard cursors. + Previously, Qt provided a version of \c bitmap() which returned the bitmap + by-pointer. That version is now removed. To maintain compatibility + with old code, this function was provided to differentiate between the by-pointer + function and the by-value function. */ -const QBitmap *QCursor::mask() const -{ - if (!QCursorData::initialized) - QCursorData::initialize(); - return d->bmm; -} -#endif // QT_DEPRECATED_SINCE(5, 15) - /*! - \since 5.15 - Returns the cursor bitmap, or a null bitmap if it is one of the standard cursors. - - Previously, Qt provided a version of \c bitmap() which returned the bitmap - by-pointer. That version is now deprecated. To maintain compatibility - with old code, you can explicitly differentiate between the by-pointer - function and the by-value function: - - \code - const QBitmap *bmpPtr = cursor->bitmap(); - QBitmap bmpVal = cursor->bitmap(Qt::ReturnByValue); - \endcode - - If you disable the deprecated version using the QT_DISABLE_DEPRECATED_BEFORE - macro, then you can omit \c Qt::ReturnByValue as shown below: - - \code - QBitmap bmpVal = cursor->bitmap(); - \endcode */ -QBitmap QCursor::bitmap(Qt::ReturnByValueConstant) const +QBitmap QCursor::bitmap() const { if (!QCursorData::initialized) QCursorData::initialize(); @@ -631,29 +593,24 @@ QBitmap QCursor::bitmap(Qt::ReturnByValueConstant) const } /*! + \fn QBitmap QCursor::mask(Qt::ReturnByValueConstant) const \since 5.15 + \obsolete Use the overload without argument instead. Returns the cursor bitmap mask, or a null bitmap if it is one of the standard cursors. Previously, Qt provided a version of \c mask() which returned the bitmap - by-pointer. That version is now deprecated. To maintain compatibility - with old code, you can explicitly differentiate between the by-pointer - function and the by-value function: - - \code - const QBitmap *bmpPtr = cursor->mask(); - QBitmap bmpVal = cursor->mask(Qt::ReturnByValue); - \endcode - - If you disable the deprecated version using the QT_DISABLE_DEPRECATED_BEFORE - macro, then you can omit \c Qt::ReturnByValue as shown below: + by-pointer. That version is now removed. To maintain compatibility + with old code, this function was provided to differentiate between the by-pointer + function and the by-value function. +*/ - \code - QBitmap bmpVal = cursor->mask(); - \endcode +/*! + Returns the cursor bitmap mask, or a null bitmap if it is one of the + standard cursors. */ -QBitmap QCursor::mask(Qt::ReturnByValueConstant) const +QBitmap QCursor::mask() const { if (!QCursorData::initialized) QCursorData::initialize(); |