title: C++ error: no matching function call from pointer to pointer reference using Qt and QVariant
body: <p>I have a QObject subclass defined as such (inside a "Danbooru" namespace):</p>
  
  <pre><code>#ifndef DANBOORUPOST_H
  #define DANBOORUPOST_H
  
  // Qt
  
  #include &lt;QtCore/QObject&gt;
  #include &lt;QtCore/QVariant&gt;
  #include &lt;QtCore/QStringList&gt;
  #include &lt;QtXml/QXmlStreamAttributes&gt;
  
  // KDE
  
  #include &lt;kurl.h&gt;
  
  
  class QPixmap;
  
  namespace Danbooru {
  
      class DanbooruPost : public QObject
      {
  
      Q_OBJECT
  
      Q_PROPERTY(QPixmap* pixmap READ pixmap WRITE setPixmap)
      Q_PROPERTY(int id READ id)
      Q_PROPERTY(KUrl fileUrl READ fileUrl)
      Q_PROPERTY(QStringList tags READ tags)
      Q_PROPERTY(KUrl thumbnailUrl READ thumbnailUrl)
  
      private:
  
          QPixmap* m_pixmap;
  
          // basic features of a post
  
          int m_id;
          int m_height;
          int m_width;
          int m_size;
  
          KUrl m_url;
          KUrl m_thumbnailUrl;
          QStringList m_tags;
  
      public:
          explicit DanbooruPost(QVariantMap postData, QPixmap* pixmap = 0,
                                QObject* parent = 0);
          explicit DanbooruPost(QXmlStreamAttributes&amp; postData,
                                QPixmap* pixmap = 0,  QObject* parent=0);
  
          bool operator==(const DanbooruPost&amp;);
  
          ~DanbooruPost();
  
          // Post attributes
  
          int id() const;
          int height() const;
          int width() const;
          int size() const;
  
          const KUrl fileUrl() const;
          QStringList tags() const;
          const KUrl thumbnailUrl() const;
  
          QPixmap* pixmap() const;
          void setPixmap(QPixmap* pixmap);
  
          const QString toString();
  
      };
  
  }; // namespace Danbooru
  
  Q_DECLARE_METATYPE(Danbooru::DanbooruPost*)
  #endif // DANBOORUPOST_H
  </code></pre>
  
  <p>and I'm using it in another class defined like this:</p>
  
  <pre><code>#ifndef DANBOORUSERVICE_H
  #define DANBOORUSERVICE_H
  
  #include &lt;QtCore/QObject&gt;
  #include &lt;QtCore/QString&gt;
  #include &lt;QtCore/QStringList&gt;
  
  #include &lt;KUrl&gt;
  #include &lt;KIO/JobClasses&gt;
  
  class QPixmap;
  class KUrl;
  class KJob;
  
  class DanbooruPost;
  
  namespace Danbooru {
  
      enum TagType {
          General,
          Artist,
          Copyright,
          Character
      };
  
      using KIO::StoredTransferJob;
  
      class DanbooruService : public QObject
      {
      Q_OBJECT
  
      private:
  
          // URL fragments
  
          static const QString POST_URL;
          static const QString TAG_URL;
          static const QString POOL_URL;
          static const QString ARTIST_URL;
          static const QString POOL_DATA_URL;
          static const QString RELATED_TAG_URL;
  
          // member variables
  
          KUrl m_url;
          QString m_username;
          QString m_password;
          QStringList m_blacklist;
          QString m_maxRating;
  
  
      public:
          DanbooruService(KUrl&amp; boardUrl, QString username = QString(),
                          QString password = QString(),
                          QStringList blacklist = QStringList(),
                          QObject* parent=0);
          ~DanbooruService();
  
          void getPostList(int page=1, QStringList tags=QStringList(),
                          int limit=100, QString rating="Safe");
          void getPoolList(int page=0);
          void getPool(int poolId, int page=1, QString rating="Safe");
          void getTagList(int limit=10, QString name="");
          void getRelatedTags(QStringList tags=QStringList(),
                              TagType tag_type=General);
  
          QString allowedRating() const;
          QStringList blacklist() const;
  
  
      private Q_SLOTS:
          void processPostList(StoredTransferJob* job);
          void processPoolList(StoredTransferJob* job);
          void processRelatedTagList(StoredTransferJob* job);
          void downloadThumbnail(StoredTransferJob* job);
          void downloadAllTags(StoredTransferJob* job);
  
      Q_SIGNALS:
          void postDownloadFinished();
          void poolDownloadFinished();
          void downloadError(QString error);
          void postDownloaded(DanbooruPost*&amp;post);
          void postMetadataDownloaded(DanbooruPost* post);
          // TODO: Tags and similar
  
      };
  };
  </code></pre>
  
  <p>The problem I'm experiencing arises from this code (StoredTransferJob is a KDE class):</p>
  
  <pre><code>void DanbooruService::downloadThumbnail(StoredTransferJob* job)
      {
          if (job-&gt;error()) {
              Q_EMIT(downloadError(job-&gt;errorString()));
          }
  
          QVariant postData = job-&gt;property("danbooruPost");
  
          DanbooruPost* post = (DanbooruPost*) postData.data();
          QPixmap* pix = new QPixmap();
          bool ok = pix-&gt;loadFromData(job-&gt;data());
  
          if (!ok) {
              Q_EMIT(downloadError(QString("Pixmap data could not be loaded")));
          }
  
          post-&gt;setPixmap(pix);
  
          Q_EMIT(postDownloaded(post));
  
      }
  </code></pre>
  
  <p>However when compiled, the Q_EMIT part generates this error:</p>
  
  <pre><code>/home/lb/Coding/cpp/danbooru_client/src/libdanbooru/danbooruservice.cpp: In member function ‘void Danbooru::DanbooruService::downloadThumbnail(KIO::StoredTransferJob*)’:
  /home/lb/Coding/cpp/danbooru_client/src/libdanbooru/danbooruservice.cpp:186:35: error: no matching function for call to ‘Danbooru::DanbooruService::postDownloaded(Danbooru::DanbooruPost*&amp;)’
  /home/lb/Coding/cpp/danbooru_client/src/libdanbooru/danbooruservice.cpp:186:35: note: candidate is:
  In file included from /home/lb/Coding/cpp/danbooru_client/src/libdanbooru/danbooruservice.cpp:30:0:
  /home/lb/Coding/cpp/danbooru_client/src/libdanbooru/danbooruservice.h:104:14: note: void Danbooru::DanbooruService::postDownloaded(DanbooruPost*&amp;)
  /home/lb/Coding/cpp/danbooru_client/src/libdanbooru/danbooruservice.h:104:14: note:   no known conversion for argument 1 from ‘Danbooru::DanbooruPost*’ to ‘DanbooruPost*&amp;’
  </code></pre>
  
  <p>The code that generates the variant used in the function is:</p>
  
  <pre><code>void DanbooruService::processPostList(KIO::StoredTransferJob* job)
  {
  
      qDebug() &lt;&lt; "Got data OK";
  
      if (job-&gt;error()) {
          Q_EMIT(downloadError(job-&gt;errorString()));
      }
  
      QByteArray data = job-&gt;data();
  
      QJson::Parser parser;
  
      bool ok;
  
      QVariant result = parser.parse(data, &amp;ok);
  
      if (!ok) {
          Q_EMIT(downloadError(QString("Unable to decode data")));
      }
  
      QList&lt;QVariant&gt; postList = result.toList();
  
      Q_FOREACH(QVariant element, postList) {
          QVariantMap map = element.toMap();
          DanbooruPost* post = new DanbooruPost(map);
          StoredTransferJob* pixmapJob = KIO::storedGet(post-&gt;thumbnailUrl(),
              KIO::NoReload, KIO::HideProgressInfo);
  
          qDebug() &lt;&lt; "Basic job info";
          qDebug() &lt;&lt; post-&gt;id() &lt;&lt; post-&gt;thumbnailUrl() &lt;&lt; post-&gt;fileUrl();
  
          QVariant variant;
  
          variant.setValue(post);
  
          pixmapJob-&gt;setProperty("danbooruPost", variant);
          connect(pixmapJob, SIGNAL(result(KJob*)), this,
                  SLOT(downloadThumbnail(StoredTransferJob*)));
  
      }
  </code></pre>
  
  <p>I'm absolutely baffled by this error. What might I be doing wrong?</p>