Quantcast
Channel: Jobs
Viewing all articles
Browse latest Browse all 18427

List of Object

$
0
0
hi all, i have a proble: i have an Object call Obj and this object extend QObject, i know that i can’t put this Object in a list like this QList<Obj> i need to use the pointer like this but after I have set the pointer in the List the Object will destroied: QList<Oggetto*> InterfacciaDataModel::convertitore(QList<MeteoLocale> lista){      for(int i=0; i < lista.count(); i++) {   Oggetto oggetto(lista.at(i).property,lista.at(i).tiplogia);   listToBeReturn.append(&oggetto);  }    cout << "Convertitore" << endl;  return listToBeReturn; } the listToBeReturn is a public list declared in h file like this QList<Oggetto*> listToBeReturn exist a method where i can store this Object??? regards to all.

Viewing all articles
Browse latest Browse all 18427

Trending Articles