Important: Please read the Qt Code of Conduct -

QListView IconMode - content problem

  • Hey guys,

    I have created a QListView and gave it the following settings:

    _listView = new QListView;
    _listView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);

    Then i created a new QStandardItemModel and set the ListView Model to the new one.
    After this i wanted to test it with this:

    for(int i = 0; i < 10; i++)
    model->appendRow(new QStandardItem(QIcon("images/no.jpg"), "SomeTestText"));

    Here is my result:


    now my question:

    Why isn't it filling the grid until the end ?
    Which setting am i missing here ?

    Thanks for reading so far.

  • Lifetime Qt Champion

    try to add

  • Perfect, Thanks!

Log in to reply