Pass a pointer to the parent in widget CTOR, e.g. in your main window:

Qt Code:
  1. btn = new QPushButton("Open!",this);
To copy to clipboard, switch view to plain text mode 

When placing the objects with designer, all of this stuff is implicitly done inside the ui object.