Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QListView IconMode - content problem

QListView IconMode - content problem

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 616 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Neko
    wrote on last edited by
    #1

    Hey guys,

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

    _listView = new QListView;
    _listView->setViewMode(QListView::IconMode);
    _listView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    _listView->setFlow(QListView::LeftToRight);

    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:

    0_1531296550296_968b927c-e50d-48a9-9fd7-3c34bb89fde1-image.png

    now my question:

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

    Thanks for reading so far.

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      try to add
      ui->theview->setResizeMode(QListView::Adjust);

      1 Reply Last reply
      3
      • N Offline
        N Offline
        Neko
        wrote on last edited by
        #3

        Perfect, Thanks!

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved