Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Integration with Glib event loop
Luca Ottaviano last edited by
I have a C library that requires a GLib event loop to work, it takes a
GMainContexton initialization and allows me to register callback functions. My solution to integrate it with a Qt application is the classic thread + polling approach, I spawn a thread which every 100ms runs a single
g_main_context_iteration(). From what I understood, I can't just run the GLib event loop in the thread because it will block there without emitting any Qt signals.
Is there an approach that does not involve thread + polling?
Yes it is, and IIRC, there's already an implementation of the event dispatcher with Glib.