diff options
Diffstat (limited to 'odb/qt/containers')
-rw-r--r-- | odb/qt/containers/list.hxx | 8 | ||||
-rw-r--r-- | odb/qt/containers/qlinked-list-traits.hxx | 9 | ||||
-rw-r--r-- | odb/qt/containers/qvector-traits.hxx | 10 |
3 files changed, 26 insertions, 1 deletions
diff --git a/odb/qt/containers/list.hxx b/odb/qt/containers/list.hxx index 7fdec25..143deed 100644 --- a/odb/qt/containers/list.hxx +++ b/odb/qt/containers/list.hxx @@ -46,8 +46,14 @@ public: #endif #ifdef ODB_CXX11 - QOdbList(QOdbList &&x): vector_base (std::move (x)), l_ (std::move (x.l_)) {} + QOdbList(QOdbList &&x) noexcept + : vector_base (std::move (x)), l_ (std::move (x.l_)) {} + + // Note: noexcept is not specified since it can throw while reallocating + // impl_. + // QOdbList &operator=(QOdbList &&other); + #if defined(ODB_CXX11_INITIALIZER_LIST) && \ defined(Q_COMPILER_INITIALIZER_LISTS) QOdbList(std::initializer_list<T> il): l_ (il) {} diff --git a/odb/qt/containers/qlinked-list-traits.hxx b/odb/qt/containers/qlinked-list-traits.hxx index 378a472..3bfc9e9 100644 --- a/odb/qt/containers/qlinked-list-traits.hxx +++ b/odb/qt/containers/qlinked-list-traits.hxx @@ -6,6 +6,13 @@ #include <odb/pre.hxx> +#include <QtCore/QtGlobal> // QT_VERSION + +// QLinkedList is deprecated since Qt5 5.15 and in Qt6 it has been moved to a +// separate library. +// +#if (QT_VERSION < 0x050F00) || ODB_QT_FORCE_QLINKEDLIST + #include <QtCore/QLinkedList> #include <odb/container-traits.hxx> @@ -68,6 +75,8 @@ namespace odb }; } +#endif + #include <odb/post.hxx> #endif // ODB_QT_CONTAINER_QLINKED_LIST_TRAITS_HXX diff --git a/odb/qt/containers/qvector-traits.hxx b/odb/qt/containers/qvector-traits.hxx index e3905f7..516475d 100644 --- a/odb/qt/containers/qvector-traits.hxx +++ b/odb/qt/containers/qvector-traits.hxx @@ -6,6 +6,14 @@ #include <odb/pre.hxx> +#include <QtCore/QtGlobal> // QT_VERSION + +// In Qt 6 QVector is an alias for QList. +// +#if QT_VERSION >= 0x060000 +#include <odb/qt/containers/qlist-traits.hxx> +#else + #include <QtCore/QVector> #include <odb/container-traits.hxx> @@ -67,6 +75,8 @@ namespace odb }; } +#endif + #include <odb/post.hxx> #endif // ODB_QT_CONTAINER_QVECTOR_TRAITS_HXX |