List View only displaying the first item
Unsolved
QML and Qt Quick
-
I have a list view trying to display a QStringList that I populate in C++. I've printed the count in both C++ and in the one QString that gets displayed via: text: listView.count. So I know that it receives the full list, but it only displays the first item.
QML:
ListView { id: myListView Layout.margins: 8 spacing: 5 model: myQStringListFromC++ delegate: Text { text: "- " + modelData } }
C++:
QStringList MyApp::getStringListToDisplay() const { QStringList ret; auto stringsToAdd= vectorOfStrings; for(auto aString: stringsToAdd) { ret.push_back(QString::fromStdString(aString)); } return ret; }
I've made sure that the QStringList Q_PROPERTY gets refreshed, but it still doesn't want to display the whole list.
Thank you!