I wants to add a set of images and labels for corresponding images in in QListWidget.
I am a newbie.I couldn't find any examples.
hi I am using the same code like below,still it is not showing text
m_CorouselWidget->addItem(pListWidgetItem); pListWidgetItem->setTextAlignment(Qt::AlignCenter|Qt::AlignBottom); pListWidgetItem->setTextColor("black"); pListWidgetItem->setSizeHint(QSize(100,120));
That is a bit odd. using same code ( other image)
It does show image for you ?
QIcon("E:/non-existent-path.png")throw if it's handed a non-existent path/file?
I don't know where you got that from. You sure it's not spelled
Does QIcon("E:/non-existent-path.png") throw if it's handed a non-existent path/file?
Nope. its just invalid and draws nothing.
...which might be what the OP means by "still it is not showing "? Oh, maybe I misunderstood, it's to do with not showing text or the icon? Might help if he screen-shotted.
Im not sure. i read it as shows image, but no text.
It worked for me .The issue was icon was overlapping the text .When I reduced the icon size it is showing both image and text.