Results 1 to 5 of 5

Thread: "Icon grid"

  1. #1
    Join Date
    Nov 2009
    Posts
    29
    Thanks
    10

    Default "Icon grid"

    Hello,

    How could I make an "icon grid"?

    I do not know how to say it better. I would like to set icons or simply labels on a grid. The aim is to have something that looks like, for example, the contents of a folder displayed in konqueror where every file appears as an icon. I would also need these elements to be clickable.

    I have found no easy way to do this but I assume that there must be a simple way to do it.

    Thank you!

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: "Icon grid"

    use QGridLayout.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. The following user says thank you to high_flyer for this useful post:

    pippo42 (12th January 2010)

  4. #3
    Join Date
    Nov 2009
    Posts
    29
    Thanks
    10

    Default Re: "Icon grid"

    Thank you!

    Initially, I had done it with QGridLayout but I was hoping (without being able to find it) that there would be something more simple where I could just "throw" the items I wanted to display and that their organisation would be automatic in case the use resized the window for example.

  5. #4
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: "Icon grid"

    Use QListView with your model (like QStandardItemModel or your own implementation) or QListWidget and use QListView::setViewMode() to set the mode to QListView::IconMode.
    I would like to be a "Guru"

    Useful hints (try them before asking):
    1. Use Qt Assistant
    2. Search the forum

    If you haven't found solution yet then create new topic with smart question.

  6. The following 2 users say thank you to faldzip for this useful post:

    ecanela (12th January 2010), pippo42 (13th January 2010)

  7. #5
    Join Date
    Nov 2009
    Posts
    29
    Thanks
    10

    Default Re: "Icon grid"

    Thanks!

    I had used QtAssistant and searched in google but did not find what I needed.

    I have reached the same conclusion as you did. I am now doing it in a QListWidget and icons. That way, the layout of the entries will be nicely set up automatically.

Similar Threads

  1. QSplitter like a "grid" splitter [Using qt 4.4]
    By yandy in forum Qt Programming
    Replies: 7
    Last Post: 22nd March 2012, 06:42
  2. How to sort columns by "icon"?
    By youkai in forum Qt Programming
    Replies: 3
    Last Post: 31st July 2008, 16:25
  3. Replies: 3
    Last Post: 8th July 2008, 19:37
  4. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 19:05
  5. QFile Problem~ "Unknow error" in "open(QIODevice::ReadWrite)"
    By fengtian.we in forum Qt Programming
    Replies: 3
    Last Post: 23rd May 2007, 15:58

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.