QBitmap: restore nothrow move special members
The user-defined dtor inhibits the move special member functions. We cannot do something about it in Qt 5, because the class is exported (which it shouldn't be), and because it's polymorphic (which it also shouldn't be), so we need to supply all the missing member functions manually. Add a note to remove the inheritance from QPixmap in Qt 6. Change-Id: I86a1a3fe7b84247b3e604cb008aa17bb673c8468 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
This commit is contained in:
parent
22d075fef0
commit
d06b4ca9a1
@ -196,6 +196,8 @@ QBitmap &QBitmap::operator=(const QPixmap &pixmap)
|
||||
return *this;
|
||||
}
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
|
||||
/*!
|
||||
Destroys the bitmap.
|
||||
*/
|
||||
@ -203,6 +205,8 @@ QBitmap::~QBitmap()
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*!
|
||||
\fn void QBitmap::swap(QBitmap &other)
|
||||
\since 4.8
|
||||
|
@ -55,7 +55,14 @@ public:
|
||||
QBitmap(int w, int h);
|
||||
explicit QBitmap(const QSize &);
|
||||
explicit QBitmap(const QString &fileName, const char *format = Q_NULLPTR);
|
||||
// ### Qt 6: don't inherit QPixmap
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
QBitmap(const QBitmap &other) : QPixmap(other) {}
|
||||
// QBitmap(QBitmap &&other) : QPixmap(std::move(other)) {} // QPixmap doesn't, yet, have a move ctor
|
||||
QBitmap &operator=(const QBitmap &other) { QPixmap::operator=(other); return *this; }
|
||||
QBitmap &operator=(QBitmap &&other) Q_DECL_NOTHROW { QPixmap::operator=(std::move(other)); return *this; }
|
||||
~QBitmap();
|
||||
#endif
|
||||
|
||||
QBitmap &operator=(const QPixmap &);
|
||||
inline void swap(QBitmap &other) { QPixmap::swap(other); } // prevent QBitmap<->QPixmap swaps
|
||||
|
Loading…
Reference in New Issue
Block a user