For example I have the following class:
namespace someName
{
class someClass
{
Q_ENUMS(ESomeEnum)
public:
enum ESomeEnum {ENUM_A, ENUM_B, ENUM_C};
// ... some other things ..
}
}
Q_DECLARE_METATYPE(someName::someClass)
Is there a way to use QMetaEnum::valueToKey or QMetaEnum::keyToValue ?
Tried the method in this answer but got the following error:
error: static assertion failed: QMetaEnum::fromType only works with enums declared as Q_ENUM or Q_FLAG #define Q_STATIC_ASSERT_X(Condition, Message) static_assert(bool(Condition), Message)
I can employ X-Macros to get my desired output but it would also be nice to learn more tricks in Qt.