Here is what I'm trying to get ( this is a QTableView
widget + MVC based on QAbstractTableModel
with multiply delegates ):
Notes:
Delegates a not working as editors, they are ONLY viewers! I'm not getting to edit model with this table view.
Delegates must be realizable. It means that all total height of the BLUE row could be 25px, or 250px.
MV is simple data:
1ROW: CompanyName1 Name1,Name2,Name3 OTHER DATA
2ROW: CompanyName2 SingleName1 OTHER DATA
3ROW: CompanyName3 Name1,Name2 OTHER DATA and so on...
Question:
- Is it possible to create custom delegate (
QItemDelegate
, orQStyleItemDelegate
), for example, to the 2nd column like on the image above? And if it's possible, maybe you could give me some examples, or resource links where can I look at them.
PS. Yes, I have looked at all Qt Demo examples with delegates, but I just don't get it, how to do what I want.
PSS. QTableView
-> setIndexWidget()
I think that is not a good idea. But QTableView
->setItemDelegateForColumn( myCustomDelegate )
methods are better!
P3S. I'm not looking solution for QTableWidget
class...
Thank you for your replies! :-)
Update #1:
I think that:
Delegates are used only for edits (for example, if we are working with model/view object) and manage similar items (all/just column/just row).
Custom widgets are better, but I have not meet them in free Qt projects. And it's not too easy to get the nice and correct code of such kind of widgets...
Addition:
- Here is link to similarity question.