4 ms·
> Qt's approach requires a separate compilation pass woith a Qt-specific tool named "moc" which declares a bunch of info in the signal class that's necessary fo
by jcelerier 8y ago
> Qt's approach requires a separate compilation pass woith a Qt-specific tool named "moc" which declares a bunch of info in the signal class that's necessary for the slot implementation.
If you are willing to accept uglier macros, you can have QObject-compatible signals / slots in pure C++ without any kind of specific tool : https://github.com/woboq/verdigris https://github.com/woboq/verdigris
Also, Qt's approach is thread-safe (if you call a signal in a thread A on an object attached to a thread B, the slot will be executed in thread B) since it is tied to Qt's event loop.
- grefab 8y agoWe successfully use verdigris in production (image processing application with QT/QML as GUI). This allowed using bazel without having to teach it moc.