PDA

View Full Version : QFontDialog BOLD hint on ARIAL not working?



mustermann.klaus@gmx.de
21st November 2020, 10:20
Hello everybody,

BOLD-hint on Arial seems to fail. Can anybody tell why and how to workaround?



QFont font;
font.setFamily("Arial");
font.setPointSizeF(7);
font.setBold(true);

qDebug() << font.bold() << font.weight(); // returns: true 75


QFontDialog dialog(this); // or QFontDialog dialog(font, this);
dialog.setCurrentFont(font);
font = dialog.getFont(&ok, font, this);


Opens the dialog. But weight is set to standard. This happens on ARIAL and on initial opening only. After I switched trough the dialog to bold, the next launch is set properly. Why is that?
Tried various other fonts, worked fine.

I also would like to learn, why I can't set PointSizeF to i.e. 7.5. User experience on my windows systems show that it is possible (i.e. MS-Office)

Thanks in advance, Lars

mustermann.klaus@gmx.de
30th November 2020, 21:23
Nobody an idea?