title: QML C++ Signals-Slot not overloaded
body: <p>I have spent the whole day on this code and couldn't figure out what is the problem.</p>
  
  <p>This is the error:</p>
  
  <pre><code>* ISO C++ forbids declaration of 'cppReturnAnswer' with no type [-fpermissive]
  
  * 'int HandleTextField::cppReturnAnswer(QVariant)' cannot be overloaded
  
  * with 'void HandleTextField::cppReturnAnswer(QVariant)'
  </code></pre>
  
  <p>And this the code:</p>
  
  <pre><code>//handletextfield.h
  class HandleTextField : public QObject
  {
      Q_OBJECT
  public:
  signals:
      void cppReturnAnswer(QVariant data); // ERROR HERE
  public slots:
      std::string text;
      QString color = QString::fromStdString(text);
      emit cppReturnAnswer(QVariant(color)); // ERROR HERE
  };
  </code></pre>
  
  <p>which is used respectively in program</p>
  
  <pre><code>// in .. handletextfield.cpp
  ...
  void HandleTextField::handleSubmitTextField(const QString &amp;in)
  {   qDebug() &lt;&lt; "c++: HandleTextField::handleSubmitTextField:" &lt;&lt; in;
  
      text="green";
      QString color = QString::fromStdString(text);
      emit cppReturnAnswer(QVariant(color));
  }
  
  // in main.cpp
  ...
  QObject *topLevel = engine.rootObjects().at(0);
  QQuickWindow *window = qobject_cast&lt;QQuickWindow *&gt;(topLevel);
  // connect - from QML to C++ ---- WORKS NICE
  QObject::connect(window, SIGNAL(submitTextField(QString)),
                       &amp;handleTextField, SLOT(handleSubmitTextField(QString)));
  // connect - from C++ to QML  ---- NOT WORKING
  QObject::connect(&amp;handleTextField,
                   SIGNAL(cppReturnAnswer(QVariant)),
                   window,
                   SLOT(qmlUpdateData(QVariant)));
  
  // in main.qml
  ...
  function qmlUpdateData(text){
      // hack(msg designer:: imperative code not supported in Qt Quick)
      page.color=text // gotdata from C++ backend
  }
  </code></pre>
  
  <p>Any suggestions and comments are highly appreciated.</p>