Hi, probably this question was discussed before, but I do not find the answer in the forum archive...
Short: I need to access the parent Widget scope from a child widget...
The code I use is the follow, in the child widget :

Qt Code:
  1. foreach (QWidget *widget, QApplication::topLevelWidgets())
  2. {
  3. this->myMainForm = qobject_cast<MainForm *>(widget);
  4. if(this->myMainForm)
  5. {
  6. break;
  7. }
  8. }
  9.  
  10. this->myMainForm->parentivar;
To copy to clipboard, switch view to plain text mode 

The code works, but is it the correct and best approach to access a parent widget ivar, from a child widget ?
Thank you in advance for the answer.