How to make Qt Dbus more responsive? (When the main thread is busy)

811 Views Asked by At

I am using Qt DBus to monitor signals. However, as the main Qt thread is often busy with a long running task (a design I currently cannot change), there is a long delay between sending a qt-dbus message by another program an the slot being called. How can I reduce this delay?

I connect a slot to be called when a signal is received something like so:

#include <QtDBus>
#include <QString>
#include <QObject>

MyDbus : public QObject {
public:
    MyDbus() {
        QDBusConnection::systemBus().connect("", "path", "interface.com", "member", this, SLOT(mySlot(QString)));
    }

private slots:
    void mySlot(QString& message) const {
        // Do something.
    }
 };

Using Qt 4.8.6.

0

There are 0 best solutions below