Results 1 to 5 of 5

Thread: How to design a thumbnail viewer in QT

  1. #1
    Join Date
    Apr 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default How to design a thumbnail viewer in QT

    I'm trying to design a thumbnail viewer that displays several pixmaps in a grid of some type.

    I want it to automatically re-arrange the thumbnails when I resize the window. So far I've tried using a QGridLayout to do this but it doesn't seem like it has the ability to auto-rearrange.

    Any suggestions on what Qt objects to use for this purpose? Or are there any good examples to point me to? Thanks!

  2. #2
    Join Date
    Feb 2007
    Location
    Karlsruhe, Germany
    Posts
    469
    Thanks
    17
    Thanked 90 Times in 88 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to design a thumbnail viewer in QT

    Hi!

    This qt-app uses a QGraphicsView. They use it to allow dynamic resizing of the images, when the user clicks on them.
    http://qt-apps.org/content/show.php/...content=106101

    What do you mean by auto-arrange? That the number of rows and columns change automatically? I dont know if something like this exists, but writing your own layoutclass that arranges widgets in a line breaking manner should be possible :->

    Johannes

  3. #3
    Join Date
    Apr 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to design a thumbnail viewer in QT

    Thanks for the reply, I'll check it out.

    By auto-arrange I mean that, if I stretch the window to become wider, the images will automatically form a single row across. If I make the window smaller, the images will form several rows as needed with a vertical scroll bar.

    A quick QGridLayout example that I made doesn't do that. Thanks again.

  4. #4
    Join Date
    Aug 2009
    Location
    Greece, Chania
    Posts
    63
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: How to design a thumbnail viewer in QT

    What size policy did you use and you didn't got the desired result?

  5. #5
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: How to design a thumbnail viewer in QT

    Quote Originally Posted by MrBeef View Post
    By auto-arrange I mean that, if I stretch the window to become wider, the images will automatically form a single row across. If I make the window smaller, the images will form several rows as needed with a vertical scroll bar.

    A quick QGridLayout example that I made doesn't do that. Thanks again.
    Have a look for the flow layout example. But if you don't have thousends of items, just react on the resize event and calculate the position of the items yourself in a function. ~ 15 lines of code!

  6. The following user says thank you to Lykurg for this useful post:

    JohannesMunk (21st April 2010)

Similar Threads

  1. photo thumbnail viewer
    By chezifresh in forum Qt Programming
    Replies: 12
    Last Post: 3rd January 2012, 21:25
  2. show thumbnail
    By adonaicanez in forum Newbie
    Replies: 1
    Last Post: 19th October 2009, 07:46
  3. Replies: 3
    Last Post: 5th October 2008, 23:41
  4. Multiplatform Video Viewer Application Design Options
    By PhilippB in forum Qt Programming
    Replies: 2
    Last Post: 18th August 2008, 09:38
  5. Problems with a thumbnail viewer for Konqueror
    By Valheru in forum KDE Forum
    Replies: 5
    Last Post: 22nd January 2008, 18:23

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.