QListWidget-two rows
-
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.
-
@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.