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 of
the font family, the font style, the font size, e.g. you could change
the size and keep each respective font families for "General" and "Toolbar"
as is.
When using ajustAllFonts(), try to set the fixed width/Monospace font
from the font family the user has selected, otherwise fallback to whatever
QFontDatabase::systemFont(QFontDatabase::FixedFont) gets.
Depends on D27785