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

QFontDatabase::standardSizes() range changed on Mac

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P3: Somewhat important
    • None
    • 5.3.1
    • GUI: Font handling
    • None
    • Mac OSX 10.9.4 with prebuilt Qt 5.3.1
    • macOS

    Description

      Something seems to have changed on Qt 5.3.1 vs. Previous Qt Versions on Mac OSX for the QFontDatabase::standardSizes().

      I haven't compared the exact lists side-by-side, but my app pulls the min and max values from the QList returned by standardSizes() to set as range values for a QSpinBox for the user font configuration options. On previous Qt Versions, it was returning a reasonable range of 6 to 72. On Qt 5.3.1, it's returning 9 to 288.

      It's almost like it's using different units or something than it previously was. Previously, I could use this as the point-size for the user to select and the 6 to 72 was a reasonable range. But 9 to 288 is too large – users need smaller values in general.

      My workaround for this in the meantime is to simply hardcode a reasonable range into my app, but am reporting this because it seems to be a regression that should be fixed.

      This also seems to only be on Mac (using the prebuilt Qt 5.3.1 package for Mac), as my Linux version is still getting 6 to 72.

      My code for this looks like:

      	QList<int> lstStandardFontSizes = QFontDatabase::standardSizes();
      	assert(lstStandardFontSizes.size() > 0);
      	int nFontMin = -1;
      	int nFontMax = -1;
      	for (int ndx=0; ndx<lstStandardFontSizes.size(); ++ndx) {
      		if ((nFontMin == -1) || (lstStandardFontSizes.at(ndx) < nFontMin)) nFontMin = lstStandardFontSizes.at(ndx);
      		if ((nFontMax == -1) || (lstStandardFontSizes.at(ndx) > nFontMax)) nFontMax = lstStandardFontSizes.at(ndx);
      	}
      

      Previous Qt's return nFontMin==6 and nFontMax==72. Qt 5.3.1 is returning nFontMin==9 and nFontMax==288.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              liaqi Liang Qi
              dewhisna Donna Whisnant
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes