summaryrefslogtreecommitdiff
path: root/libodb-qt
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2024-05-08 21:29:52 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2024-05-16 10:12:03 +0300
commit5ac802457ccf985b334ee81252c185f1d3e1cfb7 (patch)
tree2011186d74b8d662c146d17c65558ef97ff38169 /libodb-qt
parent71be31b2c14a2d72ff9d301be848d4c5f9e8023d (diff)
Add boost/ and qt/ to odb-tests and odb-examples
Diffstat (limited to 'libodb-qt')
-rw-r--r--libodb-qt/manifest1
-rw-r--r--libodb-qt/odb/qt/basic/mssql/qstring-traits.hxx2
-rw-r--r--libodb-qt/odb/qt/basic/oracle/qbyte-array-traits.hxx3
-rw-r--r--libodb-qt/odb/qt/basic/oracle/qstring-traits.hxx3
-rw-r--r--libodb-qt/odb/qt/containers/list.hxx17
-rw-r--r--libodb-qt/odb/qt/containers/list.ixx2
-rw-r--r--libodb-qt/odb/qt/containers/mutable-list-iterator.hxx12
-rw-r--r--libodb-qt/odb/qt/date-time/mysql/qdate-time-traits.hxx6
-rw-r--r--libodb-qt/odb/qt/smart-ptr/lazy-ptr.ixx2
-rw-r--r--libodb-qt/odb/qt/version.hxx.in3
10 files changed, 33 insertions, 18 deletions
diff --git a/libodb-qt/manifest b/libodb-qt/manifest
index 137f93a..b848077 100644
--- a/libodb-qt/manifest
+++ b/libodb-qt/manifest
@@ -15,7 +15,6 @@ email: odb-users@codesynthesis.com
build-warning-email: odb-builds@codesynthesis.com
builds: all
requires: c++11
-requires: libqt-core ; Requires not yet packaged libqt-core.
# @@ TMP Bump the toolchain version to 0.17.0 after it is released.
#
diff --git a/libodb-qt/odb/qt/basic/mssql/qstring-traits.hxx b/libodb-qt/odb/qt/basic/mssql/qstring-traits.hxx
index 779120e..c3528ca 100644
--- a/libodb-qt/odb/qt/basic/mssql/qstring-traits.hxx
+++ b/libodb-qt/odb/qt/basic/mssql/qstring-traits.hxx
@@ -93,7 +93,7 @@ namespace odb
// overload was only added in Qt 4.7.
//
v.resize (static_cast<int> (n));
- std::memcpy (v.data (), b, n * 2);
+ std::memcpy (static_cast<void*> (v.data ()), b, n * 2);
}
}
diff --git a/libodb-qt/odb/qt/basic/oracle/qbyte-array-traits.hxx b/libodb-qt/odb/qt/basic/oracle/qbyte-array-traits.hxx
index 6979cc9..fb8bc8e 100644
--- a/libodb-qt/odb/qt/basic/oracle/qbyte-array-traits.hxx
+++ b/libodb-qt/odb/qt/basic/oracle/qbyte-array-traits.hxx
@@ -118,9 +118,8 @@ namespace odb
case chunk_first:
{
v.clear ();
-
- // Falling through.
}
+ // Fall through.
case chunk_next:
case chunk_last:
{
diff --git a/libodb-qt/odb/qt/basic/oracle/qstring-traits.hxx b/libodb-qt/odb/qt/basic/oracle/qstring-traits.hxx
index 418d30e..e9ccecd 100644
--- a/libodb-qt/odb/qt/basic/oracle/qstring-traits.hxx
+++ b/libodb-qt/odb/qt/basic/oracle/qstring-traits.hxx
@@ -124,9 +124,8 @@ namespace odb
case chunk_first:
{
v.clear ();
-
- // Falling through.
}
+ // Fall through.
case chunk_next:
case chunk_last:
{
diff --git a/libodb-qt/odb/qt/containers/list.hxx b/libodb-qt/odb/qt/containers/list.hxx
index 143deed..90ad660 100644
--- a/libodb-qt/odb/qt/containers/list.hxx
+++ b/libodb-qt/odb/qt/containers/list.hxx
@@ -7,6 +7,8 @@
#include <odb/pre.hxx>
#include <odb/details/config.hxx> // ODB_CXX11
+#include <list>
+
#include <QtCore/QtGlobal> // QT_VERSION
#include <QtCore/QList>
@@ -67,9 +69,14 @@ public:
int size() const {return l_.size ();}
void detach() {l_.detach ();}
+
+#if QT_VERSION < 0x060000
void detachShared() {l_.detachShared ();}
- bool isDetached() const {return l_.isDetached ();}
+
void setSharable(bool sharable) {l_.setSharable (sharable);}
+#endif
+
+ bool isDetached() const {return l_.isDetached ();}
// Implicit conversion.
bool isSharedWith(const QList<T> &x) const {return l_.isSharedWith (x);}
bool isEmpty() const {return l_.isEmpty ();}
@@ -178,16 +185,16 @@ public:
QOdbList &operator<<(const QList<T> &l) {append (l); return *this;}
QVector<T> toVector() const {return l_.toVector ();}
- QSet<T> toSet() const {return l_.toSet ();}
+ QSet<T> toSet() const {return QSet<T> (l_.begin(), l_.end());}
static QOdbList fromVector(const QVector<T> &v)
{return base_list_type::fromVector (v);}
static QOdbList fromSet(const QSet<T> &s)
- {return base_list_type::fromSet (s);}
+ {return base_list_type (s.begin (), s.end ());}
static QOdbList fromStdList(const std::list<T> &l)
- {return base_list_type::fromStdList (l);}
- std::list<T> toStdList() const {return l_.toStdList ();}
+ {return base_list_type (l.begin (), l.end ());}
+ std::list<T> toStdList() const {return std::list<T> (l_.begin(), l_.end());}
// Interfacing with the base list.
//
diff --git a/libodb-qt/odb/qt/containers/list.ixx b/libodb-qt/odb/qt/containers/list.ixx
index d9d37b6..53106e3 100644
--- a/libodb-qt/odb/qt/containers/list.ixx
+++ b/libodb-qt/odb/qt/containers/list.ixx
@@ -211,7 +211,7 @@ template <typename T>
inline void QOdbList<T>::
swap (int i, int j)
{
- l_.swap (i, j);
+ l_.swapItemsAt (i, j);
if (_tracking ())
{
impl_.modify (static_cast<std::size_t> (i));
diff --git a/libodb-qt/odb/qt/containers/mutable-list-iterator.hxx b/libodb-qt/odb/qt/containers/mutable-list-iterator.hxx
index 271633a..44b7d91 100644
--- a/libodb-qt/odb/qt/containers/mutable-list-iterator.hxx
+++ b/libodb-qt/odb/qt/containers/mutable-list-iterator.hxx
@@ -20,18 +20,30 @@ public:
QMutableOdbListIterator(QOdbList<T> &x)
: c (&x)
{
+#if QT_VERSION < 0x060000
c->setSharable(false);
+#endif
+
i = c->begin();
n = c->end();
}
+#if QT_VERSION < 0x060000
~QMutableOdbListIterator() {c->setSharable(true);}
+#endif
QMutableOdbListIterator &operator=(QOdbList<T> &x)
{
+#if QT_VERSION < 0x060000
c->setSharable(true);
+#endif
+
c = &x;
+
+#if QT_VERSION < 0x060000
c->setSharable(false);
+#endif
+
i = c->begin();
n = c->end();
return *this;
diff --git a/libodb-qt/odb/qt/date-time/mysql/qdate-time-traits.hxx b/libodb-qt/odb/qt/date-time/mysql/qdate-time-traits.hxx
index 92279eb..1b4628c 100644
--- a/libodb-qt/odb/qt/date-time/mysql/qdate-time-traits.hxx
+++ b/libodb-qt/odb/qt/date-time/mysql/qdate-time-traits.hxx
@@ -47,8 +47,8 @@ namespace odb
is_null = true;
else
{
- if ((v < QDateTime (QDate (1000, 1, 1))) ||
- (v >= QDateTime (QDate (10000, 1, 1))))
+ if ((v < QDateTime (QDate (1000, 1, 1), QTime (0, 0, 0))) ||
+ (v >= QDateTime (QDate (10000, 1, 1), QTime (0, 0, 0))))
throw odb::qt::date_time::value_out_of_range ();
is_null = false;
@@ -101,7 +101,7 @@ namespace odb
is_null = true;
else
{
- if ((v <= QDateTime (QDate (1970, 1, 1))) ||
+ if ((v <= QDateTime (QDate (1970, 1, 1), QTime (0, 0, 0))) ||
(v > QDateTime (QDate (2038, 1, 19), QTime (3, 14, 7))))
throw odb::qt::date_time::value_out_of_range ();
diff --git a/libodb-qt/odb/qt/smart-ptr/lazy-ptr.ixx b/libodb-qt/odb/qt/smart-ptr/lazy-ptr.ixx
index b9e6de8..0639663 100644
--- a/libodb-qt/odb/qt/smart-ptr/lazy-ptr.ixx
+++ b/libodb-qt/odb/qt/smart-ptr/lazy-ptr.ixx
@@ -420,7 +420,7 @@ template <class T>
inline T* QLazyWeakPointer<T>::
data () const
{
- return p_.data ();
+ return p_.toStrongRef ().data ();
}
template <class T>
diff --git a/libodb-qt/odb/qt/version.hxx.in b/libodb-qt/odb/qt/version.hxx.in
index c7ce430..b95bec3 100644
--- a/libodb-qt/odb/qt/version.hxx.in
+++ b/libodb-qt/odb/qt/version.hxx.in
@@ -37,8 +37,7 @@
#include <odb/version.hxx>
-$libodb.check(LIBODB_VERSION, LIBODB_SNAPSHOT)$
-
+$libodb.check(LIBODB_VERSION_FULL, LIBODB_SNAPSHOT)$
// Old/deprecated numeric version format is AABBCCDD where:
//