I'm getting only integer values from QFontMetricsF::width() and QFontMetricsF.boundingRect().width().
I'm trying to use the width to draw a box with GraphicsView, but because of the integer coordinates, the box sometimes overlaps the text.
Here's the code I'm using:
font.setPointSizeF(13.2524);
std::cout << "width: " << fontsizer->width("string") << std::endl;
QFont font("Sans", 12);
font.setPointSizeF(13.2524);
fontsizer = new QFontMetricsF(font);
std::cout << "width: " << fontsizer->width("string") << std::endl;
To copy to clipboard, switch view to plain text mode
Am I doing something wrong?
Bookmarks