[Interest] Question about using QtDBus

Rogers Nate nate.rogers at raymondcorp.com
Wed Sep 3 17:03:05 CEST 2014


On 09/02/2014 05:32 PM, Thiago Macieira wrote:

On Tuesday 02 September 2014 20:05:04 Rogers Nate wrote:


I used qdbuscpp2xml to generate new adapter and interface files but I am
still getting the same error...



As I said, you can't use cpp2xml on a class where there's a signal or slot
containing a parameter that isn't one of the basic Qt types. The tool won't
know what that type expands to in D-Bus.

You need to manually adjust the .xml file and keep it around. Don't generate it
during build.



Sorry that was a typo, I meant to say I generated the new adapter file using the following command...

qdbusxml2cpp ServiceData.xml -i ServiceData.h -i ServiceErrorLogData.h -a ServiceDataAdaptor

and the new interface using this command...

qdbusxml2cpp ServiceData.xml -i ServiceData.h -i ServiceErrorLogData.h -p ServiceDataInterface

Since my last email I commented out the lines DBUS_ADAPTORS += ServiceData.xml and DBUS_INTERFACES += ../DataProcess/ServiceData.xml from the pro files so no files are generated automatically.  Then I took the output from the qdbusxml2cpp commands above (ServiceDataAdaptor.cpp, ServiceDataAdaptor.h, ServiceDataInterface.cpp, & ServiceDataInterface.h) and added them to my project.  The project builds but I am still getting the same message back when I run the programs...


QDBusError("org.freedesktop.DBus.Error.InvalidSignature", "Unexpected reply signature: got "", expected "a(ss)"")

This is the tutorial I have been trying to follow: https://techbase.kde.org/Development/Tutorials/D-Bus/CustomTypes

After looking back over this I noticed they create an instance of the adaptor in the main so I updated my  Data Process main.cpp to look like this...

#include <qt5/QtCore/QCoreApplication>
#include <qt5/QtDBus/QtDBus>
#include "ServiceData.h"
#include "ServiceErrorLogData.h"
#include "ServiceDataAdaptor.h"

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);

    ServiceErrorLogData::registerMetaType();

    ServiceData *serviceData = new ServiceData(&a);
    ServiceDataAdaptor *serviceDataAdaptor = new ServiceDataAdaptor(serviceData);
    Q_UNUSED(serviceDataAdaptor);

    return a.exec();
}

Unfortunately this hasn't fixed the problem I reported above.  Any tips or suggestions are greatly appreciated, thanks!

Nate


Confidentiality Notice: The preceding e-mail message (including any attachments) contains information that may be confidential, protected by applicable legal privileges, or constitute non-public information. It is intended to be conveyed only to the designated recipient(s). If you are not an intended recipient of this message, please notify the sender by replying to this message and then delete it from your system. Use, dissemination, distribution or reproduction of this message by unintended recipients is not authorized and may be unlawful.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140903/d12cad98/attachment.html>


More information about the Interest mailing list