title: QT extend MainWindow to other class or diffrent way
body: <p>I have class <code>printrectangle</code></p>
  
  <pre><code>class PrintRectangle : public QWidget
  {
      Q_OBJECT
  public:
      explicit PrintRectangle(QWidget *parent = 0);
  
  private:
      void resetClickedIndex();
      void updateIndexFromPoint( const QPoint&amp; point);
  public:
      int mXIndex;
      int mYIndex;
      QVector&lt;QPoint&gt; points;
      bool clicked[5][5] = {};
      teacher tech;
      perceptron p[5][5];
      double techconst = 0.1;
  
  signals:
  
  public slots:
  protected:
      void paintEvent(QPaintEvent *);
      void mousePressEvent(QMouseEvent *eventPress);
  };
  </code></pre>
  
  <p>and <code>MainWindow</code></p>
  
  <pre><code>namespace Ui {
  class MainWindow;
  }
  
  class MainWindow : public QMainWindow
  {
      Q_OBJECT
  
  public:
      explicit MainWindow(QWidget *parent = 0);
      ~MainWindow();
  
  private slots:
      void on_learn_clicked();
      void on_classify_clicked();
  
  private:
      Ui::MainWindow *ui;
  };
  </code></pre>
  
  <p>When I click button I call to <code>on_learn_clicked()</code> function. I would like to transfer <code>clicked[5][5]</code> array into <code>on_learn_clicked</code> becasue I send this array to other object when user click button. How to do this?  </p>