Update QMetaEnum::fromType()'s static assert's error message

QMetaEnum fromType() also works for enums declared with Q_{ENUM,FLAG}_NS.
This hadn't been added to the message when we added Q_{ENUM,FLAG}_NS.

Fixes: QTBUG-75829
Change-Id: Ib71dae83dd8d837adf46b73cd299b8e61bdb1f64
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Edward Welbourne 2019-05-15 11:33:57 +02:00
parent 6fb2b4b271
commit 2ed4fcca19

View File

@ -230,7 +230,8 @@ public:
template<typename T> static QMetaEnum fromType() {
Q_STATIC_ASSERT_X(QtPrivate::IsQEnumHelper<T>::Value,
"QMetaEnum::fromType only works with enums declared as Q_ENUM or Q_FLAG");
"QMetaEnum::fromType only works with enums declared as "
"Q_ENUM, Q_ENUM_NS, Q_FLAG or Q_FLAG_NS");
const QMetaObject *metaObject = qt_getEnumMetaObject(T());
const char *name = qt_getEnumName(T());
return metaObject->enumerator(metaObject->indexOfEnumerator(name));