[Qt-interest] Question about Models, Roles and data
Arnold Krille
arnold at arnoldarts.de
Tue Aug 25 20:31:28 CEST 2009
Hi,
On Tuesday 25 August 2009 20:16:22 André Somers wrote:
> -----Oorspronkelijk bericht-----
>> No, a table is actually a tree with only first-level entries:-) In other
>> words: A tree-model can have as many columns >as needed, the QTreeView or
>> any simpler QTableView (showing only foos or bars) will show the columns.
> I know, but if I understand the question correctly, the OP wanted to show
> only _second_ level entries. Now that may be a problem... AFAIK a
> QTableView can actually operate on any level, not just the first level
> (just like QListView can).
Acting only on the second-level items of one first-level item is possible with
all views.
Showing only second-level items but from all top-level items at the same time
calls for a proxy-model.
> Can you really hide top-level nodes with a proxy model
> though while still showing the second level nodes though? I've never tried
> to do that, but I guess it would not be easy.
It is only a matter of getting the indices right. ;-)
The proxy will have to check the number of childs of each first-level item to
construct the matching list. Not easy but not rocket science either...
Arnold
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090825/b6b8c71c/attachment.bin
More information about the Qt-interest-old
mailing list