title: How do I get the value of an object from one window into another window's class with Qt Creator?
body: <p>This seems like it should be a simple question. I have two QSpinBoxes in my MainWindow, with a push button beside them. The user first selects the dimensions of an array of checkboxes using these spin boxes, then clicks the push button. This pops up a new window with the array of checkboxes in it. The problem I am having though is that when I try to get the value of the spinboxes in my popup window's code, I get a compiler error because these buttons are private. Here is the code:</p>
  
  <pre><code>void DomainGeneration::createBoxes()
  {
      int x_dim = MainWindow::ui-&gt;xDim-&gt;value();
      int y_dim = MainWindow::ui-&gt;yDim-&gt;value();
  ......the code......
  }
  </code></pre>
  
  <p>Compiler errors:</p>
  
  <blockquote>
    <p>'Ui::MainWindow* MainWindow::ui' is
    private within this context</p>
  </blockquote>
  
  <p>and</p>
  
  <blockquote>
    <p>object missing in reference to
    'MainWindow::ui' from this location</p>
  </blockquote>
  
  <p>So my question is, how do I access these objects from a different window?</p>