Results 1 to 4 of 4

Thread: QListView icon list like explorer + resize dynamic

  1. #1
    Join Date
    May 2013
    Posts
    321
    Thanks
    9
    Thanked 8 Times in 8 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Exclamation QListView icon list like explorer + resize dynamic

    Hi,
    I try to achieve something very easy but looks like very complicated to have a working solution in Qt.
    I have a QListWidget and I simply try to have the icons like windows explorer, meaning a space between each of them on top, bottom, left and right.
    Additionally I try to have the size dynamically change to always use the whole space of the widget, simple linear interpolation from min size to max size then it adds a new icon to the row.
    Is it possible to have some help ?
    Thank you

  2. #2
    Join Date
    Jan 2006
    Location
    Bremen, Germany
    Posts
    554
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QListView icon list like explorer + resize dynamic

    Don't understand completely what you need but are you looking for QListView::IconMode view mode? http://doc.qt.io/qt-5/qlistview.html#ViewMode-enum

  3. #3
    Join Date
    May 2013
    Posts
    321
    Thanks
    9
    Thanked 8 Times in 8 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QListView icon list like explorer + resize dynamic

    I'm trying to have something like windows explorer: https://mspoweruser.com/wp-content/u...e-Explorer.jpg
    Icon mode of QListWidget works but the space between the items don't have the same behavior as windows explorer.
    All the icon are next to each other without any empty space around them.
    When you resize it, it should resize the item to take the most of space possible keeping the empty space around the items.

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QListView icon list like explorer + resize dynamic

    Maybe the Flow Layout will do what you want. If all the items are the same size, I believe it will space them evenly.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Replies: 4
    Last Post: 20th September 2017, 18:14
  2. QListView resize icon dynamically
    By Alundra in forum Qt Programming
    Replies: 1
    Last Post: 24th June 2014, 03:38
  3. Create windows explorer with QListView QTreeView
    By dima in forum Qt Programming
    Replies: 3
    Last Post: 13th January 2012, 11:12
  4. Creating a list with icon and text in the center of icon
    By prophet0 in forum Qt Programming
    Replies: 2
    Last Post: 15th December 2011, 04:03
  5. icon visible from explorer
    By ChasW in forum Qt Programming
    Replies: 2
    Last Post: 9th February 2007, 22:30

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.