Op 2-2-2013 9:42, Иван Комиссаров schreef:
> This hack has some disadvantages too. I made small investigation into a 
> QCommonStyle and it's inherited styles to find solution for that particular 
> feature in Qt.
>
> Is it possible to add new values to QStyleOptionViewItemV2::ViewItemFeature? 
> Something like ViewItemFeature::WrapAnywhere and 
> ViewItemFeature::WrapAtWordBoundaryOrAnywhere ? Or this is an awful hack?
>
> Better solution is to introduce QStyleOptionViewItemV5 with WordWrap 
> property, but i'm not sure how views should use it. Should new "wordWrapMode" 
> property be added to views (and should be "wordWrap" prop deprecated) or this 
> feature can only be used in custom views?
> Also, there's a problem in QCommonStylePrivate::viewItemSize method - it 
> bounds text rect to icon rect, but normally text should take more place than 
> the icon. If QListView::gridSize prop is set, it should be bounded to that 
> grid size instead (and optionV5 should have gridSize prop too?). However, i 
> don't know what should be the bound in case when no grid size is specified. 
> Maybe pixel width of the longest word in the text (bad approximation, because 
> it almost same as "word wrap").
>
> So, should any patches be applied to Qt styles and if yes - how?
I'd much prefer an even more radical enhancement: support rich text 
rendering. That would include word wrapping, but also colors, links, 
images, fonts, etc. That would make a lot of users happy, I'm sure. I 
also did a bit of digging into these classes at an earlier stage, and 
found that it is really doesn't possible to properly support it without 
some changes quite deep in the rendering code. I found that code too 
hard to follow to propose a change myself.

André

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to