Commit 5813e4ed authored by Harald Sitter's avatar Harald Sitter 🏳️‍🌈
Browse files

translations: get qmetaenum from type rather than string

less fragile this way since the compiler just know T. if T changes name
the compiler will shout at us
parent ae739002
......@@ -165,8 +165,7 @@ QHash<int, QByteArray> TranslationsModel::roleNames() const
{
QHash<int, QByteArray> roles = QAbstractItemModel::roleNames();
QMetaEnum e = metaObject()->enumerator(metaObject()->indexOfEnumerator("AdditionalRoles"));
const auto e = QMetaEnum::fromType<AdditionalRoles>();
for (int i = 0; i < e.keyCount(); ++i) {
roles.insert(e.value(i), e.key(i));
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment