title: How do I display a counter function in qt
body: <p>I know that in c++ you do int counter and when it does something I want its gonna do c++ and then <code>cout&lt;&lt; counter</code> to show the counter but now I want to do a GUI app which will have 20 buttons and when a button is pressed to do the counter++ and print the counter. I have done it but how do I do it to show the counter in a label?  </p>
  
  <p><strong>code</strong></p>
  
  <pre><code>        #include "form.h"
          #include "ui_form.h"
          #include &lt;QString&gt;
          #include &lt;QLabel&gt;
  
          Form::Form(QWidget *parent) :
              QWidget(parent),
              ui(new Ui::Form)
          {
              QString::number();
              QString s = QString::number();
              ui-&gt;setupUi(this);
  
          }
  
          Form::~Form()
          {
              delete ui;
          }
  
          void Form::on_pushButton_clicked()
          {
  
              counter++;
  
              ui-&gt;label-&gt;setText(QString::number(counter));
          }
  </code></pre>
  
  <p><strong>header</strong>:</p>
  
  <pre><code>                           #ifndef FORM_H
          #define FORM_H
  
          #include &lt;QWidget&gt;
          #include &lt;QString&gt;
  
          namespace Ui {
          class Form;
          }
  
          class Form : public QWidget
          {
              Q_OBJECT
  
          public:
              explicit Form(QWidget *parent = 0);
              ~Form();
  
          private slots:
              void on_pushButton_clicked();
              int counter=0;
  
          private:
              Ui::Form *ui;
          };
  
          #endif // FORM_H
  </code></pre>
  
  <p>errors I get:</p>
  
  <p>1)</p>
  
  <blockquote>
    <p>no matching function for call to 'QString::number()'
         QString::number();</p>
  </blockquote>