White-Oak / qml-rust

QML (Qt Quick) bindings for Rust language
MIT License
205 stars 18 forks source link

Enum registering? #24

Closed bzar closed 7 years ago

bzar commented 7 years ago

I tried to find how to register enums, but couldn't see any indication of support for such in the examples nor the code. Is there a preferred workaround for this?

White-Oak commented 7 years ago

@bzar no, qml-rust does not support registering enums. Is it needed? Why not define enums in QML code?

bzar commented 7 years ago

Well, because they're already defined in another part of the application. I'm creating a thin translation layer for a library to be usable from a QML UI. Much of the library's interface depends on various enums, and not being able to register them directly results in either multiple versions of the same function to cover all the cases or creating some ugly magic number/string based enum emulation. This is only a doodle, so nothing of importance is lost for me if there's no enum support, just wanted to ask if there's a way to do this. Thanks for the quick reply.

White-Oak commented 7 years ago

@bzar sorry for the inconvenience