A "Regular" font will have an empty styleName e.g. "DejaVu Sans,12,-1,5,50,0,0,0,0,0"
so that setBold(true) can work; we deliberately clear the styleName for
"Regular"-like font styles when saving via KConfig, see: writeEntryGui()
from kconfiggroupgui.cpp and https://phabricator.kde.org/D27735 for more
gory details.
Change nearestExistingFont() to return the same font it's been called on
if the search result gives us the same font (same weight, same style), and
interpret the case when the styleName is empty to mean it's using a
"Regular"-like style if the font weight is QFont::Normal and the styleName
is "Regular|Normal|Book|Roman".
Change setNearestExistingFonts() to set the fonts only if nearestExistingFont()
returns a different font.
Also remove setNeedsSave(false) from load() method, doesn't seem to be needed
any more (Partially reverting commit 0c4da0774e4388b6937b).
[Fonts KCM] Port KFontDialog/KFontChooser to QFontDialog
QFontDialog doesn't have the capability that KFontDialog had, where with
the latter when using adjustAllFonts() you could change only one ofDue to the change to clear font styleName property when saving via
the font family, the font style, the font sizeKConfig (D27735), e.g.if in kdegloblas you could changeremoved the ",Regular|Normal|Book|Roman"
the size and keep each respective from the end of the *font families for "General" and "Toolbar" as is.
When using ajustAllFonts()*= entries, try to setopenin the fixed width/Monospace fontont selection dialog
fromin the font family the user haKCM, the very first style is selected, not "Regular" and co. otherwise fallback to whateveras
QFontDatabase::systemFont(QFontDatabase::FixedFont) gets.
Depends on D27785it should be. This will be addressed in an upcoming diff.