Subject: Re: QTreeView setFirstColumnSpanned?

Tomaz Canabrava tcanabrava at kde.org
Wed Jun 12 13:13:57 PDT 2013


Silly mail client send only to Linus.
Close this thread guys, I fixed it. Will commit as soon as I arrive back
home.
Em 12/06/2013 17:07, "Tomaz Canabrava" <tcanabrava at kde.org> escreveu:

>
> Em 11/06/2013 18:04, "Linus Torvalds" <torvalds at linux-foundation.org>
> escreveu:
> >
> > On Tue, Jun 11, 2013 at 1:41 PM, Tomaz Canabrava <tcanabrava at kde.org>
> wrote:
> > >
> > > but we can test if index has children, if it does, trip.
> >
> > Oh, that's not the problem.
> >
> > The problem is *where*.
>
> In the layout change event (well, signal)
>
> > Every time we change the model, do we have to iterate over all of the
> > QTreeView entries?
>
> No, we need only to iterate over the first column, and see if the item is
> a trip or dive.
>
> > *That* is the insane part of the interface.We'd presubaly have to
> > intercept "model changed" events, only to then walk all the treeview.
> > Ugh. All just because the QTreeView::setFirstColumnSpanned interface
> > is badly integrated with the model.
>
> Agreed.
>
> > The silly part is, QTreeView already calls down to the model for
> > almost everything else. So *if* the interface had been similar to the
> > "what font should I use for this model entry" model callbacks (just a
> > different role: Qt::FirstColumnSpannedRole) it would have been
> > trivial, and worked really well.
> >
> > I've googled peoples use of setFirstColumnSpanned(), and pretty much
> > all I find is complaints and people asking how to use it.
>
> Well my friend, complain no more. For I have did that what you asked. ^^
> It intercepts the model change and looks for trips, when he finds it, it
> expands the column.
>
> I'll commit this tonight, as soon as I arrive home.
>
> >                   Linus
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20130612/a6d78653/attachment.html>


More information about the subsurface mailing list