title: Expose QAbstractListModel element properties to QML in Qt 5.0
body: <p>I've been loosely following the article on <a href="http://cdumez.blogspot.de/2010/11/how-to-use-c-list-model-in-qml.html" rel="nofollow">Christophe Dumez's blog</a> to get a custom QAbstractListModel class to expose the data to a QML (QtQuick2) interface (QtQuick2ApplicationViewer). However, since I'm using Qt 5.0.0 (and MSVC2012), there are some parts of his article that don't apply. For example, the ListModel constructor no longer has to call <code>setRoleNames()</code>, because <code>setRoleNames()</code> has been depreciated in Qt 5.</p>
  
  <pre><code>ListModel::ListModel(ListItem* prototype, QObject *parent) :
      QAbstractListModel(parent), m_prototype(prototype)
  {
    setRoleNames(m_prototype-&gt;roleNames());
  }
  </code></pre>
  
  <p>It is my understanding that the class that inherits from QAbstractListModel must only define <code>roleNames()</code>, as it has been changed to be a purely virtual function in Qt 5. So in his example, I simply comment out <code>setRoleNames(m_prototype-&gt;roleNames());</code> in the constructor and everything should work. Right?</p>
  
  <p>But instead, all of the defined roles are undefined, when accessed through QML. I can check the names in C++ with this:</p>
  
  <pre><code>QHash&lt;int, QByteArray&gt; mynames = model-&gt;find("Elephant")-&gt;roleNames();
  qDebug() &lt;&lt; "Model: " &lt;&lt; mynames;
  </code></pre>
  
  <p>In this case, the role names for the Elephant object print as expected.</p>
  
  <p>Are my assumptions correct, or do I need to do something else to get a QAbstractListModel object to share list element properties with QML2? This seems like a stupid question, but the Qt5 docs are so broken right now, I can't figure it out.</p>
  
  <p>Thanks!</p>