title: Qt5 Remote Objects + custom type but not in POD
body: <p>I would like to use loads of custom objects with Qt5 remote objects.
  As I read they might not needed to be created as PODs in the .REP file.
  I have tried to do the following:</p>
  
  <pre><code>namespace my::api {
      class Card {
          Q_GADGET
  
          Q_PROPERTY(QString type READ type WRITE setType)
          [... removed property functions]
          Q_PROPERTY(QString id READ id WRITE setId)
          [... removed property functions]
  
          public:
          static void declareQML() {
              qRegisterMetaType&lt;my::api::Card&gt;("Card");
          }
      };
  
      inline QDataStream&amp; operator&lt;&lt;(QDataStream&amp; stream, const my::api::Card &amp; value) {
          stream &lt;&lt; value.type() &lt;&lt; value.id();
          return stream;
      }
  
      inline QDataStream&amp; operator&gt;&gt;(QDataStream&amp; stream, quint::api::Card &amp; value) {
          QString tmp;
          stream &gt;&gt; tmp;
          value.setType(tmp);
  
          stream &gt;&gt; tmp;
          value.setId(tmp);
  
          return stream;
      }
  
      class Result {
          Q_GADGET
  
          Q_PROPERTY(bool status READ status WRITE setStatus NOTIFY statusChanged)
      public:
          bool status() { return m_status; }
      public slots:
          void setStatus(bool p) { m_status = p;  emit statusChanged(); }
      private:
          bool m_status;
  
      public:
  
          static void declareQML() {
              qRegisterMetaType&lt;my::api::Result&gt;("Result");
          }
  
          Result() : m_code(false) {}
      };
  
      inline QDataStream&amp; operator&lt;&lt;(QDataStream&amp; stream, const my::api::Result &amp; value) {
          stream &lt;&lt; value.status();
          return stream;
      }
  
      inline QDataStream&amp; operator&gt;&gt;(QDataStream&amp; stream, my::api::Result &amp; value) {
          bool tmp;
          stream &gt;&gt; tmp;
          value.setStatus(tmp);
          return stream;
      }
  }
  </code></pre>
  
  <p>Then do something like that in the .REP:</p>
  
  <pre><code>SLOT(checkCard(my::api::Card card));
  SIGNAL(checkCardResponse(my::api::Result result));
  </code></pre>
  
  <p>However I get </p>
  
  <pre><code>Trying to construct an instance of an invalid type, type id: 1073676288
  Trying to construct an instance of an invalid type, type id: 655615
  Trying to construct an instance of an invalid type, type id: 1073676288
  </code></pre>
  
  <p>from the client, when I try to do a checkCard().</p>
  
  <p>all the declareQML stuff is called right after starting the application
  (before the replica is created).</p>
  
  <p>Can anyone post me a complete/working example how to use custom classes
  with QT5 Remote Objects without creating the custom classes as PODs in the
  REP file?</p>