Subject: Re: QTreeView setFirstColumnSpanned?

Linus Torvalds torvalds at linux-foundation.org
Tue Jun 11 14:04:03 PDT 2013


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*.

Every time we change the model, do we have to iterate over all of the
QTreeView entries?

*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.

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.

                  Linus


More information about the subsurface mailing list