开发者

List-view groups with Qt?

We have ListView.Groups in .NET. Is there an equivalent in Qt (without using Windows APIs)?

I am unable to find anything that indicates support for this in the documentation for Qt.

Example in Windows Vista/7: http://i50.tinypic开发者_JAVA技巧.com/zumgyg.jpg

Thanks in advance!


It looks like that is very easy to do with Qt model-view control.

It's a little confusing at first, but basically all lists, tree ctrls and grids are treated in the same way - which lets you do interestign combiantions of them very easily.

Edit: Casey posted a useful comment in an answer that was deleted. Here is the text and the link:

creating your tree model is pretty straight forward. To create that "grouped" effect where the parent nodes look different then their children, I would suggest creating an ItemDelegate then setting it on your view using setItemDelegate1. In the Delegate's paint function you can detect whether the index is a header or now, and draw something appropriately. When you get there if you need help, start another question and I can post an example.

http://doc.trolltech.com/4.6/qabstractitemview.html#setItemDelegate

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜