diff options
author | Liang Qi <liang.qi@qt.io> | 2016-05-20 13:46:21 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2016-05-23 21:09:46 +0200 |
commit | 56d6e000f7487c59172330ebd23a718268c508f1 (patch) | |
tree | 1494432583b1569816075091a8075b31d795f77c /src/gui | |
parent | 9fd407fc6a29c94b4568dd042a05c208255179e0 (diff) | |
parent | c276aa51303b7c6f8e4cd854aadf8344a906e50f (diff) |
Merge remote-tracking branch 'origin/5.7' into dev
Conflicts:
mkspecs/wince80colibri-armv7-msvc2012/qmake.conf
qmake/generators/win32/msvc_vcproj.cpp
src/corelib/global/qnamespace.h
src/corelib/global/qnamespace.qdoc
src/corelib/io/qfsfileengine_win.cpp
src/corelib/tools/tools.pri
src/network/ssl/qsslconfiguration_p.h
src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp
src/plugins/platforms/windows/windows.pri
src/src.pro
src/tools/bootstrap/bootstrap.pro
src/tools/uic/cpp/cppwriteinitialization.cpp
src/widgets/dialogs/qfilesystemmodel.cpp
tests/auto/testlib/selftests/expected_cmptest.teamcity
tests/auto/testlib/selftests/expected_cmptest.txt
Change-Id: I4d2ac78f0dcc97f008186bbbc769c6fe588ab0e5
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/doc/qtgui.qdocconf | 2 | ||||
-rw-r--r-- | src/gui/opengl/qopengl.cpp | 50 | ||||
-rw-r--r-- | src/gui/painting/qpainter.cpp | 4 | ||||
-rw-r--r-- | src/gui/painting/qplatformbackingstore.cpp | 3 | ||||
-rw-r--r-- | src/gui/painting/qstroker.cpp | 2 | ||||
-rw-r--r-- | src/gui/text/qfont.cpp | 3 |
6 files changed, 23 insertions, 41 deletions
diff --git a/src/gui/doc/qtgui.qdocconf b/src/gui/doc/qtgui.qdocconf index 027d2663de..b07d39fa37 100644 --- a/src/gui/doc/qtgui.qdocconf +++ b/src/gui/doc/qtgui.qdocconf @@ -4,7 +4,7 @@ project = QtGui description = Qt GUI Reference Documentation version = $QT_VERSION -examplesinstallpath = qtbase/gui +examplesinstallpath = gui qhp.projects = QtGui diff --git a/src/gui/opengl/qopengl.cpp b/src/gui/opengl/qopengl.cpp index a798db662c..1a8fc599ce 100644 --- a/src/gui/opengl/qopengl.cpp +++ b/src/gui/opengl/qopengl.cpp @@ -138,22 +138,6 @@ QDebug operator<<(QDebug d, const QOpenGLConfig::Gpu &g) enum Operator { NotEqual, LessThan, LessEqualThan, Equals, GreaterThan, GreaterEqualThan }; static const char operators[][3] = {"!=", "<", "<=", "=", ">", ">="}; -static inline QString valueKey() { return QStringLiteral("value"); } -static inline QString opKey() { return QStringLiteral("op"); } -static inline QString versionKey() { return QStringLiteral("version"); } -static inline QString releaseKey() { return QStringLiteral("release"); } -static inline QString typeKey() { return QStringLiteral("type"); } -static inline QString osKey() { return QStringLiteral("os"); } -static inline QString vendorIdKey() { return QStringLiteral("vendor_id"); } -static inline QString glVendorKey() { return QStringLiteral("gl_vendor"); } -static inline QString deviceIdKey() { return QStringLiteral("device_id"); } -static inline QString driverVersionKey() { return QStringLiteral("driver_version"); } -static inline QString driverDescriptionKey() { return QStringLiteral("driver_description"); } -static inline QString featuresKey() { return QStringLiteral("features"); } -static inline QString idKey() { return QStringLiteral("id"); } -static inline QString descriptionKey() { return QStringLiteral("description"); } -static inline QString exceptionsKey() { return QStringLiteral("exceptions"); } - typedef QJsonArray::ConstIterator JsonArrayConstIt; static inline bool contains(const QJsonArray &haystack, unsigned needle) @@ -216,8 +200,8 @@ VersionTerm VersionTerm::fromJson(const QJsonValue &v) if (!v.isObject()) return result; const QJsonObject o = v.toObject(); - result.number = QVersionNumber::fromString(o.value(valueKey()).toString()); - const QString opS = o.value(opKey()).toString(); + result.number = QVersionNumber::fromString(o.value(QLatin1String("value")).toString()); + const QString opS = o.value(QLatin1String("op")).toString(); for (size_t i = 0; i < sizeof(operators) / sizeof(operators[0]); ++i) { if (opS == QLatin1String(operators[i])) { result.op = static_cast<Operator>(i); @@ -292,9 +276,9 @@ OsTypeTerm OsTypeTerm::fromJson(const QJsonValue &v) if (!v.isObject()) return result; const QJsonObject o = v.toObject(); - result.type = o.value(typeKey()).toString(); - result.versionTerm = VersionTerm::fromJson(o.value(versionKey())); - result.release = o.value(releaseKey()).toArray(); + result.type = o.value(QLatin1String("type")).toString(); + result.versionTerm = VersionTerm::fromJson(o.value(QLatin1String("version"))); + result.release = o.value(QLatin1String("release")).toArray(); return result; } @@ -318,8 +302,8 @@ QString OsTypeTerm::hostOs() static QString msgSyntaxWarning(const QJsonObject &object, const QString &what) { QString result; - QTextStream(&result) << "Id " << object.value(idKey()).toInt() - << " (\"" << object.value(descriptionKey()).toString() + QTextStream(&result) << "Id " << object.value(QLatin1String("id")).toInt() + << " (\"" << object.value(QLatin1String("description")).toString() << "\"): " << what; return result; } @@ -333,11 +317,11 @@ static bool matches(const QJsonObject &object, const QString &osRelease, const QOpenGLConfig::Gpu &gpu) { - const OsTypeTerm os = OsTypeTerm::fromJson(object.value(osKey())); + const OsTypeTerm os = OsTypeTerm::fromJson(object.value(QLatin1String("os"))); if (!os.isNull() && !os.matches(osName, kernelVersion, osRelease)) return false; - const QJsonValue exceptionsV = object.value(exceptionsKey()); + const QJsonValue exceptionsV = object.value(QLatin1String("exceptions")); if (exceptionsV.isArray()) { const QJsonArray exceptionsA = exceptionsV.toArray(); for (JsonArrayConstIt it = exceptionsA.constBegin(), cend = exceptionsA.constEnd(); it != cend; ++it) { @@ -346,20 +330,20 @@ static bool matches(const QJsonObject &object, } } - const QJsonValue vendorV = object.value(vendorIdKey()); + const QJsonValue vendorV = object.value(QLatin1String("vendor_id")); if (vendorV.isString()) { if (gpu.vendorId != vendorV.toString().toUInt(Q_NULLPTR, /* base */ 0)) return false; } else { - if (object.contains(glVendorKey())) { - const QByteArray glVendorV = object.value(glVendorKey()).toString().toUtf8(); + if (object.contains(QLatin1String("gl_vendor"))) { + const QByteArray glVendorV = object.value(QLatin1String("gl_vendor")).toString().toUtf8(); if (!gpu.glVendor.contains(glVendorV)) return false; } } if (gpu.deviceId) { - const QJsonValue deviceIdV = object.value(deviceIdKey()); + const QJsonValue deviceIdV = object.value(QLatin1String("device_id")); switch (deviceIdV.type()) { case QJsonValue::Array: if (!contains(deviceIdV.toArray(), gpu.deviceId)) @@ -375,7 +359,7 @@ static bool matches(const QJsonObject &object, } } if (!gpu.driverVersion.isNull()) { - const QJsonValue driverVersionV = object.value(driverVersionKey()); + const QJsonValue driverVersionV = object.value(QLatin1String("driver_version")); switch (driverVersionV.type()) { case QJsonValue::Object: if (!VersionTerm::fromJson(driverVersionV).matches(gpu.driverVersion)) @@ -392,7 +376,7 @@ static bool matches(const QJsonObject &object, } if (!gpu.driverDescription.isEmpty()) { - const QJsonValue driverDescriptionV = object.value(driverDescriptionKey()); + const QJsonValue driverDescriptionV = object.value(QLatin1String("driver_description")); if (driverDescriptionV.isString()) { if (!gpu.driverDescription.contains(driverDescriptionV.toString().toUtf8())) return false; @@ -412,7 +396,7 @@ static bool readGpuFeatures(const QOpenGLConfig::Gpu &gpu, { result->clear(); errorMessage->clear(); - const QJsonValue entriesV = doc.object().value(QStringLiteral("entries")); + const QJsonValue entriesV = doc.object().value(QLatin1String("entries")); if (!entriesV.isArray()) { *errorMessage = QLatin1String("No entries read."); return false; @@ -423,7 +407,7 @@ static bool readGpuFeatures(const QOpenGLConfig::Gpu &gpu, if (eit->isObject()) { const QJsonObject object = eit->toObject(); if (matches(object, osName, kernelVersion, osRelease, gpu)) { - const QJsonValue featuresListV = object.value(featuresKey()); + const QJsonValue featuresListV = object.value(QLatin1String("features")); if (featuresListV.isArray()) { const QJsonArray featuresListA = featuresListV.toArray(); for (JsonArrayConstIt fit = featuresListA.constBegin(), fcend = featuresListA.constEnd(); fit != fcend; ++fit) diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index aeb76589e0..8defcfb28d 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -6272,7 +6272,7 @@ static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const pen.setColor(uc); // Adapt wave to underlineOffset or pen width, whatever is larger, to make it work on all platforms - const QPixmap wave = generateWavyPixmap(qMin(qMax(underlineOffset, pen.widthF()), maxHeight / 2.), pen); + const QPixmap wave = generateWavyPixmap(qMin(qMax(underlineOffset, pen.widthF()), maxHeight / qreal(2.)), pen); const int descent = qFloor(maxHeight); painter->setBrushOrigin(painter->brushOrigin().x(), 0); @@ -6283,7 +6283,7 @@ static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const // the text above it, but limit it to stay within descent. qreal adjustedUnderlineOffset = std::ceil(underlineOffset) + 0.5; if (underlineOffset <= fe->descent().toReal()) - adjustedUnderlineOffset = qMin(adjustedUnderlineOffset, fe->descent().toReal() - 0.5); + adjustedUnderlineOffset = qMin(adjustedUnderlineOffset, fe->descent().toReal() - qreal(0.5)); const qreal underlinePos = pos.y() + adjustedUnderlineOffset; QColor uc = charFormat.underlineColor(); if (uc.isValid()) diff --git a/src/gui/painting/qplatformbackingstore.cpp b/src/gui/painting/qplatformbackingstore.cpp index 7381f381fe..d967a168d2 100644 --- a/src/gui/painting/qplatformbackingstore.cpp +++ b/src/gui/painting/qplatformbackingstore.cpp @@ -232,7 +232,8 @@ void QPlatformTextureList::clear() Flushes the given \a region from the specified \a window onto the screen. - Note that the \a offset parameter is currently unused. + The \a offset parameter is relative to the origin of the backing + store image. */ #ifndef QT_NO_OPENGL diff --git a/src/gui/painting/qstroker.cpp b/src/gui/painting/qstroker.cpp index 92683448aa..c52792c2d3 100644 --- a/src/gui/painting/qstroker.cpp +++ b/src/gui/painting/qstroker.cpp @@ -428,7 +428,7 @@ void QStroker::processCurrentSubpath() bool fwclosed = qt_stroke_side(&fwit, this, false, &fwStartTangent); bool bwclosed = qt_stroke_side(&bwit, this, !fwclosed, &bwStartTangent); - if (!bwclosed) + if (!bwclosed && !fwStartTangent.isNull()) joinPoints(m_elements.at(0).x, m_elements.at(0).y, fwStartTangent, m_capStyle); } diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp index 7e18250087..f92e4ab457 100644 --- a/src/gui/text/qfont.cpp +++ b/src/gui/text/qfont.cpp @@ -118,9 +118,6 @@ bool QFontDef::exactMatch(const QFontDef &other) const QFontDatabase::parseFontName(family, this_foundry, this_family); QFontDatabase::parseFontName(other.family, other_foundry, other_family); - this_family = QFontDatabase::resolveFontFamilyAlias(this_family); - other_family = QFontDatabase::resolveFontFamilyAlias(other_family); - return (styleHint == other.styleHint && styleStrategy == other.styleStrategy && weight == other.weight |