Сan someone explain to me results of this test program?
#include <QApplication>
#include <QDebug>
#include <QFontMetrics>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QFont font;
font.fromString("Monospace,14");
QFontMetrics fm(font);
qDebug() << "W : " << fm.width('W');
qDebug() << "8*W : " << 8*fm.width('W');
qDebug() << "WWWWWWWW: " << fm.width("WWWWWWWW"); // 8*W
return 0;
}
After comipiling this code with Qt5.11 I have such results:
W : 11 8*W : 88 WWWWWWWW: 92
Size of one character 'W' for this monospace font is 11. I expect that size of string that consists of 8 such characters should be 88. But QFontmetrics::width returns 92!