Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要自定义列表视图,我在列表视图的中心放置了一个图标和一个文本。
如果文本长度大于列表矩形长度..文本超过图标字符串的第一个字母不可见..
如何避免这种情况?是否可以为字符串赋予 marique 效果?
提前致谢。
我们可以实现的一种方法是
painter->drawText(Gradiantrect, Qt::AlignCenter,sfm.elidedText(subText,option.textElideMode, rectwidth));
如果文本长度大于矩形的宽度,则文本后面会出现三个点。
谢谢