Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.0
-
None
-
Tumbleweed (Linux), using Qt 6 build from https://build.opensuse.org/project/show/home:cgiboudeaux:Qt6 - but it likely applies to all platforms
-
-
0c010cd9c (dev)
Description
I've been using Qt 6 commit 174154bcac2780cb704011662f2e9c1233fec933 (from Fri Aug 21 13:01:43). Maybe the problem stated in the summary has already been fixed.
The compile error looks like this:
/usr/include/qt6/QtCore/qdatastream.h:421:12: error: use of overloaded operator '<<' is ambiguous (with operand types 'QDataStream' and 'typename std::underlying_type<EnumClassUsingUnsignedLong>::type' (aka 'long')) { return s << static_cast<typename std::underlying_type<T>::type>(t); } ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/qt6/QtCore/qmetatype.h:2435:10: note: in instantiation of function template specialization 'operator<<<QtGui::EnumClassUsingUnsignedLong>' requested here \{ ds << *reinterpret_cast<const T *>(a); } ^ /usr/include/qt6/QtCore/qmetatype.h:2534:56: note: in instantiation of member function 'QtPrivate::QDataStreamOperatorForType<QtGui::EnumClassUsingUnsignedLong, true>::dataStreamOut' requested here /*.dataStreamOut=*/ QDataStreamOperatorForType<T>::dataStreamOut, ^ /usr/include/qt6/QtCore/qmetatype.h:2645:39: note: in instantiation of static data member 'QtPrivate::QMetaTypeForType<QtGui::EnumClassUsingUnsignedLong>::metaType' requested here return &QMetaTypeForType<Ty>::metaType;
Code snipped to reproduce the compile error:
enum EnumClassUsingUnsignedLong : long { Foo, Bar, }; class Test : public QObject { Q_OBJECT public Q_SLOTS: void foo(EnumClassUsingUnsignedLong bar); };
It also doesn't work with unsigned long and when using enum class.
Likely it is just missing an overload for long and unsigned long.
Attachments
Issue Links
- relates to
-
QTBUG-129177 QDataStream does not work with std::[u]int64_t
- Closed
-
QTBUG-99234 Spike RISC-V as a supported platform for Embedded
- Closed