I am writing a graphics drawing program, and I want to be able to dynamically "parent" objects to one another. Parenting in my case involves connecting a particular signal on the "parent" to a slot on the "child," not using the setParent() method as might seem more intuitive. I wish to set the constraint that if an object is already a "child", that object cannot have two "parent"s (i.e. there can't be two "parents" hooked to the "child"s slot). As well, if an object is already a "child," that object is then not allowed to "parent" other objects.
I could set up some sort of manager class to track all of this with my dynamically created/destroyed objects, but as I am only connecting one slot to one signal to accomplish my "parenting," it seems more direct to me to be able to just query the current signal/slot connection state on that particular signal/slot.
Bookmarks