GLib based event dispatcher: how to compile it from QT Everywhere source code?
-
You can grab the two files, rename the files and the classes inside it and use them for your own purpose. That's what we've done a few times with some other helper classes, which are private to Qt. Be aware of some license issues, though (provide the sources in case of (L)GPL).
-
IIRC Qt uses a glib based eventloop by default, at least on Linux. Mixing glib and Qt based code in one application is possible by default AFAIR.
So I do not understand your question:-)
Please be aware of the license implications when copying code from Qt into your libraries: LGPL does only apply when doing dynamic linking, so it is not an option when copying code over into your project.
-
Volker,
I intend to grab those 2 files and do so, preserving the license restrictions and anything else.
However those files have references to lots of other files from the QT source code.
I believe I'm going to have trouble to compile this code by myself because QT Makefiles use a lot of pre-processor definitions (-D) and this kind of stuff (configure script and related).
I thought there would be a better way to do that.Tobias,
I'll have a look at IIRC. Thanks for the suggestion.
I'm having trouble to find information regarding QT embedded details (event loop details, for instance).
Do you know whether GLib based event loop is default in Embedded QT (QWS and non QWS) or not?
Don't worry about lincense issues. I'll preserve that.Thanks very much for both of you.
-
http://labs.qt.nokia.com/2006/02/24/qt-and-glib/ is the first hit on google for Qt and glib.
-
Tobias, I know that.
That was my start point on this issue. Unfortunely, it doesn't say how to do that.
I tried to find some literature that explains how to implement a QAbstractEventDispatcher, but I couldn't find some.
I tried to check the QT source code for the default Event Dispatcher... it might give some clue on how to do that, that was how I found the files I mentined above.
The problem is that those files seems to have a lot of dependencies in the QT source code and I'm having trouble to understand how to deal with them.
Do you know where can I find something to help me out?Thanks very much.
-
I do not understand your problem then.
As far as I know (but I am no expert in this area) Qt uses the glib event loop by default. So why do you need to write a event dispatcher yourself?
The files you reference are internal to Qt. That is what the warning says: Do not use this, we will change it whenever we need to. We make no guarantees about any of the APIs implemented in those files. So if you decide to use those files anyway, your application may break on the next upgrade of Qt.
That does not say that the APIs are not used internally inside Qt. In fact that event dispatcher should be the one used in Qt on Linux. But again: I am no expert in this area, so I might be wrong.
-
Tobias,
I have contacted the platform development team asking for a recompiled version of the Embedded QT libs with glib support. I believe the -glib configuration option does the magic (uses that dispatcher as the default one).
It is really hard to find information regarding this kind of stuff.
Maybe the the developers of the platform I'm using have some support directly from QT Team on that.
This is what makes me a little more confident about it.Right now, this is absolutely necessary to make my project possible.
I'll post here any proggress on this issue.
Thanks very much.
-
Looks like my QT libs are already compiled with GLib support (the -glib option is default).
I though QT would run a GLib based (GMainContext + GMainLoop) Event Dispatcher when Glib support is enabled. But it doesn't seem to be true. If the GMainLoop was running, my DBus communication would be ok, and it is not.
Now I have no clue what exactly means GLib support for QT.
-
Perhaps you can ask around on IRC. On the freenode network, you can use the #qt channel. If you don't get anything useful there, you might want to ask and see if you can get answer on the #qt-labs channel. Lots of Qt devs hang out there, but it is not geared towards helping end users. Still, if you come up with an interesting question and you could not get that answered elsewhere, you might get lucky. First try in #qt though!
-
Thanks very much Andre. I'll try it!
-
Hi Allan,
After a lot of trying, I gave up using the QT GLib based event loop.
I end up writing my own solution to replace the Glib based library I was using before.
I was using DBus and wrote a custom IPC system based on sockets. It works really well, BTW.Even though, I'm really interested in learning how to use the GLib based loop.
If you manage to do that, please post your solution here. It would be useful to all other users too.Thanks.
-
Don't worry.
If you managed to do that, someone else may find that useful!
I've already found other ways! :D
Thanks!