You are not logged in.

Lykurg

Trainee

  • "Lykurg" is male
  • "Lykurg" started this thread

Posts: 92

Location: Germany

Occupation: Student

  • Send private message

1

Sunday, March 12th 2006, 2:14pm

QT4: QListWidget with custom QWidget

Hi,

how can I get a QListWidget, where I can put custom Widgets in it instead of simple QStrings?

I found QListView, but this is too confus to me. I just want the same behavior as QListWidget, with simple, no-interactiv QWidgets (which are generated from a selfwritten class (widget with qlabels and pictures..)).


Thanks,
Lykurg

2

Monday, March 13th 2006, 4:03pm

RE: QT4: QListWidget with custom QWidget

Have you tried QItemDelegate ? It can be useful to customize your view.

Lykurg

Trainee

  • "Lykurg" is male
  • "Lykurg" started this thread

Posts: 92

Location: Germany

Occupation: Student

  • Send private message

3

Tuesday, March 14th 2006, 2:55pm

RE: QT4: QListWidget with custom QWidget

Hi,

as I can see, QItemDelegate is good for customize the view of an editor.

I found, that it should be best, if I use a QListView with subclassing QAbstractListModel to get my customized view of the items. Unfortunately I have no idea to do so, so have anyone a good tutorial or someting else?

Thanks

4

Tuesday, March 14th 2006, 6:14pm

RE: QT4: QListWidget with custom QWidget

In my opinion, models can't be used to customize your view because it's the part that contains data. I'm not a pro in this field though ...

Lykurg

Trainee

  • "Lykurg" is male
  • "Lykurg" started this thread

Posts: 92

Location: Germany

Occupation: Student

  • Send private message

5

Wednesday, March 15th 2006, 2:13pm

I just found, QTableWidget::setCellWidget ( int row, int column, QWidget * widget )! So I only must make an x,1-table, and then I have my "QListWidget" with custom Widgets.

Lykurg

6

Thursday, March 16th 2006, 3:16pm

RE: QT4: QListWidget with custom QWidget

Do you knox the same hint for tree widgets ?