SIMPLIFIED REPOST How to access "parent" from "closeEvent" ? SIMPLIFIED REPOST
-
@AnneRanch said in SIMPLIFIED REPOST How to access "parent" from "closeEvent" ? SIMPLIFIED REPOST:
QList<QObject*> ppList = this->parent()->parent()->parent()->parent()->children();
QObject* p=this; while(p->parent()) p = p->parent(); QObjectList ppList = p->children();
-
Thanks a million .. true piece of art code = KISS !
I am not just saying this , but this morning I came up with identical idea... but I was not sure how to implement the while loop.
Woks great, skips over all of the intermediate classes...
And most of all - no RTFM,
I do appreciate your help. -
-
@mpergand Hello,
I have posted more stuff related to my task and it may look as negative toward you.
I am posting this to make sure it is not interpreted that way and woudl like to let you know that I do appreciate all the help you have given me.
The whole idea of automatic re-tillling of QMdiArea subwindows after one is deleted , was really just "bells and whistles ",
nice to have and not essential for my project.
This is / was an extremely (sic?) positive , hence beneficial experience for me, with an exception of uncalled for "contributions" AI / RTFM style.
I realized that big part of the mess was my silly way to keep the Qt example and add QMdiArea to it. Then I ended up with two instances of same class and it was not easy to keep track of which is which.It really does not matter I did not end up with working code, but I sure can reuse it in my next "GUI class hierarchy " - another B&W project.
Yours truly
MFTR