3 ms·
The real problem isn't that C++ is that hard to bind. Writing a C style wrapper around the OO style code in Qt is easy. But Qt relies on compile time code gener
by gmueckl 7y ago
The real problem isn't that C++ is that hard to bind. Writing a C style wrapper around the OO style code in Qt is easy. But Qt relies on compile time code generation for event handling, properties and such, and this part is hard to replicate in other languages. It can be done; PyQt, PySide, etc do it, but it takes quite some effort.
- 0815test 7y agoRust has excellent support for compile-time codegen.
- gmueckl 7y agoYou are welcome to try to duplicate the functionality of the moc tool somehow. If it was trivial, it would have been done already.
- ogoffart 7y agoIt has been done already: https://github.com/woboq/qmetaobject-rs https://github.com/woboq/qmetaobject-rs
- gmueckl 7y agoHm... unless I am mistaken, this misses the ability to write arbitrary slots and connect them. If I am right, then a major part of what moc is responsible for - the whole signal/slot glue code - is not covered in this library.