[Interest] ItemDelegate and word wrapping

Bache-Wiig Jens Jens.Bache-Wiig at digia.com
Fri Feb 1 15:11:34 CET 2013


On Feb 1, 2013, at 1:15 PM, André Somers <andre at familiesomers.nl> wrote:

> Op 1-2-2013 12:59, Иван Комиссаров schreef:
>> So, what should i do?) Should i hardcode style names that support drawing fancy background and emulate in other cases?
>> 
>> Иван Комиссаров
>> 
>> 
> You might try the same trick^H^H^H hack I described earlier. It worked 
> for me. That is, unless Jens or somebody else can explain a proper way 
> of doing it.

I fully agree with Andre that the API should have more flexibility built into it. If only as a way to tell it which parta to draw and which to ignore. 

I would however advice against hardcoding style names. I think the simplest way right now would be to reimplement displayText to return an empty string, call the base implementation in paint(), fetch the DisplayRole and draw it yourself. At least if you are ok with keeping the icon decoration as it is. Otherwise use the model hack that Andre suggested.

Regards,
Jens


More information about the Interest mailing list