From b0493998c391688022df7502892bd9b42cfdab7b Mon Sep 17 00:00:00 2001 From: wangChuan Date: Tue, 21 May 2019 16:08:25 +0800 Subject: [PATCH 01/21] QTextBoundaryFinder: don't break after uppercase followed by comma [ChangeLog][QtCore][QTextBoundaryFinder] Sentence breaking now no longer breaks between uppercase letters and comma. This is a deviation from the Unicode specification, but produces less surprising behavior. Fixes: QTBUG-75857 Change-Id: If1e78b3be3f20250d01100353ea7da6110985f82 Reviewed-by: Edward Welbourne Reviewed-by: Konstantin Ritt --- src/corelib/tools/qunicodetools.cpp | 2 +- .../tools/qtextboundaryfinder/tst_qtextboundaryfinder.cpp | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/corelib/tools/qunicodetools.cpp b/src/corelib/tools/qunicodetools.cpp index c9d0868fef9..0a2bea28e21 100644 --- a/src/corelib/tools/qunicodetools.cpp +++ b/src/corelib/tools/qunicodetools.cpp @@ -327,7 +327,7 @@ static const uchar breakTable[BAfter + 1][QUnicodeTables::NumSentenceBreakClasse // Any CR LF Sep Extend Sp Lower Upper OLetter Numeric ATerm SContinue STerm Close { Initial, BAfterC, BAfter , BAfter , Initial, Initial, Lower , Upper , Initial, Initial, ATerm , Initial, STerm , Initial }, // Initial { Initial, BAfterC, BAfter , BAfter , Lower , Initial, Initial, Initial, Initial, Initial, LUATerm, Initial, STerm , Initial }, // Lower - { Initial, BAfterC, BAfter , BAfter , Upper , Initial, Initial, Upper , Initial, Initial, LUATerm, STerm , STerm , Initial }, // Upper + { Initial, BAfterC, BAfter , BAfter , Upper , Initial, Initial, Upper , Initial, Initial, LUATerm, Initial, STerm , Initial }, // Upper { Lookup , BAfterC, BAfter , BAfter , LUATerm, ACS , Initial, Upper , Break , Initial, ATerm , STerm , STerm , ATermC }, // LUATerm { Lookup , BAfterC, BAfter , BAfter , ATerm , ACS , Initial, Break , Break , Initial, ATerm , STerm , STerm , ATermC }, // ATerm diff --git a/tests/auto/corelib/tools/qtextboundaryfinder/tst_qtextboundaryfinder.cpp b/tests/auto/corelib/tools/qtextboundaryfinder/tst_qtextboundaryfinder.cpp index 5467d438a3e..5701335b4ac 100644 --- a/tests/auto/corelib/tools/qtextboundaryfinder/tst_qtextboundaryfinder.cpp +++ b/tests/auto/corelib/tools/qtextboundaryfinder/tst_qtextboundaryfinder.cpp @@ -539,6 +539,13 @@ void tst_QTextBoundaryFinder::sentenceBoundaries_manual_data() QTest::newRow("data3") << testString << expectedBreakPositions; } + { + QString testString(QString::fromUtf8("Doing TEST, doing another test.")); + QList expectedBreakPositions; + expectedBreakPositions << 0 << 31; + + QTest::newRow("data4") << testString << expectedBreakPositions; + } } void tst_QTextBoundaryFinder::sentenceBoundaries_manual() From 90aefe0843a50aede26b8d411f46f3828dae25f1 Mon Sep 17 00:00:00 2001 From: Fredrik Orderud Date: Sun, 26 May 2019 22:14:45 +0200 Subject: [PATCH 02/21] Add quoting to deal with empty ${CMAKE_CXX_STANDARD_LIBRARIES} Done to fix broken CMake WebAssembly support, where CMAKE_CXX_STANDARD_LIBRARIES appear to be empty. The regression was introduced by ba4fdd99fff80790f764ab1ac8addd699e3101e7. This fixes the following CMake error on find_package(Qt ...): string sub-command REGEX, mode REPLACE needs at least 6 arguments total to command. Fixes: QTBUG-73475 Fixes: QTBUG-76244 Change-Id: Ieebe8cd1d49bb302dc37d8f118cc0b9376d6cdd7 Reviewed-by: Kai Koehne --- mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in index 1c4994c30ff..705e0a3c933 100644 --- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in +++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in @@ -59,7 +59,7 @@ function(_qt5_$${CMAKE_MODULE_NAME}_process_prl_file prl_file_location Configura file(STRINGS \"${prl_file_location}\" _prl_strings REGEX \"QMAKE_PRL_LIBS[ \\t]*=\") string(REGEX REPLACE \"QMAKE_PRL_LIBS[ \\t]*=[ \\t]*([^\\n]*)\" \"\\\\1\" _static_depends ${_prl_strings}) string(REGEX REPLACE \"[ \\t]+\" \";\" _static_depends ${_static_depends}) - string(REGEX REPLACE \"[ \\t]+\" \";\" _standard_libraries ${CMAKE_CXX_STANDARD_LIBRARIES}) + string(REGEX REPLACE \"[ \\t]+\" \";\" _standard_libraries \"${CMAKE_CXX_STANDARD_LIBRARIES}\") set(_search_paths) string(REPLACE \"\\$\\$[QT_INSTALL_LIBS]\" \"${_qt5_install_libs}\" _static_depends \"${_static_depends}\") foreach(_flag ${_static_depends}) From 2e7b7e4c90882cef50b293fe8048205a9ca7e5a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Thu, 13 Dec 2018 15:39:26 +0100 Subject: [PATCH 03/21] QSslSocket: add and set the TLSv1.3-specific PSK callback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If this callback is not set then OpenSSL will call the callback used for <= TLS 1.2 unconditionally when connecting. If using PSK it will call it again later once the preshared key is needed. We don't currently handle the TLSv1.3 PSK, but we definitely should. But for now we can work around it - when psk_use_session_callback is called we simply change the PSK callback to a dummy function whose only purpose is to restore the old callback. This is mostly done to keep behavior the same as it is now for users (and to keep our tests running). Later we can add a new signal and handle this new feature properly. Reviewed-by: Simo Fält (cherry picked from commit d8efc8d718e3b3a0464f321e740541f5b221a5d6) Task-number: QTBUG-67463 Change-Id: I4aca4ae73ec4be7c4f82a85e8864de103f35a834 Reviewed-by: Timur Pocheptsov --- src/network/ssl/qsslsocket_openssl.cpp | 56 +++++++++++++++++++ .../ssl/qsslsocket_openssl11_symbols_p.h | 6 ++ .../ssl/qsslsocket_openssl_symbols.cpp | 2 + .../network/ssl/qsslsocket/tst_qsslsocket.cpp | 12 +--- 4 files changed, 65 insertions(+), 11 deletions(-) diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp index c48cd423601..977d8a6742d 100644 --- a/src/network/ssl/qsslsocket_openssl.cpp +++ b/src/network/ssl/qsslsocket_openssl.cpp @@ -137,6 +137,55 @@ static unsigned int q_ssl_psk_server_callback(SSL *ssl, Q_ASSERT(d); return d->tlsPskServerCallback(identity, psk, max_psk_len); } + +#ifdef TLS1_3_VERSION +#ifndef OPENSSL_NO_PSK +static unsigned int q_ssl_psk_restore_client(SSL *ssl, + const char *hint, + char *identity, unsigned int max_identity_len, + unsigned char *psk, unsigned int max_psk_len) +{ + Q_UNUSED(hint); + Q_UNUSED(identity); + Q_UNUSED(max_identity_len); + Q_UNUSED(psk); + Q_UNUSED(max_psk_len); + +#ifdef QT_DEBUG + QSslSocketBackendPrivate *d = reinterpret_cast(q_SSL_get_ex_data(ssl, QSslSocketBackendPrivate::s_indexForSSLExtraData)); + Q_ASSERT(d); + Q_ASSERT(d->mode == QSslSocket::SslClientMode); +#endif + q_SSL_set_psk_client_callback(ssl, &q_ssl_psk_client_callback); + + return 0; +} +#endif // !OPENSSL_NO_PSK + +static int q_ssl_psk_use_session_callback(SSL *ssl, const EVP_MD *md, const unsigned char **id, + size_t *idlen, SSL_SESSION **sess) +{ + Q_UNUSED(ssl); + Q_UNUSED(md); + Q_UNUSED(id); + Q_UNUSED(idlen); + Q_UNUSED(sess); + +#ifndef OPENSSL_NO_PSK +#ifdef QT_DEBUG + QSslSocketBackendPrivate *d = reinterpret_cast(q_SSL_get_ex_data(ssl, QSslSocketBackendPrivate::s_indexForSSLExtraData)); + Q_ASSERT(d); + Q_ASSERT(d->mode == QSslSocket::SslClientMode); +#endif + + // Temporarily rebind the psk because it will be called next. The function will restore it. + q_SSL_set_psk_client_callback(ssl, &q_ssl_psk_restore_client); +#endif + + return 1; // need to return 1 or else "the connection setup fails." +} +#endif // TLS1_3_VERSION + #endif #if QT_CONFIG(ocsp) @@ -555,6 +604,13 @@ bool QSslSocketBackendPrivate::initSslContext() q_SSL_set_psk_server_callback(ssl, &q_ssl_psk_server_callback); } #endif +#if OPENSSL_VERSION_NUMBER >= 0x10101006L + // Set the client callback for TLSv1.3 PSK + if (mode == QSslSocket::SslClientMode + && QSslSocket::sslLibraryBuildVersionNumber() >= 0x10101006L) { + q_SSL_set_psk_use_session_callback(ssl, &q_ssl_psk_use_session_callback); + } +#endif // openssl version >= 0x10101006L #if QT_CONFIG(ocsp) if (configuration.ocspStaplingEnabled) { diff --git a/src/network/ssl/qsslsocket_openssl11_symbols_p.h b/src/network/ssl/qsslsocket_openssl11_symbols_p.h index a44d00a8303..d523a957503 100644 --- a/src/network/ssl/qsslsocket_openssl11_symbols_p.h +++ b/src/network/ssl/qsslsocket_openssl11_symbols_p.h @@ -183,4 +183,10 @@ const OCSP_CERTID *q_OCSP_SINGLERESP_get0_id(const OCSP_SINGLERESP *x); #define q_SSL_CTX_set_max_proto_version(ctx, version) \ q_SSL_CTX_ctrl(ctx, SSL_CTRL_SET_MAX_PROTO_VERSION, version, nullptr) +extern "C" { +typedef int (*q_SSL_psk_use_session_cb_func_t)(SSL *, const EVP_MD *, const unsigned char **, size_t *, + SSL_SESSION **); +} +void q_SSL_set_psk_use_session_callback(SSL *s, q_SSL_psk_use_session_cb_func_t); + #endif diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp index aa1dc681e07..93b54aaa67c 100644 --- a/src/network/ssl/qsslsocket_openssl_symbols.cpp +++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp @@ -163,6 +163,7 @@ DEFINEFUNC(int, SSL_session_reused, SSL *a, a, return 0, return) DEFINEFUNC2(unsigned long, SSL_CTX_set_options, SSL_CTX *ctx, ctx, unsigned long op, op, return 0, return) #ifdef TLS1_3_VERSION DEFINEFUNC2(int, SSL_CTX_set_ciphersuites, SSL_CTX *ctx, ctx, const char *str, str, return 0, return) +DEFINEFUNC2(void, SSL_set_psk_use_session_callback, SSL *ssl, ssl, q_SSL_psk_use_session_cb_func_t callback, callback, return, DUMMYARG) #endif DEFINEFUNC3(size_t, SSL_get_client_random, SSL *a, a, unsigned char *out, out, size_t outlen, outlen, return 0, return) DEFINEFUNC3(size_t, SSL_SESSION_get_master_key, const SSL_SESSION *ses, ses, unsigned char *out, out, size_t outlen, outlen, return 0, return) @@ -967,6 +968,7 @@ bool q_resolveOpenSslSymbols() RESOLVEFUNC(SSL_CTX_set_options) #ifdef TLS1_3_VERSION RESOLVEFUNC(SSL_CTX_set_ciphersuites) + RESOLVEFUNC(SSL_set_psk_use_session_callback) #endif // TLS 1.3 or OpenSSL > 1.1.1 RESOLVEFUNC(SSL_get_client_random) RESOLVEFUNC(SSL_SESSION_get_master_key) diff --git a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp index 1c279018447..b4dc9bed33b 100644 --- a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp +++ b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp @@ -3546,12 +3546,7 @@ protected: socket = new QSslSocket(this); socket->setSslConfiguration(config); socket->setPeerVerifyMode(peerVerifyMode); - if (QSslSocket::sslLibraryVersionNumber() > 0x10101000L) { - // FIXME. With OpenSSL 1.1.1 and TLS 1.3 PSK auto-test is broken. - socket->setProtocol(QSsl::TlsV1_2); - } else { - socket->setProtocol(protocol); - } + socket->setProtocol(protocol); if (ignoreSslErrors) connect(socket, SIGNAL(sslErrors(QList)), this, SLOT(ignoreErrorSlot())); @@ -3895,11 +3890,6 @@ void tst_QSslSocket::pskServer() return; QSslSocket socket; -#ifdef TLS1_3_VERSION - // FIXME: with OpenSSL 1.1.1 (thus TLS 1.3) test is known to fail - // due to the different PSK mechanism (?) - to be investigated ASAP. - socket.setProtocol(QSsl::TlsV1_2); -#endif this->socket = &socket; QSignalSpy connectedSpy(&socket, SIGNAL(connected())); From 2c5d21be436ad5f2549cb1a6f40b185e159812a4 Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Wed, 12 Jun 2019 15:29:09 +0200 Subject: [PATCH 04/21] H2 auto-test, degrage flowControlServerSide MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit our powerful VMs die/time out on 30 requests, use 10 only. Change-Id: Ibf3ceedeac1839f9a88f88def844c7d61786b94f Reviewed-by: Mårten Nordheim (cherry picked from commit 515c6e7639a7df647cfcc8b639e258864aaaa4af) Reviewed-by: Timur Pocheptsov --- tests/auto/network/access/http2/tst_http2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/network/access/http2/tst_http2.cpp b/tests/auto/network/access/http2/tst_http2.cpp index 53d0e7a6946..e24370fc87e 100644 --- a/tests/auto/network/access/http2/tst_http2.cpp +++ b/tests/auto/network/access/http2/tst_http2.cpp @@ -340,7 +340,7 @@ void tst_Http2::flowControlServerSide() clearHTTP2State(); serverPort = 0; - nRequests = 30; + nRequests = 10; const Http2::RawSettings serverSettings = {{Settings::MAX_CONCURRENT_STREAMS_ID, 7}}; From fc9ae22c88dd085c7c31599037132fc756feeb04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Mon, 11 Mar 2019 15:56:51 +0100 Subject: [PATCH 05/21] tst_qsslsocket: fix racy test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In this threaded setup the server can sometimes have the data before it calls "waitForReadyRead", what happens then is that we fail the wait and as a result the test fails overall. Let's check if we actually got some data after all and then continue if we did. Since both the client and the server currently wait the same amount of time (2s) the max timeout for the client was increased by 0.5s so it has some time to notice that the server got the message. Change-Id: Ib5915958853413047aa5a7574712585bcae28f79 Reviewed-by: Edward Welbourne Reviewed-by: Timur Pocheptsov (cherry picked from commit e79b1dcdf542be3a20d5c21ea163ff857ed875bf) Reviewed-by: Simo Fält (cherry picked from commit d53b8b77bc8de236e148ef2652806015a9a87e2b) Change-Id: I2f6ffb8e0a9b4d591edb6925e48baffcefc14511 Reviewed-by: Timur Pocheptsov --- tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp index b4dc9bed33b..66475e55ad6 100644 --- a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp +++ b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp @@ -2096,7 +2096,7 @@ protected: // delayed reading data QTest::qSleep(100); - if (!socket->waitForReadyRead(2000)) + if (!socket->waitForReadyRead(2000) && socket->bytesAvailable() == 0) return; // error socket->readAll(); dataReadSemaphore.release(); @@ -2167,7 +2167,7 @@ void tst_QSslSocket::waitForMinusOne() socket.write("How are you doing?"); QVERIFY(socket.bytesToWrite() != 0); QVERIFY(socket.waitForBytesWritten(-1)); - QVERIFY(server.dataReadSemaphore.tryAcquire(1, 2000)); + QVERIFY(server.dataReadSemaphore.tryAcquire(1, 2500)); // third verification: it should wait for 100 ms: QVERIFY(socket.waitForReadyRead(-1)); From 5aaade8c935caa1add92f61187c0065e34cf7e0e Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Wed, 15 May 2019 12:35:08 +0200 Subject: [PATCH 06/21] Fix editing of QDateTimeEdit in 12-hour locales that don't use AM/PM The code made two incorrect assumptions: that the strings used are "AM" or "PM", or would be translated. Instead, the locale provides the correct strings, and there is no need to translate. However, in order not to break existing translations, we give those preference. And that the AM/PM string is not longer than 4 characters, while in e.g Spanish/Columbia locale the strings are "A. M." and "P. M.", ie 5 characters long. Also, the use of qMin in a function that is asked to provide the maximum section length is wrong. [ChangeLog][QWidgets][QDateTimeEdit] Use the information provided by the locale to determine the AM/PM strings, unless they are already translated. Change-Id: I6d1b05376e5ac62fc58da2cdea2e6cb732ec6747 Fixes: QTBUG-72833 Reviewed-by: Andy Shaw Reviewed-by: Edward Welbourne --- src/corelib/tools/qdatetimeparser.cpp | 27 ++++++++++--------- src/widgets/widgets/qdatetimeedit.cpp | 22 +++++++++++++-- .../corelib/tools/qdatetime/tst_qdatetime.cpp | 7 +++-- 3 files changed, 40 insertions(+), 16 deletions(-) diff --git a/src/corelib/tools/qdatetimeparser.cpp b/src/corelib/tools/qdatetimeparser.cpp index e8470f6cde9..adc5451deca 100644 --- a/src/corelib/tools/qdatetimeparser.cpp +++ b/src/corelib/tools/qdatetimeparser.cpp @@ -622,11 +622,11 @@ int QDateTimeParser::sectionMaxSize(Section s, int count) const case LastSection: return 0; case AmPmSection: { - const int lowerMax = qMin(getAmPmText(AmText, LowerCase).size(), + const int lowerMax = qMax(getAmPmText(AmText, LowerCase).size(), getAmPmText(PmText, LowerCase).size()); - const int upperMax = qMin(getAmPmText(AmText, UpperCase).size(), + const int upperMax = qMax(getAmPmText(AmText, UpperCase).size(), getAmPmText(PmText, UpperCase).size()); - return qMin(4, qMin(lowerMax, upperMax)); + return qMax(lowerMax, upperMax); } case Hour24Section: @@ -1665,13 +1665,16 @@ QDateTimeParser::findTimeZone(QStringRef str, const QDateTime &when, /*! \internal - Returns - AM if str == tr("AM") - PM if str == tr("PM") - PossibleAM if str can become tr("AM") - PossiblePM if str can become tr("PM") - PossibleBoth if str can become tr("PM") and can become tr("AM") - Neither if str can't become anything sensible + Compares str to the am/pm texts returned by getAmPmText(). + Returns AM or PM if str is one of those texts. Failing that, it looks to see + whether, ignoring spaces and case, each character of str appears in one of + the am/pm texts. + If neither text can be the result of the user typing more into str, returns + Neither. If both texts are possible results of further typing, returns + PossibleBoth. Otherwise, only one of them is a possible completion, so this + returns PossibleAM or PossiblePM to indicate which. + + \sa getAmPmText() */ QDateTimeParser::AmPmFinder QDateTimeParser::findAmPm(QString &str, int sectionIndex, int *used) const { @@ -1700,10 +1703,10 @@ QDateTimeParser::AmPmFinder QDateTimeParser::findAmPm(QString &str, int sectionI QDTPDEBUG << "findAmPm" << str << ampm[0] << ampm[1]; - if (str.indexOf(ampm[amindex], 0, Qt::CaseInsensitive) == 0) { + if (str.startsWith(ampm[amindex], Qt::CaseInsensitive)) { str = ampm[amindex]; return AM; - } else if (str.indexOf(ampm[pmindex], 0, Qt::CaseInsensitive) == 0) { + } else if (str.startsWith(ampm[pmindex], Qt::CaseInsensitive)) { str = ampm[pmindex]; return PM; } else if (context == FromString || (str.count(space) == 0 && str.size() >= size)) { diff --git a/src/widgets/widgets/qdatetimeedit.cpp b/src/widgets/widgets/qdatetimeedit.cpp index 3cebea77d6d..3e6afdb5869 100644 --- a/src/widgets/widgets/qdatetimeedit.cpp +++ b/src/widgets/widgets/qdatetimeedit.cpp @@ -2307,13 +2307,31 @@ void QDateTimeEdit::paintEvent(QPaintEvent *event) style()->drawComplexControl(QStyle::CC_ComboBox, &optCombo, &p, this); } +/* + Returns the string for AM and PM markers. + + If a translation for "AM" and "PM" is installed, then use that. + Otherwise, use the default implementation, which uses the locale. +*/ QString QDateTimeEditPrivate::getAmPmText(AmPm ap, Case cs) const { + QString original; + QString translated; if (ap == AmText) { - return (cs == UpperCase ? QDateTimeParser::tr("AM") : QDateTimeParser::tr("am")); + original = QLatin1String(cs == UpperCase ? "AM" : "am"); + translated = (cs == UpperCase ? QDateTimeParser::tr("AM") : QDateTimeParser::tr("am")); } else { - return (cs == UpperCase ? QDateTimeParser::tr("PM") : QDateTimeParser::tr("pm")); + original = QLatin1String(cs == UpperCase ? "PM" : "pm"); + translated = (cs == UpperCase ? QDateTimeParser::tr("PM") : QDateTimeParser::tr("pm")); } + + // This logic fails if a translation exists but doesn't change the string, + // which we can accept as a corner-case for which a locale-derived answer + // will be acceptable. + if (original != translated) + return translated; + + return QDateTimeParser::getAmPmText(ap, cs); } int QDateTimeEditPrivate::absoluteIndex(QDateTimeEdit::Section s, int index) const diff --git a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp index 38b72ab91fe..ce7cacf9668 100644 --- a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp +++ b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp @@ -2490,17 +2490,20 @@ void tst_QDateTime::fromString_LOCALE_ILDATE() void tst_QDateTime::fromStringToStringLocale_data() { + QTest::addColumn("locale"); QTest::addColumn("dateTime"); - QTest::newRow("data0") << QDateTime(QDate(1999, 1, 18), QTime(11, 49, 00)); + QTest::newRow("frFR") << QLocale(QLocale::French, QLocale::France) << QDateTime(QDate(1999, 1, 18), QTime(11, 49, 00)); + QTest::newRow("spCO") << QLocale(QLocale::Spanish, QLocale::Colombia) << QDateTime(QDate(1999, 1, 18), QTime(11, 49, 00)); } void tst_QDateTime::fromStringToStringLocale() { + QFETCH(QLocale, locale); QFETCH(QDateTime, dateTime); QLocale def; - QLocale::setDefault(QLocale(QLocale::French, QLocale::France)); + QLocale::setDefault(locale); #define ROUNDTRIP(format) \ QCOMPARE(QDateTime::fromString(dateTime.toString(format), format), dateTime) From eed85dc3e72c56caaa65dd4ec27ef6892ca1ffae Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Mon, 17 Jun 2019 17:02:15 +0200 Subject: [PATCH 07/21] Turn on C++11 and 14 correctly Without this, a local build of this test on macOS fails. Change-Id: Ie03fa47ff0a54db752af47f223fbe5724cd9c976 Reviewed-by: Thiago Macieira --- tests/auto/corelib/global/qglobal/qglobal.pro | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/auto/corelib/global/qglobal/qglobal.pro b/tests/auto/corelib/global/qglobal/qglobal.pro index b1057694307..e4453affa54 100644 --- a/tests/auto/corelib/global/qglobal/qglobal.pro +++ b/tests/auto/corelib/global/qglobal/qglobal.pro @@ -2,4 +2,6 @@ CONFIG += testcase TARGET = tst_qglobal QT = core testlib SOURCES = tst_qglobal.cpp qglobal.c -contains(QT_CONFIG, c++1z): CONFIG += c++1z +qtConfig(c++11): CONFIG += c++11 +qtConfig(c++14): CONFIG += c++14 +qtConfig(c++1z): CONFIG += c++1z From e6f7cc96fa09b50c17bc5f4645b06c30145a3f55 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Mon, 17 Jun 2019 17:07:45 +0200 Subject: [PATCH 08/21] Use C++11 alignof as reference for Q_ALIGNOF, and fix test on Android Not removing QT_EMULATED_ALIGNOF logic from qglobal.h at this point, as it might be used elsewhere. Change-Id: Ie78922bb604a54aed03ab5b88e31a7f29a3a4de0 Fixes: QTBUG-73561 Reviewed-by: Thiago Macieira --- tests/auto/corelib/global/qglobal/tst_qglobal.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/corelib/global/qglobal/tst_qglobal.cpp b/tests/auto/corelib/global/qglobal/tst_qglobal.cpp index 56da047147d..7800a101ecb 100644 --- a/tests/auto/corelib/global/qglobal/tst_qglobal.cpp +++ b/tests/auto/corelib/global/qglobal/tst_qglobal.cpp @@ -468,7 +468,7 @@ typedef int (Empty::*memFun) (); QCOMPARE(Q_ALIGNOF(type), size_t(alignment)); \ /* Compare to native operator for compilers that support it, otherwise... erm... check consistency! :-) */ \ - QCOMPARE(QT_EMULATED_ALIGNOF(type), Q_ALIGNOF(type)); \ + QCOMPARE(alignof(type), Q_ALIGNOF(type)); \ } while (false) /**/ @@ -521,7 +521,7 @@ void tst_QGlobal::qAlignOf() TEST_AlignOf_impl(AlignmentInStruct, Q_ALIGNOF(AlignmentInStruct)); // 32-bit x86 ABI, Clang disagrees with gcc -#if !defined(Q_PROCESSOR_X86_32) || !defined(Q_CC_CLANG) +#if !defined(Q_PROCESSOR_X86_32) || !defined(Q_CC_CLANG) || defined(Q_OS_ANDROID) TEST_AlignOf_impl(qint64 [5], Q_ALIGNOF(qint64)); #else TEST_AlignOf_impl(qint64 [5], Q_ALIGNOF(AlignmentInStruct)); From 4ad915425d804df798e12031c9b2fc13534dcb97 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Fri, 3 May 2019 14:17:19 +0200 Subject: [PATCH 09/21] Doc: Replace example file lists with links to code.qt.io Instead of generating .html page for each file in an example project, generate links to code.qt.io, under the correct path and branch, where the user can browse the example source. Store all URLs under QT_INSTALL_DOCS/config where other qt5 submodules can access them. The repository name appears in the URL, so we cannot define a single URL for all modules. Task-number: QTBUG-74391 Change-Id: I63d4d6d2c352877797b1ee8e057d48c0cd789bff Reviewed-by: Paul Wicking --- doc/config/exampleurl-qt3d.qdocconf | 1 + doc/config/exampleurl-qtactiveqt.qdocconf | 1 + doc/config/exampleurl-qtandroidextras.qdocconf | 1 + doc/config/exampleurl-qtbase.qdocconf | 1 + doc/config/exampleurl-qtcharts.qdocconf | 1 + doc/config/exampleurl-qtconnectivity.qdocconf | 1 + doc/config/exampleurl-qtdatavis3d.qdocconf | 1 + doc/config/exampleurl-qtdeclarative.qdocconf | 1 + doc/config/exampleurl-qtdoc.qdocconf | 1 + doc/config/exampleurl-qtgamepad.qdocconf | 1 + doc/config/exampleurl-qtgraphicaleffects.qdocconf | 1 + doc/config/exampleurl-qtimageformats.qdocconf | 1 + doc/config/exampleurl-qtlocation.qdocconf | 1 + doc/config/exampleurl-qtlottie.qdocconf | 1 + doc/config/exampleurl-qtmacextras.qdocconf | 1 + doc/config/exampleurl-qtmultimedia.qdocconf | 1 + doc/config/exampleurl-qtnetworkauth.qdocconf | 1 + doc/config/exampleurl-qtpurchasing.qdocconf | 1 + doc/config/exampleurl-qtquickcontrols.qdocconf | 1 + doc/config/exampleurl-qtquickcontrols2.qdocconf | 1 + doc/config/exampleurl-qtremoteobjects.qdocconf | 1 + doc/config/exampleurl-qtscript.qdocconf | 1 + doc/config/exampleurl-qtscxml.qdocconf | 1 + doc/config/exampleurl-qtsensors.qdocconf | 1 + doc/config/exampleurl-qtserialbus.qdocconf | 1 + doc/config/exampleurl-qtserialport.qdocconf | 1 + doc/config/exampleurl-qtspeech.qdocconf | 1 + doc/config/exampleurl-qtsvg.qdocconf | 1 + doc/config/exampleurl-qttools.qdocconf | 1 + doc/config/exampleurl-qtvirtualkeyboard.qdocconf | 1 + doc/config/exampleurl-qtwayland.qdocconf | 1 + doc/config/exampleurl-qtwebchannel.qdocconf | 1 + doc/config/exampleurl-qtwebengine.qdocconf | 1 + doc/config/exampleurl-qtwebsockets.qdocconf | 1 + doc/config/exampleurl-qtwebview.qdocconf | 1 + doc/config/exampleurl-qtwinextras.qdocconf | 1 + doc/config/exampleurl-qtx11extras.qdocconf | 1 + doc/config/exampleurl-qtxmlpatterns.qdocconf | 1 + src/concurrent/doc/qtconcurrent.qdocconf | 1 + src/corelib/doc/qtcore.qdocconf | 1 + src/dbus/doc/qtdbus.qdocconf | 1 + src/gui/doc/qtgui.qdocconf | 1 + src/network/doc/qtnetwork.qdocconf | 1 + src/opengl/doc/qtopengl.qdocconf | 1 + src/platformheaders/doc/qtplatformheaders.qdocconf | 1 + src/printsupport/doc/qtprintsupport.qdocconf | 1 + src/sql/doc/qtsql.qdocconf | 1 + src/testlib/doc/qttestlib.qdocconf | 1 + src/widgets/doc/qtwidgets.qdocconf | 1 + src/xml/doc/qtxml.qdocconf | 1 + 50 files changed, 50 insertions(+) create mode 100644 doc/config/exampleurl-qt3d.qdocconf create mode 100644 doc/config/exampleurl-qtactiveqt.qdocconf create mode 100644 doc/config/exampleurl-qtandroidextras.qdocconf create mode 100644 doc/config/exampleurl-qtbase.qdocconf create mode 100644 doc/config/exampleurl-qtcharts.qdocconf create mode 100644 doc/config/exampleurl-qtconnectivity.qdocconf create mode 100644 doc/config/exampleurl-qtdatavis3d.qdocconf create mode 100644 doc/config/exampleurl-qtdeclarative.qdocconf create mode 100644 doc/config/exampleurl-qtdoc.qdocconf create mode 100644 doc/config/exampleurl-qtgamepad.qdocconf create mode 100644 doc/config/exampleurl-qtgraphicaleffects.qdocconf create mode 100644 doc/config/exampleurl-qtimageformats.qdocconf create mode 100644 doc/config/exampleurl-qtlocation.qdocconf create mode 100644 doc/config/exampleurl-qtlottie.qdocconf create mode 100644 doc/config/exampleurl-qtmacextras.qdocconf create mode 100644 doc/config/exampleurl-qtmultimedia.qdocconf create mode 100644 doc/config/exampleurl-qtnetworkauth.qdocconf create mode 100644 doc/config/exampleurl-qtpurchasing.qdocconf create mode 100644 doc/config/exampleurl-qtquickcontrols.qdocconf create mode 100644 doc/config/exampleurl-qtquickcontrols2.qdocconf create mode 100644 doc/config/exampleurl-qtremoteobjects.qdocconf create mode 100644 doc/config/exampleurl-qtscript.qdocconf create mode 100644 doc/config/exampleurl-qtscxml.qdocconf create mode 100644 doc/config/exampleurl-qtsensors.qdocconf create mode 100644 doc/config/exampleurl-qtserialbus.qdocconf create mode 100644 doc/config/exampleurl-qtserialport.qdocconf create mode 100644 doc/config/exampleurl-qtspeech.qdocconf create mode 100644 doc/config/exampleurl-qtsvg.qdocconf create mode 100644 doc/config/exampleurl-qttools.qdocconf create mode 100644 doc/config/exampleurl-qtvirtualkeyboard.qdocconf create mode 100644 doc/config/exampleurl-qtwayland.qdocconf create mode 100644 doc/config/exampleurl-qtwebchannel.qdocconf create mode 100644 doc/config/exampleurl-qtwebengine.qdocconf create mode 100644 doc/config/exampleurl-qtwebsockets.qdocconf create mode 100644 doc/config/exampleurl-qtwebview.qdocconf create mode 100644 doc/config/exampleurl-qtwinextras.qdocconf create mode 100644 doc/config/exampleurl-qtx11extras.qdocconf create mode 100644 doc/config/exampleurl-qtxmlpatterns.qdocconf diff --git a/doc/config/exampleurl-qt3d.qdocconf b/doc/config/exampleurl-qt3d.qdocconf new file mode 100644 index 00000000000..1a141514162 --- /dev/null +++ b/doc/config/exampleurl-qt3d.qdocconf @@ -0,0 +1 @@ +url.examples = "https://code.qt.io/cgit/qt/qt3d.git/tree/examples/\1?h=$QT_VER" diff --git a/doc/config/exampleurl-qtactiveqt.qdocconf b/doc/config/exampleurl-qtactiveqt.qdocconf new file mode 100644 index 00000000000..f1abbd165e1 --- /dev/null +++ b/doc/config/exampleurl-qtactiveqt.qdocconf @@ -0,0 +1 @@ +url.examples = "https://code.qt.io/cgit/qt/qtactiveqt.git/tree/examples/\1?h=$QT_VER" diff --git a/doc/config/exampleurl-qtandroidextras.qdocconf b/doc/config/exampleurl-qtandroidextras.qdocconf new file mode 100644 index 00000000000..44984a56934 --- /dev/null +++ b/doc/config/exampleurl-qtandroidextras.qdocconf @@ -0,0 +1 @@ +url.examples = "https://code.qt.io/cgit/qt/qtandroidextras.git/tree/examples/\1?h=$QT_VER" diff --git a/doc/config/exampleurl-qtbase.qdocconf b/doc/config/exampleurl-qtbase.qdocconf new file mode 100644 index 00000000000..b29df464ba4 --- /dev/null +++ b/doc/config/exampleurl-qtbase.qdocconf @@ -0,0 +1 @@ +url.examples = "https://code.qt.io/cgit/qt/qtbase.git/tree/examples/\1?h=$QT_VER" diff --git a/doc/config/exampleurl-qtcharts.qdocconf b/doc/config/exampleurl-qtcharts.qdocconf new file mode 100644 index 00000000000..2e49a7d1d86 --- /dev/null +++ b/doc/config/exampleurl-qtcharts.qdocconf @@ -0,0 +1 @@ +url.examples = "https://code.qt.io/cgit/qt/qtcharts.git/tree/examples/\1?h=$QT_VER" diff --git a/doc/config/exampleurl-qtconnectivity.qdocconf b/doc/config/exampleurl-qtconnectivity.qdocconf new file mode 100644 index 00000000000..42923eb6732 --- /dev/null +++ b/doc/config/exampleurl-qtconnectivity.qdocconf @@ -0,0 +1 @@ +url.examples = "https://code.qt.io/cgit/qt/qtconnectivity.git/tree/examples/\1?h=$QT_VER" diff --git a/doc/config/exampleurl-qtdatavis3d.qdocconf b/doc/config/exampleurl-qtdatavis3d.qdocconf new file mode 100644 index 00000000000..66f129a7731 --- /dev/null +++ b/doc/config/exampleurl-qtdatavis3d.qdocconf @@ -0,0 +1 @@ +url.examples = "https://code.qt.io/cgit/qt/qtdatavis3d.git/tree/examples/\1?h=$QT_VER" diff --git a/doc/config/exampleurl-qtdeclarative.qdocconf b/doc/config/exampleurl-qtdeclarative.qdocconf new file mode 100644 index 00000000000..4b1d751b609 --- /dev/null +++ b/doc/config/exampleurl-qtdeclarative.qdocconf @@ -0,0 +1 @@ +url.examples = "https://code.qt.io/cgit/qt/qtdeclarative.git/tree/examples/\1?h=$QT_VER" diff --git a/doc/config/exampleurl-qtdoc.qdocconf b/doc/config/exampleurl-qtdoc.qdocconf new file mode 100644 index 00000000000..947a5757728 --- /dev/null +++ b/doc/config/exampleurl-qtdoc.qdocconf @@ -0,0 +1 @@ +url.examples = "https://code.qt.io/cgit/qt/qtdoc.git/tree/examples/\1?h=$QT_VER" diff --git a/doc/config/exampleurl-qtgamepad.qdocconf b/doc/config/exampleurl-qtgamepad.qdocconf new file mode 100644 index 00000000000..d55de4e3d93 --- /dev/null +++ b/doc/config/exampleurl-qtgamepad.qdocconf @@ -0,0 +1 @@ +url.examples = "https://code.qt.io/cgit/qt/qtgamepad.git/tree/examples/\1?h=$QT_VER" diff --git a/doc/config/exampleurl-qtgraphicaleffects.qdocconf b/doc/config/exampleurl-qtgraphicaleffects.qdocconf new file mode 100644 index 00000000000..4d25ef4c944 --- /dev/null +++ b/doc/config/exampleurl-qtgraphicaleffects.qdocconf @@ -0,0 +1 @@ +url.examples = "https://code.qt.io/cgit/qt/qtgraphicaleffects.git/tree/examples/\1?h=$QT_VER" diff --git a/doc/config/exampleurl-qtimageformats.qdocconf b/doc/config/exampleurl-qtimageformats.qdocconf new file mode 100644 index 00000000000..1070beaf128 --- /dev/null +++ b/doc/config/exampleurl-qtimageformats.qdocconf @@ -0,0 +1 @@ +url.examples = "https://code.qt.io/cgit/qt/qtimageformats.git/tree/examples/\1?h=$QT_VER" diff --git a/doc/config/exampleurl-qtlocation.qdocconf b/doc/config/exampleurl-qtlocation.qdocconf new file mode 100644 index 00000000000..93d47fca135 --- /dev/null +++ b/doc/config/exampleurl-qtlocation.qdocconf @@ -0,0 +1 @@ +url.examples = "https://code.qt.io/cgit/qt/qtlocation.git/tree/examples/\1?h=$QT_VER" diff --git a/doc/config/exampleurl-qtlottie.qdocconf b/doc/config/exampleurl-qtlottie.qdocconf new file mode 100644 index 00000000000..f60714027ab --- /dev/null +++ b/doc/config/exampleurl-qtlottie.qdocconf @@ -0,0 +1 @@ +url.examples = "https://code.qt.io/cgit/qt/qtlottie.git/tree/examples/\1?h=$QT_VER" diff --git a/doc/config/exampleurl-qtmacextras.qdocconf b/doc/config/exampleurl-qtmacextras.qdocconf new file mode 100644 index 00000000000..1e2d515e05b --- /dev/null +++ b/doc/config/exampleurl-qtmacextras.qdocconf @@ -0,0 +1 @@ +url.examples = "https://code.qt.io/cgit/qt/qtmacextras.git/tree/examples/\1?h=$QT_VER" diff --git a/doc/config/exampleurl-qtmultimedia.qdocconf b/doc/config/exampleurl-qtmultimedia.qdocconf new file mode 100644 index 00000000000..b710693d315 --- /dev/null +++ b/doc/config/exampleurl-qtmultimedia.qdocconf @@ -0,0 +1 @@ +url.examples = "https://code.qt.io/cgit/qt/qtmultimedia.git/tree/examples/\1?h=$QT_VER" diff --git a/doc/config/exampleurl-qtnetworkauth.qdocconf b/doc/config/exampleurl-qtnetworkauth.qdocconf new file mode 100644 index 00000000000..e71da43bb18 --- /dev/null +++ b/doc/config/exampleurl-qtnetworkauth.qdocconf @@ -0,0 +1 @@ +url.examples = "https://code.qt.io/cgit/qt/qtnetworkauth.git/tree/examples/\1?h=$QT_VER" diff --git a/doc/config/exampleurl-qtpurchasing.qdocconf b/doc/config/exampleurl-qtpurchasing.qdocconf new file mode 100644 index 00000000000..fe232c02fe2 --- /dev/null +++ b/doc/config/exampleurl-qtpurchasing.qdocconf @@ -0,0 +1 @@ +url.examples = "https://code.qt.io/cgit/qt/qtpurchasing.git/tree/examples/\1?h=$QT_VER" diff --git a/doc/config/exampleurl-qtquickcontrols.qdocconf b/doc/config/exampleurl-qtquickcontrols.qdocconf new file mode 100644 index 00000000000..e9cd8c49f34 --- /dev/null +++ b/doc/config/exampleurl-qtquickcontrols.qdocconf @@ -0,0 +1 @@ +url.examples = "https://code.qt.io/cgit/qt/qtquickcontrols.git/tree/examples/\1?h=$QT_VER" diff --git a/doc/config/exampleurl-qtquickcontrols2.qdocconf b/doc/config/exampleurl-qtquickcontrols2.qdocconf new file mode 100644 index 00000000000..3e2749ec657 --- /dev/null +++ b/doc/config/exampleurl-qtquickcontrols2.qdocconf @@ -0,0 +1 @@ +url.examples = "https://code.qt.io/cgit/qt/qtquickcontrols2.git/tree/examples/\1?h=$QT_VER" diff --git a/doc/config/exampleurl-qtremoteobjects.qdocconf b/doc/config/exampleurl-qtremoteobjects.qdocconf new file mode 100644 index 00000000000..40c4c68bff2 --- /dev/null +++ b/doc/config/exampleurl-qtremoteobjects.qdocconf @@ -0,0 +1 @@ +url.examples = "https://code.qt.io/cgit/qt/qtremoteobjects.git/tree/examples/\1?h=$QT_VER" diff --git a/doc/config/exampleurl-qtscript.qdocconf b/doc/config/exampleurl-qtscript.qdocconf new file mode 100644 index 00000000000..b7b5324481a --- /dev/null +++ b/doc/config/exampleurl-qtscript.qdocconf @@ -0,0 +1 @@ +url.examples = "https://code.qt.io/cgit/qt/qtscript.git/tree/examples/\1?h=$QT_VER" diff --git a/doc/config/exampleurl-qtscxml.qdocconf b/doc/config/exampleurl-qtscxml.qdocconf new file mode 100644 index 00000000000..2383f823ea8 --- /dev/null +++ b/doc/config/exampleurl-qtscxml.qdocconf @@ -0,0 +1 @@ +url.examples = "https://code.qt.io/cgit/qt/qtscxml.git/tree/examples/\1?h=$QT_VER" diff --git a/doc/config/exampleurl-qtsensors.qdocconf b/doc/config/exampleurl-qtsensors.qdocconf new file mode 100644 index 00000000000..291a0e80858 --- /dev/null +++ b/doc/config/exampleurl-qtsensors.qdocconf @@ -0,0 +1 @@ +url.examples = "https://code.qt.io/cgit/qt/qtsensors.git/tree/examples/\1?h=$QT_VER" diff --git a/doc/config/exampleurl-qtserialbus.qdocconf b/doc/config/exampleurl-qtserialbus.qdocconf new file mode 100644 index 00000000000..b263b510389 --- /dev/null +++ b/doc/config/exampleurl-qtserialbus.qdocconf @@ -0,0 +1 @@ +url.examples = "https://code.qt.io/cgit/qt/qtserialbus.git/tree/examples/\1?h=$QT_VER" diff --git a/doc/config/exampleurl-qtserialport.qdocconf b/doc/config/exampleurl-qtserialport.qdocconf new file mode 100644 index 00000000000..6b1e66b1d3c --- /dev/null +++ b/doc/config/exampleurl-qtserialport.qdocconf @@ -0,0 +1 @@ +url.examples = "https://code.qt.io/cgit/qt/qtserialport.git/tree/examples/\1?h=$QT_VER" diff --git a/doc/config/exampleurl-qtspeech.qdocconf b/doc/config/exampleurl-qtspeech.qdocconf new file mode 100644 index 00000000000..0cb3b209bd8 --- /dev/null +++ b/doc/config/exampleurl-qtspeech.qdocconf @@ -0,0 +1 @@ +url.examples = "https://code.qt.io/cgit/qt/qtspeech.git/tree/examples/\1?h=$QT_VER" diff --git a/doc/config/exampleurl-qtsvg.qdocconf b/doc/config/exampleurl-qtsvg.qdocconf new file mode 100644 index 00000000000..2514710f119 --- /dev/null +++ b/doc/config/exampleurl-qtsvg.qdocconf @@ -0,0 +1 @@ +url.examples = "https://code.qt.io/cgit/qt/qtsvg.git/tree/examples/\1?h=$QT_VER" diff --git a/doc/config/exampleurl-qttools.qdocconf b/doc/config/exampleurl-qttools.qdocconf new file mode 100644 index 00000000000..12a79f303db --- /dev/null +++ b/doc/config/exampleurl-qttools.qdocconf @@ -0,0 +1 @@ +url.examples = "https://code.qt.io/cgit/qt/qttools.git/tree/examples/\1?h=$QT_VER" diff --git a/doc/config/exampleurl-qtvirtualkeyboard.qdocconf b/doc/config/exampleurl-qtvirtualkeyboard.qdocconf new file mode 100644 index 00000000000..f9080346b31 --- /dev/null +++ b/doc/config/exampleurl-qtvirtualkeyboard.qdocconf @@ -0,0 +1 @@ +url.examples = "https://code.qt.io/cgit/qt/qtvirtualkeyboard.git/tree/examples/\1?h=$QT_VER" diff --git a/doc/config/exampleurl-qtwayland.qdocconf b/doc/config/exampleurl-qtwayland.qdocconf new file mode 100644 index 00000000000..65417434cee --- /dev/null +++ b/doc/config/exampleurl-qtwayland.qdocconf @@ -0,0 +1 @@ +url.examples = "https://code.qt.io/cgit/qt/qtwayland.git/tree/examples/\1?h=$QT_VER" diff --git a/doc/config/exampleurl-qtwebchannel.qdocconf b/doc/config/exampleurl-qtwebchannel.qdocconf new file mode 100644 index 00000000000..e9926b29e6e --- /dev/null +++ b/doc/config/exampleurl-qtwebchannel.qdocconf @@ -0,0 +1 @@ +url.examples = "https://code.qt.io/cgit/qt/qtwebchannel.git/tree/examples/\1?h=$QT_VER" diff --git a/doc/config/exampleurl-qtwebengine.qdocconf b/doc/config/exampleurl-qtwebengine.qdocconf new file mode 100644 index 00000000000..27b28536ac6 --- /dev/null +++ b/doc/config/exampleurl-qtwebengine.qdocconf @@ -0,0 +1 @@ +url.examples = "https://code.qt.io/cgit/qt/qtwebengine.git/tree/examples/\1?h=$QT_VER" diff --git a/doc/config/exampleurl-qtwebsockets.qdocconf b/doc/config/exampleurl-qtwebsockets.qdocconf new file mode 100644 index 00000000000..814f97b3e1b --- /dev/null +++ b/doc/config/exampleurl-qtwebsockets.qdocconf @@ -0,0 +1 @@ +url.examples = "https://code.qt.io/cgit/qt/qtwebsockets.git/tree/examples/\1?h=$QT_VER" diff --git a/doc/config/exampleurl-qtwebview.qdocconf b/doc/config/exampleurl-qtwebview.qdocconf new file mode 100644 index 00000000000..38a57352858 --- /dev/null +++ b/doc/config/exampleurl-qtwebview.qdocconf @@ -0,0 +1 @@ +url.examples = "https://code.qt.io/cgit/qt/qtwebview.git/tree/examples/\1?h=$QT_VER" diff --git a/doc/config/exampleurl-qtwinextras.qdocconf b/doc/config/exampleurl-qtwinextras.qdocconf new file mode 100644 index 00000000000..daf3a71fee9 --- /dev/null +++ b/doc/config/exampleurl-qtwinextras.qdocconf @@ -0,0 +1 @@ +url.examples = "https://code.qt.io/cgit/qt/qtwinextras.git/tree/examples/\1?h=$QT_VER" diff --git a/doc/config/exampleurl-qtx11extras.qdocconf b/doc/config/exampleurl-qtx11extras.qdocconf new file mode 100644 index 00000000000..046691d3344 --- /dev/null +++ b/doc/config/exampleurl-qtx11extras.qdocconf @@ -0,0 +1 @@ +url.examples = "https://code.qt.io/cgit/qt/qtx11extras.git/tree/examples/\1?h=$QT_VER" diff --git a/doc/config/exampleurl-qtxmlpatterns.qdocconf b/doc/config/exampleurl-qtxmlpatterns.qdocconf new file mode 100644 index 00000000000..b28a32767ac --- /dev/null +++ b/doc/config/exampleurl-qtxmlpatterns.qdocconf @@ -0,0 +1 @@ +url.examples = "https://code.qt.io/cgit/qt/qtxmlpatterns.git/tree/examples/\1?h=$QT_VER" diff --git a/src/concurrent/doc/qtconcurrent.qdocconf b/src/concurrent/doc/qtconcurrent.qdocconf index 356d602a7c4..610dca2a7e1 100644 --- a/src/concurrent/doc/qtconcurrent.qdocconf +++ b/src/concurrent/doc/qtconcurrent.qdocconf @@ -1,4 +1,5 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) +include($QT_INSTALL_DOCS/config/exampleurl-qtbase.qdocconf) project = QtConcurrent description = Qt Concurrent Reference Documentation diff --git a/src/corelib/doc/qtcore.qdocconf b/src/corelib/doc/qtcore.qdocconf index 85dcde4607d..15b1925e51b 100644 --- a/src/corelib/doc/qtcore.qdocconf +++ b/src/corelib/doc/qtcore.qdocconf @@ -1,4 +1,5 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) +include($QT_INSTALL_DOCS/config/exampleurl-qtbase.qdocconf) project = QtCore description = Qt Core Reference Documentation diff --git a/src/dbus/doc/qtdbus.qdocconf b/src/dbus/doc/qtdbus.qdocconf index 4ff7242b25b..e08bbfd94e5 100644 --- a/src/dbus/doc/qtdbus.qdocconf +++ b/src/dbus/doc/qtdbus.qdocconf @@ -1,4 +1,5 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) +include($QT_INSTALL_DOCS/config/exampleurl-qtbase.qdocconf) # Name of the project which must match the outputdir. Determines the .index file project = QtDBus diff --git a/src/gui/doc/qtgui.qdocconf b/src/gui/doc/qtgui.qdocconf index b8b8a00cd66..049b9ef1797 100644 --- a/src/gui/doc/qtgui.qdocconf +++ b/src/gui/doc/qtgui.qdocconf @@ -1,4 +1,5 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) +include($QT_INSTALL_DOCS/config/exampleurl-qtbase.qdocconf) project = QtGui description = Qt GUI Reference Documentation diff --git a/src/network/doc/qtnetwork.qdocconf b/src/network/doc/qtnetwork.qdocconf index 4f667eed9d7..5465b1c0af1 100644 --- a/src/network/doc/qtnetwork.qdocconf +++ b/src/network/doc/qtnetwork.qdocconf @@ -1,4 +1,5 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) +include($QT_INSTALL_DOCS/config/exampleurl-qtbase.qdocconf) project = QtNetwork description = Qt Network Reference Documentation diff --git a/src/opengl/doc/qtopengl.qdocconf b/src/opengl/doc/qtopengl.qdocconf index 2d38a5d2af1..22194bda596 100644 --- a/src/opengl/doc/qtopengl.qdocconf +++ b/src/opengl/doc/qtopengl.qdocconf @@ -1,4 +1,5 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) +include($QT_INSTALL_DOCS/config/exampleurl-qtbase.qdocconf) # Name of the project which must match the outputdir. Determines the .index file project = QtOpenGL diff --git a/src/platformheaders/doc/qtplatformheaders.qdocconf b/src/platformheaders/doc/qtplatformheaders.qdocconf index 9a034e7671e..c8868d678b9 100644 --- a/src/platformheaders/doc/qtplatformheaders.qdocconf +++ b/src/platformheaders/doc/qtplatformheaders.qdocconf @@ -1,4 +1,5 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) +include($QT_INSTALL_DOCS/config/exampleurl-qtbase.qdocconf) project = QtPlatformHeaders description = Qt Platform Headers Reference Documentation diff --git a/src/printsupport/doc/qtprintsupport.qdocconf b/src/printsupport/doc/qtprintsupport.qdocconf index fbb6f8d1a98..b46d9f37d90 100644 --- a/src/printsupport/doc/qtprintsupport.qdocconf +++ b/src/printsupport/doc/qtprintsupport.qdocconf @@ -1,4 +1,5 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) +include($QT_INSTALL_DOCS/config/exampleurl-qtbase.qdocconf) project = QtPrintSupport description = Qt Print Support Reference Documentation diff --git a/src/sql/doc/qtsql.qdocconf b/src/sql/doc/qtsql.qdocconf index 5a224adeb96..f353a11e8b0 100644 --- a/src/sql/doc/qtsql.qdocconf +++ b/src/sql/doc/qtsql.qdocconf @@ -1,4 +1,5 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) +include($QT_INSTALL_DOCS/config/exampleurl-qtbase.qdocconf) project = QtSql description = Qt SQL Reference Documentation diff --git a/src/testlib/doc/qttestlib.qdocconf b/src/testlib/doc/qttestlib.qdocconf index 5fdf6d9415a..73310221cf3 100644 --- a/src/testlib/doc/qttestlib.qdocconf +++ b/src/testlib/doc/qttestlib.qdocconf @@ -1,4 +1,5 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) +include($QT_INSTALL_DOCS/config/exampleurl-qtbase.qdocconf) project = QtTestLib moduleheader = QtTest diff --git a/src/widgets/doc/qtwidgets.qdocconf b/src/widgets/doc/qtwidgets.qdocconf index 5d7262fca16..6e04372a8b6 100644 --- a/src/widgets/doc/qtwidgets.qdocconf +++ b/src/widgets/doc/qtwidgets.qdocconf @@ -1,4 +1,5 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) +include($QT_INSTALL_DOCS/config/exampleurl-qtbase.qdocconf) project = QtWidgets description = Qt Widgets Reference Documentation diff --git a/src/xml/doc/qtxml.qdocconf b/src/xml/doc/qtxml.qdocconf index a23915487f0..25a463fecd2 100644 --- a/src/xml/doc/qtxml.qdocconf +++ b/src/xml/doc/qtxml.qdocconf @@ -1,4 +1,5 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) +include($QT_INSTALL_DOCS/config/exampleurl-qtbase.qdocconf) project = QtXml description = Qt XML Reference Documentation From cdfe8c76af1518ccdd497c20ecc189365c733879 Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Mon, 17 Jun 2019 14:25:09 +0200 Subject: [PATCH 10/21] checkOcspResponse - remove unneeded locking and also plain wrong comments: since we don't set verification callback on a store - we don't have to lock (our q_X509Callback never gets called). This change should simplify the merge with change I have in 5.12 (where I completely got rid of locking). Since I don't care about exact errors found (relying on the fact it's the same chain of certs we check in SSL_connect/SSL_accept), for now we don't try to extract them from OCSP_basic_verify. In fufure, if these chains are different, we can create a temporary store (see how it's done in 'verify', for example) and set a VF callback on this store. Change-Id: I4a36e19836d19c2ea95c869dcfe85f49fe723ff0 Reviewed-by: Timur Pocheptsov --- src/network/ssl/qsslsocket_openssl.cpp | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp index 977d8a6742d..7c04feb5f88 100644 --- a/src/network/ssl/qsslsocket_openssl.cpp +++ b/src/network/ssl/qsslsocket_openssl.cpp @@ -1575,27 +1575,15 @@ bool QSslSocketBackendPrivate::checkOcspStatus() // 3) It checks CertID in response. // 4) Ensures the responder is authorized to sign the status respond. // - // Here it's important to notice that it calls X509_cert_verify and - // as a result, possibly, our verification callback. Given this callback - // at the moment uses a global variable, we have to lock. This will change - // as soon as we fix our verification procedure. - // Also note, OpenSSL prior to 1.0.2b would only use bs->certs to + // Note, OpenSSL prior to 1.0.2b would only use bs->certs to // verify the responder's chain (see their commit 4ba9a4265bd). // Working this around - is too much fuss for ancient versions we // are dropping quite soon anyway. { const unsigned long verificationFlags = 0; - const QMutexLocker locker(&_q_sslErrorList()->mutex); - // Before unlocking the mutex, startHandshake() stores errors (found in SSL_connect() - // or SSL_accept()) into the local variable, so it's safe to clear it here - as soon - // as we managed to lock, whoever had the lock before, already stored their own copy - // of errors. - _q_sslErrorList()->errors.clear(); const int success = q_OCSP_basic_verify(basicResponse, peerChain, store, verificationFlags); - if (success <= 0 || _q_sslErrorList()->errors.size()) { - _q_sslErrorList()->errors.clear(); + if (success <= 0) ocspErrors.push_back(QSslError::OcspResponseCannotBeTrusted); - } } if (q_OCSP_resp_count(basicResponse) != 1) { From 6275e037bfe532d12ecd76913d5d36a91c1d5034 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Tue, 18 Jun 2019 23:03:01 +0200 Subject: [PATCH 11/21] Android: Make sure that the root file system is in the list of volumes On Android (at least in the emulator), the root file system is reported to be of type rootfs, which we usually ignore on Linux as legacy. Also, it's a read-only file system with bytesTotal reported as zero. We usually ignore such volumes, but as the root file system is expected to be in the list, we should never ignore it. This fixes the failing QStorageInfo test. Change-Id: I778ee9e76e385649e58d5e5ac7e0ae2d8e0ba92b Fixes: QTBUG-73563 Reviewed-by: Thiago Macieira Reviewed-by: BogDan Vatra --- src/corelib/io/qstorageinfo_unix.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qstorageinfo_unix.cpp b/src/corelib/io/qstorageinfo_unix.cpp index b7621b5d2f1..6b821b0fe9a 100644 --- a/src/corelib/io/qstorageinfo_unix.cpp +++ b/src/corelib/io/qstorageinfo_unix.cpp @@ -220,7 +220,7 @@ static bool shouldIncludeFs(const QStorageIterator &it) return false; } -#ifdef Q_OS_LINUX +#if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID) if (it.fileSystemType() == "rootfs") return false; #endif @@ -846,7 +846,7 @@ QList QStorageInfoPrivate::mountedVolumes() const QString mountDir = it.rootPath(); QStorageInfo info(mountDir); - if (info.bytesTotal() == 0) + if (info.bytesTotal() == 0 && info != root()) continue; volumes.append(info); } From b877285694501d16b2bb0dc8d1a92e185b079b87 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Wed, 19 Jun 2019 00:01:14 +0200 Subject: [PATCH 12/21] Android: don't run test function for fd leakage, make test pass It is sufficient to run this test on systems where we don't need to set up dependencies and satisfy other assumptions the test makes. It is safe to assume that if this test passes on regular Unix, then QTemporaryFile will behave as expected on Android as well. Change-Id: Iaf9a67d7c12b3acfd0992bab591c3f906b073d9e Fixes: QTBUG-73564 Reviewed-by: Thiago Macieira --- .../auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp b/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp index cf4ab4902dc..b8f67c7d379 100644 --- a/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp +++ b/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp @@ -569,13 +569,7 @@ void tst_QTemporaryFile::rename() void tst_QTemporaryFile::renameFdLeak() { -#ifdef Q_OS_UNIX - -# if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) - ChdirOnReturn cor(QDir::currentPath()); - QDir::setCurrent(QStandardPaths::writableLocation(QStandardPaths::CacheLocation)); -# endif - +#if defined(Q_OS_UNIX) && !defined(Q_OS_ANDROID) const QByteArray sourceFile = QFile::encodeName(QFINDTESTDATA(__FILE__)); QVERIFY(!sourceFile.isEmpty()); // Test this on Unix only From 2ce4a9f48705095669cb74c8de9d8a72f9d49b0e Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Wed, 19 Jun 2019 16:35:28 +0200 Subject: [PATCH 13/21] Fix crash in QPainterPath::reserve() Function did not handle default-constructed (null d_ptr) path correctly. Fixes: QTBUG-76516 Change-Id: I2925d4306f7fce34ece6739b18a8e275e7970837 Reviewed-by: Allan Sandfeld Jensen --- src/gui/painting/qpainterpath.cpp | 3 ++- tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp index cbe34c2857a..d20faf89a2f 100644 --- a/src/gui/painting/qpainterpath.cpp +++ b/src/gui/painting/qpainterpath.cpp @@ -675,8 +675,9 @@ void QPainterPath::reserve(int size) { Q_D(QPainterPath); if ((!d && size > 0) || (d && d->elements.capacity() < size)) { + ensureData(); detach(); - d->elements.reserve(size); + d_func()->elements.reserve(size); } } diff --git a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp index 69c961c1a13..c90348e91a6 100644 --- a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp +++ b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp @@ -189,6 +189,10 @@ void tst_QPainterPath::reserveAndCapacity() p.reserve(0); QVERIFY(p.capacity() >= 1000); + + QPainterPath p2; + p2.reserve(10); + QVERIFY(p.capacity() >= 10); } Q_DECLARE_METATYPE(QPainterPath) From cbdc9a7786278c31fdb6eb465f32d0374349c1ef Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 20 Jun 2019 09:36:46 -0700 Subject: [PATCH 14/21] RCC: Change the default compression to Zlib Codebases using QResource::isCompressed() and assuming it is Zlib break if zstd is enabled. So change the default back to Zlib until Qt 6.0. [ChangeLog][Important Behavior Changes] RCC's default compression algorithm was changed back to Zlib, as it was in all previous releases until 5.13.0. The default will remain Zlib for all Qt 5.x releases but will change in Qt 6.0. To activate Zstd compression for your resources, either pass the --compress-algo=zstd option to the rcc tool or add the XML attribute compression-algorithm="zstd" to the tags in the .qrc file. Task-number: QTBUG-76521 Change-Id: Ief874765cd7b43798de3fffd15a9f56fd9ad1ad4 Reviewed-by: Simon Hausmann --- src/tools/rcc/rcc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/rcc/rcc.cpp b/src/tools/rcc/rcc.cpp index 862e574f2db..011a7db8100 100644 --- a/src/tools/rcc/rcc.cpp +++ b/src/tools/rcc/rcc.cpp @@ -58,7 +58,7 @@ enum { CONSTANT_COMPRESSTHRESHOLD_DEFAULT = 70 }; -#if QT_CONFIG(zstd) +#if QT_CONFIG(zstd) && QT_VERSION >= QT_VERSION_CHECK(6,0,0) # define CONSTANT_COMPRESSALGO_DEFAULT RCCResourceLibrary::CompressionAlgorithm::Zstd #elif !defined(QT_NO_COMPRESS) # define CONSTANT_COMPRESSALGO_DEFAULT RCCResourceLibrary::CompressionAlgorithm::Zlib From 859eb2467dbc15728ea2ee15931073a4147f8d59 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 7 Sep 2018 13:20:42 -0700 Subject: [PATCH 15/21] Add qmake config for controlling LTCG behavior for static libs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Static libraries may get installed and used by other builds, which may be done with a different version or build of the compiler. So this commit introduces two new flags: - no-static-ltcg: disables LTCG completely for static libraries - fat-static-lto: forces static libraries to produce fat LTO objects fat-static-lto is useful for Linux distributions, since installed static libraries should not carry LTO information, but that information is useful during Qt's own build. This feature should be used alongside some compiler-specific method of removing the LTO information from the static libraries prior to installation, so only the regular part remains. For current GCC versions, this command suffices: strip -R '.gnu.lto*' -R '.gnu.debuglto*' libname.a Otherwise, distributions can use "no-static-ltcg" to disable it completely. Change-Id: I495bc19409f348069f5bfffd155237ade9f4b42f Reviewed-by: Jörg Bornemann --- mkspecs/features/ltcg.prf | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mkspecs/features/ltcg.prf b/mkspecs/features/ltcg.prf index f2dbc6fa9e0..a94f6d0eebf 100644 --- a/mkspecs/features/ltcg.prf +++ b/mkspecs/features/ltcg.prf @@ -1,4 +1,6 @@ -CONFIG(release, debug|release) { +static:no-static-ltcg { + # Static library but no-static-ltcg enabled: skip LTCG +} else: CONFIG(release, debug|release) { # We need fat object files when creating static libraries on some platforms # so the linker will know to load a particular object from the library # in the first place. On others, we have special ar and nm to create the symbol @@ -22,7 +24,7 @@ CONFIG(release, debug|release) { } } - fat-lto { + fat-lto|if(static:fat-static-lto) { QMAKE_CFLAGS_LTCG += $$QMAKE_CFLAGS_LTCG_FATOBJECTS QMAKE_CXXFLAGS_LTCG += $$QMAKE_CXXFLAGS_LTCG_FATOBJECTS } From e3b3dbbe93dbbac196543f62b444b2c044d14907 Mon Sep 17 00:00:00 2001 From: Venugopal Shivashankar Date: Wed, 22 May 2019 16:41:15 +0200 Subject: [PATCH 16/21] Example: Move the SQL statements Used const variables for the SQL statements, so that the code looks similar to its couterpart in Qt for Python. Change-Id: If2a505a404deff77d3d37c5ffad913c8c538d0b3 Reviewed-by: Christian Tismer Reviewed-by: Paul Wicking --- examples/sql/books/initdb.h | 38 +++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/examples/sql/books/initdb.h b/examples/sql/books/initdb.h index 44f74f0c375..773e3fb74cb 100644 --- a/examples/sql/books/initdb.h +++ b/examples/sql/books/initdb.h @@ -79,6 +79,32 @@ QVariant addAuthor(QSqlQuery &q, const QString &name, const QDate &birthdate) return q.lastInsertId(); } +const auto BOOKS_SQL = QLatin1String(R"( + create table books(id integer primary key, title varchar, author integer, + genre integer, year integer, rating integer) + )"); + +const auto AUTHORS_SQL = QLatin1String(R"( + create table authors(id integer primary key, name varchar, birthdate date) + )"); + +const auto GENRES_SQL = QLatin1String(R"( + create table genres(id integer primary key, name varchar) + )"); + +const auto INSERT_AUTHOR_SQL = QLatin1String(R"( + insert into authors(name, birthdate) values(?, ?) + )"); + +const auto INSERT_BOOK_SQL = QLatin1String(R"( + insert into books(title, year, author, genre, rating) + values(?, ?, ?, ?, ?) + )"); + +const auto INSERT_GENRE_SQL = QLatin1String(R"( + insert into genres(name) values(?) + )"); + QSqlError initDb() { QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE"); @@ -93,26 +119,26 @@ QSqlError initDb() return QSqlError(); QSqlQuery q; - if (!q.exec(QLatin1String("create table books(id integer primary key, title varchar, author integer, genre integer, year integer, rating integer)"))) + if (!q.exec(BOOKS_SQL)) return q.lastError(); - if (!q.exec(QLatin1String("create table authors(id integer primary key, name varchar, birthdate date)"))) + if (!q.exec(AUTHORS_SQL)) return q.lastError(); - if (!q.exec(QLatin1String("create table genres(id integer primary key, name varchar)"))) + if (!q.exec(GENRES_SQL)) return q.lastError(); - if (!q.prepare(QLatin1String("insert into authors(name, birthdate) values(?, ?)"))) + if (!q.prepare(INSERT_AUTHOR_SQL)) return q.lastError(); QVariant asimovId = addAuthor(q, QLatin1String("Isaac Asimov"), QDate(1920, 2, 1)); QVariant greeneId = addAuthor(q, QLatin1String("Graham Greene"), QDate(1904, 10, 2)); QVariant pratchettId = addAuthor(q, QLatin1String("Terry Pratchett"), QDate(1948, 4, 28)); - if (!q.prepare(QLatin1String("insert into genres(name) values(?)"))) + if (!q.prepare(INSERT_GENRE_SQL)) return q.lastError(); QVariant sfiction = addGenre(q, QLatin1String("Science Fiction")); QVariant fiction = addGenre(q, QLatin1String("Fiction")); QVariant fantasy = addGenre(q, QLatin1String("Fantasy")); - if (!q.prepare(QLatin1String("insert into books(title, year, author, genre, rating) values(?, ?, ?, ?, ?)"))) + if (!q.prepare(INSERT_BOOK_SQL)) return q.lastError(); addBook(q, QLatin1String("Foundation"), 1951, asimovId, sfiction, 3); addBook(q, QLatin1String("Foundation and Empire"), 1952, asimovId, sfiction, 4); From 3a806254fe265583f3871ed4629e13b23675ac86 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 24 Jun 2019 17:18:20 +0200 Subject: [PATCH 17/21] Fix 'clean' target for MinGW DLLs 'make clean' removed the import libs for DLLs which makes them quite unusable. Move the import lib removal to the 'distclean' target. Fixes: QTBUG-51977 Change-Id: I727d520435f88a83a7fb14cb0ad81f8fe7c6d61b Reviewed-by: Oliver Wolff --- qmake/generators/win32/mingw_make.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmake/generators/win32/mingw_make.cpp b/qmake/generators/win32/mingw_make.cpp index de7363e51b6..746f3e9008c 100644 --- a/qmake/generators/win32/mingw_make.cpp +++ b/qmake/generators/win32/mingw_make.cpp @@ -254,7 +254,7 @@ void MingwMakefileGenerator::init() } if(project->isActiveConfig("dll")) { - project->values("QMAKE_CLEAN").append(project->first("MINGW_IMPORT_LIB")); + project->values("QMAKE_DISTCLEAN").append(project->first("MINGW_IMPORT_LIB")); } } From f6db25962e820d7709c2f235f02893dd3edde4f4 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 24 Jun 2019 17:36:41 +0200 Subject: [PATCH 18/21] Add QDebug streaming operator for ProString This saves us lots of .toQString() and .toQStringList() typing when qDebug()'ing qmake code. Change-Id: I037e5e1816f2dcb6a20dec4c275f3d886f155ad5 Reviewed-by: Oliver Wolff --- qmake/library/proitems.cpp | 5 +++++ qmake/library/proitems.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/qmake/library/proitems.cpp b/qmake/library/proitems.cpp index 8bbde9f8c0a..41bed69f00a 100644 --- a/qmake/library/proitems.cpp +++ b/qmake/library/proitems.cpp @@ -517,4 +517,9 @@ ProKey ProFile::getHashStr(const ushort *&tPtr) return ret; } +QDebug operator<<(QDebug debug, const ProString &str) +{ + return debug << str.toQString(); +} + QT_END_NAMESPACE diff --git a/qmake/library/proitems.h b/qmake/library/proitems.h index 71e5e053671..0e0bebddc7c 100644 --- a/qmake/library/proitems.h +++ b/qmake/library/proitems.h @@ -31,6 +31,7 @@ #include "qmake_global.h" +#include #include #include #include @@ -468,6 +469,8 @@ struct ProFunctionDefs { QHash replaceFunctions; }; +QDebug operator<<(QDebug debug, const ProString &str); + QT_END_NAMESPACE #endif // PROITEMS_H From 64033c35927efed044bac2eebd903304452abaa0 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 21 Jun 2019 13:29:50 +0200 Subject: [PATCH 19/21] Output all font families in HTML output Fix our generation of font-family CSS so it contains the full list of families. Change-Id: I37d5efa64faeb4b6aeb7e2c5d6a54ff07febe9cc Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qtextdocument.cpp | 33 +++++++++++++++++-- src/gui/text/qtextdocument_p.h | 1 + .../text/qtextdocument/tst_qtextdocument.cpp | 12 +++++++ 3 files changed, 44 insertions(+), 2 deletions(-) diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp index 4e5ba8e0386..2c677dffe03 100644 --- a/src/gui/text/qtextdocument.cpp +++ b/src/gui/text/qtextdocument.cpp @@ -2299,7 +2299,11 @@ QString QTextHtmlExporter::toHtml(const QByteArray &encoding, ExportMode mode) if (mode == ExportEntireDocument) { html += QLatin1String(" style=\""); - emitFontFamily(defaultCharFormat.fontFamily()); + QStringList fontFamilies = defaultCharFormat.fontFamilies().toStringList(); + if (!fontFamilies.isEmpty()) + emitFontFamily(fontFamilies); + else + emitFontFamily(defaultCharFormat.fontFamily()); if (defaultCharFormat.hasProperty(QTextFormat::FontPointSize)) { html += QLatin1String(" font-size:"); @@ -2361,8 +2365,12 @@ bool QTextHtmlExporter::emitCharFormatStyle(const QTextCharFormat &format) bool attributesEmitted = false; { + const QStringList families = format.fontFamilies().toStringList(); const QString family = format.fontFamily(); - if (!family.isEmpty() && family != defaultCharFormat.fontFamily()) { + if (!families.isEmpty() && families != defaultCharFormat.fontFamilies().toStringList()) { + emitFontFamily(families); + attributesEmitted = true; + } else if (!family.isEmpty() && family != defaultCharFormat.fontFamily()) { emitFontFamily(family); attributesEmitted = true; } @@ -2639,6 +2647,27 @@ void QTextHtmlExporter::emitFontFamily(const QString &family) html += QLatin1Char(';'); } +void QTextHtmlExporter::emitFontFamily(const QStringList &families) +{ + html += QLatin1String(" font-family:"); + + bool first = true; + for (const QString &family : families) { + QLatin1String quote("\'"); + if (family.contains(QLatin1Char('\''))) + quote = QLatin1String("""); + + if (!first) + html += QLatin1String(","); + else + first = false; + html += quote; + html += family.toHtmlEscaped(); + html += quote; + } + html += QLatin1Char(';'); +} + void QTextHtmlExporter::emitMargins(const QString &top, const QString &bottom, const QString &left, const QString &right) { html += QLatin1String(" margin-top:"); diff --git a/src/gui/text/qtextdocument_p.h b/src/gui/text/qtextdocument_p.h index cad9131fbf3..d6680660914 100644 --- a/src/gui/text/qtextdocument_p.h +++ b/src/gui/text/qtextdocument_p.h @@ -396,6 +396,7 @@ private: void emitPageBreakPolicy(QTextFormat::PageBreakFlags policy); void emitFontFamily(const QString &family); + void emitFontFamily(const QStringList &families); void emitBackgroundAttribute(const QTextFormat &format); QString findUrlForImage(const QTextDocument *doc, qint64 cacheKey, bool isPixmap); diff --git a/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp b/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp index a07181c1990..e4ee778f64f 100644 --- a/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp +++ b/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp @@ -861,6 +861,18 @@ void tst_QTextDocument::toHtml_data() << QString("

Blah

"); } + { + CREATE_DOC_AND_CURSOR(); + + QTextCharFormat fmt; + fmt.setFontFamily("Times"); + fmt.setFontFamilies(QStringList{ "Times", "serif" }); + cursor.insertText("Blah", fmt); + + QTest::newRow("font-family-with-fallback") << QTextDocumentFragment(&doc) + << QString("

Blah

"); + } + { CREATE_DOC_AND_CURSOR(); From 7f69c13fd9c629acde796b8486e1d32f016678d2 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Wed, 19 Jun 2019 16:50:48 +0200 Subject: [PATCH 20/21] Skip tests if the required plugins were not deployed This is usually the case on Android, where running this test would require deployment of files to the emulator. This doesn't give us any further testing that we don't already do by running this test on regular Linux, so skipping the test instead if the preconditions aren't met. Change-Id: I3722796634871213ba51c89ae7f40b19f954f2cb Fixes: QTBUG-73566 Reviewed-by: Daniel Smith Reviewed-by: Volker Hilsheimer --- .../corelib/plugin/qplugin/tst_qplugin.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/tests/auto/corelib/plugin/qplugin/tst_qplugin.cpp b/tests/auto/corelib/plugin/qplugin/tst_qplugin.cpp index a290c012df6..aa85a7c35ba 100644 --- a/tests/auto/corelib/plugin/qplugin/tst_qplugin.cpp +++ b/tests/auto/corelib/plugin/qplugin/tst_qplugin.cpp @@ -41,7 +41,6 @@ class tst_QPlugin : public QObject Q_OBJECT QDir dir; - QString invalidPluginName; public: tst_QPlugin(); @@ -64,15 +63,14 @@ void tst_QPlugin::initTestCase() QVERIFY2(dir.exists(), qPrintable(QString::fromLatin1("Cannot find the 'plugins' directory starting from '%1'"). arg(QDir::toNativeSeparators(QDir::currentPath())))); - - const auto fileNames = dir.entryList({"*invalid*"}, QDir::Files); - if (!fileNames.isEmpty()) - invalidPluginName = dir.absoluteFilePath(fileNames.first()); } void tst_QPlugin::loadDebugPlugin() { const auto fileNames = dir.entryList(QStringList() << "*debug*", QDir::Files); + if (fileNames.isEmpty()) + QSKIP("No debug plugins found - skipping test"); + for (const QString &fileName : fileNames) { if (!QLibrary::isLibrary(fileName)) continue; @@ -100,6 +98,9 @@ void tst_QPlugin::loadDebugPlugin() void tst_QPlugin::loadReleasePlugin() { const auto fileNames = dir.entryList(QStringList() << "*release*", QDir::Files); + if (fileNames.isEmpty()) + QSKIP("No release plugins found - skipping test"); + for (const QString &fileName : fileNames) { if (!QLibrary::isLibrary(fileName)) continue; @@ -227,7 +228,13 @@ static qsizetype locateMetadata(const uchar *data, qsizetype len) void tst_QPlugin::scanInvalidPlugin() { - QVERIFY(!invalidPluginName.isEmpty()); + const auto fileNames = dir.entryList({"*invalid*"}, QDir::Files); + QString invalidPluginName; + if (fileNames.isEmpty()) + QSKIP("No invalid plugin found - skipping test"); + else + invalidPluginName = dir.absoluteFilePath(fileNames.first()); + // copy the file QFileInfo fn(invalidPluginName); From 0d6b4b519272915c2690ee12d1834823747233ab Mon Sep 17 00:00:00 2001 From: Heikki Halmet Date: Mon, 17 Jun 2019 12:26:54 +0300 Subject: [PATCH 21/21] Add keyword msvc-2019 to testlib blacklisting Change-Id: Ibb1d225909e6c0c8b35f3b41aeb619784012d43b Reviewed-by: Frederik Gladhorn --- src/testlib/qtestblacklist.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/testlib/qtestblacklist.cpp b/src/testlib/qtestblacklist.cpp index 886f1f75b97..66426997588 100644 --- a/src/testlib/qtestblacklist.cpp +++ b/src/testlib/qtestblacklist.cpp @@ -150,8 +150,10 @@ static QSet keywords() << "msvc-2013" # elif _MSC_VER <= 1900 << "msvc-2015" -# else +# elif _MSC_VER <= 1916 << "msvc-2017" +# else + << "msvc-2019" # endif #endif