Forums

OverviewV-Play 2 Support (Qt 5)Add C++ model (QAbstractListModel) into ListPage with delegated SimpleRow › Reply To: Add C++ model (QAbstractListModel) into ListPage with delegated SimpleRow

OverviewV-Play 2 Support (Qt 5)Add C++ model (QAbstractListModel) into ListPage with delegated SimpleRow › Reply To: Add C++ model (QAbstractListModel) into ListPage with delegated SimpleRow
#11784

Günther
V-Play Team

Hi Sascha!

We designed the SimpleRow type for easy usage with models described as arrays. This turned out to be a problem when using ListModel based types together with the SimpleRow.

We already fixed this error for the next update. Until then, it should work to add a dummy property “modelData” to your ListModel to get rid of the error.

    ListModel {
      id: listModel
      ListElement { title: "Title"; description: "description"; modelData: "dummy"  }
    }

    ListPage {
        title: qsTr("Test")
        model: listModel
        delegate: SimpleRow{
            textItem.text: title
            detailTextItem.text: description
        }
    }

Hope this also works for your C++ model in the same way!

Best,
Günther

 

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support