Yes, of course. But it's the programmers responsibility not to delete objects he/she doesn't own. If you want a QMap with pointers to objects you don't own and those objects inherit QObject, you can use:

Qt Code:
  1. QMap<Model *, QPointer<DataSet> > map;
To copy to clipboard, switch view to plain text mode 

In Qt3 you can use QGuardedPtr instead of QPointer. With such a mechanism qDeleteAll() should not make any harm as QPointer sets its internal pointer to 0 when the object it references gets deleted. And deleting null pointers is safe. On the other hand deleting pointers which you don't own doesn't make much sense, so the situation is purely academic.