diff options
author | Liang Qi <liang.qi@qt.io> | 2019-09-30 12:57:57 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2019-09-30 14:43:02 +0200 |
commit | 99cdd5fc67386fb3361299b9ec493e081043097d (patch) | |
tree | 2c1d41d3d71f671f104e93b87bf11bdd169ba746 /src/gui/text/qfont.cpp | |
parent | 86876744f07cbaa01daca6869b896741878c39a3 (diff) | |
parent | 46201f0e82a7b1629adad196dfa8f7ff1cf4dffd (diff) |
Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
src/corelib/global/qrandom.cpp
src/corelib/io/qfileinfo.cpp
src/corelib/kernel/qeventdispatcher_win.cpp
src/corelib/kernel/qeventdispatcher_win_p.h
src/gui/text/qfontdatabase.cpp
src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
src/plugins/platforms/windows/qwindowsglcontext.cpp
src/testlib/qtestcase.cpp
Done-With: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Done-With: Edward Welbourne <edward.welbourne@qt.io>
Change-Id: I4893212471aa24be804c989a581810e2f714545c
Diffstat (limited to 'src/gui/text/qfont.cpp')
-rw-r--r-- | src/gui/text/qfont.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp index 3c1a052f37..efc79a1783 100644 --- a/src/gui/text/qfont.cpp +++ b/src/gui/text/qfont.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2019 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtGui module of the Qt Toolkit. @@ -2096,10 +2096,11 @@ uint qHash(const QFont &font, uint seed) noexcept */ bool QFont::fromString(const QString &descrip) { - const auto l = descrip.splitRef(QLatin1Char(',')); - - int count = l.count(); - if (!count || (count > 2 && count < 9) || count > 11) { + const QStringRef sr = QStringRef(&descrip).trimmed(); + const auto l = sr.split(QLatin1Char(',')); + const int count = l.count(); + if (!count || (count > 2 && count < 9) || count > 11 || + l.first().isEmpty()) { qWarning("QFont::fromString: Invalid description '%s'", descrip.isEmpty() ? "(empty)" : descrip.toLatin1().data()); return false; |