QSqlIndex: implement member swap() and use a macro for move-assignment
Also declare the type as shared using Q_DECLARE_SHARED
Found during Qt 6.6 API review.
This commit amends 46e909a37a
.
[ChangeLog][QtSql] QSqlIndex is now a relocatable type.
Pick-to: 6.6
Change-Id: I78394cba082b4df2e4d8a6aab8e8e87f2340962c
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This commit is contained in:
parent
2f87711913
commit
f081578ce0
@ -20,7 +20,14 @@ public:
|
|||||||
QSqlIndex(QSqlIndex &&other) noexcept = default;
|
QSqlIndex(QSqlIndex &&other) noexcept = default;
|
||||||
~QSqlIndex();
|
~QSqlIndex();
|
||||||
QSqlIndex &operator=(const QSqlIndex &other);
|
QSqlIndex &operator=(const QSqlIndex &other);
|
||||||
QSqlIndex &operator=(QSqlIndex &&other) = default;
|
QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QSqlIndex)
|
||||||
|
|
||||||
|
void swap(QSqlIndex &other) noexcept {
|
||||||
|
QSqlRecord::swap(other);
|
||||||
|
cursor.swap(other.cursor);
|
||||||
|
nm.swap(other.nm);
|
||||||
|
sorts.swap(other.sorts);
|
||||||
|
};
|
||||||
|
|
||||||
void setCursorName(const QString &cursorName);
|
void setCursorName(const QString &cursorName);
|
||||||
inline QString cursorName() const { return cursor; }
|
inline QString cursorName() const { return cursor; }
|
||||||
@ -41,6 +48,8 @@ private:
|
|||||||
QList<bool> sorts;
|
QList<bool> sorts;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Q_DECLARE_SHARED(QSqlIndex)
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#endif // QSQLINDEX_H
|
#endif // QSQLINDEX_H
|
||||||
|
Loading…
Reference in New Issue
Block a user