title: error: no matching function for call to
body: <p>I am getting this error:</p>
  
  <pre><code>main.cpp:31: error: no matching function for call to 'QWebFrame::addToJavaScriptWindowObject(QString, Eh*&amp;)'
  candidates are: void QWebFrame::addToJavaScriptWindowObject(const QString&amp;, QObject*)
  </code></pre>
  
  <p>This is the source code:</p>
  
  <pre><code>#include &lt;string&gt;
  #include &lt;QtGui/QApplication&gt;
  #include &lt;QWebFrame&gt;
  #include &lt;QWebView&gt;
  #include &lt;QGraphicsWebView&gt;
  #include &lt;QWebPage&gt;
  #include "html5applicationviewer.h"
  
  class Eh
  {
      int lol()
      {
          return 666;
      }
  };
  
  int main(int argc, char *argv[])
  {
      QApplication app(argc, argv);
  
      Html5ApplicationViewer viewer;
      viewer.setOrientation(Html5ApplicationViewer::ScreenOrientationAuto);
      viewer.showExpanded();
      viewer.loadFile(QLatin1String("html/index.html"));
  
      QWebPage *page = viewer.webView()-&gt;page();
      QWebFrame *frame = page-&gt;mainFrame();
  
      Eh *s = new Eh();
  
      frame-&gt;addToJavaScriptWindowObject(QString("test"), s);
  
      return app.exec();
  }
  </code></pre>
  
  <p>I've tried giving a new instance of <code>Eh</code> and the <code>Eh</code> class itself. In both cases it fails. Also I can't give the non-pointer of it since new returns a pointer.</p>
  
  <p>My question is this: why is it <code>Eh*&amp;</code> and not <code>Eh*</code>?</p>