Double QListView using Qt4 Model/View paradigm
I have a list of lists I have to show to the user. When the user clicks on an element of the first list the second view must update to show the "childs" of the clicked element.
I'm wondering, should I开发者_JAVA百科 go with QAbstractListModel
or QAbstractItemView
? QAbstractItemView
seems to be much more complex of what I need to do... Can you give me some hints on how to implement what I said at the beginning?
Thank you very much ;), it's my first attempt at implementing a custom model... Paolo
QColumnView does what you want.
QColumnView displays a model in a number of QListViews, one for each hierarchy in the tree. This is sometimes referred to as a cascading list.
You should use tree model with it. There is example.
精彩评论