Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
I want to display text and image inside the listwidget (as thumbnail)
I have a listwidget and i am making the listwidget as a thumbnail of the combination as text and image but the sequence of this is text followed by the image. But I am getting the sequence as image followed by text. I am using this one code for this :
also, I am attaching the image view for this:
so question is
How do i get the text on top of image or ?
amarism last edited by amarism
@mrjj yes but an index of listwidget is same for text and image (here the only 6 index is there, but when I try to put text and image as an item then the listwidget index takes 1 index for everyone
Im not sure what you mean with 1 index.
Each item has text and icon.
@mrj I am taking 6 images. So, the index is from (0-5). But when I put text and image as item then all item taking 1-1 index I want too set the listwidget index equal to a number of the image.
listWidget->addItem(new QListWidgetItem ..
should handle that automtically.
@mrjj This one method
QListWidgetItem(const QIcon & icon, const QString & text, QListWidget * parent = 0, int type = Type)
but i want to take item value like ( Text and Image).
but its just
Icon and text. why should that matter ?
and see if that works.
Update: it wont. still under when icon mode.
I could be wrong but i think to have text over, you need a delegate and draw it.
(unless someone knows how to make it use TextAlignment in iconmode)
the SmallIconDelegate should be excellent starting point.