PDA

View Full Version : add custom widget items to QListView or QListWidget



yazwas
26th December 2009, 17:44
Hello All

I want to do a custom list that has the following items in it, its formed of 2 lines,
on the first line, it will have a QLabel object, and on the other line, it will have 2 QPushButton objects. almost the same as the pic attached

I'm wondering on what is the best way to perform this, and how to implement this functionality.
I want to add this item to custom qlistwidget or qlistview, whichever is doable

any suggestion is more than welcome :)

thankx

Lykurg
26th December 2009, 18:01
Both are possible, but for beginning a QListWidget is easier. Just use QListWidget::setItemWidget() and set your custom widget composed out of a label and buttons.

druidamix
16th September 2010, 23:36
Heiii, Thank you.

I've been looking for about setItemWidget and first I found some simple examples, Intresting.
Howver, later I found this: http://www.qtcentre.org/threads/27777-Customize-QListWidgetItem-how-to

It's just what I was looking for.

Yeah, it's easy. However, when you know it. xD.


Thank you!!!.

PD. Sorry for my English. I'm trying to improve it.