PDA

View Full Version : QListWidget access item after using listWidget->setItemWidget



Archa4
3rd February 2011, 08:36
So i created custom widget containing a picture, and 3 labels. I created a list, where there custom widgets are used as items. I would like to know if it is possible to access the data from these items (I used "listWidget->setItemWidget" to make list items). For example first label contains some URL, i want to use it later, how do i access it?

Lykurg
3rd February 2011, 09:10
See QListWidget::itemWidget() and cast it to the widget type you want.

Archa4
3rd February 2011, 11:07
I don't know what happened but my message got lost.
I am new to qt, and i learned just basics of C++. What is cast, and how to use it?

Added after 20 minutes:

And another question that i have right now:
I have custom items in mi ListWidget. They can be different size. How to make those list items resize to their content?