4 ms·
You can - and do - use Qt's C++ objects from Python in a very native way, as though they were just ordinary Python objects. I would imagine the same would be th
by lmm 7y ago
You can - and do - use Qt's C++ objects from Python in a very native way, as though they were just ordinary Python objects. I would imagine the same would be the case when using Qt from Java or any other language that offers bindings. And since C++ with its class system is a widely adopted standard (for good or ill), there is at least some appetite for offering good bindings to object-oriented C++ libraries among the wider community, and any improvements or techniques there will generally cross-pollinate to improved bindings for Qt and vice versa.
In theory GObject is intended to be a whole parallel OO ecosystem, a better way of doing objects in C-like languages that can compete with C++, and that would ultimately give rise to a whole platform of things like Vala that interop with that platform. However that whole ecosystem just hasn't caught on; outside of Gnome, no-one is using GObject, no-one is using Vala, and so no-one else is interested in working on bindings between other OO languages and GObject (which have to solve much the same problems as bindings between those languages and C++ - GObject may be "C" but it relies heavily on macros, and to bind it in a usable way that makes it feel native in an OO language you have to do a lot more work than just exposing C functions as functions).
- xfer 7y agoThere is a reason there aren't any close to complete bindings for other languages except python for Qt5. It takes significant effort compared to binding to Glib/Gobject especially with gir.
- einpoklum 7y agoQt is not a "fair" comparison. I mean, yes, it's relatively popular, but: 1. It's a huge framework, not just a GUI toolkit. 2. It uses the not-really-C++ mechanism of signals and slots and a "meta-object compiler". Thus, for example, wxWidgets - written in C++ - has bindings in Lua, Python, Ruby, Rust, Java, Javascript, etc.