Revert "QMetaType: extract the signedness of a QFlags enum type"
This reverts commit b957400b64e2fb9f3933c09d14d486bd1f4e8468. Reason for revert: This blocks dependency update bot by breaking the test tst_declarative_positioning_core. The reverted patch however reveals the incorrect behavior regarding signedness of the flagged enum types in qtdeclarative. It is tracked by QTBUG-128131. Fixes: QTBUG-128122 Change-Id: I3abb65daf3fd5c09c99508937e0010ee2cd3b898 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
382c87333f
commit
928ddf32af
@ -2979,13 +2979,8 @@ bool QMetaType::hasRegisteredDataStreamOperators() const
|
|||||||
If this metatype represents an enumeration, this method returns a
|
If this metatype represents an enumeration, this method returns a
|
||||||
metatype of a numeric class of the same signedness and size as the
|
metatype of a numeric class of the same signedness and size as the
|
||||||
enums underlying type.
|
enums underlying type.
|
||||||
If it represents a QFlags type, it returns a metatype of a numeric class
|
If it represents a QFlags type, it returns QMetaType::Int.
|
||||||
with the same signedness and size as that \l QFlags::Int type.
|
|
||||||
In all other cases an invalid QMetaType is returned.
|
In all other cases an invalid QMetaType is returned.
|
||||||
|
|
||||||
Do note the metatype is synthesized from size and signedness and may thus
|
|
||||||
not match the actual underlying type of the enum itself. That is, it will
|
|
||||||
never return the metatype for \c{char}, \c{long}, \c{unsigned long}.
|
|
||||||
*/
|
*/
|
||||||
QMetaType QMetaType::underlyingType() const
|
QMetaType QMetaType::underlyingType() const
|
||||||
{
|
{
|
||||||
|
@ -1267,12 +1267,10 @@ namespace QtPrivate {
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
inline constexpr bool IsQmlListType = false;
|
inline constexpr bool IsQmlListType = false;
|
||||||
|
|
||||||
template<typename T, bool = std::is_enum<T>::value, bool = QtPrivate::IsQFlags<T>::value>
|
template<typename T, bool = std::is_enum<T>::value>
|
||||||
constexpr bool IsUnsignedEnum = false;
|
constexpr bool IsUnsignedEnum = false;
|
||||||
template<typename T> constexpr bool IsUnsignedEnum<T, true, false> =
|
template<typename T>
|
||||||
!std::is_signed_v<std::underlying_type_t<T>>;
|
constexpr bool IsUnsignedEnum<T, true> = !std::is_signed_v<std::underlying_type_t<T>>;
|
||||||
template<typename T> constexpr bool IsUnsignedEnum<T, false, true> =
|
|
||||||
!std::is_signed_v<std::underlying_type_t<typename T::enum_type>>;
|
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct QMetaTypeTypeFlags
|
struct QMetaTypeTypeFlags
|
||||||
|
Loading…
x
Reference in New Issue
Block a user