Subject: Re: QTreeView setFirstColumnSpanned?

Amit Chaudhuri amit.k.chaudhuri at gmail.com
Tue Jun 11 00:13:09 PDT 2013


Ok... tiny bit more progress in thinking if not in code.

[And Linus - I see what you mean about drawRow]

The actual painting probably gets done by a delegate (sub-class of
QStyledItemDelegate probably). It is possible to set this in a row or
column basis - row looks like what we need.

That sub-class needs a paint method and maybe a private helper to compose
our text and embellish it.

I think we can use Linus' patch to get us to the right place and state to
set up the relevant delegate.  I ought to have the delegate in place this
evening UK time.  Anyone with time before then is welcome, as ever...

A


On Sun, Jun 9, 2013 at 10:46 PM, Amit Chaudhuri
<amit.k.chaudhuri at gmail.com>wrote:

> Linus - Totally see what you're after.
>
> Tomaz - not sure I go with the "do that in the model" part.  Doesn't that
> turn the whole model/view thing on it's head, in terms of what classes are
> responsible for? Maybe we don't need to worry about multiple views of the
> same model, but this feels wrong to me.  Sure, the model might report
> different things for different "types" but can the view class really handle
> this without alteration?
>
> I'm happy to have a crack at filling in the rendering of the string....but
> that'll not be before tomorrow night.
>
> Tomaz - is there no end to your talents? Now it's cooking! What's on the
> menu?
>
> A
>
>
>
>
>
> On Sun, Jun 9, 2013 at 10:11 PM, Linus Torvalds <
> torvalds at linux-foundation.org> wrote:
>
>> On Sun, Jun 9, 2013 at 1:47 PM, Tomaz Canabrava <tcanabrava at kde.org>
>> wrote:
>> >
>> > Can you provide a dummy screenshoot on what you are trying to achive?
>>
>> This beautiful mock-up hopefully gives the idea.
>>
>> The point being that notice how the trip header *crosses* the fields.
>> It's not in the dive number field, it's not in the date field, it's
>> the whole line. So if my trip name was longer, it could take up much
>> more of the line, and not be constrained by the columns. The columns
>> would *only* be relevant for the dives.
>>
>> See what I'm going for?
>>
>> Quite frankly, setFirstColumnSpanned() should do this, but the
>> interface seems to be f*cking retarded. You want to set the "spanned"
>> data in the *model*, not in the QTreeView. But I'm not seeing how to
>> do it sanely in the treeview.
>>
>>             Linus
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20130611/40701e36/attachment.html>


More information about the subsurface mailing list