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

QFont::fromString incorrectly detects a font in strings with no commas.

    XMLWordPrintable

    Details

    • Platform/s:
      Windows
    • Commits:
      06cc5d307177ebacf8e6926b9690c12703004a1a (qt/qtbase/5.13)

      Description

      The problem is here: https://code.woboq.org/qt5/qtbase/src/gui/text/qfont.cpp.html#_ZN5QFont10fromStringERK7QString

      const auto l = descrip.splitRef(QLatin1Char(','));

      should be

      const auto l = descrip.splitRef(QLatin1Char(','), QString::SkipEmptyParts);

      Presumably this is a bug, since the next few lines of this function test if count() == 0. And of course, please add tests for this function being passed empty strings. Super easy to encounter when reading from QSettings.

       It probably affects much more than just 5.13.0 and Windows, but that's all I tested.

        Attachments

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

          Activity

            People

            • Assignee:
              qt.team.quick.subscriptions Qt Quick and Widgets Team
              Reporter:
              artikash artikash
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes