Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QFileDialog.getOpenFileName with preview?
Forum Updated to NodeBB v4.3 + New Features

QFileDialog.getOpenFileName with preview?

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    Ulrich.Goebel
    wrote on last edited by
    #1

    Hallo,
    I give the user a QFileDialog.getOpenFileName to chose a picture (*.png, *.jpg and so on).
    It would be very nice to have a preview of the pictures in this file dialog, so the user don't have to know the filename but can look at the pictures... Is there a chance?

    1 Reply Last reply
    0
    • P Offline
      P Offline
      poorBob
      wrote on last edited by
      #2

      Hello,

      of course there is a chance ;). One of possible solutions would be writing Your own delegate which could visiualize the picture for You/User. To do this You should derive from QStyledItemDelegate (here's example: "Star delegate":http://qt-project.org/doc/qt-4.8/itemviews-stardelegate.html ) and implemented Your own paint and sizeHint methods. Then You can set this delegate to Your view with "SetItemDelegate":http://qt-project.org/doc/qt-5.0/qtwidgets/qfiledialog.html#setItemDelegate# setItemDelegate method.

      EDIT: Sorry, seems like I read to fast Your post and I bit missunderstood Your problem... So I made a small update of methods and links above.

      with best regards,
      Robert :)

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved