QFontDatabase doesn't contain all the fonts families or it has different names
问题 I'm getting a QWidget's default font's family using font().family(). I compare this against the QStringList I get from QFontDatabase().families(). The default font's family is "Sans" but I cannot find that in the list I get from QFontDatabase, I can only find Sans Serif, Droid Sans, FreeSans etc. How come QWidget's default font is something that is not even present on the system's fonts? 回答1: This is a classic trip-up. Logically, QFont is a request for a font. It may be satisfied by something