title: Can I create a slot without creating a class?
body: <p>Just a simple prog to illustrate the issue in a larger one. What I am trying to do is to create a function for signal/slot connection without using any classes. I am new to OOP and don't want to have to do with classes at the moment. So, I am creating a function before the <code>main</code> function and hope this will work... but it doesn't. The prog can be compiled and executed, but I get a notification: <code>Object::connect: No such slot QTextEdit::onClicked()</code>. I anticipate the issue can very easily be solved as it is rather a mistake of expression than of understanding, so thanks in advance for your help! :)</p>
  
  <pre><code>#include &lt;QtGui&gt;
  #include &lt;QtCore&gt;
  
      void onClicked (QTextEdit text, QString a)
      {
          text.setText(a);
      }
  
      int main(int argc, char *argv[])
      {
          QApplication app(argc, argv);
  
          QWidget mw;
          mw.setWindowTitle("Main Window");
          mw.resize(400, 400);
          mw.show();
  
          QLabel label ("Enter something:", &amp;mw);
          label.setAlignment(Qt::AlignHCenter);
          label.show();
  
          QLineEdit line (&amp;mw);
          line.show();
  
          QString a = line.text();
  
          QTextEdit text (&amp;mw);
          text.show();
  
          QPushButton btn ("Convert", &amp;mw);
          QObject::connect(
          &amp;btn,
          SIGNAL(clicked()),
          &amp;text,
          SLOT(onClicked()));
          btn.show();
  
          QVBoxLayout layout_mw;
  
          layout_mw.addWidget(&amp;label);
          layout_mw.addWidget(&amp;line);
          layout_mw.addWidget(&amp;btn);
          layout_mw.addWidget(&amp;text);
  
          mw.setLayout(&amp;layout_mw);
  
          return app.exec();
      }
  </code></pre>