by fxfan · 7y ago · 0 comments
Personally, I like Qt a lot more than GTK (both as a programmer and a user), but to each their own. QtQuick/QML is really great way of quickly whipping together complex UI’s. I’ve never used Qt on Rust though.
It is pretty trivial if you want to build an almost purely QML app. As soon as you want to do some C++ stuff (e.g. registering new C++ classes, using QtWidgets), however, things go south very quickly. The main problem is that Qt has its own ideas about ownership (QObject-parent-stuff), and Rust really does not like that. You end of working a lot with raw pointers and boxes. It feels like you’re writing C++ but in Rust (if that makes sense).
Rust-qt is really nice IMO, and I would extremely encourage anyone interested to take a look, and provide more feedbacks and contributions to the maintainers (I am not one of them). Some non-trivial examples would help a lot. But expect sharp edges.
The documentation isn't perfect but its _really_ easy to map the documentation of the bindings to the original C documentation. From quick glance the situation seems to be more or less (maybe a bit less) the same with python bindings for Gtk.
I personally have enjoyed the gtk-rs bindings.
The bindgen that seems to show up on google search is very un-intuitive to use (or maybe that's because I'm a rust newbie)
https://www.vandenoever.info/blog/2017/02/17/a-simple-rust-g...
I've tried most QT Rust projects and none were all that usable. I'm afraid your plans are not likely to succeed.
https://www.vandenoever.info/blog/2018/10/30/building_qt_app...