[Interest] Grouping Items in TreeWidget

Philipp Kursawe phil.kursawe at gmail.com
Thu Nov 21 09:36:19 CET 2013


And post the code fragment here maybe? ;)


On Wed, Nov 20, 2013 at 10:58 AM, Joseph W. Joshua <joshua at megvel.me.ke>wrote:

> On 20-Nov-13 12:36 PM, André Somers wrote:
> > Joseph W. Joshua schreef op 20-11-2013 9:40:
> >> Hi all,
> >>
> >> In the attached image, you can see how I am able to group items in a
> >> listview in .NET. Is there a way to achieve this in Qt? I have tried
> >> several avenues with no apparent success.
> > Sure, this is doable, but it takes a little work.
> >
> > You're going to need a delegate to render your header items. You make
> > the delegate return a sizehint for the item (to get the extra height).
> > You can make it draw the underline, and if you want you can also make it
> > do the column spanning, though that's a bit trickier. It might be easier
> > to use QTreeView::setFirstColumnSpanned for that, even though that
> > breaks the model/view pattern.*
> >
> > André
> >
> > [*] I don't get why QAbstractItemModel::span was never actualy used in
> > Qt. I had to write my own delegate that uses it to get it to work.
> >
>
> Thank you, André.
>
> I will try your suggestions and revert.
>
> Josh
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20131121/a2c28cfa/attachment.html>


More information about the Interest mailing list