title: Linking a QWidget to another QWidget new created
body: <p>I am try to, by pressing a button in the main QWidget, to create a new QWidget. In that new created QWidget I want to have a button connected to a slot of the main QWidget.</p>
  <pre><code>class UI : public QWidget
  {
  public:
      UI(){connection();};
  private:
      QPushButton* all = new QPushButton{ &quot;ALL&quot; };
      void connection(){
         QObject::connect(all,QPushButton::clicked,[](){
               SmallGUI* s=new SmallGUI{};
               s-&gt;show();
         });
      }
  
      void something(){
         //something
      }
  </code></pre>
  <p>and the second class</p>
  <pre><code>class SmallGUI1 :
      public QWidget
  {
  public:
      SmallGUI(){connection();};
  private:
       QPushButton* N =new QPushButton;
       
       void connection(){
         //to connect N to something()
       }
  </code></pre>
  <p>I want to connect N to something() .</p>