PDA

View Full Version : MetaPointer: QPointer with Signals and Slots



ntessore
18th May 2008, 01:59
I just up'd a little template snippet that you might find as useful as I do: It's a QPointer which allows to connect signals and slots to it, which will always arrive or come from the pointed-to object.

It's here (http://ntessore.blog.uni-heidelberg.de/2008/05/18/metapointer-qpointer-with-signals-and-slots/).

Regards,
ntessore

elcuco
21st May 2008, 14:08
Looks sweet!

What happens when the new pointer does not have the needed slow? Do you throw a warning or just ignore?

ntessore
21st May 2008, 20:17
The MetaPointer has all slots of the base class used as its template argument. Since I don't think it is possible to dynamically remove static slots, this cannot happen.