PDA

View Full Version : Custom Listview with all-time editable items



ivan.cukic
6th September 2006, 12:02
I need to create a list of widgets for editing my data model. Every item needs to be "interactive" all the time - to respond to user interaction, and even change it's size.

Similar effect can be found in the Amarok player - the stars for song popularity can be clicked and worked with even when there is no request for editing.

Do you have any example or text for me to read on how to achieve this in QT4?

:confused:

wysota
6th September 2006, 15:39
Can you explain a bit more what exactly do you want? What do you mean by "a list of widgets"? You can use QAbstractItemView::setIndexWidget() to embed a widget into an item. "Interactiveness" of widgets (widgets or items?) depends only on your implementation.

ivan.cukic
6th September 2006, 16:05
Thanks, I'll try that.

One image is worth thousand words - i need to accomplish something like this mockup:

http://alas.matf.bg.ac.yu/~mr02014/kamion2.jpg

I have the widget that does everything I want, and now I only need to place it in the list... Cheers!

wysota
6th September 2006, 16:09
Thanks, I'll try that.

One image is worth thousand words - i need to accomplish something like this mockup:

http://alas.matf.bg.ac.yu/~mr02014/kamion2.jpg

I have the widget that does everything I want, and now I only need to place it in the list... Cheers!

I think you don't want/need widgets at all. The only widget you need is QListView and a good item model which allows items to be checkable and to change their size. Standard QListView can easily handle that.

ivan.cukic
6th September 2006, 16:14
Ok. I'll try.

wysota
6th September 2006, 16:15
Check out different itemviews examples that come with Qt.