I find some code sample with these oddl lines
QList<TDataXml *> *newXMLData = input->getValue<QList<TDataXml *>>();
if(newXMLData)
{
// do things
}
I dont understand if(newXMLData). This is a QList. When should statement be true or false? Why not use Qt isEmpty() method instead?
Thanks
if(newXMLData)checks for nullity, becausenewXMLDatais a pointer, and therefore it could point to no object, in which case it’s value isnullptr(orNULLin C++03).If
newXMLDatais notnullptr, then it will betrueand the if-block will execute, otherwisefalseand if-block will not execute.It is same as (C++11):