Results 1 to 3 of 3

Thread: Need some advise with thumbnails and loading image

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    8
    Thanked 334 Times in 317 Posts

    Default Re: Need some advise with thumbnails and loading image

    You can maintain a list of sort -
    Qt Code:
    1. QList < QLabel* /*thumbnail pointer*/, QString /*filename*/> tumbNailList;
    To copy to clipboard, switch view to plain text mode 
    When a label is clicked you can get the file name from the list and load the full image and show in some other label/window.

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

    Default Re: Need some advise with thumbnails and loading image

    You can also reconsider to use a graphic scene for that thumbnail list, which would be not so expensive. (Then you coud use setData() with user role)

    But for your solution, simply add a member variable to your widget which inherits the label.

    Qt Code:
    1. void XXX::setImage(const QString &file)
    2. {
    3. QPixmap thumb = /*generate thumb of file*/
    4. QLabel::setPixmap(thumb);
    5. m_myFilePath = file;
    6. }
    7.  
    8. QString XXX::originalFileName() const
    9. {
    10. return m_myFilePath;
    11. }
    To copy to clipboard, switch view to plain text mode 

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.