python - How to increase the size of a thumbnail in QListWidget -
problem => create qlistwidgetitem object containing list of images thumbnails @ relatively larger size current 1 have (sorta "medium icons" or "large icons" option in windows explorer)
progress far => have managed find out how create list , icons far small.
what have tried => i've tried changing font size of list items assuming tht cld make font grow bigger proportionally. didn't work. i've tried setting size of thumbnail using (pil's image) according online blogger didnt work well.
code snippet => #imported image , imageqt pil , imported qtgui , qtcore
testimages = glob.glob(dirname + "/*.jpg") # create list item each image file, # setting text , icon appropriately image in testimages: picture = image.open(image) picture.thumbnail((128,128), image.antialias) icon = qicon(qpixmap.fromimage(imageqt.imageqt(picture))) item = qlistwidgetitem(image, self) item.seticon(icon) fonter = qfont("times new roman") fonter.setpointsize(14) item.setfont(fonter)
hope guys can me out. :)
define desired size using seticonsize
on qlistwidget
.
Comments
Post a Comment