title: Using QScriptEngine with a "native function" call... QT Example... fails: "no matching function for call to 'QScriptEngine::newFunction' "?
body: <p>I am using an example provide by Qtcreator and getting this error...  ??</p>
  
  <p><img src="https://i.stack.imgur.com/PTbNl.jpg" alt="enter image description here"></p>
  
  <pre><code>void MainWindow::hBtn
  {
      QScriptEngine e;
  
      QScriptValue fun = e.newFunction(myAdd);  // ERROR: No matching function...
      e.globalObject().setProperty("myAdd", fun);
  
      QScriptValue result = e.evaluate("myAdd(myNumber, 1)");
  }
  
  
  QScriptValue myAdd(QScriptContext *context, QScriptEngine *engine)
  //also tried:  QScriptValue MainWindow::myAdd(QScriptContext *context, QScriptEngine *engine) //fails as well with same ERROR
  {
     QScriptValue a = context-&gt;argument(0);
     QScriptValue b = context-&gt;argument(1);
     return a.toNumber() + b.toNumber();
  }
  </code></pre>
  
  <hr>
  
  <p>Example:  <a href="http://harmattan-dev.nokia.com/docs/library/html/qt4/qscriptengine.html" rel="nofollow noreferrer">http://harmattan-dev.nokia.com/docs/library/html/qt4/qscriptengine.html</a></p>
  
  <p>scroll down to "Native Functions"</p>
  
  <hr>
  
  <p>Looked through another user having problems with no solution either:  <a href="https://stackoverflow.com/questions/2935802/using-a-member-function-with-qscriptenginenewfunction">Using a member function with QScriptEngine::newFunction</a></p>