Coming from a C# background, I have some habbits that need to be changed. I'm tring to return a QList<int> from a function. The compiler error message is conversion from 'QList*' to non-scalar type 'QList' requested. Here is the function:
QList<int> toCategories(QVariant qv)
{
QList<int>categories = new QList<int>();
if(qv.isValid() && qv.type() == QVariant::List)
{
foreach(QVariant category,qv.toList()){
categories.append(category.toInt() );
}
}
return categories;
}
I'd appreciate a link to the documentation or a function using the correct syntax