Relative font sizes in QT or the most portable way to define them

后端 未结 3 1642
长发绾君心
长发绾君心 2020-12-21 01:02

Coming from a Web Development background I am now into QT Applications development.

Working with QFonts I have seen that I have only two options apparently, to defin

3条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-21 01:54

    in qt3, the next code works at least for fixed fonts:

    QFont f=font();
    int psz=f.pixelSize();
    if (psz>0) f.setPixelSize(psz*6/5);
    else f.setPointSizeFloat(f.pointSizeFloat()*1.2);
    

提交回复
热议问题