1
我試圖連接到從的ObjectManager使用下面的代碼InterfacesAdded信號:C++的Qt的DBus沒有這樣的信號InterfacesAdded
UDisks::UDisks(QObject *parent) : QObject(parent), disks(UD_SERVICE,
UD_PATH, UD_INTERFACE_OBJECT_MANAGER, QDBusConnection::systemBus())
{
qDBusRegisterMetaType<InterfaceList>();
qDBusRegisterMetaType<ManagedObjectList>();
connect(&disks, SIGNAL(InterfacesRemoved(QDBusObjectPath, QStringList)), this, SLOT(mediaRemoved(QDBusObjectPath, QStringList)));
connect(&disks, SIGNAL(InterfacesAdded(QDBusObjectPath, InterfaceList)), this, SLOT(mediaAdded(QDBusObjectPath,InterfaceList)));
}
當我運行的代碼,它與下面的錯誤出現:
QObject::connect: No such signal org::freedesktop::DBus::ObjectManager::InterfacesAdded(QDBusObjectPath, InterfaceList)
下面是InterfaceList typedef的:
typedef QMap<QString, QMap<QString, QVariant>> InterfaceList;