From b2b32d3147eb213c835072994c93d2af3e7d285a Mon Sep 17 00:00:00 2001 From: Andrew O'Doherty Date: Mon, 24 Sep 2018 14:52:09 +0200 Subject: [PATCH 1/9] fix HTML subset documentation is not very readable on smaller screens When viewing "Supported HTML Subset" documentation in Qt Creator (in QTextBrowser), the first table that lists all tags is quite unreadable (see images). It happens because there is a code snippet in Comment column for tag "meta" that uses pre-formatted text. Because it should not be wrapped automatically, it ends up pushing first 2 columns into their minimum size, which mostly makes them take a single letter per row. Task-number: QTBUG-64126 Change-Id: I08bf6f61806d52e7a2f47bdbed1b5950825ce739 Reviewed-by: Leena Miettinen --- src/gui/doc/src/richtext.qdoc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/gui/doc/src/richtext.qdoc b/src/gui/doc/src/richtext.qdoc index f3bbcaf5bb..a0f739d418 100644 --- a/src/gui/doc/src/richtext.qdoc +++ b/src/gui/doc/src/richtext.qdoc @@ -975,14 +975,12 @@ \li \row \li \c meta \li Meta-information - \li If a text encoding is specified using the \c{meta} tag, - it is picked up by Qt::codecForHtml(). - Likewise, if an encoding is specified to - QTextDocument::toHtml(), the encoding is stored using - a \c meta tag, for example: - - \snippet code/doc_src_richtext.qdoc 7 - + \li If a text encoding is specified using the \c{meta} + tag, it is picked up by Qt::codecForHtml(). Likewise, + if an encoding is specified to QTextDocument::toHtml(), + the encoding is stored using a \c meta tag, for + example: + \c {} \row \li \c li \li List item \li From c958fb8b488ea6e86365298796d5710ec4deccc9 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 24 Sep 2018 13:23:16 +0200 Subject: [PATCH 2/9] zlib: Fix spelling of license Follow spelling convention at https://spdx.org/licenses/Zlib.html Change-Id: Ib25b98cf7f3a052ec25ba6924748a962733e2ed8 Reviewed-by: Friedemann Kleint --- src/3rdparty/zlib/qt_attribution.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rdparty/zlib/qt_attribution.json b/src/3rdparty/zlib/qt_attribution.json index ce3fa50f35..ea3a476e7b 100644 --- a/src/3rdparty/zlib/qt_attribution.json +++ b/src/3rdparty/zlib/qt_attribution.json @@ -8,7 +8,7 @@ "Homepage": "http://zlib.net/", "Version": "1.2.11", - "License": "ZLib license", + "License": "zlib License", "LicenseId": "Zlib", "LicenseFile": "LICENSE", "Copyright": "(C) 1995-2017 Jean-loup Gailly and Mark Adler" From 5a295a1009dad3a020be10331fa8e8c6163a9106 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 1 Oct 2018 19:58:40 +0200 Subject: [PATCH 3/9] Scale seconds by a thousand to get milliseconds QTimeZonePrivate::dataForLocalTime()'s handling of times in a spring-forward gap added offsets in seconds to values in milliseconds. Supply the missing factor of a thousand. Change-Id: Ic32d87675f902e1c7fd85025fb70c8272a4f2db2 Reviewed-by: Thiago Macieira --- src/corelib/tools/qtimezoneprivate.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/tools/qtimezoneprivate.cpp b/src/corelib/tools/qtimezoneprivate.cpp index 1a5135f103..54c2f65d94 100644 --- a/src/corelib/tools/qtimezoneprivate.cpp +++ b/src/corelib/tools/qtimezoneprivate.cpp @@ -399,7 +399,7 @@ QTimeZonePrivate::Data QTimeZonePrivate::dataForLocalTime(qint64 forLocalMSecs, 0 < tran.atMSecsSinceEpoch - nextTran.atMSecsSinceEpoch = (nextTran.offsetFromUtc - tran.offsetFromUtc) * 1000 */ - int dstStep = nextTran.offsetFromUtc - tran.offsetFromUtc; + int dstStep = (nextTran.offsetFromUtc - tran.offsetFromUtc) * 1000; Q_ASSERT(dstStep > 0); // How else could we get here ? if (nextFirst) { // hint thought we needed nextTran, so use tran tran.atMSecsSinceEpoch -= dstStep; @@ -439,7 +439,7 @@ QTimeZonePrivate::Data QTimeZonePrivate::dataForLocalTime(qint64 forLocalMSecs, // Invalid forLocalMSecs: in spring-forward gap. const int dstStep = daylightTimeOffset(early < late ? forLocalMSecs + sixteenHoursInMSecs : - forLocalMSecs - sixteenHoursInMSecs); + forLocalMSecs - sixteenHoursInMSecs) * 1000; Q_ASSERT(dstStep); // There can't be a transition without it ! utcEpochMSecs = (hint > 0) ? forStd - dstStep : forDst + dstStep; } From ced34cb3d5805f1fbaf3b275714a1a5f3585900c Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 1 Oct 2018 20:01:54 +0200 Subject: [PATCH 4/9] QDateTimeParser: avoid using an invalid hour by default When a time-zone does a spring-forward, skipping an hour (either to start DST or to move its standard time), there's an hour that doesn't exist on the day in question. That hour can be the first hour of the day, in which case using 0:0 as the default time is broken. So catch this case and use the first time that day that makes sense. Fixes: QTBUG-70823 Change-Id: I23dae9320a3cdd2c988841a7db1b111edb945730 Reviewed-by: Thiago Macieira --- src/corelib/tools/qdatetimeparser.cpp | 29 ++++++++++++++++--- .../corelib/tools/qdatetime/tst_qdatetime.cpp | 8 +++++ 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/src/corelib/tools/qdatetimeparser.cpp b/src/corelib/tools/qdatetimeparser.cpp index 18c44c3a17..e6afd510fd 100644 --- a/src/corelib/tools/qdatetimeparser.cpp +++ b/src/corelib/tools/qdatetimeparser.cpp @@ -1341,12 +1341,33 @@ QDateTimeParser::scanString(const QDateTime &defaultValue, const QDate date(year, month, day); const QTime time(hour, minute, second, msec); - return StateNode( + const QDateTime when = #if QT_CONFIG(timezone) - tspec == Qt::TimeZone ? QDateTime(date, time, timeZone) : + tspec == Qt::TimeZone ? QDateTime(date, time, timeZone) : #endif - QDateTime(date, time, tspec, zoneOffset), - state, padding, conflicts); + QDateTime(date, time, tspec, zoneOffset); + + // If hour wasn't specified, check the default we're using exists on the + // given date (which might be a spring-forward, skipping an hour). + if (parserType == QVariant::DateTime && !(isSet & HourSectionMask) && !when.isValid()) { + qint64 msecs = when.toMSecsSinceEpoch(); + // Fortunately, that gets a useful answer ... + const QDateTime replace = +#if QT_CONFIG(timezone) + tspec == Qt::TimeZone + ? QDateTime::fromMSecsSinceEpoch(msecs, timeZone) : +#endif + QDateTime::fromMSecsSinceEpoch(msecs, tspec, zoneOffset); + const QTime tick = replace.time(); + if (replace.date() == date + && (!(isSet & MinuteSection) || tick.minute() == minute) + && (!(isSet & SecondSection) || tick.second() == second) + && (!(isSet & MSecSection) || tick.msec() == msec)) { + return StateNode(replace, state, padding, conflicts); + } + } + + return StateNode(when, state, padding, conflicts); } /*! diff --git a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp index d460beafde..943805e228 100644 --- a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp +++ b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp @@ -2390,6 +2390,14 @@ void tst_QDateTime::fromStringStringFormat_data() QTest::newRow("data16") << QString("2005-06-28T07:57:30.001Z") << QString("yyyy-MM-ddThh:mm:ss.zt") << QDateTime(QDate(2005, 06, 28), QTime(07, 57, 30, 1), Qt::UTC); +#if QT_CONFIG(timezone) + QTimeZone southBrazil("America/Sao_Paulo"); + if (southBrazil.isValid()) { + QTest::newRow("spring-forward-midnight") + << QString("2008-10-19 23:45.678 America/Sao_Paulo") << QString("yyyy-MM-dd mm:ss.zzz t") + << QDateTime(QDate(2008, 10, 19), QTime(1, 23, 45, 678), southBrazil); + } +#endif QTest::newRow("late") << QString("9999-12-31T23:59:59.999Z") << QString("yyyy-MM-ddThh:mm:ss.zZ") << QDateTime(QDate(9999, 12, 31), QTime(23, 59, 59, 999)); From d8817ddde65d8fd9c5a2785a31a01db43d050114 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Thu, 27 Sep 2018 13:20:52 +0200 Subject: [PATCH 5/9] Use update() instead of repaint() when displaying a new message There is no advantage to using repaint() here, so using update will give a performance improvement. Change-Id: Icc6a28dfc12dffb8ea3df0300fd14c66c775bf16 Reviewed-by: Friedemann Kleint Reviewed-by: Richard Moe Gustavsen --- src/widgets/widgets/qstatusbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/widgets/qstatusbar.cpp b/src/widgets/widgets/qstatusbar.cpp index fb551158bf..ef98bb6950 100644 --- a/src/widgets/widgets/qstatusbar.cpp +++ b/src/widgets/widgets/qstatusbar.cpp @@ -643,7 +643,7 @@ void QStatusBar::hideOrShow() } #endif - repaint(d->messageRect()); + update(d->messageRect()); } /*! From 18ec0a8b0991855f4576c2993832f9da41d97766 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 2 Oct 2018 08:36:09 +0200 Subject: [PATCH 6/9] Windows QPA: Fix WM_NCHITTEST not being sent to QAbstractNativeEventFilter The message is not sent to the QAbstractEventDispatcher, so it needs to be excluded from the list of input messages not sent to QAbstractNativeEventFilter. Amends a0a22037cdacbf51a2db560ff902a5a341561b15. Fixes: QTBUG-70873 Change-Id: Id84d73b46e8954867c06a4ddf5dc9e536ecd897e Reviewed-by: Oliver Wolff --- src/plugins/platforms/windows/qwindowscontext.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index 1da39a0516..b0c9349da5 100644 --- a/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/src/plugins/platforms/windows/qwindowscontext.cpp @@ -873,7 +873,6 @@ static inline bool isInputMessage(UINT m) case WM_TOUCH: case WM_MOUSEHOVER: case WM_MOUSELEAVE: - case WM_NCHITTEST: case WM_NCMOUSEHOVER: case WM_NCMOUSELEAVE: case WM_SIZING: From 04aeffbe8f6d452529671205fa2ded43103e1a46 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Mon, 24 Sep 2018 12:55:42 +0200 Subject: [PATCH 7/9] Doc: Describe behavior of QSslConfiguration::caCertificates() on iOS In iOS, the system certificates cannot be accessed, so this function will return an empty list for the default configuration. Task-number: QTBUG-60407 Change-Id: I0d691a0dd5e6367594e71c7ebccfbdc866d4a3f0 Reviewed-by: Edward Welbourne Reviewed-by: Andy Shaw --- src/network/ssl/qsslconfiguration.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/network/ssl/qsslconfiguration.cpp b/src/network/ssl/qsslconfiguration.cpp index 46df181496..52ddf8bb88 100644 --- a/src/network/ssl/qsslconfiguration.cpp +++ b/src/network/ssl/qsslconfiguration.cpp @@ -641,6 +641,10 @@ QList QSslConfiguration::caCertificates() const The CA certificate database is used by the socket during the handshake phase to validate the peer's certificate. + \note The default configuration uses the system CA certificate database. If + that is not available (as is commonly the case on iOS), the default database + is empty. + \sa caCertificates() */ void QSslConfiguration::setCaCertificates(const QList &certificates) From 92f42caff1d1cb02dc218adc8589c03d0b30ef80 Mon Sep 17 00:00:00 2001 From: Sergio Martins Date: Sat, 22 Sep 2018 14:59:14 +0100 Subject: [PATCH 8/9] Fix ICE on QNX 6.6 qabstractitemmodeltester.cpp:223:31: internal compiler error: in expand_expr_real_1, at expr.c:9170 Change-Id: I098c1bdf706512c91c649205f4675de0ca374227 Reviewed-by: David Faure --- src/testlib/qabstractitemmodeltester.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/testlib/qabstractitemmodeltester.cpp b/src/testlib/qabstractitemmodeltester.cpp index fc6f696ecd..859966c0e3 100644 --- a/src/testlib/qabstractitemmodeltester.cpp +++ b/src/testlib/qabstractitemmodeltester.cpp @@ -217,7 +217,7 @@ QAbstractItemModelTester::QAbstractItemModelTester(QAbstractItemModel *model, Fa Q_D(QAbstractItemModelTester); - const auto &runAllTests = [d] { d->runAllTests(); }; + auto runAllTests = [d] { d->runAllTests(); }; connect(model, &QAbstractItemModel::columnsAboutToBeInserted, this, runAllTests); From 7146c9075c85cb46cb38b57ded3e12dfa6cbef66 Mon Sep 17 00:00:00 2001 From: Sergio Martins Date: Fri, 5 Oct 2018 10:54:51 +0100 Subject: [PATCH 9/9] Fix DejaVu fonts URL http://dejavu-fonts.org is something else nowadays Change-Id: Idb03b864fb145b016ce4ae1a2f0df02ff80280a8 Reviewed-by: Rolland Dudemaine Reviewed-by: Giuseppe D'Angelo --- .../fontdatabases/freetype/qfreetypefontdatabase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platformsupport/fontdatabases/freetype/qfreetypefontdatabase.cpp b/src/platformsupport/fontdatabases/freetype/qfreetypefontdatabase.cpp index 2caa47658a..4baba64de3 100644 --- a/src/platformsupport/fontdatabases/freetype/qfreetypefontdatabase.cpp +++ b/src/platformsupport/fontdatabases/freetype/qfreetypefontdatabase.cpp @@ -63,7 +63,7 @@ void QFreeTypeFontDatabase::populateFontDatabase() if (!dir.exists()) { qWarning("QFontDatabase: Cannot find font directory %s.\n" - "Note that Qt no longer ships fonts. Deploy some (from http://dejavu-fonts.org for example) or switch to fontconfig.", + "Note that Qt no longer ships fonts. Deploy some (from https://dejavu-fonts.github.io/ for example) or switch to fontconfig.", qPrintable(fontpath)); return; }