Get service name from QDBusConnection with Qt5

470 Views Asked by At

Our framework is recently updating to Qt5 from Qt4. But here we got some problems on the d-bus event processing.

The original code QDBusConnection::sender().name() return empty string. And the official suggested substitute way QDBusContext::connection() return something like "1.40", "1.101" (should be address or something, and is correct).

We also try to use msg.service() where msg is a QDBusMessage, but still get the former address.

We need to get its name like com.stackoverflow.HelpMe which we send into the QDBusConnection::connect() to insure that we can distinguish different services even if the d-bus services are restarted which may make the address change.

Thanks for any suggestion.

1

There are 1 best solutions below

0
On

Well....... in fact, the official suggested substitute way QDBusContext::connection() can work. We don't know why the previous try got different result.