Put limits with pixels[SOLVED]
-
I am, using html in Qt, and i want put limits in my strings for pixels, i use "mid" but the letters have diferent size, so not work very well.
sorry for my english. =)
-
@QFontMetrics fm(theFontYoureUsing);
QString originalText("very long phrase that might not fit inside the parent window, how sad.");
QString outText = fm.elidedText(originalText, Qt::ElideRight, 200)@the 200 is the maximum width of the text. For example, outText might contain:
"very long phrase that might not fit insi..." -
i can not include "QFontMetric". Its need a new version to use that? My Qt is the 4.7.4.
-
hehehe now i can include, i was write the rigth name, but i was drop the "gui".
-
thanks, is exactly what i want.