[Interest] Question about using QtDBus

Rogers Nate nate.rogers at raymondcorp.com
Thu Sep 4 14:40:16 CEST 2014


On 09/03/2014 01:34 PM, Thiago Macieira wrote:
> On Wednesday 03 September 2014 17:16:47 Rogers Nate wrote:
>>         <annotation name="org.qtproject.QtDBus.QtTypeName.Out0"
>> value="QList<ServiceErrorLogData>"/>
> Not valid XML. The < needs to be < and the > needs to be >
Ha, that was it, thanks!  One last question on how to process the value,
I noticed some people use waitForFinished().  Is that required or is it
safest to use that?  I found that the two functions below produce the
same output, granted this is a very simple example.  Should I be using
waitForFinished()?

void CanData::generateTestData()
{
    foreach(ServiceErrorLogData data,
m_ServiceData->serviceErrorLog().value())
    {
        qDebug() << "Label: " << data.label() << "Value: " << data.value();
    }
}

void CanData::generateTestData()
{
    QDBusPendingReply<QList<ServiceErrorLogData> > logData =
m_ServiceData->serviceErrorLog();
    logData.waitForFinished();
    if (logData.isError())
    {
        qDebug() << logData.error();
    }

    foreach(ServiceErrorLogData data, logData.value() )
    {
        qDebug() << "Label: " << data.label() << "Value: " << data.value();
    }
}

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