title: QML: Unable to assign [undefined] to
body: <p>I'm trying to rewrite interface for a Qt-Android program from QWidgets to QML. I never used it earlier so mistakes could be very obvious and dumb.</p>
  
  <p>New interface is based on ListView:</p>
  
  <p>It looks like:</p>
  
  <pre><code>ListView
  {
      id: listView
      x: 16
      y: 146
      width: 262
      height: 282
      model: myModel
      delegate: Item
      {
          x: 5
          width: 80
          height: 40
          Row
          {
              id: row1
              spacing: 10
              Text
              {
                  width: 50
                  text:model.modelData.getPassword
                  font.bold: true
                  anchors.verticalCenter: parent.verticalCenter
              }
              ProgressBar
              {
                  value: model.modelData.getDifficulty
              }
          }
      }
  }
  </code></pre>
  
  <p>List in main() is filled this way:</p>
  
  <pre><code>QList&lt;QObject*&gt; dataList;
  dataList.append(new DataObject("Item 1", 50));
  dataList.append(new DataObject("Item 2", 60));
  dataList.append(new DataObject("Item 3", 70));
  dataList.append(new DataObject("Item 4", 80));
  
  
  QGuiApplication app(argc, argv);
  qmlRegisterType&lt;BackEnd&gt;("tk.asciigames.backend", 1, 0, "BackEnd");
  
  QQmlApplicationEngine engine;
  
  engine.rootContext()-&gt;setContextProperty("myModel", QVariant::fromValue(dataList));
  
  engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
  
  return app.exec();
  </code></pre>
  
  <p>DataObject:</p>
  
  <pre><code>class DataObject : public QObject
  {
      Q_OBJECT
  
      Q_PROPERTY(QString password         READ getPassword)
      Q_PROPERTY(unsigned int difficulty  READ getDifficulty)
  public:
     DataObject(QString _pass, unsigned int _difficulty)
  {
      difficulty = _difficulty;
      password = _pass;
  }
  
  QString getPassword()
  {
      return password;
  }
  
  unsigned int getDifficulty()
  {
      return difficulty;
  }
  
  private:
  unsigned int    difficulty;
  QString         password;
  
  };
  </code></pre>
  
  <p>While running QML really shows 4 lines(as expected) but without data.
  Log has such errors:</p>
  
  <pre><code>qrc:/main.qml:118:26: Unable to assign [undefined] to QString
  qrc:/main.qml:124:28: Unable to assign [undefined] to double
  </code></pre>
  
  <p>Those errors corresponds to QML-lines:</p>
  
  <pre><code>text:model.modelData.getPassword
  value: model.modelData.getDifficulty
  </code></pre>
  
  <p>So it looks like QML gets the array but not able to get data from it.</p>
  
  <p>Can somebody help me to find a mistake?</p>