Results 1 to 4 of 4

Thread: QListView icon list like explorer + resize dynamic

  1. #1
    Join Date
    May 2013
    Posts
    304
    Thanks
    9
    Thanked 7 Times in 7 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
    445
    Thanked 61 Times in 57 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
    304
    Thanks
    9
    Thanked 7 Times in 7 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
    4,111
    Thanks
    235
    Thanked 654 Times in 644 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    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, 17:14
  2. QListView resize icon dynamically
    By Alundra in forum Qt Programming
    Replies: 1
    Last Post: 24th June 2014, 02:38
  3. Create windows explorer with QListView QTreeView
    By dima in forum Qt Programming
    Replies: 3
    Last Post: 13th January 2012, 10: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, 03:03
  5. icon visible from explorer
    By ChasW in forum Qt Programming
    Replies: 2
    Last Post: 9th February 2007, 21: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.