Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QFont::setPixelSize adds extra top padding.



  • I have following code:
    @
    QFont serifFont("Times");
    serifFont.setPixelSize(20);

    QFontMetrics m (serifFont);
    qDebug() <<  m.height();
    

    @

    This gives an output 26???, so real size of font is 26px. This make very difficult to predict real size of font.


Log in to reply