Right, I was assuming as much; but I wanted to ask.
@high_flyer, I was talking about both.. sort of. I meant a has-a relationship when I was speaking about traditional C++ and how that wouldn't imply anything in Qt. In Qt a has-a relationship when initialized with a "this" (or some other Qobject) denotes a child parent relationship regardless (IIRC.)
@amleto ...and thus (continuing from the above) I was wondering if there was any neat functionality like a constructor that could build *two* parent relationships such as MyWidget(*parent1 = somewidget, *parent2 = someotherwidget);
I knew it was a stretch but for all I knew there'd be a simple workaround to it or it would exist.
The idea was that I could do something like:
parent1->hide(); (which hides all of it's qchildren)
and
parent2->show(); (which shows all of it's qchildren)
and by this button having both parents it remains abstracted from the View Manager class I'm using but shows in both windows in an elegant way; I.E. not hardcoding it to show in both windows but showing only when it's appropriate.
My question (tangled up with the other one) was also if there was some way (without modifying show() and hide(), though that is a possibility) to perform such functionality; by putting some reference in each one somehow. I'm attempting to avoid duplicating the same QWidget in multiple windows (in terms of code) while having it show in each window *without hardcoding it in.* Now, there's no real reason I *can't* hardcode it, it's just dirty. I could also pull it up to the parent of these two.. parents, but that means the view-manager is dealing with dirty details instead of delegating; which I figured is unintuitive were someone to play with my code later.
Does that clear it up a bit? Thank you for any ideas you might put forth
Bookmarks