Results 1 to 13 of 13

Thread: how to browse images in thumbnail view?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2008
    Posts
    88
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11
    Thanks
    4
    Thanked 4 Times in 3 Posts
    Wiki edits
    1

    Default Re: how to browse images in thumbnail view?

    I'm using a graphics view however I want to use a flow layout which I dont believe exists for QGraphicsPixmapItems so I'm thinking I'm going to have to implement that myself... which seems like a daunting task.

    And so we're all on the same page I want the GraphicsView thumbnail viewer to have vertical scrollbars but no horizontal ones. The thumbnails would show up in rows, say 4 to a row and as you zoom in the icons would resize and eventually you'd have 3 to a row... etc

    I'm pretty sure there are other people out there looking to do the same exact thing since thats exactly how it works in thumbnail view in nautilus, konqueror, finder, etc. Basically any file browser that supports thumbnail views.

    Since konqueror is a Qt app its probably the best example... though unfortunately no one else can use it because its so KDE specific. I was hoping that we could find a Qt example of something like this in the 4.5 examples but no dice.

    In general it seems like it would be an awesome widget to have in say source forge or something with SIP bindings and all. Too bad Qt doesn't support a community of user made widgets in their git repos. The Qt labs examples are a great start but only the guys at Qt seem to be able to contribute.

  2. #2
    Join Date
    Jun 2008
    Posts
    88
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11
    Thanks
    4
    Thanked 4 Times in 3 Posts
    Wiki edits
    1

    Default Re: how to browse images in thumbnail view?

    Just an update...

    I did some digging into the replacement for Konqueror, "Dolphin", and it appears to be using an item view for its thumbnail view (a KCategorizedView which is derived from a QListView). At least as far as I can tell it doesnt appear to be taking advantage of the QGraphicsView.

    I'm assuming they're using that because they have a QDirModel driving it.

    It sure would be nice to have an open source thumbnail viewer that takes advantage of the QGraphicsView. Not that my code is all that fantastic, but if I make some headway on one I'll post some stuff back here at the very least.

  3. #3
    Join Date
    Jun 2008
    Posts
    88
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11
    Thanks
    4
    Thanked 4 Times in 3 Posts
    Wiki edits
    1

    Default Re: how to browse images in thumbnail view?

    Ok, as promised I have some code that will hopefully get some people started, its attached as a PyQt example

    I apologize for the lack of comments and docstrings but this was more of a mockup than anything else

    Here's how to use:

    Qt Code:
    1. app = QtGui.QApplication([])
    2. widget = QdContactSheet()
    3. images = # list of images you want to view as thumbnails
    4. images.sort()
    5. widget.load(images)
    6.  
    7. widget.setWindowTitle("Contact Sheet")
    8. widget.resize(1000, 800)
    9. widget.show()
    10. app.exec_()
    To copy to clipboard, switch view to plain text mode 
    Attached Files Attached Files

  4. The following 2 users say thank you to chezifresh for this useful post:

    jfjf (9th February 2011), ksl871 (26th April 2012)

Similar Threads

  1. How to view images using QT
    By Pitso in forum Newbie
    Replies: 1
    Last Post: 16th April 2007, 15:00

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.