Details
-
Bug
-
Resolution: Fixed
-
Not Evaluated
-
5.11.0
-
None
-
Ubuntu 18.04.1 LTS
-
-
ee2ad9df701b27790e2ab72e99111d255fde42ed
Description
I create project with default settings.
Source code of the project below.
#include <QApplication> #include <QDebug> #include <QFontMetrics> int main(int argc, char *argv[]) { QApplication app(argc, argv); QFont font; font.fromString("Monospace,14"); QFontMetricsF fm(font); qDebug() << "maxWidth : " << fm.maxWidth(); qDebug() << "widht of 'W': " << fm.width('W'); return 0; }
results:
maxWidth : 11
widht of 'W': 11.4375
According to documentation maxWidth method returns the width of the widest character in the font. The type of returning value is qreal. And it seems to me that in this example maxWidth should return something as 11.4375.