I have a QListView with a list of strings.
Basically, I use it as pop window for a QLineEdit for an autocomplete process.
I dont want the QListView to display blank lines, only lines that have strings in it.
See this:

I want it to resize itself automatically so it wont have these blank rows after the last entry.
Thanks
You can try to do this: Reimplement QListView::rowsInserted() method class. Say you have MyListView inherited from QListView. So the code can look like this:
But to do it simpler, I’d recommend you to use QCompleter class with QLineEdit. Its already designed for what you need and you don’t need to spend time trying to make it work.