title: QML Listview and c++: ReferenceError Model not defined
body: <p>I want to display my C++ class as a <code>ListView</code> in QML. I have an empty vector, which will later be filled:</p>
  
  <pre><code>QList&lt;QObject*&gt; _myList;
  </code></pre>
  
  <p>and set the context</p>
  
  <pre><code>QQmlContext *ctxt = _eng-&gt;rootContext();
  ctxt-&gt;setContextProperty("modelName",QVariant::fromValue(_myList));
  </code></pre>
  
  <p>In the qml file I have</p>
  
  <pre><code>ListView {
      id: listView
      model: modelName
      delegate: myDelegate {}
  }
  </code></pre>
  
  <p>But when starting the application I get the following error</p>
  
  <pre><code>qrc:/screen2.qml:252: ReferenceError: modelName is not defined
  </code></pre>
  
  <p>What am I doing wrong? Strangly, the error does not prevent the list from being correctly displayed once it is filled.</p>