[odb-users] Qt6: error: redefinition of 'class odb::access::container_traits<QList<T>

Boris Kolpackov boris at codesynthesis.com
Thu Nov 16 07:15:03 EST 2023


CETONI GmbH - Uwe Kindler <uwe.kindler at cetoni.de> writes:

> The generated header files include the odb container traits files such as
> qlist-traits.hxx and qvector-traits.hxx. The problem here is, that in Qt6
> QVector is just a typedef for QList (snipped from Qt source):
> 
> ...
> template<typename T> using QVector = QList<T>;
> ...

Thanks for the bug report and the analysis.


> I could fix this by wrapping the code in qvector-traits.hxx into:
> 
> #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
> 
> ...
> 
> #endif
> 
> But I'm not sure, if this is the right solution.

Yes, I fixed this slightly differently (but based on the same
underlying idea). If you could try this fix and confirm it
works as expected for you, that would be helpful:

https://git.codesynthesis.com/cgit/odb/libodb-qt/commit/?id=c020bda61fe4a8108772309561d1f8e2f089aec0



More information about the odb-users mailing list