[Qt-jambi-interest] BackgroundRole

Vincent Lebreil vincent.lebreil at gmail.com
Wed Feb 11 12:11:21 CET 2009


Thanks a lot for this explanation Gunnar! :)

I'll try to override drawBackground() method as you suggest.

Vincent

On Wed, Feb 11, 2009 at 12:01 PM, Gunnar Sletta <gunnar at trolltech.com>wrote:

> Vincent Lebreil wrote:
>
>> Ok me again :)
>>
>> I found it: QApplication.setStyle(String)
>>
>> Then i got allowed styles with QStyleFactory.keys(): [Windows, WindowsXP,
>> WindowsVista, Motif, CDE, Plastique, Cleanlooks]
>>
>> So i tried with some of them:
>>
>> It works with the following styles: Windows, WindowsXP
>> but not with: WindowsVista
>>
>> Do you know why ?
>>
>
> I suspected this earlier on, but forgot to check vista so I missed it. The
> problem is really that the style has "final say" in the background in the
> default item delegate. All other styles will respect the BackgroundRole, but
> the vista style overrides it. This is because vista tree backgrounds need
> some special handling to be compatible with native look and feel.
>
> In this case, you can override the default behaviour by subclassing
> QItemDelegate and reimplement one of the paint functions, for instance
> drawBackground().
>
> best regards,
> Gunnar
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-jambi-interest/attachments/20090211/b5cef56d/attachment.html 


More information about the Qt-jambi-interest mailing list