diff --git a/src/testlib/qtestcase.h b/src/testlib/qtestcase.h index 80cece7f9a..adfc987862 100644 --- a/src/testlib/qtestcase.h +++ b/src/testlib/qtestcase.h @@ -290,7 +290,7 @@ namespace QTest inline typename std::enable_if::Value, char*>::type toString(QFlags f) { const QMetaEnum me = QMetaEnum::fromType(); - return qstrdup(me.valueToKeys(int(f)).constData()); + return qstrdup(me.valueToKeys(int(f.toInt())).constData()); } template // Fallback: Output hex value @@ -298,7 +298,7 @@ namespace QTest { const size_t space = 3 + 2 * sizeof(unsigned); // 2 for 0x, two hex digits per byte, 1 for '\0' char *msg = new char[space]; - qsnprintf(msg, space, "0x%x", unsigned(f)); + qsnprintf(msg, space, "0x%x", unsigned(f.toInt())); return msg; }