4 ms·
Hi guys, This is the 7th post in the series "Crash course in Qt for C++ developers." Do you structure and architect your application in a similar way? Let me kn
by AlexFagrell 8y ago
Hi guys,
This is the 7th post in the series "Crash course in Qt for C++ developers." Do you structure and architect your application in a similar way? Let me know what you think and I would appreciate if you have any feedback.
- fxfan 8y agoI'm going to write a GUI in 3 months using qt + rust. Bookmarking for later.
- isatty2 8y agoHave you found any good tutorials or even documentation for using rust-qt? 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)
- fxfan 8y agoI seem to remember having come a Ross a link where the code objects in qml were rust and not Js. Can't find now. Seen this:? https://www.vandenoever.info/blog/2017/02/17/a-simple-rust-gui-with-qml.html https://www.vandenoever.info/blog/2017/02/17/a-simple-rust-g...
- rapsey 8y agoThat uses the qml crate that has not been updated in 2 years. Quite unlikely to not work at all. I've tried most QT Rust projects and none were all that usable. I'm afraid your plans are not likely to succeed.
- oever 8y agoI'm developing a few hobby projects with Qt and Rust. The Rust Qt Binding Generator I developed for that works so well for me that I've barely needed to improve it in months. https://www.vandenoever.info/blog/2018/10/30/building_qt_apps_with_cargo.html https://www.vandenoever.info/blog/2018/10/30/building_qt_app...
- rapsey 8y agoThat json glue is quite ofputting tbh. I did try it, but failed building it on macos.
- oever 8y agoThe JSON glue could be changed to Rust macros, but I've not found the time to do that. It's a bit ugly but free and works for me on Linux and I've had reports of success on Raspberry Pi and Windows. If it fails to build on Mac OS, I'd like to see why and help. The latest version uses Cargo for building, so e.g. `cargo qrep && qrep` should give you a working Rust + Qt example application.
- pknopf 8y agoMy project, Qml.Net (https://github.com/qmlnet/qmlnet https://github.com/qmlnet/qmlnet), does this as well, but with .NET.
- vhakulinen 8y agoYou should checkout gtk-rs[0] too if you're settled on rust but have an option to pick other GUI library. 0: https://gtk-rs.org/ https://gtk-rs.org/
- fxfan 8y agoI have not but I looked at qml and find it elegant. I will give it a look.
- dkersten 8y agoCan you say a little bit about what makes it great? Is it just a well designed wrapper? Super easy to use? Good documentation? More mature than Rusts Qt bindings? 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.
- vhakulinen 8y agoI have virtually no experience with Qt (as a developer). That said, I find the gtk-rs bindings good and easy to use in rust. They are automatically generated from C code, and as the generator matures the bindings come more and more complete. Tho' some of the bindings are manually written. AFAIK Gtk has QML counter part, but I haven't used that either. 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.
- uranusjr 8y agoHopefully my experience could be useful, having tried rust-qt just a while ago on a project. Bottom line: it is usable. 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.
- ensiferum 8y agoYou have too many CMakeFiles. I'm sure you can just simply them all into a single CMakeFile at the top level.