View Full Version : draw long text in rect

21st January 2010, 09:28
I want to display a string in a rect, implement it with drawText of QPainter. A problem just bring out when the string is too length that the rect can't contains it.

The default is to clip the string and display in the rect, and i feel disppointed with this, what i want is clips some part of the string and diaplay like "abcd...", and fill the rect, i want to display something to hit that the rect is too small to contains it.

I have try with some flags with Qt, but still can't sovle it.

Thanks in advance for any point.

21st January 2010, 10:00
Check http://qt.nokia.com/doc/4.6/qfontmetrics.html#elidedText