strange calculation... the pixel size (of the font) is the size of one character (or so), certainly not of the whole text or so.
try something like this
Qt Code:
int pixelSize=20; { --pixelSize; font.setPixelSize(pixelSize); }To copy to clipboard, switch view to plain text mode
Untried. Maybe there is a better way to find the maximum font size such that a given text fits a certain rectangle.
HTH




Reply With Quote

Bookmarks