PDA

View Full Version : How can I display thumbnails with filenames under them?



xlz209
17th June 2010, 21:00
Hi all,
I am trying to write a Image viewer, when you select certain folder, the thumbnails of all the pictures under the folder would display at QGraphicsView, and when you click on one thumbnail, the original picture would display below. I make QGraphicsItems with thumbnail and add them into QGraphicsScene then display them in the QGraphicsView. See the screenshot for details.
4801
However, I can only display the thumbnails now, how can I display the thumbnails with their filenames under them? Just like the Windows does.
4802
Also, How can I change the foucs item style? I dont like the dash line for the QGraphicsItem.

Can anyone give me any suggestion about that? I really appreciate your help!

wysota
18th June 2010, 07:08
Why are you using Graphics View and not the Model-View approach for this? You'd have everything ready out of the box.

xlz209
18th June 2010, 15:05
Hi wysota,
Thanks for your reply, since I just started with QT for two weeks, I have not come to the the Model-View approach yet.
I just searched for the Model-View approach. For my case, do I need to make a custom subclass of QAbstractItemModel? Can you talk a little more specific about the Model-View approach? Either some names of specific classes or an example would help me greatly.
Thanks again for your help.