Active Topics

 


Reply
Thread Tools
Posts: 6 | Thanked: 2 times | Joined on Nov 2009 @ Tampere, Finland
#1
Hullo,

I'm trying to use BlueZ BT stack in N900 PR 1.2 with Qt 4.6.2. I'm not able to connect to signals that contain a{sv} parameter which I think should be used as QVariantMap in Qt. Connect and signals work if I use Python but for some reason Qt does not accept that QVariantMap parameter.

<code>
QDBusConnection * m_dbus = new QDBusConnection(QDBusConnection::systemBus());
QDBusMessage message = QDBusMessage::createMethodCall("org.bluez", "/", "org.bluez.Manager", "DefaultAdapter");
QDBusMessage reply = m_dbus->call(message);
QString m_path = reply.arguments().first().value<QDBusObjectPath>() .path();
QDBusInterface * interface = new QDBusInterface("org.bluez", m_path, "org.bluez.Adapter", *m_dbus);
connect(interface, SIGNAL(DeviceFound(QString, QVariantMap)), this, SLOT(slotDeviceFound(QString, QVariantMap)));
</code>
 
Posts: 432 | Thanked: 645 times | Joined on Mar 2009
#2
Hi,

Originally Posted by kende View Post
Hullo,

<code>
QDBusInterface * interface = new QDBusInterface("org.bluez", m_path, "org.bluez.Adapter", *m_dbus);
connect(interface, SIGNAL(DeviceFound(QString, QVariantMap)), this, SLOT(slotDeviceFound(QString, QVariantMap)));
</code>

QDBusInterface doesn't have a signal called "DeviceFound". Which code are you referring to in Python? Any example?

Daniel
 
Posts: 6 | Thanked: 2 times | Joined on Nov 2009 @ Tampere, Finland
#3
I got this to work with using <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="QVariantMap"/> in DBus xml and then generating the proxy class with qdbusxml2cpp. Connect and signal work just fine when using this generated interface.

I missed this because all other parameters work just fine with just QDBusInterface.
 
Reply


 
Forum Jump


All times are GMT. The time now is 08:51.