Unsolved QListWidget-two rows
-
Hi
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.
Regards
Divya -
-
hi I am using the same code like below,still it is not showing text
pListWidgetItem =new
QListWidgetItem(QIcon("E:/Kostal_Widget/QWidgetCorousel/QWidgetCorousel/images/2.png"),"Preset1");m_CorouselWidget->addItem(pListWidgetItem); pListWidgetItem->setTextAlignment(Qt::AlignCenter|Qt::AlignBottom); pListWidgetItem->setTextColor("black"); pListWidgetItem->setSizeHint(QSize(100,120));
-
hi
That is a bit odd. using same code ( other image)
i get
It does show image for you ?
-
@mrjj
DoesQIcon("E:/non-existent-path.png")
throw if it's handed a non-existent path/file?E:/Kostal_Widget/QWidgetCorousel/QWidgetCorousel/images/2.png
I don't know where you got that from. You sure it's not spelled
QWidgetCarousel
? -
@JonB said in QListWidget-two rows:
Does QIcon("E:/non-existent-path.png") throw if it's handed a non-existent path/file?
Nope. its just invalid and draws nothing.
-
@mrjj
...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. -
@JonB
Im not sure. i read it as shows image, but no text. -
Hi
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.
Thank You