mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Nest TextureType JS interface in Type
This commit is contained in:
parent
c2909946e6
commit
de8145ec71
1 changed files with 5 additions and 1 deletions
|
@ -37,9 +37,13 @@ TextureCache::TextureCache() {
|
|||
setObjectName("TextureCache");
|
||||
|
||||
// Expose enum Type to JS/QML via properties
|
||||
// Despite being one-off, this should be fine, because TextureCache is a SINGLETON_DEPENDENCY
|
||||
QObject* type = new QObject(this);
|
||||
type->setObjectName("TextureType");
|
||||
setProperty("Type", QVariant::fromValue(type));
|
||||
auto metaEnum = QMetaEnum::fromType<Type>();
|
||||
for (int i = 0; i < metaEnum.keyCount(); ++i) {
|
||||
setProperty(metaEnum.key(i), metaEnum.value(i));
|
||||
type->setProperty(metaEnum.key(i), metaEnum.value(i));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue