return a pointer to a QList then test it for null pointer, i think this is what your asking anyway, sorry if i misinterpreted
void someClass::test()
{
std::shared_ptr<QList<float> > testList = doSomething()
if(testList == nulllptr)
{
// Then its null
}
else
{
// Do whatever you want with it
}
}
std::shared_ptr<QList<float>> someClass::doSomething()
{
std::shared_ptr<QList<float>> someList; // = NULL at the moment
if(weWantValues) // Lets just pretend this bool knows if we want values
{
someList = std::make_shared<QList<float>(); // now a shared pointer to a list
// Populate with whatever values you want. use ".get()" or "->" to access list
}
// this may be null or populated so check if it == nullptr before using
// Like we do in the function above
return someList;
}