Hey Adrian,

2009/5/11 Adrian Sutherland <[email protected]>:
> I've been working on this and think I may have come across a bug - I
> have unfortunately worked round it and don't have simple code to
> exploit it .... (sorry)
>
> Anyway the scenario is refreshing a Model - in this scenario I clear()
> the model and then repopulate it.
>
> The bug seems to be that the header count is not reset - so when you
> add the columns again it tries to add headers with the wrong index
> (e.g. with 6 columns, I would see (in the back trace) reference to
> adding headers 7-11).
>
> My workaround was to delete the model and start again.

Oops, WStandardItemModel::clear() was not triggering the proper
signals. Might be because an appropriate signal (modelReset()) was not
yet provided by WAbstractItemModel.

All that has been fixed in the latest git.

> Column 0 Header
> -------------------------
>
> Also, I have an ongoing issue with the format of headers in column 0.
> It seems to me that setting the column 0 width does not work - it
> always takes the remaining space. Also on IE6 if the column (or
> perhaps table width I think) is less that around 250 then the header
> title is lost as the header width is rendered very small.

Apparently I forgot to implement the column 0 resizing, this has been
fixed in git.

In IE, it is indeed the case that header gets lost when rendered too
small -- we have not yet found a workaround for this problem.

> And finally where a table is added and removed from a container
> (scenario: different menu options are selected and I am displaying
> different content) - then column 0 header text is not rendered the
> second (or perhaps third) time.

That is strange. Could you make a small test case for this ?

> Suggestions
> ------------------
> - I do not use CSS but rather want to use the layout managers. What I
> find a bit confusing is should I be using resize() which seems to work
> but mentions that it is for CSS, or should I use setminimumsize() -
> which does not seem to work sometime (might just be me). Perhaps some
> clearer guidance could be added to the doc?

The doc is indeed not clear: resize() indeed specifies the CSS size.
The CSS size is used for widgets whose size is not managed by a layout
managers. This thus includes the size of a widget whose contents is
managed by a layout manager. Minimum/Maximum size is taken into
account by layout managers for widgets it manages -- but there may be
problems with this (as IE does not implement this well). What issues
do you see, which browsers, and could you turn them into a
reproducible test case ?

> - I understand why you have done it this way but I find it strange to
> add the headers in the Model - I feel that the header text should be
> in the [tree] view.

(The real reason why I have done it this way is because Qt has done it
this way).

I would agree with the Qt way though -- the view should not be
concerned with any contents, and headers are as much part of the
contents as the data itself (as it provides the context for the data)
?

You could implement a proxy model which overrides the headers for
another model, if you want to manage/override the headers suggested by
a model with custom headers.

Regards,
koen

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to