Monday 15 August 2011

qt - QObject selfdestruction aware container -


Is there a QT container that is aware of the deleted signal of the Q object and if an element is destroyed then the element swept aside?

Ie like this:

  QObject * obj1 = new MyObject (); QObject * obj2 = New MyObject (); QObjectContainer c; C.add (obj1); C.add (obj2); QDebug () & lt; & Lt; C.size (); // Remove 2 obj1 print; QDebug () & lt; & Lt; C.size (); // print1  

You can capture the signal yourself by Destroy () inside container - taboo class.

PS does not do any QT class, AFAIK.


No comments:

Post a Comment