title: Models and roles in Qt5 and Qt 4.8
body: <p>Today I wanted to play with QtQuick2 a little bit. So I have started to port very simple Qt Quick1 app to Quick2. This app uses some models. And in Qt5 models are not working as I expect: I can't access data using roles.</p>
  
  <p>This is my QML code:</p>
  
  <pre><code>import QtQuick 2.0
  
  Rectangle {
  width: 800
  height: 360
  
  ListView {
      model: mainModel
      spacing: 5
      anchors.fill: parent
      orientation: ListView.Vertical
      delegate: Text {
          text: "1"
  
          Component.onCompleted: {
              console.log(mainModel);
              console.log(mainModel.roles() );
              console.log(model);
              console.log(model.homm); // `homm` is my roleName
              console.log(homm);
          }
      }
  </code></pre>
  
  <p>In Qt4.8 I was able to get data using <code>roleName</code> syntax (in this QML my roleName=<code>homm</code>) but in Qt5 I can't. That's what is written in console:</p>
  
  <pre><code>MainModel(0x7fff08beff80)
  homm,wtf
  QQuickVDMAbstractItemModelData(0x23c96e0)
  undefined
  file:///media/disk/kakadu/prog/qt/quick2test/qml/quick2test/main.qml:20: ReferenceError: homm is not defined
  </code></pre>
  
  <p>And that's for Quick 1.1</p>
  
  <pre><code>MainModel(0x7fffe58182f0)
  undefined
  QDeclarativeVisualDataModelData(0x2372ea0)
  QVariant(MiniModel*)
  QVariant(MiniModel*)
  </code></pre>
  
  <p>As you can see accessing data using roles work as expected. I have created test apps for you:
  <a href="https://github.com/Kakadu/qml-test-2/tree/88b2f33d7b06f41b44601d9387b8a0046731fa3f" rel="nofollow">for Qt5</a> and <a href="https://github.com/Kakadu/qml-test-2/tree/88b2f33d7b06f41b44601d9387b8a0046731fa3f" rel="nofollow">for Qt 4.8</a>. I hope  you will help me to find the heart of matter.</p>
  
  <p>P.S. I have made some changes in Qt5 version. In Qt5 method <code>setRoleNames()</code> is obsolete and overriding of <code>roleNames()</code> is recommended. I have done this overriding.</p>
  
  <p>P.P.S. My code example should be compilable on GNU/Linux x64</p>