Hi everyone,

I have a huge list of strings (up to 5.000) in a QStringList that I want to display in a custom way (not only as a simple list of strings).
Therefore I created a QWidget in designer in the way how each of my list entries should be displayed.

The custom QWidget:
Screen Shot 2016-11-07 at 15.25.49.png

In my mainview I want to have a QListWidget or QListView that uses my QStringList as data model (may I have to switch to QStringListModel) but display each line as one of the above QWidgets.
And if the data of the model (QStringList/Model) changes the QListWidget/View should update automatically.

My desired result (with display button mouseover):
Screen Shot 2016-11-07 at 16.04.57.png
Don't worry there will be a search bar too.

I know how to make a (simple) QListView that uses and reacts on changes of a model.
I also know how to get the custom QWidget into a QListWidget.
But I have no idea on how to connect these two things and have a view that is filled by and reacts on a models data and displays the data in custom widgets.

This is how I currently update my view.
It deletes all current entries fetches the list again and fills in everything again, but I think there has to be a way to make that easier/better.
Qt Code:
  1. void updateView() {
  2. ui->listWidget->clear();
  3. m_dataList->clear(); // QStringList
  4.  
  5. // fill the given QStringList with data
  6. getData(m_dataList);
  7.  
  8. foreach (const QString &itemInList, m_dataList) {
  9. ListEntry *entry = new ListEntry(itemInList, ui->listWidget);
  10.  
  11. QSize size(60, 60);
  12. QListWidgetItem *item = new QListWidgetItem(listWidget);
  13. item->setSizeHint(size);
  14. listWidget->setItemWidget(item, entry);
  15.  
  16. connect(entry, &ListEntry::delete,
  17. this, &MainWindow::onDeleteClicked);
  18. }
  19. }
To copy to clipboard, switch view to plain text mode 

Maybe there is just a little piece to solve it that I'm currently totally not aware of.

Kind regards for everyone to help out.