I have a QList in which I inserted object pointers. I am trying to go through this QList to read the name of these objects. Whenever I do this, I get the address of these objects as opposed to reading the name of the object itself. I am wondering how could I read the name of an object instead of an address?
QList<MyObject*> newObjectList; QList<MyObject*>::iterator i; MyObject *pNewObject = new MyObject(name); MyObject.append(pNewObject); for (i = newObjectList.begin(); i != newObjectList.end(); i++) { cout << "\n" << *i << "\n"; }
source share