title: Connecting button to an arbitrary function
body: <p>Myself trying to write a program in Qt connecting a function to a button in Qt5.</p>
  
  <pre><code> #include &lt;QApplication&gt;
   #include &lt;QtGui&gt;
   #include &lt;QPushButton&gt;
   static void insert()
   {
       qDebug() &lt;&lt; “pressed”;
   }
  
   int main(int argc,char *argv[])
   {
       QApplication app(argc,argv);
       QPushButton *button=new QPushButton(“button”);
       button-&gt;setGeometry(50,100,150,80);
       QObject::connect(button,&amp;QPushButton::clicked,insert());
       button-&gt;show();
    }
  </code></pre>
  
  <p>But I am getting errors like
      main.cc:23:39: error: within this context
      main.cc:23:55: error: invalid use of void expression
      make: <em>*</em> [main.o] Error 1</p>
  
  <p>Please help…</p>