formatQEnum: deal with enum class types

The enum class doesn't get treated as an int automatically, the
way that a plain enum does; so there's a silly compile error which
this cast fixes.

Change-Id: I21b56337e4f724e4de1819e22bc93e9af23c51ea
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Shawn Rutledge 2018-07-24 16:24:58 +02:00
parent 549abf9e6a
commit 5d0827cbe7

View File

@ -93,7 +93,7 @@ static inline void formatQEnum(QDebug &debug, QEnum value)
{
const QMetaObject *metaObject = qt_getEnumMetaObject(value);
const QMetaEnum me = metaObject->enumerator(metaObject->indexOfEnumerator(qt_getEnumName(value)));
if (const char *key = me.valueToKey(value))
if (const char *key = me.valueToKey(int(value)))
debug << key;
else
debug << int(value);