Subject: Re: QTreeView setFirstColumnSpanned?

Amit Chaudhuri amit.k.chaudhuri at gmail.com
Tue Jun 11 12:48:33 PDT 2013


...drawRow() idea as currently conceived in my mind doesn't work...It's
because it is a const method. This prevents setting a custom row delegate
to do the rendering.

QAbstractItemView - from which QTreeView derives - has a method which
allows us to set a delegate for any given row (specified by an int index
and giving a pointer to the delegate).

So, I think we can customise the text (etc.) in a given row, through a
simple custom delegate class, as long as we can specify "this row - index X
- is a trip row"

A




On Tue, Jun 11, 2013 at 6:51 PM, Amit Chaudhuri
<amit.k.chaudhuri at gmail.com>wrote:

> No please don't use as is - I may discover my ideas don't work as hoped,
> or as Linus says, perhaps there's a much better way.
>
>
> On Tue, Jun 11, 2013 at 2:45 PM, Dirk Hohndel <dirk at hohndel.org> wrote:
>
>> On Tue, 2013-06-11 at 08:13 +0100, Amit Chaudhuri wrote:
>> > 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...
>>
>> So you are saying I should apply Linus' patch as is and you'll clean up
>> from there?
>>
>> /D
>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20130611/2a2a19a4/attachment.html>


More information about the subsurface mailing list