[Interest] Question about using QtDBus

Rogers Nate nate.rogers at raymondcorp.com
Thu Aug 28 20:28:55 CEST 2014

I have that static method in ServiceErrorLogData.cpp...

void ServiceErrorLogData::registerMetaType()

    qDBusRegisterMetaType<QList<ServiceErrorLogData> >();

I was calling this from my main.cpp.  Is that not a good way to do it or
did I not use it correctly?


On 08/28/2014 02:23 PM, Thiago Macieira wrote:
> On Thursday 28 August 2014 17:17:54 Rogers Nate wrote:
>> I have a data process where I am trying to store my data so it can be
>> updated/retrieved from different processes.  I am trying to get a QList
>> of a custom object to be returned from the data object so it can be used
>> by my CAN communication object.  I have striped down some code to give
>> an example of what I am trying to do.  I have been trying to get this to
>> work for awhile but I must be missing something and I am not fully
>> understanding what needs to be done.  I am thinking it has something to
>> do with my dbus type, I feel like the xml file should define it as a(ss)
>> but it won't compile with that and gives no meaningful information as to
>> why.  If I change it to ao it will compile but no data is available over
>> in the CAN comm process and it prints an error saying it expected a(ss)
>> before killing the process.  Any help is greatly appreciated, thanks!
> Hi Nate
> I don't see any qDBusRegisterMetaType. You need to tell D-Bus how to marshall 
> your returned type when you return it. Make sure you call that before the 
> function returns -- better yet, in the constructor.
>> #include <qt5/QtDBus/QtDBus>
> Please don't include Qt headers like that. The correct way is <QtDBus/QtDBus>.

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.

More information about the Interest mailing list