On Thu, Dec 31, 2009 at 1:27 AM, Koen Deforche <[email protected]> wrote:
> Hey,
>
> 2009/12/31 OvermindDL1 <[email protected]>:
>> On Wed, Dec 30, 2009 at 1:20 PM, Albert Cervera i Areny
>> <[email protected]> wrote:
>>> A Dimecres, 30 de desembre de 2009, OvermindDL1 va escriure:
>>>> When I click the sorting column (my reason for choosing WTreeView) it
>>>> is doing a case sensitive ordering (as you can see on the member list
>>>> page on the http://overminddl1.no-ip.info:8030 still).  Looking
>>>> through the class API for WTreeView I do not see a method for setting
>>>> case-insensitive ordering on which columns, is there a way?  If not,
>>>> what would be the best way to implement it, subclass it?
>>>
>>> Haven't used it but I think you should look at WAbstractItemModel and co.
>>
>> However, WStandardItemModel as used with the WTreeView only accepts
>> WStandardItem's, and the compare function that is called from
>> everywhere is both not virtual and is private so I could not do
>> anything with it anyway.  But the compare functions really only just
>> calls:
>
> You can reimplement WStandardItem::operator< (const WStandardItem &other)
>
> http://www.webtoolkit.eu/wt/doc/reference/html/classWt_1_1WStandardItem.html#c7753533f27c5e142d6e92ded1f0f683

Yep, I did, but it seems the 'standard' thing to do is change the
compare function since JWt uses that, and the operator< by default
just calls compare, hence would it not be easier to make it easy to
override compare instead so as to keep things consistent if you create
subclasses in the C++ side that may be used in the Java side?  As it
is now, you cannot.


>> Implementation note, instead of Any in those cases, since you have to
>> specify exact types with that anyway, why not use Variant?  It is a
>> *lot* better for performance and you can stick in subclasses of things
>> that it supports.
>
> But then we need to limit the items it supports: now you can put into
> an Any just anything.

True, but right now the related classes only works on specific types
anyway, and if you put in anything else it throws an exception.  Using
a Variant makes that a lot cleaner, and it makes it a lot faster.  You
can always expand the Variant to include more types as you add
support, plus Variant supports dynamic types where Any does not (Any
only works on *exact* types, Variant is more flexible).

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to