PDA

View Full Version : Best way to add icon / small picture



Pembar
18th May 2009, 16:04
Hello guys,

I'm looking to add a small icon or picture beside a label, and within a QTableWidget. I was wondering what's the best way to go about this? Which class to use? I'm going to have to update the icon / picture in run-time, from one icon / picture to another.

Thanks much.

Regards,
Pembar

spirit
18th May 2009, 16:06
take a look at QTableWidgetItem::setIcon.

Pembar
18th May 2009, 17:39
Is there a way to add a picture / icon to a QLabel? It has to be beside the text.

If not, what's the best way to add it beside a QLabel within a HBoxLayout?

Regards,
Pembar

Boron
18th May 2009, 19:11
To have a icon AND text side-by-side you should use to different labels, one holding the icon to other for the text. Both labels in a QHBoxLayout as already stated.