title: QT/c++ call class function with pushbutton
body: <p>i have an UI with two buttons. My first button read an xml file. The second button should create an window an show a circle.</p>
  
  <p>I have a mainwindow.h and a circle.h. Now i want to start my circle function with a  pushbutton click.</p>
  
  <p>My circle function:</p>
  
  <pre><code>void circle::paintEvent(QPaintEvent *e)
  {
  
   Q_UNUSED(e);
   QPainter painter(this);
  
   painter.setRenderHint(QPainter::Antialiasing);
   painter.setPen(QPen(QBrush("#888"), 1));
   painter.setBrush(QBrush(QColor("#888")));
  
   qDebug() &lt;&lt; "\r\nxarray : " &lt;&lt;"test";
   for(int z = 0; z &lt; 50; z++)
   {
    painter.drawEllipse(10, 10, 100, 100);
   }
   }
  </code></pre>
  
  <p>Atm i start it with:</p>
  
  <pre><code>circle::circle(QWidget *parent)
  : QWidget(parent)
  {}
  </code></pre>
  
  <p>But i want to start it with:</p>
  
  <pre><code>void MainWindow::on_pushButton_clicked(
   {}
  </code></pre>
  
  <p>How can i start my function with the pushButton?</p>
  
  <p>[I just started to learn qt/c++ so im a beginner]</p>
  
  <p>greetings</p>