Hooking the QT Main Loop

David Zeuthen david at fubar.dk
Mon Apr 16 13:41:31 PDT 2007


On Mon, 2007-04-16 at 22:33 +0200, Thiago Macieira wrote:
> David Zeuthen wrote:
> >How does this work if I'm a library and I ask the application to
> >integrate one of my DBusConnection objects into the applications main
> >loop? (it might be a private connection)
> 
> You don't. QtDBus doesn't handle third-party connections. It only handles 
> its own.
> 
> If you're a library using D-Bus and you want to work with Qt, you must use 
> QDBusConnection and not DBusConnection.

I'm just curious but is there a specific technical reason why this is
so? I mean, there are libraries in the wild working like this [1].. and
I can think of valid reasons for people to do this.

Of course, people can always just write their own implementation of
dbus_connection_setup_qt4_main() - it just seems.. rather weird.. and a
bit asocial.. that you don't provide this at all. For example, how do
you expect people to use Qt and provide a library using D-Bus that
allows you to use a foreign main loop (that is not necessarily glib or
Qt)?

    David

[1] : libhal is one such example. Of course, I tell people not to use
libhal but it's here and widely used - mostly for historical reasons
though.




More information about the dbus mailing list