开发者

text is exceeding the listview bounds in Qt

开发者 https://www.devze.com 2022-12-23 02:37 出处:网络
I need to customize the listview,I am placing an icon and a text at the center of the listview. If the text length is bigger then the list rectangle length.. the text is coming over the icon first le

I need to customize the listview,I am placing an icon and a text at the center of the listview.

If the text length is bigger then the list rectangle length.. the text is coming over the icon first letter of the string is not visible..

How to avoid this situation? Is it possible to give marique effect for the string?

Thanks in advanc开发者_Python百科e.


one way we can achive is

painter->drawText(Gradiantrect, Qt::AlignCenter,sfm.elidedText(subText,option.textElideMode, rectwidth));

if the text length is bigger then the width of rectangle,three dots are appearing after the text.

Thanks

0

精彩评论

暂无评论...
验证码 换一张
取 消