How can I put an tag on the item in a Iconmode Qlistwidget??
-
Hi all!
I'm doing a dicom viewer with thumbnail list on the left side, just like Radiant.
The thumbnail list is a Iconmode Qlistwidget ,
and I want to add a little number tag on each item in the lower right corner ,
(the tag is the number of picture in the series)
but I have no idea how to do it..For example,
This is my list now,
And I want to add the number in the red circle ,
(this is a screen shot of Radiant)How can I do it?
Is there anything similar to what I'm saying that I can use in Pyqt5?
Sorry for my poor English.
Thank you very much! -
Hi,
Are you generating the thumbnail yourself ?
If so, as @eyllanesc suggested you can draw the number on it using QPainter.Otherwise, create a QStyledItemDelegate subclass and paint it there.
-
@eyllanesc Ok, I will try it, thanks!!
How about the black background of each item? Can it be done by Qpixmap, too?
(As shown the Radiant example, all item in the list is in a black frame. But there's no such frame for each item in my list, wonder how to do it.) -
You can compose a new image. Fill it with black and draw your thumbnail on top of it.