title: Qt: update - add ui objects to existing window at runtime
body: <p>Is it possible to add ui objects (buttons, text boxes etc) to a visible qt window, i.e. I have a window that has a QTextEdit where the user can add a number, then there is a button to add another QTetEdit for another number and a button to remove it. This means that i can add an arbitrary number of fields and later on i can perform some sort of calculation on the all the elements, because I need to be able to add an arbitrary number of extra objects so showing and hiding elements would probably be inefficient. This is a made up example but it demonstrates the purpose of what I'm after.</p>
  
  <p>Has anyone done anything similar?</p>
  
  <p>-- update --</p>
  
  <p>Heres some code I am trying thats not working for me, the window is already visible when the code runs:</p>
  
  <pre><code>void MainWindow::addArgument()
  {
      QPushButton button;
      ui-&gt;addArgRowHorizontalLayout-&gt;addWidget(&amp;button);
      button.show();
      this-&gt;show();
  }
  </code></pre>
  
  <p>anybody know what im doing wrong, everything autocompletes in qtcreator and compiles with no errors so i dont know where to go next.</p>
  
  <p>j</p>