5 ms·
I tend to prefer Qt as an end user, are there similar tutorials for Qt+Rust? I remember someone telling me that it’s not as good a fit but I can’t remember why
by dijit 7y ago
I tend to prefer Qt as an end user, are there similar tutorials for Qt+Rust?
I remember someone telling me that it’s not as good a fit but I can’t remember why that is.
- hdfbdtbcdg 7y agoAs a guess it is probably because GTK has a C API whilst Qt is C++.
- simion314 7y agoGTK is a C toolkit and Qt is C++, it is easier for other languages to use GTK if those languages have a way to interact with C library. There are a lot of bindings to GTK and very few to Qt.
- dijit 7y agoThat explains a lot. Thank you. :)
- pknopf 7y agohttps://github.com/qmlnet/qmlnet https://github.com/qmlnet/qmlnet
- simion314 7y agoThere were C# Qt bindings since many years ago but those were not official supported so the quality was not that good,once there was a Java official binding/port that was dropped after a short time, I would not use someone's hobby bindings for a real world project(I mean a project with many users that you need to support for years , through OS and oteher system updates)
- pknopf 7y agoI'm the author. The QtSharp project used technology that couldn't really address the problem (MonoCppSharp). QML.Net is different. It is purely a QML integration (no c++ wrapper), using a C interop. There is extensive unit tests for QML.Net, including garbage collection tests. I consider it segfault-proof. It's currently used in production on embedded medical devices: https://medxchange.com/4klear-all-in-one-camera-recorder/ https://medxchange.com/4klear-all-in-one-camera-recorder/
- simion314 7y agoSounds like a nice project, I did not want to insinuate that the quality is not good, I did not used Qt in a few years(since Qt4 days) so I am not sure about QML, without doing any research I think I am inclined to use the classic QtWidgedts for a desktop applications, SQML seems to me more mobile or designer first toolkit. I strongly believe that Microsoft made a huge mistake not making .Net WPF and Silverlight cross platform and open source it. they would have made money by selling the Visual Studio IDE,
- mlevental 7y agodoes it work with .net core? i.e. linux?
- Zardoz84 7y agothe problem is that QT is write on C++. It makes harder to make bindings to any other language.
- kbumsik 7y agoDoes C++ make it harder to bind than C? I'm genuinely curious.
- pknopf 7y agoIt wasn't bad for me. I wrote a .NET Core/QML interior layer. https://github.com/qmlnet/qmlnet https://github.com/qmlnet/qmlnet
- redblacktree15 7y agoIt's just more work, because worst case you just need to wrap C++ APIs to C and bind that to rust.
- flohofwoe 7y agoYes because C++ doesn't have a standardized ABI, and C++ language concepts sometimes map badly to other languages, while C is sort of a lowest-common-demoninator (pretty much any language can call C functions through some sort of FFI mechanism). The usual workaround is to wrap the C++ API into a C API.
- kbumsik 7y agoThat explains very well. I didn't know that C++ doesn't have a stable ABI. Is it because C++ is so complicated to make a standard ABI?
- KyleJ61782 7y agoPrimarily it's due to function overloading. Different implementations may use different means to consistently and uniquely "mangle" function names on symbols to uniquely identify them in the library export. This mangling depends upon numerous factors, including parameter types and calling convention (if there are multiple conventions on a platform).
- arusahni 7y agoI was wondering the same thing a few weeks back and found this project from the folks at KDE: https://github.com/KDE/rust-qt-binding-generator https://github.com/KDE/rust-qt-binding-generator They provide some tutorial links in the README.
- ogoffart 7y agoUsing QML from rust: https://github.com/woboq/qmetaobject-rs https://github.com/woboq/qmetaobject-rs