title: Qt C++ Accessing window methods from another class
body: <p>Im using Qt for a project, I made a QWidget and it works fine. In my widget class i have 3 methods, Quiz is my window,-</p>
  
  <pre><code>void Quiz::appendConsole(QString string) {
      ui-&gt;console-&gt;append(string);
  }
  
  void Quiz::setInput(QString string) {
      ui-&gt;input-&gt;setText(string);
  }
  
  QString Quiz::getInput() {
      return ui-&gt;input-&gt;text();
  }
  </code></pre>
  
  <p>and in the header class they are listed as public as shown - </p>
  
  <pre><code>namespace Ui {
  class Quiz;
  }
  
  class Quiz : public QWidget
  {
      Q_OBJECT
  
  public:
       Quiz(QWidget *parent = 0);
      ~Quiz();
       void appendConsole(QString string);
       void setInput(QString string);
       QString getInput();
  
  private slots:
      void on_button_clicked();
  
      void on_input_returnPressed();
  private:
      Ui::Quiz *ui;
  };
  </code></pre>
  
  <p>But when i try access any of these three methods from another class it fails with the error - 
  error: call to non-static member function without an object argument</p>
  
  <pre><code>void startQuiz() {
      Quiz::setInput("Hello");
  }
  </code></pre>
  
  <p>does anyone know the proper way to access these classes or how these classes should be setup?</p>