0

I compile a simple QT GUI application with Qt 5.15.2 and Qt 6.2.4 in Linux Ubuntu 20.04.4. As you see in the below figure, the font of the application compiled with Qt 6.2.4 (Right Fig) is bigger and uglier than the program compiled with Qt 5.15.2 (Left Fig). enter image description here

Point: I do not use the following code:

QApplication::setAttribute(Qt::AA_DisableHighDpiScaling);

or

QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);

Point: Compile sample:

g++ -c -pipe -Wno-unused-function -O2 -std=gnu++1z -Wall -Wextra -D_REENTRANT -fPIC -DAPP_TARGET
m7913d
  • 10,244
  • 7
  • 28
  • 56
Abolfazl Diyanat
  • 397
  • 2
  • 13
  • Hmm, it's same font, but with some enhancement (a-la ClearType) going on. Is it same OS install\same GPU\same display? Note, Qt 6 got different render backend from 5th generation, Qt 5 app and Qt 6 apps have different system-wide defaults as well. – Swift - Friday Pie Mar 26 '22 at 09:34
  • Yes, It is same OS, same display, same computer, same C++ compiler. – Abolfazl Diyanat Mar 26 '22 at 09:45
  • 2
    Not sure if I would call it ugly, it had changed weight but it's graphically correct font. It's line wight of GUI doesn't match well to the font weight though. Since Qt 6 Qt use OpenFont standard font parameters instead of legacyones. Weight is one of parameters which now matches standard. SOme members of QFOnt class became deprecated because f that – Swift - Friday Pie Mar 26 '22 at 11:26
  • 2
    I'd say Qt6 version looks better. – Osyotr Mar 26 '22 at 11:33
  • Have you tried setting a font [`QApplication::setFont`](https://doc.qt.io/qt-5/qapplication.html#setFont) explicitly? De gustibus non disputandum est ... – m7913d Mar 27 '22 at 01:24

0 Answers0