Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-53377

Theme font ignored in QQC2 due to not exact match

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.7.0
    • 5.7.0 Beta
    • Quick: Controls 2
    • None
    • Mageia Linux Cauldron x86_64.
    • 82c422b5b1c81f0572fdb2be1efba900200680d8

    Description

      When code from themes set font it calls QFont::exactMatch(). But I've found, that function always return false, even if the font available. This is output from debugger in QFontDef::exactMatch(), that is called by exactMatch() when Material theme is used:

      other	@0x854f00	QFontDef &
              fallBackFamilies	<0 элементов>	QStringList
              family	"Roboto"	QString
              fixedPitch	0	uint
              fixedPitchComputed	0	uint
              hintingPreference	0	uint
              ignorePitch	0	uint
              pixelSize	13	qreal
              pointSize	9.75	qreal
              reserved	0	int
              stretch	100	uint
              style	0	uint
              styleHint	5	uint
              styleName	"Regular"	QString
              styleStrategy	1	uint
              weight	50	uint
      other_family	<недоступно>	QString
      other_foundry	""	QString
      this	@0x874558	QFontDef
              fallBackFamilies	<0 элементов>	QStringList
              family	"Roboto"	QString
              fixedPitch	0	uint
              fixedPitchComputed	0	uint
              hintingPreference	0	uint
              ignorePitch	1	uint
              pixelSize	-1	qreal
              pointSize	10	qreal
              reserved	0	int
              stretch	100	uint
              style	0	uint
              styleHint	5	uint
              styleName	""	QString
              styleStrategy	1	uint
              weight	50	uint
      this_family	<недоступно>	QString
      this_foundry	""	QString
      

      Though fonts are found, some parameters mismatch: pixelSize, pointSize and ignorePitch. I don't know, is it a bug in Qt font system or exactMatch() shouldn't be used this way.

      On my system I have no font installed system-wide, I loaded the font using QFontDatabase::addApplicationFontFromData(), but this may be reproducible when font installed into system too.

      Attachments

        For Gerrit Dashboard: QTBUG-53377
        # Subject Branch Project Status CR V

        Activity

          People

            krnekit Nikita Krupenko
            krnekit Nikita Krupenko
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes