title: Binding QList<Type*> to QListView
body: <p>I have a custom type, called <code>Patients</code> (please ignore the plural mistake). I want to create a <code>QList&lt;Patients*&gt;</code> in my cpp and consume that from my QML. I am following the patterns from <a href="http://doc.qt.io/qt-5/qtquick-modelviewsdata-cppmodels.html" rel="nofollow">here</a>, but it is not working.</p>
  
  <p>Here is my patients.h (probably more info than needed) . . .</p>
  
  <pre><code>class Patients : public QObject
  {
      Q_OBJECT
      Q_PROPERTY(QString name READ getName)
      Q_PROPERTY(QString email READ getEmail)
      Q_PROPERTY(int id READ getId)
  
  public:
      explicit Patients(QObject *parent = 0);
      explicit Patients(int id, QString name, QString email, QObject *parent = 0);
  
      QString getName() const;
      QString getEmail() const;
      int getId() const;
  
  private:
      QString email, name;
      int id;
  }; 
  </code></pre>
  
  <p>Here is the main cpp</p>
  
  <pre><code>int main(int argc, char *argv[])
  {
      QApplication app(argc, argv);
      QQmlApplicationEngine engine;
  
      QList&lt;Patients*&gt; lst;
      lst.append(new Patients(0, QString("abe"), QString("albert")));
      QQmlContext *ctx = engine.rootContext();
      ctx-&gt;setContextProperty("pLst", QVariant::fromValue(lst));
  
      engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
      return app.exec();
  }
  </code></pre>
  
  <p>Here is the qml . . . </p>
  
  <pre><code>ListView{
      id: lst
      height: 100; width: 100
      anchors.fill: parent
      x: 100; y: 100
  
      model: pLst
      delegate: Text{
          text: model.modelData.name
      }
  }
  </code></pre>
  
  <p>It works when I bind a single object, but not as a list. Even presenting the <code>index</code> inside <code>Text</code> does not work. No error messages or anything.</p>