View Full Version : Simple QtDBus question

22nd April 2012, 00:51
Hi there,

I'm trying to get some IPC going between a program called Mixxx (for DJing) and a separate application used to control Mixxx. I'm going to implement this via the DBus. I understand how the DBus works, but I'm having trouble connecting to it using Qt. I've been working with the DBus examples provided by Qt. In the chat example, there is this section of code in the main:

: m_nickname(QLatin1String("nickname"))

// add our D-Bus interface and connect to D-Bus
new ChatAdaptor(this);
QDBusConnection::sessionBus().registerObject("/", this);

com::trolltech::chat *iface;
iface = new com::trolltech::chat(QString(), QString(), QDBusConnection::sessionBus(), this);
//connect(iface, SIGNAL(message(QString,QString)), this, SLOT(messageSlot(QString,QString)));
QDBusConnection::sessionBus().connect(QString(), QString(), "com.trolltech.chat", "message", this, SLOT(messageSlot(QString,QString)));
connect(iface, SIGNAL(action(QString,QString)), this, SLOT(actionSlot(QString,QString)));


My question is that in the new ChatAdaptor(this) line, what would I use in the place of 'this' if I don't have any Qt GUI? I'm not that
comfortable with programming yet so if anyone can answer this it would be great if as much detail as possible could be included, like what 'this' is
in this context? Any help is very much appreciated.

Thanks in advance!