From 9e7d76946270216d46c8cf0d02427ca3c2109de3 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 1 Mar 2017 14:41:14 +0100 Subject: [PATCH 01/75] Use the same timeout value for all QTest::qWaitForWindow*() functions Some were 5s, others 1s. Pick one (the higher). Change-Id: I81929d4f49c2e41b4d4b75c3e2bf8ff75af868ad Reviewed-by: Friedemann Kleint --- src/testlib/qtestsystem.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/testlib/qtestsystem.h b/src/testlib/qtestsystem.h index 08e240e25a5..9c509690e4d 100644 --- a/src/testlib/qtestsystem.h +++ b/src/testlib/qtestsystem.h @@ -114,14 +114,14 @@ namespace QTest #endif #ifdef QT_WIDGETS_LIB - inline static bool qWaitForWindowActive(QWidget *widget, int timeout = 1000) + inline static bool qWaitForWindowActive(QWidget *widget, int timeout = 5000) { if (QWindow *window = widget->windowHandle()) return qWaitForWindowActive(window, timeout); return false; } - inline static bool qWaitForWindowExposed(QWidget *widget, int timeout = 1000) + inline static bool qWaitForWindowExposed(QWidget *widget, int timeout = 5000) { if (QWindow *window = widget->windowHandle()) return qWaitForWindowExposed(window, timeout); @@ -131,7 +131,7 @@ namespace QTest #if QT_DEPRECATED_SINCE(5, 0) # ifdef QT_WIDGETS_LIB - QT_DEPRECATED inline static bool qWaitForWindowShown(QWidget *widget, int timeout = 1000) + QT_DEPRECATED inline static bool qWaitForWindowShown(QWidget *widget, int timeout = 5000) { return qWaitForWindowExposed(widget, timeout); } From 8b9d246225dcd63900399297b0fd553918840bea Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Mon, 20 Feb 2017 10:34:47 +0100 Subject: [PATCH 02/75] QHttpNetworkConnection: fall back gracefully to HTTP/1.1 Both SPDY and HTTP/2 work with a single qhttpnetworkchannel (and this means one socket per qhttpnetworkconnection). Normally, HTTP/1.1 connection is using up to 6 channels/sockets though. At the moment a failure to negotiate SPDY/HTTP/2 leaves us with a downgraded HTTP/1.1 connection (with only one channel vs. default 6). Since we initialize channels (and establish connections) in a 'lazy' manner it's ok to pre-allocate all 6 channels and then either use 1 (if SPDY/HTTP/2 indeed was negotiated) or switch back to 6 in case of failure. Change-Id: Ia6c3061463c4d634aaed05ce0dde47bfb5e24dd8 Reviewed-by: Edward Welbourne Reviewed-by: Timur Pocheptsov --- src/network/access/qhttpnetworkconnection.cpp | 54 ++++++++++--------- src/network/access/qhttpnetworkconnection_p.h | 3 ++ .../access/qhttpnetworkconnectionchannel.cpp | 30 +++++++++-- 3 files changed, 59 insertions(+), 28 deletions(-) diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index 128f75f93b4..1f14049a44e 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -82,27 +82,31 @@ QHttpNetworkConnectionPrivate::QHttpNetworkConnectionPrivate(const QString &host : state(RunningState), networkLayerState(Unknown), hostName(hostName), port(port), encrypt(encrypt), delayIpv4(true) + , activeChannelCount(type == QHttpNetworkConnection::ConnectionTypeHTTP2 #ifndef QT_NO_SSL -, channelCount((type == QHttpNetworkConnection::ConnectionTypeSPDY || type == QHttpNetworkConnection::ConnectionTypeHTTP2) - ? 1 : defaultHttpChannelCount) -#else -, channelCount(type == QHttpNetworkConnection::ConnectionTypeHTTP2 ? 1 : defaultHttpChannelCount) -#endif // QT_NO_SSL + || type == QHttpNetworkConnection::ConnectionTypeSPDY +#endif + ? 1 : defaultHttpChannelCount) + , channelCount(defaultHttpChannelCount) #ifndef QT_NO_NETWORKPROXY , networkProxy(QNetworkProxy::NoProxy) #endif , preConnectRequests(0) , connectionType(type) { + // We allocate all 6 channels even if it's SPDY or HTTP/2 enabled + // connection: in case the protocol negotiation via NPN/ALPN fails, + // we will have normally working HTTP/1.1. + Q_ASSERT(channelCount >= activeChannelCount); channels = new QHttpNetworkConnectionChannel[channelCount]; } -QHttpNetworkConnectionPrivate::QHttpNetworkConnectionPrivate(quint16 channelCount, const QString &hostName, +QHttpNetworkConnectionPrivate::QHttpNetworkConnectionPrivate(quint16 connectionCount, const QString &hostName, quint16 port, bool encrypt, QHttpNetworkConnection::ConnectionType type) : state(RunningState), networkLayerState(Unknown), hostName(hostName), port(port), encrypt(encrypt), delayIpv4(true), - channelCount(channelCount) + activeChannelCount(connectionCount), channelCount(connectionCount) #ifndef QT_NO_NETWORKPROXY , networkProxy(QNetworkProxy::NoProxy) #endif @@ -147,7 +151,7 @@ void QHttpNetworkConnectionPrivate::pauseConnection() state = PausedState; // Disable all socket notifiers - for (int i = 0; i < channelCount; i++) { + for (int i = 0; i < activeChannelCount; i++) { if (channels[i].socket) { #ifndef QT_NO_SSL if (encrypt) @@ -163,7 +167,7 @@ void QHttpNetworkConnectionPrivate::resumeConnection() { state = RunningState; // Enable all socket notifiers - for (int i = 0; i < channelCount; i++) { + for (int i = 0; i < activeChannelCount; i++) { if (channels[i].socket) { #ifndef QT_NO_SSL if (encrypt) @@ -184,7 +188,7 @@ void QHttpNetworkConnectionPrivate::resumeConnection() int QHttpNetworkConnectionPrivate::indexOf(QAbstractSocket *socket) const { - for (int i = 0; i < channelCount; ++i) + for (int i = 0; i < activeChannelCount; ++i) if (channels[i].socket == socket) return i; @@ -210,7 +214,7 @@ bool QHttpNetworkConnectionPrivate::shouldEmitChannelError(QAbstractSocket *sock channels[otherSocket].ensureConnection(); } - if (channelCount == 1) { + if (activeChannelCount < channelCount) { if (networkLayerState == HostLookupPending || networkLayerState == IPv4or6) networkLayerState = QHttpNetworkConnectionPrivate::Unknown; channels[0].close(); @@ -405,7 +409,7 @@ void QHttpNetworkConnectionPrivate::copyCredentials(int fromChannel, QAuthentica // select another channel QAuthenticator* otherAuth = 0; - for (int i = 0; i < channelCount; ++i) { + for (int i = 0; i < activeChannelCount; ++i) { if (i == fromChannel) continue; if (isProxy) @@ -886,7 +890,7 @@ void QHttpNetworkConnectionPrivate::removeReply(QHttpNetworkReply *reply) Q_Q(QHttpNetworkConnection); // check if the reply is currently being processed or it is pipelined in - for (int i = 0; i < channelCount; ++i) { + for (int i = 0; i < activeChannelCount; ++i) { // is the reply associated the currently processing of this channel? if (channels[i].reply == reply) { channels[i].reply = 0; @@ -989,7 +993,7 @@ void QHttpNetworkConnectionPrivate::_q_startNextRequest() return; //resend the necessary ones. - for (int i = 0; i < channelCount; ++i) { + for (int i = 0; i < activeChannelCount; ++i) { if (channels[i].resendCurrent && (channels[i].state != QHttpNetworkConnectionChannel::ClosingState)) { channels[i].resendCurrent = false; @@ -1009,7 +1013,7 @@ void QHttpNetworkConnectionPrivate::_q_startNextRequest() return; // try to get a free AND connected socket - for (int i = 0; i < channelCount; ++i) { + for (int i = 0; i < activeChannelCount; ++i) { if (channels[i].socket) { if (!channels[i].reply && !channels[i].isSocketBusy() && channels[i].socket->state() == QAbstractSocket::ConnectedState) { if (dequeueRequest(channels[i].socket)) @@ -1047,7 +1051,7 @@ void QHttpNetworkConnectionPrivate::_q_startNextRequest() // return fast if there is nothing to pipeline if (highPriorityQueue.isEmpty() && lowPriorityQueue.isEmpty()) return; - for (int i = 0; i < channelCount; i++) + for (int i = 0; i < activeChannelCount; i++) if (channels[i].socket && channels[i].socket->state() == QAbstractSocket::ConnectedState) fillPipeline(channels[i].socket); @@ -1063,7 +1067,7 @@ void QHttpNetworkConnectionPrivate::_q_startNextRequest() int normalRequests = queuedRequests - preConnectRequests; neededOpenChannels = qMax(normalRequests, preConnectRequests); } - for (int i = 0; i < channelCount && neededOpenChannels > 0; ++i) { + for (int i = 0; i < activeChannelCount && neededOpenChannels > 0; ++i) { bool connectChannel = false; if (channels[i].socket) { if ((channels[i].socket->state() == QAbstractSocket::ConnectingState) @@ -1093,7 +1097,7 @@ void QHttpNetworkConnectionPrivate::_q_startNextRequest() void QHttpNetworkConnectionPrivate::readMoreLater(QHttpNetworkReply *reply) { - for (int i = 0 ; i < channelCount; ++i) { + for (int i = 0 ; i < activeChannelCount; ++i) { if (channels[i].reply == reply) { // emulate a readyRead() from the socket QMetaObject::invokeMethod(&channels[i], "_q_readyRead", Qt::QueuedConnection); @@ -1212,7 +1216,7 @@ void QHttpNetworkConnectionPrivate::_q_hostLookupFinished(const QHostInfo &info) // connection will then be disconnected. void QHttpNetworkConnectionPrivate::startNetworkLayerStateLookup() { - if (channelCount > 1) { + if (activeChannelCount > 1) { // At this time all channels should be unconnected. Q_ASSERT(!channels[0].isSocketBusy()); Q_ASSERT(!channels[1].isSocketBusy()); @@ -1250,7 +1254,7 @@ void QHttpNetworkConnectionPrivate::startNetworkLayerStateLookup() void QHttpNetworkConnectionPrivate::networkLayerDetected(QAbstractSocket::NetworkLayerProtocol protocol) { - for (int i = 0 ; i < channelCount; ++i) { + for (int i = 0 ; i < activeChannelCount; ++i) { if ((channels[i].networkLayerPreference != protocol) && (channels[i].state == QHttpNetworkConnectionChannel::ConnectingState)) { channels[i].close(); } @@ -1347,7 +1351,7 @@ void QHttpNetworkConnection::setCacheProxy(const QNetworkProxy &networkProxy) d->networkProxy = networkProxy; // update the authenticator if (!d->networkProxy.user().isEmpty()) { - for (int i = 0; i < d->channelCount; ++i) { + for (int i = 0; i < d->activeChannelCount; ++i) { d->channels[i].proxyAuthenticator.setUser(d->networkProxy.user()); d->channels[i].proxyAuthenticator.setPassword(d->networkProxy.password()); } @@ -1363,7 +1367,7 @@ QNetworkProxy QHttpNetworkConnection::cacheProxy() const void QHttpNetworkConnection::setTransparentProxy(const QNetworkProxy &networkProxy) { Q_D(QHttpNetworkConnection); - for (int i = 0; i < d->channelCount; ++i) + for (int i = 0; i < d->activeChannelCount; ++i) d->channels[i].setProxy(networkProxy); } @@ -1395,7 +1399,7 @@ void QHttpNetworkConnection::setSslConfiguration(const QSslConfiguration &config return; // set the config on all channels - for (int i = 0; i < d->channelCount; ++i) + for (int i = 0; i < d->activeChannelCount; ++i) d->channels[i].setSslConfiguration(config); } @@ -1418,7 +1422,7 @@ void QHttpNetworkConnection::ignoreSslErrors(int channel) return; if (channel == -1) { // ignore for all channels - for (int i = 0; i < d->channelCount; ++i) { + for (int i = 0; i < d->activeChannelCount; ++i) { d->channels[i].ignoreSslErrors(); } @@ -1434,7 +1438,7 @@ void QHttpNetworkConnection::ignoreSslErrors(const QList &errors, int return; if (channel == -1) { // ignore for all channels - for (int i = 0; i < d->channelCount; ++i) { + for (int i = 0; i < d->activeChannelCount; ++i) { d->channels[i].ignoreSslErrors(errors); } diff --git a/src/network/access/qhttpnetworkconnection_p.h b/src/network/access/qhttpnetworkconnection_p.h index 430c715717e..3dd9bde9bdb 100644 --- a/src/network/access/qhttpnetworkconnection_p.h +++ b/src/network/access/qhttpnetworkconnection_p.h @@ -243,6 +243,9 @@ public: bool encrypt; bool delayIpv4; + // Number of channels we are trying to use at the moment: + int activeChannelCount; + // The total number of channels we reserved: const int channelCount; QTimer delayedConnectionTimer; QHttpNetworkConnectionChannel *channels; // parallel connections to the server diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp index 7fa19dc65b5..a11fc7e807f 100644 --- a/src/network/access/qhttpnetworkconnectionchannel.cpp +++ b/src/network/access/qhttpnetworkconnectionchannel.cpp @@ -1082,12 +1082,36 @@ void QHttpNetworkConnectionChannel::_q_encrypted() } } Q_FALLTHROUGH(); - case QSslConfiguration::NextProtocolNegotiationNone: + case QSslConfiguration::NextProtocolNegotiationNone: { protocolHandler.reset(new QHttpProtocolHandler(this)); + + QList protocols = sslConfiguration.allowedNextProtocols(); + const int nProtocols = protocols.size(); + // Clear the protocol that we failed to negotiate, so we do not try + // it again on other channels that our connection can create/open. + if (connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2) + protocols.removeAll(QSslConfiguration::ALPNProtocolHTTP2); + else if (connection->connectionType() == QHttpNetworkConnection::ConnectionTypeSPDY) + protocols.removeAll(QSslConfiguration::NextProtocolSpdy3_0); + + if (nProtocols > protocols.size()) { + sslConfiguration.setAllowedNextProtocols(protocols); + const int channelCount = connection->d_func()->channelCount; + for (int i = 0; i < channelCount; ++i) + connection->d_func()->channels[i].setSslConfiguration(sslConfiguration); + } + connection->setConnectionType(QHttpNetworkConnection::ConnectionTypeHTTP); - // re-queue requests from SPDY queue to HTTP queue, if any - requeueSpdyRequests(); + // We use only one channel for SPDY or HTTP/2, but normally six for + // HTTP/1.1 - let's restore this number to the reserved number of + // channels: + if (connection->d_func()->activeChannelCount < connection->d_func()->channelCount) { + connection->d_func()->activeChannelCount = connection->d_func()->channelCount; + // re-queue requests from SPDY queue to HTTP queue, if any + requeueSpdyRequests(); + } break; + } default: emitFinishedWithError(QNetworkReply::SslHandshakeFailedError, "detected unknown Next Protocol Negotiation protocol"); From 375bbcdd01f5afab2f9630d6b6c396145e5d6b00 Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Tue, 28 Feb 2017 17:21:56 +0100 Subject: [PATCH 03/75] qlalr: Fix and re-run qlalr on its own sources So the generated files are up-to-date again. Generated with: qlalr --qt --no-lines --no-debug lalr.g Change-Id: I3c4adb0083be7e66fed3db92c079493b574295aa Reviewed-by: Edward Welbourne Reviewed-by: Oswald Buddenhagen --- src/tools/qlalr/cppgenerator.cpp | 243 +++++++++++-------------------- src/tools/qlalr/grammar.cpp | 128 ++++++++-------- src/tools/qlalr/grammar_p.h | 108 +++++++------- src/tools/qlalr/lalr.g | 12 +- src/tools/qlalr/recognizer.cpp | 6 +- 5 files changed, 218 insertions(+), 279 deletions(-) diff --git a/src/tools/qlalr/cppgenerator.cpp b/src/tools/qlalr/cppgenerator.cpp index efceb8c5201..ed0f53d43e9 100644 --- a/src/tools/qlalr/cppgenerator.cpp +++ b/src/tools/qlalr/cppgenerator.cpp @@ -36,6 +36,29 @@ #include #include +namespace { + +void generateSeparator(int i, QTextStream &out) +{ + if (!(i % 10)) { + if (i) + out << ","; + out << endl << " "; + } else { + out << ", "; + } +} + +void generateList(const QVector &list, QTextStream &out) +{ + for (int i = 0; i < list.size(); ++i) { + generateSeparator(i, out); + + out << list[i]; + } +} + +} QString CppGenerator::copyrightHeader() const { @@ -47,7 +70,7 @@ QString CppGenerator::copyrightHeader() const "**\n" "** This file is part of the Qt Toolkit.\n" "**\n" - "** $QT_BEGIN_LICENSE:LGPL$\n" + "** $QT_BEGIN_LICENSE:GPL-EXCEPT$\n" "** Commercial License Usage\n" "** Licensees holding valid commercial Qt licenses may use this file in\n" "** accordance with the commercial license agreement provided with the\n" @@ -56,24 +79,13 @@ QString CppGenerator::copyrightHeader() const "** and conditions see https://www.qt.io/terms-conditions. For further\n" "** information use the contact form at https://www.qt.io/contact-us.\n" "**\n" - "** GNU Lesser General Public License Usage\n" - "** Alternatively, this file may be used under the terms of the GNU Lesser\n" - "** General Public License version 3 as published by the Free Software\n" - "** Foundation and appearing in the file LICENSE.LGPL3 included in the\n" - "** packaging of this file. Please review the following information to\n" - "** ensure the GNU Lesser General Public License version 3 requirements\n" - "** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.\n" - "**\n" "** GNU General Public License Usage\n" "** Alternatively, this file may be used under the terms of the GNU\n" - "** General Public License version 2.0 or (at your option) the GNU General\n" - "** Public license version 3 or any later version approved by the KDE Free\n" - "** Qt Foundation. The licenses are as published by the Free Software\n" - "** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3\n" + "** General Public License version 3 as published by the Free Software\n" + "** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT\n" "** included in the packaging of this file. Please review the following\n" "** information to ensure the GNU General Public License requirements will\n" - "** be met: https://www.gnu.org/licenses/gpl-2.0.html and\n" - "** https://www.gnu.org/licenses/gpl-3.0.html.\n" + "** be met: https://www.gnu.org/licenses/gpl-3.0.html.\n" "**\n" "** $QT_END_LICENSE$\n" "**\n" @@ -446,7 +458,7 @@ void CppGenerator::generateDecl (QTextStream &out) out << "class " << grammar.table_name << endl << "{" << endl << "public:" << endl - << " enum VariousConstants {" << endl; + << " enum VariousConstants {" << endl; for (Name t : qAsConst(grammar.terminals)) { @@ -462,59 +474,59 @@ void CppGenerator::generateDecl (QTextStream &out) else name.prepend (grammar.token_prefix); - out << " " << name << " = " << value << "," << endl; + out << " " << name << " = " << value << "," << endl; } out << endl - << " ACCEPT_STATE = " << accept_state << "," << endl - << " RULE_COUNT = " << grammar.rules.size () << "," << endl - << " STATE_COUNT = " << state_count << "," << endl - << " TERMINAL_COUNT = " << terminal_count << "," << endl - << " NON_TERMINAL_COUNT = " << non_terminal_count << "," << endl + << " ACCEPT_STATE = " << accept_state << "," << endl + << " RULE_COUNT = " << grammar.rules.size () << "," << endl + << " STATE_COUNT = " << state_count << "," << endl + << " TERMINAL_COUNT = " << terminal_count << "," << endl + << " NON_TERMINAL_COUNT = " << non_terminal_count << "," << endl << endl - << " GOTO_INDEX_OFFSET = " << compressed_action.index.size () << "," << endl - << " GOTO_INFO_OFFSET = " << compressed_action.info.size () << "," << endl - << " GOTO_CHECK_OFFSET = " << compressed_action.check.size () << endl - << " };" << endl + << " GOTO_INDEX_OFFSET = " << compressed_action.index.size () << "," << endl + << " GOTO_INFO_OFFSET = " << compressed_action.info.size () << "," << endl + << " GOTO_CHECK_OFFSET = " << compressed_action.check.size () << endl + << " };" << endl << endl - << " static const char *const spell [];" << endl - << " static const short lhs [];" << endl - << " static const short rhs [];" << endl; + << " static const char *const spell[];" << endl + << " static const short lhs[];" << endl + << " static const short rhs[];" << endl; if (debug_info) { QString prot = debugInfoProt(); out << endl << "#ifndef " << prot << endl - << " static const int rule_index [];" << endl - << " static const int rule_info [];" << endl + << " static const int rule_index[];" << endl + << " static const int rule_info[];" << endl << "#endif // " << prot << endl << endl; } - out << " static const short goto_default [];" << endl - << " static const short action_default [];" << endl - << " static const short action_index [];" << endl - << " static const short action_info [];" << endl - << " static const short action_check [];" << endl + out << " static const short goto_default[];" << endl + << " static const short action_default[];" << endl + << " static const short action_index[];" << endl + << " static const short action_info[];" << endl + << " static const short action_check[];" << endl << endl - << " static inline int nt_action (int state, int nt)" << endl - << " {" << endl - << " const int yyn = action_index [GOTO_INDEX_OFFSET + state] + nt;" << endl - << " if (yyn < 0 || action_check [GOTO_CHECK_OFFSET + yyn] != nt)" << endl - << " return goto_default [nt];" << endl + << " static inline int nt_action (int state, int nt)" << endl + << " {" << endl + << " const int yyn = action_index [GOTO_INDEX_OFFSET + state] + nt;" << endl + << " if (yyn < 0 || action_check [GOTO_CHECK_OFFSET + yyn] != nt)" << endl + << " return goto_default [nt];" << endl << endl - << " return action_info [GOTO_INFO_OFFSET + yyn];" << endl - << " }" << endl + << " return action_info [GOTO_INFO_OFFSET + yyn];" << endl + << " }" << endl << endl - << " static inline int t_action (int state, int token)" << endl - << " {" << endl - << " const int yyn = action_index [state] + token;" << endl + << " static inline int t_action (int state, int token)" << endl + << " {" << endl + << " const int yyn = action_index [state] + token;" << endl << endl - << " if (yyn < 0 || action_check [yyn] != token)" << endl - << " return - action_default [state];" << endl + << " if (yyn < 0 || action_check [yyn] != token)" << endl + << " return - action_default [state];" << endl << endl - << " return action_info [yyn];" << endl - << " }" << endl + << " return action_info [yyn];" << endl + << " }" << endl << "};" << endl << endl << endl; @@ -539,11 +551,7 @@ void CppGenerator::generateImpl (QTextStream &out) name_ids.insert (t, idx); - if (idx) - out << ", "; - - if (! (idx % 10)) - out << endl << " "; + generateSeparator(idx, out); if (terminal) { @@ -569,35 +577,27 @@ void CppGenerator::generateImpl (QTextStream &out) if (debug_info) out << endl << "#endif // " << debugInfoProt() << endl; - out << "};" << endl << endl; + out << endl << "};" << endl << endl; out << "const short " << grammar.table_name << "::lhs [] = {"; idx = 0; for (RulePointer rule = grammar.rules.begin (); rule != grammar.rules.end (); ++rule, ++idx) { - if (idx) - out << ", "; - - if (! (idx % 10)) - out << endl << " "; + generateSeparator(idx, out); out << aut.id (rule->lhs); } - out << "};" << endl << endl; + out << endl << "};" << endl << endl; out << "const short " << grammar.table_name << "::rhs [] = {"; idx = 0; for (RulePointer rule = grammar.rules.begin (); rule != grammar.rules.end (); ++rule, ++idx) { - if (idx) - out << ", "; - - if (! (idx % 10)) - out << endl << " "; + generateSeparator(idx, out); out << rule->rhs.size (); } - out << "};" << endl << endl; + out << endl << "};" << endl << endl; if (debug_info) { @@ -608,35 +608,26 @@ void CppGenerator::generateImpl (QTextStream &out) idx = 0; for (auto rule = grammar.rules.cbegin (); rule != grammar.rules.cend (); ++rule, ++idx) { - out << endl << " "; - - if (idx) - out << ", "; - else - out << " "; + generateSeparator(idx, out); out << name_ids.value(rule->lhs); for (const Name &n : rule->rhs) out << ", " << name_ids.value (n); } - out << "};" << endl << endl; + out << endl << "};" << endl << endl; out << "const int " << grammar.table_name << "::rule_index [] = {"; idx = 0; int offset = 0; for (RulePointer rule = grammar.rules.begin (); rule != grammar.rules.end (); ++rule, ++idx) { - if (idx) - out << ", "; - - if (! (idx % 10)) - out << endl << " "; + generateSeparator(idx, out); out << offset; offset += rule->rhs.size () + 1; } - out << "};" << endl + out << endl << "};" << endl << "#endif // " << prot << endl << endl; } @@ -644,92 +635,34 @@ void CppGenerator::generateImpl (QTextStream &out) idx = 0; for (StatePointer state = aut.states.begin (); state != aut.states.end (); ++state, ++idx) { - if (state != aut.states.begin ()) - out << ", "; - - if (! (idx % 10)) - out << endl << " "; + generateSeparator(idx, out); if (state->defaultReduce != grammar.rules.end ()) out << aut.id (state->defaultReduce); else out << "0"; } - out << "};" << endl << endl; + out << endl << "};" << endl << endl; out << "const short " << grammar.table_name << "::goto_default [] = {"; - for (int i = 0; i < defgoto.size (); ++i) - { - if (i) - out << ", "; - - if (! (i % 10)) - out << endl << " "; - - out << defgoto [i]; - } - out << "};" << endl << endl; + generateList(defgoto, out); + out << endl << "};" << endl << endl; out << "const short " << grammar.table_name << "::action_index [] = {"; - for (int i = 0; i < compressed_action.index.size (); ++i) - { - if (! (i % 10)) - out << endl << " "; - - out << compressed_action.index [i] << ", "; - } - out << endl; - for (int i = 0; i < compressed_goto.index.size (); ++i) - { - if (i) - out << ", "; - - if (! (i % 10)) - out << endl << " "; - - out << compressed_goto.index [i]; - } - out << "};" << endl << endl; + generateList(compressed_action.index, out); + out << "," << endl; + generateList(compressed_goto.index, out); + out << endl << "};" << endl << endl; out << "const short " << grammar.table_name << "::action_info [] = {"; - for (int i = 0; i < compressed_action.info.size (); ++i) - { - if (! (i % 10)) - out << endl << " "; - - out << compressed_action.info [i] << ", "; - } - out << endl; - for (int i = 0; i < compressed_goto.info.size (); ++i) - { - if (i) - out << ", "; - - if (! (i % 10)) - out << endl << " "; - - out << compressed_goto.info [i]; - } - out << "};" << endl << endl; + generateList(compressed_action.info, out); + out << "," << endl; + generateList(compressed_goto.info, out); + out << endl << "};" << endl << endl; out << "const short " << grammar.table_name << "::action_check [] = {"; - for (int i = 0; i < compressed_action.check.size (); ++i) - { - if (! (i % 10)) - out << endl << " "; - - out << compressed_action.check [i] << ", "; - } - out << endl; - for (int i = 0; i < compressed_goto.check.size (); ++i) - { - if (i) - out << ", "; - - if (! (i % 10)) - out << endl << " "; - - out << compressed_goto.check [i]; - } - out << "};" << endl << endl; + generateList(compressed_action.check, out); + out << "," << endl; + generateList(compressed_goto.check, out); + out << endl << "};" << endl << endl; } diff --git a/src/tools/qlalr/grammar.cpp b/src/tools/qlalr/grammar.cpp index 1891a548607..f6339628151 100644 --- a/src/tools/qlalr/grammar.cpp +++ b/src/tools/qlalr/grammar.cpp @@ -32,83 +32,89 @@ QT_BEGIN_NAMESPACE const char *const grammar::spell [] = { - "end of file", "identifier", "string literal", "%decl", "%expect", "%expect-lr", "%impl", "%left", "%merged_output", "%nonassoc", - "%parser", "%prec", "%right", "%start", "%token", "%token_prefix", ":", "|", ";", 0, - 0, 0}; + "end of file", "identifier", "string literal", "%decl", "%expect", "%expect-lr", "%impl", "%left", "%merged_output", "%nonassoc", + "%parser", "%prec", "%right", "%start", "%token", "%token_prefix", ":", "|", ";", 0, + 0, 0 +}; const short grammar::lhs [] = { - 22, 23, 23, 29, 25, 28, 28, 28, 28, 28, - 28, 28, 24, 24, 31, 32, 32, 33, 33, 34, - 34, 34, 31, 35, 35, 36, 37, 37, 38, 38, - 30, 30, 26, 26, 40, 39, 41, 41, 44, 43, - 43, 42, 42, 27, 45}; + 22, 23, 23, 29, 25, 28, 28, 28, 28, 28, + 28, 28, 24, 24, 31, 32, 32, 33, 33, 34, + 34, 34, 31, 35, 35, 36, 37, 37, 38, 38, + 30, 30, 26, 26, 40, 39, 41, 41, 44, 43, + 43, 42, 42, 27, 45 +}; const short grammar::rhs [] = { - 4, 1, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 1, 2, 2, 1, 2, 2, 2, 1, - 1, 1, 2, 1, 2, 1, 1, 1, 1, 2, - 0, 1, 1, 2, 2, 4, 3, 6, 0, 0, - 2, 1, 2, 0, 2}; + 4, 1, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 1, 2, 2, 1, 2, 2, 2, 1, + 1, 1, 2, 1, 2, 1, 1, 1, 1, 2, + 0, 1, 1, 2, 2, 4, 3, 6, 0, 0, + 2, 1, 2, 0, 2 +}; const short grammar::action_default [] = { - 44, 2, 44, 0, 0, 0, 0, 13, 0, 0, - 3, 0, 0, 0, 8, 10, 11, 9, 7, 6, - 12, 20, 22, 0, 21, 0, 44, 31, 0, 14, - 26, 24, 23, 25, 4, 33, 1, 0, 34, 44, - 35, 42, 39, 40, 0, 31, 44, 40, 43, 0, - 31, 41, 29, 27, 28, 32, 38, 30, 36, 31, - 37, 5, 44, 16, 15, 18, 19, 17, 45}; + 44, 2, 44, 0, 0, 0, 0, 13, 0, 0, + 3, 0, 0, 0, 8, 10, 11, 9, 7, 6, + 12, 20, 22, 0, 21, 0, 44, 31, 0, 14, + 26, 24, 23, 25, 4, 33, 1, 0, 34, 44, + 35, 42, 39, 40, 0, 31, 44, 40, 43, 0, + 31, 41, 29, 27, 28, 32, 38, 30, 36, 31, + 37, 5, 44, 16, 15, 18, 19, 17, 45 +}; const short grammar::goto_default [] = { - 3, 2, 13, 26, 36, 41, 10, 27, 61, 29, - 64, 63, 23, 32, 31, 52, 55, 38, 39, 42, - 43, 59, 44, 0}; + 3, 2, 13, 26, 36, 41, 10, 27, 61, 29, + 64, 63, 23, 32, 31, 52, 55, 38, 39, 42, + 43, 59, 44, 0 +}; const short grammar::action_index [] = { - -22, -22, 54, 1, 5, 15, 20, -22, -1, 6, - -22, 3, 2, 35, -22, -22, -22, -22, -22, -22, - -22, -22, -22, 10, -22, 7, -22, 14, 9, -22, - -22, -22, 8, -22, -22, -22, 11, -2, -22, -22, - -22, -22, -3, 16, 13, 14, -22, 17, -22, 4, - 14, -22, -22, -22, -22, 14, -22, -22, -22, 14, - -22, -22, 0, -22, 12, -22, -22, -22, -22, + -22, -22, 30, 1, 2, 3, 4, -22, 5, 6, + -22, 8, -1, 35, -22, -22, -22, -22, -22, -22, + -22, -22, -22, 13, -22, 7, -22, -2, 20, -22, + -22, -22, 11, -22, -22, -22, 15, -6, -22, -22, + -22, -22, -3, 19, -4, 12, -22, 18, -22, 10, + -2, -22, -22, -22, -22, -2, -22, -22, -22, -2, + -22, -22, 0, -22, 20, -22, -22, -22, -22, - 2, -24, -2, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -4, -24, -24, -24, - -24, -24, -14, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, 0, -16, -15, -24, -24, - 15, -24, -24, -24, -24, -10, -24, -24, -24, 1, - -24, -24, -3, -24, -1, -24, -24, -24, -24}; + 0, -24, 3, -24, -24, -24, -24, -24, -24, -24, + -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, + -24, -24, -24, -24, -24, -24, -2, -24, -24, -24, + -24, -24, -7, -24, -24, -24, -24, -24, -24, -24, + -24, -24, -24, -24, -24, 17, -19, -11, -24, -24, + 1, -24, -24, -24, -24, -15, -24, -24, -24, -6, + -24, -24, -1, -24, -5, -24, -24, -24, -24 +}; const short grammar::action_info [] = { - 17, 68, 66, 20, 19, 51, 14, 18, 34, 30, - 62, 30, 37, 62, 40, 45, 15, 48, 48, 0, - 0, 16, 0, 0, 0, 0, 0, 49, 49, 0, - 46, 0, 0, 53, 54, 0, 0, 0, 0, 0, - 0, 0, 21, 0, 22, 0, 0, 24, 25, 28, - 0, 0, 0, 0, 0, 0, 0, 4, 5, 6, - 8, 0, 9, 0, 11, 0, 0, 0, 0, 12, - 0, 0, 0, 0, 0, 0, + 20, 68, 66, 14, 15, 16, 17, 18, 34, 19, + 40, 51, 30, 46, 30, 45, 37, 53, 54, 48, + 48, 62, 0, 0, 0, 0, 0, 0, 0, 49, + 49, 53, 54, 4, 5, 6, 8, 0, 9, 0, + 11, 0, 21, 0, 22, 12, 0, 24, 25, 28, + 0, 0, 0, 0, 0, 0, 0, - 33, 35, 65, 7, 47, 57, 50, 1, 58, 60, - 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 56, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0}; + 57, 47, 60, 35, 65, 1, 67, 33, 7, 56, + 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 58, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0 +}; const short grammar::action_check [] = { - 1, 0, 2, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 16, 18, 1, 1, 1, -1, - -1, 1, -1, -1, -1, -1, -1, 11, 11, -1, - 17, -1, -1, 19, 20, -1, -1, -1, -1, -1, - -1, -1, 7, -1, 9, -1, -1, 12, 13, 14, - -1, -1, -1, -1, -1, -1, -1, 3, 4, 5, - 6, -1, 8, -1, 10, -1, -1, -1, -1, 15, - -1, -1, -1, -1, -1, -1, + 1, 0, 2, 1, 1, 1, 1, 1, 1, 1, + 16, 1, 1, 17, 1, 18, 1, 19, 20, 1, + 1, 1, -1, -1, -1, -1, -1, -1, -1, 11, + 11, 19, 20, 3, 4, 5, 6, -1, 8, -1, + 10, -1, 7, -1, 9, 15, -1, 12, 13, 14, + -1, -1, -1, -1, -1, -1, -1, - 14, 5, 5, 5, 20, 15, 21, 5, 8, 8, - 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 8, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1}; + 15, 20, 8, 5, 5, 5, 11, 14, 5, 8, + 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 8, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1 +}; QT_END_NAMESPACE diff --git a/src/tools/qlalr/grammar_p.h b/src/tools/qlalr/grammar_p.h index 1230a29b1c9..8482f9bfe1d 100644 --- a/src/tools/qlalr/grammar_p.h +++ b/src/tools/qlalr/grammar_p.h @@ -48,68 +48,68 @@ QT_BEGIN_NAMESPACE class grammar { public: - enum VariousConstants { - EOF_SYMBOL = 0, - COLON = 16, - DECL = 19, - DECL_FILE = 3, - ERROR = 21, - EXPECT = 4, - EXPECT_RR = 5, - ID = 1, - IMPL = 20, - IMPL_FILE = 6, - LEFT = 7, - MERGED_OUTPUT = 8, - NONASSOC = 9, - OR = 17, - PARSER = 10, - PREC = 11, - RIGHT = 12, - SEMICOLON = 18, - START = 13, - STRING_LITERAL = 2, - TOKEN = 14, - TOKEN_PREFIX = 15, + enum VariousConstants { + EOF_SYMBOL = 0, + COLON = 16, + DECL = 19, + DECL_FILE = 3, + ERROR = 21, + EXPECT = 4, + EXPECT_RR = 5, + ID = 1, + IMPL = 20, + IMPL_FILE = 6, + LEFT = 7, + MERGED_OUTPUT = 8, + NONASSOC = 9, + OR = 17, + PARSER = 10, + PREC = 11, + RIGHT = 12, + SEMICOLON = 18, + START = 13, + STRING_LITERAL = 2, + TOKEN = 14, + TOKEN_PREFIX = 15, - ACCEPT_STATE = 68, - RULE_COUNT = 45, - STATE_COUNT = 69, - TERMINAL_COUNT = 22, - NON_TERMINAL_COUNT = 24, + ACCEPT_STATE = 68, + RULE_COUNT = 45, + STATE_COUNT = 69, + TERMINAL_COUNT = 22, + NON_TERMINAL_COUNT = 24, - GOTO_INDEX_OFFSET = 69, - GOTO_INFO_OFFSET = 76, - GOTO_CHECK_OFFSET = 76 - }; + GOTO_INDEX_OFFSET = 69, + GOTO_INFO_OFFSET = 57, + GOTO_CHECK_OFFSET = 57 + }; - static const char *const spell []; - static const short lhs []; - static const short rhs []; - static const short goto_default []; - static const short action_default []; - static const short action_index []; - static const short action_info []; - static const short action_check []; + static const char *const spell[]; + static const short lhs[]; + static const short rhs[]; + static const short goto_default[]; + static const short action_default[]; + static const short action_index[]; + static const short action_info[]; + static const short action_check[]; - static inline int nt_action (int state, int nt) - { - const int yyn = action_index [GOTO_INDEX_OFFSET + state] + nt; - if (yyn < 0 || action_check [GOTO_CHECK_OFFSET + yyn] != nt) - return goto_default [nt]; + static inline int nt_action (int state, int nt) + { + const int yyn = action_index [GOTO_INDEX_OFFSET + state] + nt; + if (yyn < 0 || action_check [GOTO_CHECK_OFFSET + yyn] != nt) + return goto_default [nt]; - return action_info [GOTO_INFO_OFFSET + yyn]; - } + return action_info [GOTO_INFO_OFFSET + yyn]; + } - static inline int t_action (int state, int token) - { - const int yyn = action_index [state] + token; + static inline int t_action (int state, int token) + { + const int yyn = action_index [state] + token; - if (yyn < 0 || action_check [yyn] != token) - return - action_default [state]; + if (yyn < 0 || action_check [yyn] != token) + return - action_default [state]; - return action_info [yyn]; - } + return action_info [yyn]; + } }; diff --git a/src/tools/qlalr/lalr.g b/src/tools/qlalr/lalr.g index 65a63f8312d..52be7f1bc41 100644 --- a/src/tools/qlalr/lalr.g +++ b/src/tools/qlalr/lalr.g @@ -61,8 +61,7 @@ %start Specification -/: -/**************************************************************************** +/:/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ @@ -163,8 +162,7 @@ protected: }; :/ -/. -/**************************************************************************** +/./**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ @@ -344,7 +342,8 @@ int Recognizer::nextToken() text.clear (); if (! _M_no_lines) - text += QLatin1String ("\n#line ") + QString::number (_M_action_line) + " \"" + _M_input_file + "\"\n"; + text += QLatin1String("\n#line ") + QString::number(_M_action_line) + + QLatin1String(" \"") + _M_input_file + QLatin1String("\"\n"); inp (); // skip ':' forever @@ -381,7 +380,8 @@ int Recognizer::nextToken() text.clear (); if (! _M_no_lines) - text += QLatin1String ("\n#line ") + QString::number (_M_action_line) + " \"" + _M_input_file + "\"\n"; + text += QLatin1String("\n#line ") + QString::number(_M_action_line) + + QLatin1String(" \"") + _M_input_file + QLatin1String("\"\n"); inp (); // skip ':' diff --git a/src/tools/qlalr/recognizer.cpp b/src/tools/qlalr/recognizer.cpp index 69dad1a6c18..453be6f63e8 100644 --- a/src/tools/qlalr/recognizer.cpp +++ b/src/tools/qlalr/recognizer.cpp @@ -178,8 +178,8 @@ int Recognizer::nextToken() text.clear (); if (! _M_no_lines) - text += QLatin1String("\n#line ") + QString::number (_M_action_line) - + QLatin1String(" \"") + _M_input_file + QLatin1String("\"\n"); + text += QLatin1String("\n#line ") + QString::number(_M_action_line) + + QLatin1String(" \"") + _M_input_file + QLatin1String("\"\n"); inp (); // skip ':' forever @@ -216,7 +216,7 @@ int Recognizer::nextToken() text.clear (); if (! _M_no_lines) - text += QLatin1String ("\n#line ") + QString::number (_M_action_line) + + text += QLatin1String("\n#line ") + QString::number(_M_action_line) + QLatin1String(" \"") + _M_input_file + QLatin1String("\"\n"); inp (); // skip ':' From 7fd483f3de5bfb98a816e4d63724476b839effc8 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sat, 25 Feb 2017 11:40:04 -0800 Subject: [PATCH 04/75] QDateTimeParser: Merge the code to parse names of months and weekdays Simplifies everything and avoids bugfixes in one not propagating to the other. Change-Id: I95c9e502ccc74af3bcf0fffd14a69f0cde60cc8c Reviewed-by: Edward Welbourne --- src/corelib/tools/qdatetimeparser.cpp | 138 ++++++++++---------------- 1 file changed, 52 insertions(+), 86 deletions(-) diff --git a/src/corelib/tools/qdatetimeparser.cpp b/src/corelib/tools/qdatetimeparser.cpp index c8aa4fbc898..b90d7d1aea5 100644 --- a/src/corelib/tools/qdatetimeparser.cpp +++ b/src/corelib/tools/qdatetimeparser.cpp @@ -1243,6 +1243,34 @@ end: #endif // QT_NO_DATESTRING #ifndef QT_NO_TEXTDATE + +static int findTextEntry(const QString &text, int start, const QVector &entries, QString *usedText, int *used) +{ + if (text.isEmpty()) + return -1; + + int bestMatch = -1; + int bestCount = 0; + for (int n = start; n <= entries.size(); ++n) { + const QString name = entries.at(n - 1).toLower(); + + const int limit = qMin(text.size(), name.size()); + int i = 0; + while (i < limit && text.at(i) == name.at(i)) + ++i; + if (i > bestCount) { + bestCount = i; + bestMatch = n; + } + } + if (usedText && bestMatch != -1) + *usedText = entries.at(bestMatch - 1); + if (used) + *used = bestCount; + + return bestMatch; +} + /*! \internal finds the first possible monthname that \a str1 can @@ -1252,99 +1280,37 @@ end: int QDateTimeParser::findMonth(const QString &str1, int startMonth, int sectionIndex, QString *usedMonth, int *used) const { - int bestMatch = -1; - int bestCount = 0; - if (!str1.isEmpty()) { - const SectionNode &sn = sectionNode(sectionIndex); - if (sn.type != MonthSection) { - qWarning("QDateTimeParser::findMonth Internal error"); - return -1; - } - - QLocale::FormatType type = sn.count == 3 ? QLocale::ShortFormat : QLocale::LongFormat; - QLocale l = locale(); - - for (int month=startMonth; month<=12; ++month) { - const QString monthName = l.monthName(month, type); - QString str2 = monthName.toLower(); - - if (str1.startsWith(str2)) { - if (used) { - QDTPDEBUG << "used is set to" << str2.size(); - *used = str2.size(); - } - if (usedMonth) - *usedMonth = monthName; - - return month; - } - if (context == FromString) - continue; - - const int limit = qMin(str1.size(), str2.size()); - - QDTPDEBUG << "limit is" << limit << str1 << str2; - bool equal = true; - for (int i=0; i bestCount) { - bestCount = i; - bestMatch = month; - } - break; - } - } - if (equal) { - if (used) - *used = limit; - if (usedMonth) - *usedMonth = monthName; - return month; - } - } - if (usedMonth && bestMatch != -1) - *usedMonth = l.monthName(bestMatch, type); + const SectionNode &sn = sectionNode(sectionIndex); + if (sn.type != MonthSection) { + qWarning("QDateTimeParser::findMonth Internal error"); + return -1; } - if (used) { - QDTPDEBUG << "used is set to" << bestCount; - *used = bestCount; - } - return bestMatch; + + QLocale::FormatType type = sn.count == 3 ? QLocale::ShortFormat : QLocale::LongFormat; + QLocale l = locale(); + QVector monthNames; + monthNames.reserve(12); + for (int month = 1; month <= 12; ++month) + monthNames.append(month >= startMonth ? l.monthName(month, type) : QString()); + + return findTextEntry(str1, startMonth, monthNames, usedMonth, used); } int QDateTimeParser::findDay(const QString &str1, int startDay, int sectionIndex, QString *usedDay, int *used) const { - int bestMatch = -1; - int bestCount = 0; - if (!str1.isEmpty()) { - const SectionNode &sn = sectionNode(sectionIndex); - if (!(sn.type & DaySectionMask)) { - qWarning("QDateTimeParser::findDay Internal error"); - return -1; - } - const QLocale l = locale(); - for (int day=startDay; day<=7; ++day) { - const QString dayName = l.dayName(day, sn.count == 4 ? QLocale::LongFormat : QLocale::ShortFormat); - const QString str2 = dayName.toLower(); - - const int limit = qMin(str1.size(), str2.size()); - int i = 0; - while (i < limit && str1.at(i) == str2.at(i)) - ++i; - if (i > bestCount) { - bestCount = i; - bestMatch = day; - } - } - if (usedDay && bestMatch != -1) { - *usedDay = l.dayName(bestMatch, sn.count == 4 ? QLocale::LongFormat : QLocale::ShortFormat); - } + const SectionNode &sn = sectionNode(sectionIndex); + if (!(sn.type & DaySectionMask)) { + qWarning("QDateTimeParser::findDay Internal error"); + return -1; } - if (used) - *used = bestCount; - return bestMatch; + QLocale::FormatType type = sn.count == 4 ? QLocale::LongFormat : QLocale::ShortFormat; + QLocale l = locale(); + QVector daysOfWeek; + daysOfWeek.reserve(7); + for (int day = 1; day <= 7; ++day) + daysOfWeek.append(day >= startDay ? l.dayName(day, type) : QString()); + return findTextEntry(str1, startDay, daysOfWeek, usedDay, used); } #endif // QT_NO_TEXTDATE From 65bafcc29d3f41f88f6fe0fd876be4c6ac118cd4 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Tue, 21 Feb 2017 10:14:02 +0100 Subject: [PATCH 05/75] Android: Enable the usage of QPrinter Since QPrinter can be used to write to PDF and this was working in previous versions, there is no reason not to enable it here. Task-number: QTBUG-58376 Change-Id: I5760b74881995679e8df657b7d770bba00a33551 Reviewed-by: Paul Olav Tvete --- src/printsupport/configure.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/printsupport/configure.json b/src/printsupport/configure.json index dfef0bcd6c6..58fb0395343 100644 --- a/src/printsupport/configure.json +++ b/src/printsupport/configure.json @@ -41,7 +41,7 @@ "label": "QPrinter", "purpose": "Provides a printer backend of QPainter.", "section": "Painting", - "condition": "!config.android && !config.uikit && !config.winrt && features.picture && features.temporaryfile && features.pdf", + "condition": "!config.uikit && !config.winrt && features.picture && features.temporaryfile && features.pdf", "output": [ "publicFeature", "feature" ] }, "printpreviewwidget": { From 326f1fdb7d6550a529217b226cbef78425d32969 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Tue, 28 Feb 2017 12:03:46 +0100 Subject: [PATCH 06/75] Simplify QDateTimeParser's shiny new findTextEntry() Decouple from the callers' offset into a larger list; just search for an entry in a list, let the caller deal with the offset. Also, defer a .tolower() to save the need to allocate a copy of each list entry. Change-Id: I748d5214c2cc6dc592fe2bd41e3f8150f71c335b Reviewed-by: Thiago Macieira --- src/corelib/tools/qdatetimeparser.cpp | 38 ++++++++++++++++++--------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/src/corelib/tools/qdatetimeparser.cpp b/src/corelib/tools/qdatetimeparser.cpp index b90d7d1aea5..5871587f8cb 100644 --- a/src/corelib/tools/qdatetimeparser.cpp +++ b/src/corelib/tools/qdatetimeparser.cpp @@ -1244,19 +1244,28 @@ end: #ifndef QT_NO_TEXTDATE -static int findTextEntry(const QString &text, int start, const QVector &entries, QString *usedText, int *used) +/* + \internal + \brief Returns the index in \a entries with the best prefix match to \a text + + Scans \a entries looking for an entry overlapping \a text as much as possible. + Records the length of overlap in *used (if \a used is non-NULL) and the first + entry that overlapped this much in *usedText (if \a usedText is non-NULL). + */ +static int findTextEntry(const QString &text, const QVector &entries, QString *usedText, int *used) { if (text.isEmpty()) return -1; int bestMatch = -1; int bestCount = 0; - for (int n = start; n <= entries.size(); ++n) { - const QString name = entries.at(n - 1).toLower(); + for (int n = 0; n < entries.size(); ++n) + { + const QString &name = entries.at(n); const int limit = qMin(text.size(), name.size()); int i = 0; - while (i < limit && text.at(i) == name.at(i)) + while (i < limit && text.at(i) == name.at(i).toLower()) ++i; if (i > bestCount) { bestCount = i; @@ -1264,7 +1273,7 @@ static int findTextEntry(const QString &text, int start, const QVector } } if (usedText && bestMatch != -1) - *usedText = entries.at(bestMatch - 1); + *usedText = entries.at(bestMatch); if (used) *used = bestCount; @@ -1289,11 +1298,12 @@ int QDateTimeParser::findMonth(const QString &str1, int startMonth, int sectionI QLocale::FormatType type = sn.count == 3 ? QLocale::ShortFormat : QLocale::LongFormat; QLocale l = locale(); QVector monthNames; - monthNames.reserve(12); - for (int month = 1; month <= 12; ++month) - monthNames.append(month >= startMonth ? l.monthName(month, type) : QString()); + monthNames.reserve(13 - startMonth); + for (int month = startMonth; month <= 12; ++month) + monthNames.append(l.monthName(month, type)); - return findTextEntry(str1, startMonth, monthNames, usedMonth, used); + const int index = findTextEntry(str1, monthNames, usedMonth, used); + return index < 0 ? index : index + startMonth; } int QDateTimeParser::findDay(const QString &str1, int startDay, int sectionIndex, QString *usedDay, int *used) const @@ -1307,10 +1317,12 @@ int QDateTimeParser::findDay(const QString &str1, int startDay, int sectionIndex QLocale::FormatType type = sn.count == 4 ? QLocale::LongFormat : QLocale::ShortFormat; QLocale l = locale(); QVector daysOfWeek; - daysOfWeek.reserve(7); - for (int day = 1; day <= 7; ++day) - daysOfWeek.append(day >= startDay ? l.dayName(day, type) : QString()); - return findTextEntry(str1, startDay, daysOfWeek, usedDay, used); + daysOfWeek.reserve(8 - startDay); + for (int day = startDay; day <= 7; ++day) + daysOfWeek.append(l.dayName(day, type)); + + const int index = findTextEntry(str1, daysOfWeek, usedDay, used); + return index < 0 ? index : index + startDay; } #endif // QT_NO_TEXTDATE From 9ed389bf15787266c207435d712b9e225db07ad9 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Tue, 28 Feb 2017 12:03:46 +0100 Subject: [PATCH 07/75] Bugfix in QDateTimeParser's findTextEntry() If a later month-or-day were to have a name that's a prefix of an earlier one's name, the code would have selected the longer name as best match when the text matched is the shorter name, simply because it found that one first. (Found, on Turkish Cuma(rtesi)? in Thiago's recent new test, by reversing the loop that iterated the list.) Make an exact match win and a match of a full name beat any prefix match of the same length. Change-Id: I8d954b83ccc25e4f47af2e558036d714685cef5e Reviewed-by: Thiago Macieira --- src/corelib/tools/qdatetimeparser.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/corelib/tools/qdatetimeparser.cpp b/src/corelib/tools/qdatetimeparser.cpp index 5871587f8cb..62dd25e072d 100644 --- a/src/corelib/tools/qdatetimeparser.cpp +++ b/src/corelib/tools/qdatetimeparser.cpp @@ -1248,9 +1248,12 @@ end: \internal \brief Returns the index in \a entries with the best prefix match to \a text - Scans \a entries looking for an entry overlapping \a text as much as possible. - Records the length of overlap in *used (if \a used is non-NULL) and the first - entry that overlapped this much in *usedText (if \a usedText is non-NULL). + Scans \a entries looking for an entry overlapping \a text as much as possible + (an exact match beats any prefix match; a match of the full entry as prefix of + text beats any entry but one matching a longer prefix; otherwise, the match of + longest prefix wins, earlier entries beating later on a draw). Records the + length of overlap in *used (if \a used is non-NULL) and the first entry that + overlapped this much in *usedText (if \a usedText is non-NULL). */ static int findTextEntry(const QString &text, const QVector &entries, QString *usedText, int *used) { @@ -1267,9 +1270,12 @@ static int findTextEntry(const QString &text, const QVector &entries, Q int i = 0; while (i < limit && text.at(i) == name.at(i).toLower()) ++i; - if (i > bestCount) { + // Full match beats an equal prefix match: + if (i > bestCount || (i == bestCount && i == name.size())) { bestCount = i; bestMatch = n; + if (i == name.size() && i == text.size()) + break; // Exact match, name == text, wins. } } if (usedText && bestMatch != -1) From 5cc0de2e084cb887a75b076b82cf470ecdcd4dd3 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 26 May 2016 08:30:26 +0200 Subject: [PATCH 08/75] QAtomic: pass explicit failure memory order to std::atomic::compare_exchange_strong MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GCC 4.8 seems to get the failure memory order wrong when using the overload that only accepts one memory order and produces errors such as: bits/atomic_base.h:577:70: error: failure memory model cannot be stronger than success memory model for '__atomic_compare_exchange' return __atomic_compare_exchange_n(&_M_i, &__i1, __i2, 0, __m1, __m2); ^ (as seen on Android). Fix by explicitly passing the failure orders corresponding to the success orders, as specified by the standard: relaxed → relaxed release → relaxed acquire → acquire acq_rel → acquire (cf. http://en.cppreference.com/w/cpp/atomic/atomic/compare_exchange). Task-number: QTBUG-59399 Change-Id: If046e735888cf331d2d6506d8d5ca9aa7402f9ad Reviewed-by: David Faure Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/corelib/arch/qatomic_cxx11.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/corelib/arch/qatomic_cxx11.h b/src/corelib/arch/qatomic_cxx11.h index 63b23b71aba..484ec73e7f4 100644 --- a/src/corelib/arch/qatomic_cxx11.h +++ b/src/corelib/arch/qatomic_cxx11.h @@ -278,7 +278,7 @@ template struct QAtomicOps template static bool testAndSetRelaxed(std::atomic &_q_value, T expectedValue, T newValue, T *currentValue = Q_NULLPTR) Q_DECL_NOTHROW { - bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_relaxed); + bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_relaxed, std::memory_order_relaxed); if (currentValue) *currentValue = expectedValue; return tmp; @@ -287,7 +287,7 @@ template struct QAtomicOps template static bool testAndSetAcquire(std::atomic &_q_value, T expectedValue, T newValue, T *currentValue = Q_NULLPTR) Q_DECL_NOTHROW { - bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_acquire); + bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_acquire, std::memory_order_acquire); if (currentValue) *currentValue = expectedValue; return tmp; @@ -296,7 +296,7 @@ template struct QAtomicOps template static bool testAndSetRelease(std::atomic &_q_value, T expectedValue, T newValue, T *currentValue = Q_NULLPTR) Q_DECL_NOTHROW { - bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_release); + bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_release, std::memory_order_relaxed); if (currentValue) *currentValue = expectedValue; return tmp; @@ -305,7 +305,7 @@ template struct QAtomicOps template static bool testAndSetOrdered(std::atomic &_q_value, T expectedValue, T newValue, T *currentValue = Q_NULLPTR) Q_DECL_NOTHROW { - bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_acq_rel); + bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_acq_rel, std::memory_order_acquire); if (currentValue) *currentValue = expectedValue; return tmp; From 137e6632c89a04c7785a005752e8a21b60678705 Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Wed, 8 Mar 2017 16:01:52 +0100 Subject: [PATCH 09/75] qlalr: Use forward slashes in #include directives Makes sure we don't use backslashes on Windows systems, which could lead to the following warnings being emitted: In file included from main.cpp:43:0: repparser.h:2:10: warning: unknown escape sequence: '\.' #line 57 "..\..\src\repparser\parser.g" caused by lines like #line 57 "..\..\src\\repparser\parser.g" Change-Id: I6cfe0e39a2a58eb39f9d385ece30374bcfa09e05 Reviewed-by: Edward Welbourne Reviewed-by: Brett Stottlemyer Reviewed-by: Marc Mutz Reviewed-by: Oswald Buddenhagen --- src/tools/qlalr/lalr.g | 6 ++++-- src/tools/qlalr/recognizer.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/tools/qlalr/lalr.g b/src/tools/qlalr/lalr.g index 52be7f1bc41..5e335c5a3b6 100644 --- a/src/tools/qlalr/lalr.g +++ b/src/tools/qlalr/lalr.g @@ -192,6 +192,8 @@ protected: #include "recognizer.h" +#include + #include #include #include @@ -343,7 +345,7 @@ int Recognizer::nextToken() text.clear (); if (! _M_no_lines) text += QLatin1String("\n#line ") + QString::number(_M_action_line) + - QLatin1String(" \"") + _M_input_file + QLatin1String("\"\n"); + QLatin1String(" \"") + QDir::fromNativeSeparators(_M_input_file) + QLatin1String("\"\n"); inp (); // skip ':' forever @@ -381,7 +383,7 @@ int Recognizer::nextToken() text.clear (); if (! _M_no_lines) text += QLatin1String("\n#line ") + QString::number(_M_action_line) + - QLatin1String(" \"") + _M_input_file + QLatin1String("\"\n"); + QLatin1String(" \"") + QDir::fromNativeSeparators(_M_input_file) + QLatin1String("\"\n"); inp (); // skip ':' diff --git a/src/tools/qlalr/recognizer.cpp b/src/tools/qlalr/recognizer.cpp index 453be6f63e8..8c7665f1b93 100644 --- a/src/tools/qlalr/recognizer.cpp +++ b/src/tools/qlalr/recognizer.cpp @@ -28,6 +28,8 @@ #include "recognizer.h" +#include + #include #include #include @@ -179,7 +181,7 @@ int Recognizer::nextToken() text.clear (); if (! _M_no_lines) text += QLatin1String("\n#line ") + QString::number(_M_action_line) + - QLatin1String(" \"") + _M_input_file + QLatin1String("\"\n"); + QLatin1String(" \"") + QDir::fromNativeSeparators(_M_input_file) + QLatin1String("\"\n"); inp (); // skip ':' forever @@ -217,7 +219,7 @@ int Recognizer::nextToken() text.clear (); if (! _M_no_lines) text += QLatin1String("\n#line ") + QString::number(_M_action_line) + - QLatin1String(" \"") + _M_input_file + QLatin1String("\"\n"); + QLatin1String(" \"") + QDir::fromNativeSeparators(_M_input_file) + QLatin1String("\"\n"); inp (); // skip ':' From b52b509ae48125ce9ba3cb50560e2e9ff81b485e Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 27 Feb 2017 14:03:15 +0100 Subject: [PATCH 10/75] QLockFile: Don't deadlock if the lock file has a mtime in the future Stale Lock files in the future can happen in some situations. For exemple two computers with different clocks access the same file system. It could be that one of the timestamp is totaly off (several years into the future). [ChangeLog][QtCore][QLockFile] Fixed a deadlock occurring if a corrupted lock file's modification time is in the future. Change-Id: I8dac98a0e898c76bcef67f8c195e126c996b6add Reviewed-by: David Faure --- src/corelib/io/qlockfile.cpp | 3 ++ src/corelib/io/qlockfile_unix.cpp | 2 +- src/corelib/io/qlockfile_win.cpp | 2 +- .../corelib/io/qlockfile/tst_qlockfile.cpp | 28 +++++++++++++++++++ 4 files changed, 33 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qlockfile.cpp b/src/corelib/io/qlockfile.cpp index cb1ff93ad34..48317d07e0c 100644 --- a/src/corelib/io/qlockfile.cpp +++ b/src/corelib/io/qlockfile.cpp @@ -44,6 +44,7 @@ #include #include #include +#include QT_BEGIN_NAMESPACE @@ -226,6 +227,8 @@ bool QLockFile::tryLock(int timeout) return false; case LockFailedError: if (!d->isLocked && d->isApparentlyStale()) { + if (Q_UNLIKELY(QFileInfo(d->fileName).lastModified() > QDateTime::currentDateTime())) + qInfo("QLockFile: Lock file '%ls' has a modification time in the future", qUtf16Printable(d->fileName)); // Stale lock from another thread/process // Ensure two processes don't remove it at the same time QLockFile rmlock(d->fileName + QLatin1String(".rmlock")); diff --git a/src/corelib/io/qlockfile_unix.cpp b/src/corelib/io/qlockfile_unix.cpp index 3a80014c004..5a02741727d 100644 --- a/src/corelib/io/qlockfile_unix.cpp +++ b/src/corelib/io/qlockfile_unix.cpp @@ -247,7 +247,7 @@ bool QLockFilePrivate::isApparentlyStale() const } } const qint64 age = QFileInfo(fileName).lastModified().msecsTo(QDateTime::currentDateTime()); - return staleLockTime > 0 && age > staleLockTime; + return staleLockTime > 0 && qAbs(age) > staleLockTime; } QString QLockFilePrivate::processNameByPid(qint64 pid) diff --git a/src/corelib/io/qlockfile_win.cpp b/src/corelib/io/qlockfile_win.cpp index baaff8da17d..4b431816861 100644 --- a/src/corelib/io/qlockfile_win.cpp +++ b/src/corelib/io/qlockfile_win.cpp @@ -160,7 +160,7 @@ bool QLockFilePrivate::isApparentlyStale() const Q_UNUSED(appname); #endif // Q_OS_WINRT const qint64 age = QFileInfo(fileName).lastModified().msecsTo(QDateTime::currentDateTime()); - return staleLockTime > 0 && age > staleLockTime; + return staleLockTime > 0 && qAbs(age) > staleLockTime; } QString QLockFilePrivate::processNameByPid(qint64 pid) diff --git a/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp b/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp index a13ff0358af..d2f345feb5e 100644 --- a/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp +++ b/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp @@ -34,6 +34,7 @@ #include #if defined(Q_OS_UNIX) && !defined(Q_OS_VXWORKS) #include +#include #elif defined(Q_OS_WIN) && !defined(Q_OS_WINRT) # include #endif @@ -59,6 +60,7 @@ private slots: void noPermissions(); void noPermissionsWindows(); void corruptedLockFile(); + void corruptedLockFileInTheFuture(); private: static bool overwritePidInLockFile(const QString &filePath, qint64 pid); @@ -521,6 +523,32 @@ void tst_QLockFile::corruptedLockFile() QCOMPARE(int(secondLock.error()), int(QLockFile::NoError)); } +void tst_QLockFile::corruptedLockFileInTheFuture() +{ +#if !defined(Q_OS_UNIX) + QSKIP("This tests needs utimes"); +#else + // This test is the same as the previous one, but the corruption was so there is a corrupted + // .rmlock whose timestamp is in the future + + const QString fileName = dir.path() + "/corruptedLockFile.rmlock"; + + { + QFile file(fileName); + QVERIFY(file.open(QFile::WriteOnly)); + } + + struct timeval times[2]; + gettimeofday(times, 0); + times[1].tv_sec = (times[0].tv_sec += 600); + times[1].tv_usec = times[0].tv_usec; + utimes(fileName.toLocal8Bit(), times); + + QTest::ignoreMessage(QtInfoMsg, "QLockFile: Lock file '" + fileName.toUtf8() + "' has a modification time in the future"); + corruptedLockFile(); +#endif +} + bool tst_QLockFile::overwritePidInLockFile(const QString &filePath, qint64 pid) { QFile f(filePath); From c0da37a806dc0457636d787331e9f50778ee8b3e Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Thu, 9 Mar 2017 10:47:04 -0800 Subject: [PATCH 11/75] Fix QStandardPaths values on Apple Platforms containing URL encoding This corrects an issue where the file system paths returned for some QStandardPaths values on Apple Platforms would be URL encoded, for example having %20 instead of an actual space character. Task-number: QTBUG-59389 Change-Id: I771a44eb20b756842c324ac6fc9bdc475ce84826 Reviewed-by: David Faure Reviewed-by: Timur Pocheptsov Reviewed-by: Gabriel de Dietrich --- src/corelib/io/qstandardpaths_mac.mm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qstandardpaths_mac.mm b/src/corelib/io/qstandardpaths_mac.mm index a293d4862f3..e25339a7d10 100644 --- a/src/corelib/io/qstandardpaths_mac.mm +++ b/src/corelib/io/qstandardpaths_mac.mm @@ -204,13 +204,14 @@ QStringList QStandardPaths::standardLocations(StandardLocation type) CFBundleRef mainBundle = CFBundleGetMainBundle(); if (mainBundle) { CFURLRef bundleUrl = CFBundleCopyBundleURL(mainBundle); - CFStringRef cfBundlePath = CFURLCopyPath(bundleUrl); + CFStringRef cfBundlePath = CFURLCopyFileSystemPath(bundleUrl, kCFURLPOSIXPathStyle); QString bundlePath = QString::fromCFString(cfBundlePath); CFRelease(cfBundlePath); CFRelease(bundleUrl); CFURLRef resourcesUrl = CFBundleCopyResourcesDirectoryURL(mainBundle); - CFStringRef cfResourcesPath = CFURLCopyPath(resourcesUrl); + CFStringRef cfResourcesPath = CFURLCopyFileSystemPath(resourcesUrl, + kCFURLPOSIXPathStyle); QString resourcesPath = QString::fromCFString(cfResourcesPath); CFRelease(cfResourcesPath); CFRelease(resourcesUrl); From edf0be818cde51fcd47295171c65efd82b67ba65 Mon Sep 17 00:00:00 2001 From: Samuli Piippo Date: Thu, 9 Mar 2017 10:40:50 +0200 Subject: [PATCH 12/75] Use lowercase name for iphlpapi library Cross-compilation on linux with mingw-w64 failed, since it provides all libraries in lowercase name. Change-Id: I8e82a4504d4ec9d3047af6b1d6a11945754f182d Reviewed-by: Oliver Wolff --- src/plugins/bearer/generic/generic.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/bearer/generic/generic.pro b/src/plugins/bearer/generic/generic.pro index 02b3e96bfaf..f30bdc4951e 100644 --- a/src/plugins/bearer/generic/generic.pro +++ b/src/plugins/bearer/generic/generic.pro @@ -12,7 +12,7 @@ SOURCES += qgenericengine.cpp \ OTHER_FILES += generic.json -win32:!winrt:LIBS += -lIphlpapi +win32:!winrt:LIBS += -liphlpapi PLUGIN_TYPE = bearer PLUGIN_CLASS_NAME = QGenericEnginePlugin From 4f324d4655a093b406134624ff753eb518429b83 Mon Sep 17 00:00:00 2001 From: Dan Cape Date: Tue, 29 Sep 2015 09:54:24 -0400 Subject: [PATCH 13/75] Fix item keeping hover highlight even when mouse has left it Made change to clear the hover index when the mouse leaves the widget. This will ensure the component does not think the item still has the mouse over it. Task-number: QTBUG-46785 Change-Id: I34b7f0e171e9cf07ca23150af1b0e6e59a10a58a Reviewed-by: David Faure --- src/widgets/itemviews/qabstractitemview.cpp | 1 + .../tst_qabstractitemview.cpp | 53 +++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp index 6ecf5a664f7..319cc86c18e 100644 --- a/src/widgets/itemviews/qabstractitemview.cpp +++ b/src/widgets/itemviews/qabstractitemview.cpp @@ -1703,6 +1703,7 @@ bool QAbstractItemView::viewportEvent(QEvent *event) d->viewportEnteredNeeded = true; break; case QEvent::Leave: + d->setHoverIndex(QModelIndex()); // If we've left, no hover should be needed anymore #ifndef QT_NO_STATUSTIP if (d->shouldClearStatusTip && d->parent) { QString empty; diff --git a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp index d241296a6bc..f2cf78e8ac1 100644 --- a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp +++ b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -151,6 +152,7 @@ private slots: void testSelectionModelInSyncWithView(); void testClickToSelect(); void testDialogAsEditor(); + void QTBUG46785_mouseout_hover_state(); }; class MyAbstractItemDelegate : public QAbstractItemDelegate @@ -2213,5 +2215,56 @@ void tst_QAbstractItemView::testDialogAsEditor() QCOMPARE(delegate.result, QDialog::Accepted); } +class HoverItemDelegate : public QItemDelegate +{ +public: + HoverItemDelegate() + : QItemDelegate() + , m_paintedWithoutHover(false) + { } + + void paint(QPainter *painter, const QStyleOptionViewItem &opt, const QModelIndex &index) const override + { + Q_UNUSED(painter); + + if (!(opt.state & QStyle::State_MouseOver)) { + + // We don't want to set m_paintedWithoutHover for any item so check for the item at 0,0 + if (index.row() == 0 && index.column() == 0) { + m_paintedWithoutHover = true; + } + } + } + + mutable bool m_paintedWithoutHover; +}; + +void tst_QAbstractItemView::QTBUG46785_mouseout_hover_state() +{ + HoverItemDelegate delegate; + + QTableWidget table(5, 5); + table.verticalHeader()->hide(); + table.horizontalHeader()->hide(); + table.setMouseTracking(true); + table.setItemDelegate(&delegate); + centerOnScreen(&table); + table.show(); + QVERIFY(QTest::qWaitForWindowActive(&table)); + + QModelIndex item = table.model()->index(0, 0); + QRect itemRect = table.visualRect(item); + + // Move the mouse into the center of the item at 0,0 to cause a paint event to occur + QTest::mouseMove(table.viewport(), itemRect.center()); + QTest::mouseClick(table.viewport(), Qt::LeftButton, 0, itemRect.center()); + + delegate.m_paintedWithoutHover = false; + + QTest::mouseMove(table.viewport(), QPoint(-50, 0)); + + QTRY_VERIFY(delegate.m_paintedWithoutHover); +} + QTEST_MAIN(tst_QAbstractItemView) #include "tst_qabstractitemview.moc" From c75e3f70b4c246c0e11c9e1dc6737fce7e1aecb3 Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Mon, 13 Mar 2017 16:40:55 +0100 Subject: [PATCH 14/75] xcb: cleanup QXcbWindow::relayFocusToModalWindow() - recursion is not needed for walking up the parent chain; - use camel-case, modal_window -> modalWindow; Change-Id: I4b7697f2388fd16f11be67ba475bd63ad249d89e Reviewed-by: Shawn Rutledge --- src/plugins/platforms/xcb/qxcbwindow.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 78d000c7742..15ca68c663a 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -918,19 +918,17 @@ void QXcbWindow::hide() } } -static QWindow *tlWindow(QWindow *window) -{ - if (window && window->parent()) - return tlWindow(window->parent()); - return window; -} - bool QXcbWindow::relayFocusToModalWindow() const { - QWindow *w = tlWindow(static_cast(QObjectPrivate::get(window()))->eventReceiver()); - QWindow *modal_window = 0; - if (QGuiApplicationPrivate::instance()->isWindowBlocked(w,&modal_window) && modal_window != w) { - modal_window->requestActivate(); + QWindow *w = static_cast(QObjectPrivate::get(window()))->eventReceiver(); + // get top-level window + while (w && w->parent()) + w = w->parent(); + + QWindow *modalWindow = 0; + const bool blocked = QGuiApplicationPrivate::instance()->isWindowBlocked(w, &modalWindow); + if (blocked && modalWindow != w) { + modalWindow->requestActivate(); connection()->flush(); return true; } From e364384d9f91e57ad6116d549f3748d165b77ea2 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 14 Mar 2017 11:01:37 +0100 Subject: [PATCH 15/75] QChar: fix docs of (uchar) ctor The constructor is not only disabled under QT_NO_CAST_FROM_ASCII, but also under QT_RESTRICTED_CAST_FROM_ASCII. Change-Id: I7bbaf2891913d5256dff7f80c49075ea3326155a Reviewed-by: Edward Welbourne Reviewed-by: Thiago Macieira --- src/corelib/tools/qchar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/tools/qchar.cpp b/src/corelib/tools/qchar.cpp index 287861eee87..5f918aab0fa 100644 --- a/src/corelib/tools/qchar.cpp +++ b/src/corelib/tools/qchar.cpp @@ -624,9 +624,9 @@ QT_BEGIN_NAMESPACE Constructs a QChar corresponding to ASCII/Latin-1 character \a ch. \note This constructor is not available when \c QT_NO_CAST_FROM_ASCII - is defined. + or QT_RESTRICTED_CAST_FROM_ASCII is defined. - \sa QT_NO_CAST_FROM_ASCII + \sa QT_NO_CAST_FROM_ASCII, QT_RESTRICTED_CAST_FROM_ASCII */ /*! From 5cda0172e0eb912ef4814f3c5618686cbb1a5da1 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 16 Mar 2017 10:04:01 +0100 Subject: [PATCH 16/75] Fix crash in QWindowPrivate::applyCursor when screen is null QWindow::setVisible calls QWindowPrivate::applyCursor without checking if screen() returns null. This patch adds a check in QWindowPrivate::applyCursor that the screen is not null. Now that it is tested there, no need to test it from the other caller (setCursor) This patch should not change behavior of setCursor at all, it should only fix the crash when coming from setVisible Task-number: QTBUG-59528 Change-Id: I06bbdb4e04c02ac840ba637242d1f2cfde5bdd62 Reviewed-by: Friedemann Kleint --- src/gui/kernel/qwindow.cpp | 17 ++++++++++------- src/gui/kernel/qwindow_p.h | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index 94a34b5c271..7ab2d31b869 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -2559,26 +2559,29 @@ void QWindowPrivate::setCursor(const QCursor *newCursor) cursor = QCursor(Qt::ArrowCursor); hasCursor = false; } - // Only attempt to set cursor and emit signal if there is an actual platform cursor - QScreen* screen = q->screen(); - if (screen && screen->handle()->cursor()) { - applyCursor(); + // Only attempt to emit signal if there is an actual platform cursor + if (applyCursor()) { QEvent event(QEvent::CursorChange); QGuiApplication::sendEvent(q, &event); } } -void QWindowPrivate::applyCursor() +// Apply the cursor and returns true iff the platform cursor exists +bool QWindowPrivate::applyCursor() { Q_Q(QWindow); - if (platformWindow) { - if (QPlatformCursor *platformCursor = q->screen()->handle()->cursor()) { + if (QScreen *screen = q->screen()) { + if (QPlatformCursor *platformCursor = screen->handle()->cursor()) { + if (!platformWindow) + return true; QCursor *c = QGuiApplication::overrideCursor(); if (!c && hasCursor) c = &cursor; platformCursor->changeCursor(c, q); + return true; } } + return false; } #endif // QT_NO_CURSOR diff --git a/src/gui/kernel/qwindow_p.h b/src/gui/kernel/qwindow_p.h index b8a9f5d3de6..c1955be6b65 100644 --- a/src/gui/kernel/qwindow_p.h +++ b/src/gui/kernel/qwindow_p.h @@ -118,7 +118,7 @@ public: void maybeQuitOnLastWindowClosed(); #ifndef QT_NO_CURSOR void setCursor(const QCursor *c = 0); - void applyCursor(); + bool applyCursor(); #endif void deliverUpdateRequest(); From b21069d6fa74273afbdab9af3a6ac89038e4a2b8 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Mon, 13 Feb 2017 12:02:29 +0400 Subject: [PATCH 17/75] Android: Fix Accessibility items positioning with QHighDpi enabled the View's position and metrics are in pixels, not points Change-Id: I285d5378db98187f54019bff9b8a1cde05dc3b35 Reviewed-by: BogDan Vatra --- .../platforms/android/androidjniaccessibility.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/plugins/platforms/android/androidjniaccessibility.cpp b/src/plugins/platforms/android/androidjniaccessibility.cpp index 3b1ce6d21db..eeaecd53b41 100644 --- a/src/plugins/platforms/android/androidjniaccessibility.cpp +++ b/src/plugins/platforms/android/androidjniaccessibility.cpp @@ -49,6 +49,7 @@ #include #include #include +#include #include "qdebug.h" @@ -137,7 +138,7 @@ namespace QtAndroidAccessibility QRect rect; QAccessibleInterface *iface = interfaceFromId(objectId); if (iface && iface->isValid()) { - rect = iface->rect(); + rect = QHighDpi::toNativePixels(iface->rect(), iface->window()); } jclass rectClass = env->FindClass("android/graphics/Rect"); @@ -150,11 +151,13 @@ namespace QtAndroidAccessibility { QAccessibleInterface *root = interfaceFromId(-1); if (root) { - QAccessibleInterface *child = root->childAt((int)x, (int)y); + QPoint pos = QHighDpi::fromNativePixels(QPoint(int(x), int(y)), root->window()); + + QAccessibleInterface *child = root->childAt(pos.x(), pos.y()); QAccessibleInterface *lastChild = 0; while (child && (child != lastChild)) { lastChild = child; - child = child->childAt((int)x, (int)y); + child = child->childAt(pos.x(), pos.y()); } if (lastChild) return QAccessible::uniqueId(lastChild); From f418d1b26a1f8e3e9d3a81017fee5c60fad5669f Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 8 Mar 2017 13:13:12 +0100 Subject: [PATCH 18/75] Remove a Q_GLOBAL_STATIC with QMutex in favor of QBasicAtomicInt Much simpler, no memory allocation, no locking. Change-Id: Iae839f6a131a4f0784bffffd14a9e70c7b62d9a7 Reviewed-by: Olivier Goffart (Woboq GmbH) Reviewed-by: Marc Mutz --- src/plugins/sqldrivers/psql/qsql_psql.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/plugins/sqldrivers/psql/qsql_psql.cpp b/src/plugins/sqldrivers/psql/qsql_psql.cpp index 968b71a27d3..7fa1ff7da56 100644 --- a/src/plugins/sqldrivers/psql/qsql_psql.cpp +++ b/src/plugins/sqldrivers/psql/qsql_psql.cpp @@ -50,7 +50,6 @@ #include #include #include -#include #include #include @@ -618,13 +617,10 @@ static QString qCreateParamString(const QVector &boundValues, const QS return params; } -Q_GLOBAL_STATIC(QMutex, qMutex) QString qMakePreparedStmtId() { - qMutex()->lock(); - static unsigned int qPreparedStmtCount = 0; - QString id = QLatin1String("qpsqlpstmt_") + QString::number(++qPreparedStmtCount, 16); - qMutex()->unlock(); + static QBasicAtomicInt qPreparedStmtCount = Q_BASIC_ATOMIC_INITIALIZER(0); + QString id = QLatin1String("qpsqlpstmt_") + QString::number(qPreparedStmtCount.fetchAndAddRelaxed(1) + 1, 16); return id; } From e9a7739e77f79baeb5452189b6d17e63de5b341d Mon Sep 17 00:00:00 2001 From: Peter Seiderer Date: Fri, 10 Mar 2017 22:23:06 +0100 Subject: [PATCH 19/75] eglfs: fix x11 header related compile failure Add egl config and QT_EGL_NO_X11 define (as all other eglfs project files do). Task-number: QTBUG-59427 Change-Id: Ifbb11eae0fdf0e58c0b7feecb9a7914a889c8f77 Reviewed-by: Oswald Buddenhagen Reviewed-by: Laszlo Agocs --- src/plugins/platforms/eglfs/eglfs-plugin.pro | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/platforms/eglfs/eglfs-plugin.pro b/src/plugins/platforms/eglfs/eglfs-plugin.pro index cf4863975af..ec229796e54 100644 --- a/src/plugins/platforms/eglfs/eglfs-plugin.pro +++ b/src/plugins/platforms/eglfs/eglfs-plugin.pro @@ -2,6 +2,11 @@ TARGET = qeglfs QT += eglfsdeviceintegration-private +CONFIG += egl + +# Avoid X11 header collision, use generic EGL native types +DEFINES += QT_EGL_NO_X11 + SOURCES += $$PWD/qeglfsmain.cpp OTHER_FILES += $$PWD/eglfs.json From dfb6850b916271333d2bf1b244f5f3dc8a89fcb1 Mon Sep 17 00:00:00 2001 From: Daiwei Li Date: Tue, 15 Sep 2015 20:06:08 -0700 Subject: [PATCH 20/75] Android: Bearer jar shouldn't be a dependency if disabled Task-number: QTBUG-59264 Change-Id: I960d5bff902b06ca5dda447fd60002a756a11e51 Reviewed-by: Lars Knoll --- src/network/network.pro | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/network/network.pro b/src/network/network.pro index 75105bd681c..98fbf822753 100644 --- a/src/network/network.pro +++ b/src/network/network.pro @@ -22,16 +22,18 @@ include(ssl/ssl.pri) QMAKE_LIBS += $$QMAKE_LIBS_NETWORK -ANDROID_BUNDLED_JAR_DEPENDENCIES = \ - jar/QtAndroidBearer-bundled.jar -ANDROID_JAR_DEPENDENCIES = \ - jar/QtAndroidBearer.jar -ANDROID_LIB_DEPENDENCIES = \ - plugins/bearer/libqandroidbearer.so -MODULE_PLUGIN_TYPES = \ - bearer -ANDROID_PERMISSIONS += \ - android.permission.ACCESS_NETWORK_STATE +qtConfig(bearermanagement) { + ANDROID_BUNDLED_JAR_DEPENDENCIES = \ + jar/QtAndroidBearer-bundled.jar + ANDROID_JAR_DEPENDENCIES = \ + jar/QtAndroidBearer.jar + ANDROID_LIB_DEPENDENCIES = \ + plugins/bearer/libqandroidbearer.so + MODULE_PLUGIN_TYPES = \ + bearer + ANDROID_PERMISSIONS += \ + android.permission.ACCESS_NETWORK_STATE +} MODULE_WINRT_CAPABILITIES = \ internetClient \ From 1b73d1397555b99385c03eba8b5e6347b49d27f9 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 17 Mar 2017 21:09:52 +0100 Subject: [PATCH 21/75] tst_QMimeDatabase: increase update-mime-database timeout to 4mins in the vain hope to get the CI unstuck again. Change-Id: I1b01bb1d59a8850f68d1d80838f5606f4159bcbd Reviewed-by: Rafael Roquetto --- .../auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp index 02ba987ccda..280e3f77a42 100644 --- a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp +++ b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp @@ -861,7 +861,7 @@ void tst_QMimeDatabase::fromThreads() #if QT_CONFIG(process) enum { - UpdateMimeDatabaseTimeout = 120 * 1000 // 2min + UpdateMimeDatabaseTimeout = 4 * 60 * 1000 // 4min }; static bool runUpdateMimeDatabase(const QString &path) // TODO make it a QMimeDatabase method? From cdaea1696416bb2c6e1c12519c5d9d6b8bec1969 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 15 Mar 2017 18:58:27 -0700 Subject: [PATCH 22/75] Protect better against timer ID replacement Timer IDs have been reused since Qt 4.5 or thereabouts, so just checking if the timer ID is in the timer dictionary is an incorrect check: our timer may have been deleted and replaced by another with the same ID. Instead of deleting the WinTimerInfo object, let's just mark it as unregistered by setting timerId to -1 and cooperate in deleting at the appropriate places. Since unregisterTimer skips deleting if inTimerEvent is true, the appropriate places are everywhere that set inTimerEvent to true. Change-Id: I057e93314e41372ae7a5ff93c467767c8a6d92ea Reviewed-by: Friedemann Kleint Reviewed-by: Oliver Wolff Reviewed-by: Joerg Bornemann --- src/corelib/kernel/qeventdispatcher_win.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp index 88dbe8e4f7f..fd9d41647db 100644 --- a/src/corelib/kernel/qeventdispatcher_win.cpp +++ b/src/corelib/kernel/qeventdispatcher_win.cpp @@ -406,7 +406,9 @@ void QEventDispatcherWin32Private::unregisterTimer(WinTimerInfo *t) } else if (internalHwnd) { KillTimer(internalHwnd, t->timerId); } - delete t; + t->timerId = -1; + if (!t->inTimerEvent) + delete t; } void QEventDispatcherWin32Private::sendTimerEvent(int timerId) @@ -423,8 +425,9 @@ void QEventDispatcherWin32Private::sendTimerEvent(int timerId) QCoreApplication::sendEvent(t->obj, &e); // timer could have been removed - t = timerDict.value(timerId); - if (t) { + if (t->timerId == -1) { + delete t; + } else { t->inTimerEvent = false; } } @@ -1012,8 +1015,10 @@ bool QEventDispatcherWin32::event(QEvent *e) QTimerEvent te(zte->timerId()); QCoreApplication::sendEvent(t->obj, &te); - t = d->timerDict.value(zte->timerId()); - if (t) { + // timer could have been removed + if (t->timerId == -1) { + delete t; + } else { if (t->interval == 0 && t->inTimerEvent) { // post the next zero timer event as long as the timer was not restarted QCoreApplication::postEvent(this, new QZeroTimerEvent(zte->timerId())); From 4ee74257940e2ed21b653b986ad02a746e8438a6 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 16 Mar 2017 21:36:17 -0700 Subject: [PATCH 23/75] Work around Linux libc overflow in mmap64 The mmap64 functions in all Linux libc fail to properly check that the value fits in the system call parameter. I guess the developers just said "16 PB are enough for everyone"... Change-Id: Ic39b2c4fd9c84522a8fafffd14ac91567ce09c09 Reviewed-by: Sami Nurmenniemi Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/corelib/io/qfsfileengine_unix.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp index bf2f47d3997..f8e31ed92b1 100644 --- a/src/corelib/io/qfsfileengine_unix.cpp +++ b/src/corelib/io/qfsfileengine_unix.cpp @@ -688,6 +688,19 @@ QDateTime QFSFileEngine::fileTime(FileTime time) const uchar *QFSFileEnginePrivate::map(qint64 offset, qint64 size, QFile::MemoryMapFlags flags) { +#if (defined(Q_OS_LINUX) || defined(Q_OS_ANDROID)) && Q_PROCESSOR_WORDSIZE == 4 + // The Linux mmap2 system call on 32-bit takes a page-shifted 32-bit + // integer so the maximum offset is 1 << (32+12) (the shift is always 12, + // regardless of the actual page size). Unfortunately, the mmap64() + // function is known to be broken in all Linux libcs (glibc, uclibc, musl + // and Bionic): all of them do the right shift, but don't confirm that the + // result fits into the 32-bit parameter to the kernel. + + static qint64 MaxFileOffset = (Q_INT64_C(1) << (32+12)) - 1; +#else + static qint64 MaxFileOffset = std::numeric_limits::max(); +#endif + Q_Q(QFSFileEngine); Q_UNUSED(flags); if (openMode == QIODevice::NotOpen) { @@ -695,7 +708,7 @@ uchar *QFSFileEnginePrivate::map(qint64 offset, qint64 size, QFile::MemoryMapFla return 0; } - if (offset < 0 || offset != qint64(QT_OFF_T(offset)) + if (offset < 0 || offset > MaxFileOffset || size < 0 || quint64(size) > quint64(size_t(-1))) { q->setError(QFile::UnspecifiedError, qt_error_string(int(EINVAL))); return 0; From 5c724a6087b0a647e8241d35f0d44bce08e35281 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 17 Mar 2017 11:07:30 +0100 Subject: [PATCH 24/75] QChar: fix ambiguous comparisons with 0, '\0', ... for good Commit e0ea0f6178c9dbee2a8c888fde84ad1cd9670c6b optimized QChar <-> QString(Ref) comparisons by adding more overloads to avoid creating QStrings from QChars just to compare them. But these new overloads made existing comparisons to QChar ambiguous. This was known at the time for QChar/int comparisons. It has since turned out that also comparing to '\0' is ambiguous, ie. not comparing to int or char per se is ambiguous, but comparing to nullptr constants is, because QString(const char*) is just as good a candidate as QChar(char)/QChar(int). Since we allow QString/QChar comparisons, it seems logical to solve the problem by adding QChar<->nullptr overloads. [ChangeLog][QtCore][QChar] Disambiguated comparisons with nullptr constants such as '\0', which 5.8.0 broke. As a consequence, QChar<->int comparisons are no longer deprecated, as this was a failed attempt at fixing the ambiguity. Change-Id: I680dd509c2286e96894e13078899dbe3b2dd83bc Reviewed-by: Thiago Macieira --- src/corelib/tools/qchar.h | 26 +++++---- tests/auto/corelib/tools/qchar/tst_qchar.cpp | 57 +++++++++++++------- 2 files changed, 53 insertions(+), 30 deletions(-) diff --git a/src/corelib/tools/qchar.h b/src/corelib/tools/qchar.h index a83e5e6f986..81ef67d116e 100644 --- a/src/corelib/tools/qchar.h +++ b/src/corelib/tools/qchar.h @@ -578,17 +578,21 @@ Q_DECL_CONSTEXPR inline bool operator>=(QChar c1, QChar c2) Q_DECL_NOTHROW { ret Q_DECL_CONSTEXPR inline bool operator> (QChar c1, QChar c2) Q_DECL_NOTHROW { return operator< (c2, c1); } Q_DECL_CONSTEXPR inline bool operator<=(QChar c1, QChar c2) Q_DECL_NOTHROW { return !operator< (c2, c1); } -// disambiguate QChar == int (but only that, so constrain template to exactly 'int'): -template -Q_DECL_DEPRECATED_X("don't compare ints to QChars, compare them to QChar::unicode() instead") -Q_DECL_CONSTEXPR inline -typename std::enable_if::type, int>::value, bool>::type -operator==(QChar lhs, T rhs) Q_DECL_NOEXCEPT { return lhs == QChar(rhs); } -template -Q_DECL_DEPRECATED_X("don't compare ints to QChars, compare them to QChar::unicode() instead") -Q_DECL_CONSTEXPR inline -typename std::enable_if::type, int>::value, bool>::type -operator!=(QChar lhs, T rhs) Q_DECL_NOEXCEPT { return lhs != QChar(rhs); } + +Q_DECL_CONSTEXPR inline bool operator==(QChar lhs, std::nullptr_t) Q_DECL_NOTHROW { return lhs.isNull(); } +Q_DECL_CONSTEXPR inline bool operator< (QChar, std::nullptr_t) Q_DECL_NOTHROW { return false; } +Q_DECL_CONSTEXPR inline bool operator==(std::nullptr_t, QChar rhs) Q_DECL_NOTHROW { return rhs.isNull(); } +Q_DECL_CONSTEXPR inline bool operator< (std::nullptr_t, QChar rhs) Q_DECL_NOTHROW { return !rhs.isNull(); } + +Q_DECL_CONSTEXPR inline bool operator!=(QChar lhs, std::nullptr_t) Q_DECL_NOTHROW { return !operator==(lhs, nullptr); } +Q_DECL_CONSTEXPR inline bool operator>=(QChar lhs, std::nullptr_t) Q_DECL_NOTHROW { return !operator< (lhs, nullptr); } +Q_DECL_CONSTEXPR inline bool operator> (QChar lhs, std::nullptr_t) Q_DECL_NOTHROW { return operator< (nullptr, lhs); } +Q_DECL_CONSTEXPR inline bool operator<=(QChar lhs, std::nullptr_t) Q_DECL_NOTHROW { return !operator< (nullptr, lhs); } + +Q_DECL_CONSTEXPR inline bool operator!=(std::nullptr_t, QChar rhs) Q_DECL_NOTHROW { return !operator==(nullptr, rhs); } +Q_DECL_CONSTEXPR inline bool operator>=(std::nullptr_t, QChar rhs) Q_DECL_NOTHROW { return !operator< (nullptr, rhs); } +Q_DECL_CONSTEXPR inline bool operator> (std::nullptr_t, QChar rhs) Q_DECL_NOTHROW { return operator< (rhs, nullptr); } +Q_DECL_CONSTEXPR inline bool operator<=(std::nullptr_t, QChar rhs) Q_DECL_NOTHROW { return !operator< (rhs, nullptr); } #ifndef QT_NO_DATASTREAM Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, QChar); diff --git a/tests/auto/corelib/tools/qchar/tst_qchar.cpp b/tests/auto/corelib/tools/qchar/tst_qchar.cpp index fb436b67d6c..b42be94da35 100644 --- a/tests/auto/corelib/tools/qchar/tst_qchar.cpp +++ b/tests/auto/corelib/tools/qchar/tst_qchar.cpp @@ -36,7 +36,7 @@ class tst_QChar : public QObject { Q_OBJECT private slots: - void operator_eqeq_int(); + void operator_eqeq_null(); void operators_data(); void operators(); void toUpper(); @@ -72,35 +72,54 @@ private slots: void unicodeVersion(); }; -QT_WARNING_PUSH -QT_WARNING_DISABLE_DEPRECATED - -void tst_QChar::operator_eqeq_int() +void tst_QChar::operator_eqeq_null() { { const QChar ch = QLatin1Char(' '); - QVERIFY(ch != 0); - QVERIFY(!(ch == 0)); +#define CHECK(NUL) \ + do { \ + QVERIFY(!(ch == NUL)); \ + QVERIFY( ch != NUL ); \ + QVERIFY(!(ch < NUL)); \ + QVERIFY( ch > NUL ); \ + QVERIFY(!(ch <= NUL)); \ + QVERIFY( ch >= NUL ); \ + QVERIFY(!(NUL == ch )); \ + QVERIFY( NUL != ch ); \ + QVERIFY( NUL < ch ); \ + QVERIFY(!(NUL > ch )); \ + QVERIFY( NUL <= ch ); \ + QVERIFY(!(NUL >= ch )); \ + } while (0) - QVERIFY(ch == 0x20); - QVERIFY(!(ch != 0x20)); - QVERIFY(0x20 == ch); - QVERIFY(!(0x20 != ch)); + CHECK(0); + CHECK('\0'); +#undef CHECK } { const QChar ch = QLatin1Char('\0'); - QVERIFY(ch == 0); - QVERIFY(!(ch != 0)); +#define CHECK(NUL) \ + do { \ + QVERIFY( ch == NUL ); \ + QVERIFY(!(ch != NUL)); \ + QVERIFY(!(ch < NUL)); \ + QVERIFY(!(ch > NUL)); \ + QVERIFY( ch <= NUL ); \ + QVERIFY( ch >= NUL ); \ + QVERIFY( NUL == ch ); \ + QVERIFY(!(NUL != ch )); \ + QVERIFY(!(NUL < ch )); \ + QVERIFY(!(NUL > ch )); \ + QVERIFY( NUL <= ch ); \ + QVERIFY( NUL >= ch ); \ + } while (0) - QVERIFY(ch != 0x20); - QVERIFY(!(ch == 0x20)); - QVERIFY(0x20 != ch); - QVERIFY(!(0x20 == ch)); + CHECK(0); + CHECK('\0'); +#undef CHECK } } -QT_WARNING_POP - void tst_QChar::operators_data() { QTest::addColumn("lhs"); From ac74abdf50f7047cf43b3577a70d0995e197659d Mon Sep 17 00:00:00 2001 From: Michael Jabbour Date: Sat, 18 Mar 2017 04:46:45 +0200 Subject: [PATCH 25/75] PostgreSQL: fix datetime format when system locale doesn't use arabic numerals psql driver was previously using QDateTime::toString() function which is locale-depndent. Task-number: QTBUG-59524 Change-Id: I7f50f95b5c82e66476abfee24ad28b78b3257041 Reviewed-by: Thiago Macieira --- src/plugins/sqldrivers/psql/qsql_psql.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/sqldrivers/psql/qsql_psql.cpp b/src/plugins/sqldrivers/psql/qsql_psql.cpp index 7fa1ff7da56..1faab22f668 100644 --- a/src/plugins/sqldrivers/psql/qsql_psql.cpp +++ b/src/plugins/sqldrivers/psql/qsql_psql.cpp @@ -50,6 +50,7 @@ #include #include #include +#include #include #include @@ -1307,7 +1308,9 @@ QString QPSQLDriver::formatValue(const QSqlField &field, bool trimStrings) const // we force the value to be considered with a timezone information, and we force it to be UTC // this is safe since postgresql stores only the UTC value and not the timezone offset (only used // while parsing), so we have correct behavior in both case of with timezone and without tz - r = QLatin1String("TIMESTAMP WITH TIME ZONE ") + QLatin1Char('\'') + field.value().toDateTime().toUTC().toString(QLatin1String("yyyy-MM-ddThh:mm:ss.zzz")) + QLatin1Char('Z') + QLatin1Char('\''); + r = QLatin1String("TIMESTAMP WITH TIME ZONE ") + QLatin1Char('\'') + + QLocale::c().toString(field.value().toDateTime().toUTC(), QLatin1String("yyyy-MM-ddThh:mm:ss.zzz")) + + QLatin1Char('Z') + QLatin1Char('\''); } else { r = QLatin1String("NULL"); } From 4a97e3b98a40e6d35a4e63e171319ed02961a0cc Mon Sep 17 00:00:00 2001 From: Anton Kudryavtsev Date: Fri, 17 Mar 2017 00:07:57 +0300 Subject: [PATCH 26/75] QMap, QHash: make key_iterator satisfy the DefaultConstructible concept Change-Id: Ifc3f481ddb902b26c217516412c93a4a39a32b1c Reviewed-by: Marc Mutz --- src/corelib/tools/qhash.h | 1 + src/corelib/tools/qmap.h | 1 + tests/auto/corelib/tools/qhash/tst_qhash.cpp | 4 ++++ tests/auto/corelib/tools/qmap/tst_qmap.cpp | 4 ++++ 4 files changed, 10 insertions(+) diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h index 66b5e75a1a2..c59f789cb26 100644 --- a/src/corelib/tools/qhash.h +++ b/src/corelib/tools/qhash.h @@ -432,6 +432,7 @@ public: typedef const Key *pointer; typedef const Key &reference; + key_iterator() = default; explicit key_iterator(const_iterator o) : i(o) { } const Key &operator*() const { return i.key(); } diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h index e6da2820f8f..3ee6ab8c584 100644 --- a/src/corelib/tools/qmap.h +++ b/src/corelib/tools/qmap.h @@ -531,6 +531,7 @@ public: typedef const Key *pointer; typedef const Key &reference; + key_iterator() = default; explicit key_iterator(const_iterator o) : i(o) { } const Key &operator*() const { return i.key(); } diff --git a/tests/auto/corelib/tools/qhash/tst_qhash.cpp b/tests/auto/corelib/tools/qhash/tst_qhash.cpp index 0b864e71d44..0c5f1a7afb7 100644 --- a/tests/auto/corelib/tools/qhash/tst_qhash.cpp +++ b/tests/auto/corelib/tools/qhash/tst_qhash.cpp @@ -1053,6 +1053,10 @@ void tst_QHash::keyIterator() QCOMPARE(*(--key_it), (--it).key()); QCOMPARE(std::count(hash.keyBegin(), hash.keyEnd(), 99), 1); + + // DefaultConstructible test + typedef QHash::key_iterator keyIterator; + Q_STATIC_ASSERT(std::is_default_constructible::value); } void tst_QHash::rehash_isnt_quadratic() diff --git a/tests/auto/corelib/tools/qmap/tst_qmap.cpp b/tests/auto/corelib/tools/qmap/tst_qmap.cpp index 8aa7a3e5188..f42ffc0471e 100644 --- a/tests/auto/corelib/tools/qmap/tst_qmap.cpp +++ b/tests/auto/corelib/tools/qmap/tst_qmap.cpp @@ -857,6 +857,10 @@ void tst_QMap::keyIterator() QCOMPARE(*(--key_it), (--it).key()); QCOMPARE(std::count(map.keyBegin(), map.keyEnd(), 99), 1); + + // DefaultConstructible test + typedef QMap::key_iterator keyIterator; + Q_STATIC_ASSERT(std::is_default_constructible::value); } void tst_QMap::keys_values_uniqueKeys() From 391e3aeef45efc937979b44c32147206e389a60b Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 14 Mar 2017 15:00:13 +0100 Subject: [PATCH 27/75] Fix char format of preedit text in empty text block When a text block is empty, and we are adding preedit text to it, we need to merge the format of the preedit text with the current format of the cursor, otherwise we will use a default format and then suddenly switch to the proper one when the text is committed. The reason this becomes a bit complex is that there are no rules preventing someone from using several ime attributes to specify formats for isolated parts of the text, and no rules defining the order of such attributes. So even if the common case is one text format attribute for the entire string, we need to make sure we also handle the other cases gracefully, e.g. when we are setting different formats for different substrings and then providing these out of order. To make sure we have these corner cases covered, we also add a set of autotests. [ChangeLog][Qt Widgets][TextEdit] Fixed initial char format of input method text as it is in pre-edit mode. Task-number: QTBUG-59196 Change-Id: I1e37928e3bd1395fec1b5591908d4c69b84eb618 Reviewed-by: Lars Knoll --- src/widgets/widgets/qwidgettextcontrol.cpp | 47 +++- .../widgets/qtextedit/tst_qtextedit.cpp | 236 ++++++++++++++++++ 2 files changed, 281 insertions(+), 2 deletions(-) diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp index f5672bd87a1..dacb4806ce4 100644 --- a/src/widgets/widgets/qwidgettextcontrol.cpp +++ b/src/widgets/widgets/qwidgettextcontrol.cpp @@ -2052,16 +2052,59 @@ void QWidgetTextControlPrivate::inputMethodEvent(QInputMethodEvent *e) preeditCursor = a.start; hideCursor = !a.length; } else if (a.type == QInputMethodEvent::TextFormat) { - QTextCharFormat f = qvariant_cast(a.value).toCharFormat(); + QTextCharFormat f = cursor.charFormat(); + f.merge(qvariant_cast(a.value).toCharFormat()); if (f.isValid()) { QTextLayout::FormatRange o; o.start = a.start + cursor.position() - block.position(); o.length = a.length; o.format = f; - overrides.append(o); + + // Make sure list is sorted by start index + QVector::iterator it = overrides.end(); + while (it != overrides.begin()) { + QVector::iterator previous = it - 1; + if (o.start >= previous->start) { + overrides.insert(it, o); + break; + } + it = previous; + } + + if (it == overrides.begin()) + overrides.prepend(o); } } } + + if (cursor.charFormat().isValid()) { + int start = cursor.position() - block.position(); + int end = start + e->preeditString().length(); + + QVector::iterator it = overrides.begin(); + while (it != overrides.end()) { + QTextLayout::FormatRange range = *it; + int rangeStart = range.start; + if (rangeStart > start) { + QTextLayout::FormatRange o; + o.start = start; + o.length = rangeStart - start; + o.format = cursor.charFormat(); + it = overrides.insert(it, o) + 1; + } + + ++it; + start = range.start + range.length; + } + + if (start < end) { + QTextLayout::FormatRange o; + o.start = start; + o.length = end - start; + o.format = cursor.charFormat(); + overrides.append(o); + } + } layout->setFormats(overrides); cursor.endEditBlock(); diff --git a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp index cecec481138..101f7d2d128 100644 --- a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp +++ b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp @@ -46,6 +46,7 @@ #include #include #include +#include #include #include @@ -60,6 +61,8 @@ typedef QPair keyPairType; typedef QList pairListType; Q_DECLARE_METATYPE(keyPairType); +Q_DECLARE_METATYPE(QList); + QT_FORWARD_DECLARE_CLASS(QTextEdit) class tst_QTextEdit : public QObject @@ -200,6 +203,9 @@ private slots: void wheelEvent(); #endif + void preeditCharFormat_data(); + void preeditCharFormat(); + private: void createSelection(); int blockCount() const; @@ -2594,5 +2600,235 @@ void tst_QTextEdit::wheelEvent() #endif +namespace { + class MyPaintEngine : public QPaintEngine + { + public: + bool begin(QPaintDevice *) + { + return true; + } + + bool end() + { + return true; + } + + void updateState(const QPaintEngineState &) + { + } + + void drawPixmap(const QRectF &, const QPixmap &, const QRectF &) + { + } + + void drawTextItem(const QPointF &, const QTextItem &textItem) Q_DECL_OVERRIDE + { + itemFonts.append(qMakePair(textItem.text(), textItem.font())); + } + + Type type() const { return User; } + + + QList > itemFonts; + }; + + class MyPaintDevice : public QPaintDevice + { + public: + MyPaintDevice() : m_paintEngine(new MyPaintEngine) + { + } + + + QPaintEngine *paintEngine () const + { + return m_paintEngine; + } + + int metric (QPaintDevice::PaintDeviceMetric metric) const { + switch (metric) { + case QPaintDevice::PdmWidth: + case QPaintDevice::PdmHeight: + case QPaintDevice::PdmWidthMM: + case QPaintDevice::PdmHeightMM: + case QPaintDevice::PdmNumColors: + return INT_MAX; + case QPaintDevice::PdmDepth: + return 32; + case QPaintDevice::PdmDpiX: + case QPaintDevice::PdmDpiY: + case QPaintDevice::PdmPhysicalDpiX: + case QPaintDevice::PdmPhysicalDpiY: + return 72; + case QPaintDevice::PdmDevicePixelRatio: + case QPaintDevice::PdmDevicePixelRatioScaled: + ; // fall through + } + return 0; + } + + MyPaintEngine *m_paintEngine; + }; +} + +void tst_QTextEdit::preeditCharFormat_data() +{ + QTest::addColumn >("imeAttributes"); + QTest::addColumn("substrings"); + QTest::addColumn >("boldnessList"); + QTest::addColumn >("italicnessList"); + QTest::addColumn >("pointSizeList"); + + { + QList attributes; + { + QTextCharFormat tcf; + tcf.setFontPointSize(13); + tcf.setFontItalic(true); + attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, 1, 1, tcf)); + } + + { + QTextCharFormat tcf; + tcf.setFontPointSize(8); + tcf.setFontWeight(QFont::Normal); + attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, 4, 2, tcf)); + } + + QTest::newRow("Two formats, middle, in order") + << attributes + << (QStringList() << "P" << "r" << "eE" << "di" << "tText") + << (QList() << true << true << true << false << true) + << (QList() << false << true << false << false << false) + << (QList() << 20 << 13 << 20 << 8 << 20); + } + + { + QList attributes; + { + QTextCharFormat tcf; + tcf.setFontPointSize(8); + tcf.setFontWeight(QFont::Normal); + attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, 4, 2, tcf)); + } + + { + QTextCharFormat tcf; + tcf.setFontPointSize(13); + tcf.setFontItalic(true); + attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, 1, 1, tcf)); + } + + QTest::newRow("Two formats, middle, out of order") + << attributes + << (QStringList() << "P" << "r" << "eE" << "di" << "tText") + << (QList() << true << true << true << false << true) + << (QList() << false << true << false << false << false) + << (QList() << 20 << 13 << 20 << 8 << 20); + } + + { + QList attributes; + { + QTextCharFormat tcf; + tcf.setFontPointSize(13); + tcf.setFontItalic(true); + attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, 0, 1, tcf)); + } + + { + QTextCharFormat tcf; + tcf.setFontPointSize(8); + tcf.setFontWeight(QFont::Normal); + attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, 4, 2, tcf)); + } + + QTest::newRow("Two formats, front, in order") + << attributes + << (QStringList() << "P" << "reE" << "di" << "tText") + << (QList() << true << true << false << true) + << (QList() << true << false << false << false) + << (QList() << 13 << 20 << 8 << 20); + } + + { + QList attributes; + { + QTextCharFormat tcf; + tcf.setFontPointSize(8); + tcf.setFontWeight(QFont::Normal); + attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, 4, 2, tcf)); + } + + { + QTextCharFormat tcf; + tcf.setFontPointSize(13); + tcf.setFontItalic(true); + attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, 0, 1, tcf)); + } + + QTest::newRow("Two formats, front, out of order") + << attributes + << (QStringList() << "P" << "reE" << "di" << "tText") + << (QList() << true << true << false << true) + << (QList() << true << false << false << false) + << (QList() << 13 << 20 << 8 << 20); + } +} + +void tst_QTextEdit::preeditCharFormat() +{ + QFETCH(QList, imeAttributes); + QFETCH(QStringList, substrings); + QFETCH(QList, boldnessList); + QFETCH(QList, italicnessList); + QFETCH(QList, pointSizeList); + + QTextEdit *w = new QTextEdit; + w->show(); + QVERIFY(QTest::qWaitForWindowExposed(w)); + + // Set main char format + { + QTextCharFormat tcf; + tcf.setFontPointSize(20); + tcf.setFontWeight(QFont::Bold); + w->mergeCurrentCharFormat(tcf); + } + + QList attributes; + attributes.prepend(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, + w->textCursor().position(), + 0, + QVariant())); + + attributes += imeAttributes; + + QInputMethodEvent event("PreEditText", attributes); + QApplication::sendEvent(w, &event); + + MyPaintDevice device; + { + QPainter p(&device); + w->document()->drawContents(&p); + } + + QCOMPARE(device.m_paintEngine->itemFonts.size(), substrings.size()); + for (int i = 0; i < substrings.size(); ++i) + QCOMPARE(device.m_paintEngine->itemFonts.at(i).first, substrings.at(i)); + + for (int i = 0; i < substrings.size(); ++i) + QCOMPARE(device.m_paintEngine->itemFonts.at(i).second.bold(), boldnessList.at(i)); + + for (int i = 0; i < substrings.size(); ++i) + QCOMPARE(device.m_paintEngine->itemFonts.at(i).second.italic(), italicnessList.at(i)); + + for (int i = 0; i < substrings.size(); ++i) + QCOMPARE(device.m_paintEngine->itemFonts.at(i).second.pointSize(), pointSizeList.at(i)); + + delete w; +} + QTEST_MAIN(tst_QTextEdit) #include "tst_qtextedit.moc" From 035e0eafa607217f8110a492a9be7d0718e34907 Mon Sep 17 00:00:00 2001 From: David Faure Date: Wed, 15 Mar 2017 12:03:18 +0100 Subject: [PATCH 28/75] QUrl::fromUserInput: fix handling of files with a ':' in the name QUrl::isRelative(str) would be false for such files, so first check for file existence before doing any URL parsing. Change-Id: I51b6229251ad94877ac408b2f8018456d3e10a36 Reviewed-by: Shawn Rutledge Reviewed-by: Thiago Macieira --- src/corelib/io/qurl.cpp | 11 +++++++---- tests/auto/corelib/io/qurl/tst_qurl.cpp | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index 520ad2e5d3e..3df7070557f 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -4170,12 +4170,15 @@ QUrl QUrl::fromUserInput(const QString &userInput, const QString &workingDirecto return url; } + const QFileInfo fileInfo(QDir(workingDirectory), userInput); + if (fileInfo.exists()) { + return QUrl::fromLocalFile(fileInfo.absoluteFilePath()); + } + QUrl url = QUrl(userInput, QUrl::TolerantMode); // Check both QUrl::isRelative (to detect full URLs) and QDir::isAbsolutePath (since on Windows drive letters can be interpreted as schemes) - if (url.isRelative() && !QDir::isAbsolutePath(userInput)) { - QFileInfo fileInfo(QDir(workingDirectory), userInput); - if ((options & AssumeLocalFile) || fileInfo.exists()) - return QUrl::fromLocalFile(fileInfo.absoluteFilePath()); + if ((options & AssumeLocalFile) && url.isRelative() && !QDir::isAbsolutePath(userInput)) { + return QUrl::fromLocalFile(fileInfo.absoluteFilePath()); } return fromUserInput(trimmedString); diff --git a/tests/auto/corelib/io/qurl/tst_qurl.cpp b/tests/auto/corelib/io/qurl/tst_qurl.cpp index ee18151e4a4..ac5340a2129 100644 --- a/tests/auto/corelib/io/qurl/tst_qurl.cpp +++ b/tests/auto/corelib/io/qurl/tst_qurl.cpp @@ -3088,7 +3088,7 @@ void tst_QUrl::fromUserInputWithCwd_data() } // Existing files - for (const char *fileName : {"file.txt", "file#a.txt", "file .txt", "file.txt "}) { + for (const char *fileName : {"file.txt", "file#a.txt", "file .txt", "file.txt ", "file:colon.txt"}) { const QString filePath = base + '/' + fileName; QFile file(filePath); QVERIFY2(file.open(QIODevice::WriteOnly), qPrintable(filePath)); From da55b57c400af63e4b5bb8a17e1ead4ca7725a7e Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Tue, 7 Feb 2017 12:02:20 +0100 Subject: [PATCH 29/75] System library fix for wayland-scanner Add the option to omit code generated by wayland-scanner, to avoid the case where the Qt versions replace driver-specific functionality. Task-number: QTBUG-58299 Change-Id: I508b18b9392dbd9e2b8233399301c06410f9f5ba Reviewed-by: Oswald Buddenhagen Reviewed-by: Johan Helsing --- mkspecs/features/wayland-scanner.prf | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/mkspecs/features/wayland-scanner.prf b/mkspecs/features/wayland-scanner.prf index 7319392d859..9166ae77501 100644 --- a/mkspecs/features/wayland-scanner.prf +++ b/mkspecs/features/wayland-scanner.prf @@ -1,7 +1,16 @@ # # Extra-compilers for handling files specified in -# the WAYLANDSERVERSOURCES and WAYLANDCLIENTSOURCES variables +# the WAYLANDSERVERSOURCES and WAYLANDCLIENTSOURCES variables. # +# WAYLANDSERVERSOURCES_SYSTEM and WAYLANDCLIENTSOURCES_SYSTEM +# are for protocols where the wayland-scanner output is already +# included in the system libraries. In that case, .c files must +# not be generated, to avoid the Qt version replacing driver-specific +# functions. These files are therefore omitted from wayland_code.input. +# Header files are still generated because they are used to build QtWayland. +# +# qtwaylandscanner must be used even in the _SYSTEM case, since the system +# Wayland libraries do not contain Qt code. isEmpty(QMAKE_WAYLAND_SCANNER):error("QMAKE_WAYLAND_SCANNER not defined for this mkspec") @@ -9,9 +18,9 @@ defineReplace(waylandScannerHeaderFiles) { side = $$1 path = $$2 isEqual(side, "server"): \ - sources_list = $$WAYLANDSERVERSOURCES + sources_list = $$WAYLANDSERVERSOURCES $$WAYLANDSERVERSOURCES_SYSTEM else: \ - sources_list = $$WAYLANDCLIENTSOURCES + sources_list = $$WAYLANDCLIENTSOURCES $$WAYLANDCLIENTSOURCES_SYSTEM wayland_header_files_for_side = for(file, sources_list) { basenameFile = $$basename(file) @@ -50,7 +59,7 @@ qt_install_headers { } wayland_server_header.name = wayland ${QMAKE_FILE_BASE} -wayland_server_header.input = WAYLANDSERVERSOURCES +wayland_server_header.input = WAYLANDSERVERSOURCES WAYLANDSERVERSOURCES_SYSTEM wayland_server_header.variable_out = HEADERS wayland_server_header.output = $${WAYLAND_SERVER_HEADER_DEST}wayland-${QMAKE_FILE_BASE}-server-protocol$${first(QMAKE_EXT_H)} wayland_server_header.commands = $$QMAKE_WAYLAND_SCANNER server-header < ${QMAKE_FILE_IN} > ${QMAKE_FILE_OUT} @@ -58,7 +67,7 @@ silent:wayland_server_header.commands = @echo Wayland server header ${QMAKE_FILE QMAKE_EXTRA_COMPILERS += wayland_server_header wayland_client_header.name = wayland ${QMAKE_FILE_BASE} -wayland_client_header.input = WAYLANDCLIENTSOURCES +wayland_client_header.input = WAYLANDCLIENTSOURCES WAYLANDCLIENTSOURCES_SYSTEM wayland_client_header.variable_out = HEADERS wayland_client_header.output = $${WAYLAND_CLIENT_HEADER_DEST}wayland-${QMAKE_FILE_BASE}-client-protocol$${first(QMAKE_EXT_H)} wayland_client_header.commands = $$QMAKE_WAYLAND_SCANNER client-header < ${QMAKE_FILE_IN} > ${QMAKE_FILE_OUT} @@ -76,7 +85,7 @@ QMAKE_EXTRA_COMPILERS += wayland_code qtPrepareTool(QMAKE_QTWAYLANDSCANNER, qtwaylandscanner) qtwayland_client_header.name = qtwayland ${QMAKE_FILE_BASE} -qtwayland_client_header.input = WAYLANDCLIENTSOURCES +qtwayland_client_header.input = WAYLANDCLIENTSOURCES WAYLANDCLIENTSOURCES_SYSTEM qtwayland_client_header.variable_out = HEADERS qtwayland_client_header.depends += $$QMAKE_QTWAYLANDSCANNER_EXE $${WAYLAND_CLIENT_HEADER_DEST}wayland-${QMAKE_FILE_BASE}-client-protocol$${first(QMAKE_EXT_H)} qtwayland_client_header.output = $${WAYLAND_CLIENT_HEADER_DEST}qwayland-${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)} @@ -85,7 +94,7 @@ silent:qtwayland_client_header.commands = @echo QtWayland client header ${QMAKE_ QMAKE_EXTRA_COMPILERS += qtwayland_client_header qtwayland_client_code.name = qtwayland ${QMAKE_FILE_BASE} -qtwayland_client_code.input = WAYLANDCLIENTSOURCES +qtwayland_client_code.input = WAYLANDCLIENTSOURCES WAYLANDCLIENTSOURCES_SYSTEM qtwayland_client_code.variable_out = SOURCES qtwayland_client_code.depends += $$QMAKE_QTWAYLANDSCANNER_EXE $${WAYLAND_CLIENT_HEADER_DEST}qwayland-${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)} qtwayland_client_code.output = qwayland-${QMAKE_FILE_BASE}.cpp @@ -94,7 +103,7 @@ silent:qtwayland_client_code.commands = @echo QtWayland client code ${QMAKE_FILE QMAKE_EXTRA_COMPILERS += qtwayland_client_code qtwayland_server_header.name = qtwayland ${QMAKE_FILE_BASE} -qtwayland_server_header.input = WAYLANDSERVERSOURCES +qtwayland_server_header.input = WAYLANDSERVERSOURCES WAYLANDSERVERSOURCES_SYSTEM qtwayland_server_header.variable_out = HEADERS qtwayland_server_header.depends += $$QMAKE_QTWAYLANDSCANNER_EXE $${WAYLAND_SERVER_HEADER_DEST}wayland-${QMAKE_FILE_BASE}-server-protocol$${first(QMAKE_EXT_H)} qtwayland_server_header.output = $${WAYLAND_SERVER_HEADER_DEST}qwayland-server-${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)} @@ -103,7 +112,7 @@ silent:qtwayland_server_header.commands = @echo QtWayland server header ${QMAKE_ QMAKE_EXTRA_COMPILERS += qtwayland_server_header qtwayland_server_code.name = qtwayland ${QMAKE_FILE_BASE} -qtwayland_server_code.input = WAYLANDSERVERSOURCES +qtwayland_server_code.input = WAYLANDSERVERSOURCES WAYLANDSERVERSOURCES_SYSTEM qtwayland_server_code.variable_out = SOURCES qtwayland_server_code.depends += $$QMAKE_QTWAYLANDSCANNER_EXE $${WAYLAND_SERVER_HEADER_DEST}qwayland-server-${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)} qtwayland_server_code.output = qwayland-server-${QMAKE_FILE_BASE}.cpp From 2c935ef5656754869d237f3e379a79b8b4aa85f9 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 20 Mar 2017 15:01:15 +0100 Subject: [PATCH 30/75] Diaglib: Fix WinRT exclusion Amends change 8deeb6777dc2744a6b8e0c374f92ddcc8c004827. Change-Id: If403871b1fb117a3f8042e0e2397e6d521d17beb Reviewed-by: Oliver Wolff --- tests/manual/diaglib/diaglib.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/manual/diaglib/diaglib.pri b/tests/manual/diaglib/diaglib.pri index f240a731676..9f101671361 100644 --- a/tests/manual/diaglib/diaglib.pri +++ b/tests/manual/diaglib/diaglib.pri @@ -10,7 +10,7 @@ HEADERS += \ $$PWD/qwindowdump.h \ $$PWD/nativewindowdump.h -win32!winrt: { +win32:!winrt: { SOURCES += $$PWD/nativewindowdump_win.cpp LIBS *= -luser32 } else { From bd6838d54d433ed80a4c401dc68bd31a079fb731 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tony=20Saraj=C3=A4rvi?= Date: Thu, 9 Mar 2017 14:40:53 +0200 Subject: [PATCH 31/75] Blacklist tst_QPauseAnimation::multipleSequentialGroups on all macOS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-59218 Change-Id: Ic839a36af1ecab39da0c3394c34181b6717e24e2 Reviewed-by: Tor Arne Vestbø Reviewed-by: Marc Mutz --- tests/auto/corelib/animation/qpauseanimation/BLACKLIST | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/auto/corelib/animation/qpauseanimation/BLACKLIST b/tests/auto/corelib/animation/qpauseanimation/BLACKLIST index 3b2cd847495..8fc1b07502c 100644 --- a/tests/auto/corelib/animation/qpauseanimation/BLACKLIST +++ b/tests/auto/corelib/animation/qpauseanimation/BLACKLIST @@ -2,3 +2,5 @@ osx-10.9 [pauseAndPropertyAnimations] * +[multipleSequentialGroups] +osx From 3548cdedb627d9988307e9c158c2ec05b6b3e7eb Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 17 Mar 2017 19:09:06 -0700 Subject: [PATCH 32/75] qmake: Add _CRT_SECURE_NO_WARNINGS to all MSVC-like compilers The warning comes from the MS headers, not from the compiler. Task-number: QTBUG-59576 Change-Id: Ie67d35dff21147e99ad9fffd14acd7fb628fa1d4 Reviewed-by: Oswald Buddenhagen --- qmake/Makefile.win32 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32 index 6d2bcdbb78e..e9b468248e8 100644 --- a/qmake/Makefile.win32 +++ b/qmake/Makefile.win32 @@ -21,8 +21,7 @@ CFLAGS_EXTRA = -fms-compatibility-version=19.00.23506 -Wno-microsoft-enum-v !else CXX = cl LINKER = link -CFLAGS_EXTRA = /MP /D_CRT_SECURE_NO_WARNINGS /D_SCL_SECURE_NO_WARNINGS \ - /wd4577 $(CFLAGS_CRT) +CFLAGS_EXTRA = /MP /wd4577 $(CFLAGS_CRT) !endif # !win32-icc !if "$(QMAKESPEC)" != "win32-clang-msvc" @@ -37,6 +36,7 @@ CFLAGS_BARE = -c -Fo./ -Fdqmake.pdb \ -I$(INC_PATH) -I$(INC_PATH)\QtCore -I$(INC_PATH)\QtCore\$(QT_VERSION) -I$(INC_PATH)\QtCore\$(QT_VERSION)\QtCore \ -I$(BUILD_PATH)\src\corelib\global \ -I$(SOURCE_PATH)\mkspecs\$(QMAKESPEC) \ + -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS \ -DQT_VERSION_STR=\"$(QT_VERSION)\" -DQT_VERSION_MAJOR=$(QT_MAJOR_VERSION) -DQT_VERSION_MINOR=$(QT_MINOR_VERSION) -DQT_VERSION_PATCH=$(QT_PATCH_VERSION) \ -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL \ -DQT_NO_FOREACH -DUNICODE From 202d6ad73059d4dd1199fd1e8785d29018749f32 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 14 Mar 2017 11:31:52 -0700 Subject: [PATCH 33/75] QHash: unexport the hash seed variable The only allowed way to access the variable is now via the public qGlobalQHashSeed and qSetGlobalQHashSeed functions. The variable was private API, so we're allowed to remove it. Task-number: QTBUG-47566 Change-Id: I4a7dc1fe14154695b968fffd14abd331e5810482 Reviewed-by: Jake Petroules Reviewed-by: David Faure --- src/corelib/tools/qhash.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp index 9270539f4f1..334bd52f1e0 100644 --- a/src/corelib/tools/qhash.cpp +++ b/src/corelib/tools/qhash.cpp @@ -325,7 +325,7 @@ static uint qt_create_qhash_seed() /* The QHash seed itself. */ -Q_CORE_EXPORT QBasicAtomicInt qt_qhash_seed = Q_BASIC_ATOMIC_INITIALIZER(-1); +static QBasicAtomicInt qt_qhash_seed = Q_BASIC_ATOMIC_INITIALIZER(-1); /*! \internal From e54356151cd47aabefed7800695defa176228d68 Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Mon, 13 Mar 2017 21:02:19 +0100 Subject: [PATCH 34/75] Add features.widgettextcontrol Change-Id: I6d525f70e1d54b4c8383dfa387cfd5c364fab354 Reviewed-by: Oswald Buddenhagen --- src/widgets/configure.json | 12 ++++++++++-- src/widgets/widgets/qplaintextedit_p.h | 3 ++- src/widgets/widgets/qtextedit_p.h | 11 ++++++----- src/widgets/widgets/qwidgettextcontrol_p.h | 2 ++ src/widgets/widgets/qwidgettextcontrol_p_p.h | 2 ++ src/widgets/widgets/widgets.pri | 12 +++++++++--- 6 files changed, 31 insertions(+), 11 deletions(-) diff --git a/src/widgets/configure.json b/src/widgets/configure.json index 14e4d10d38a..dedea8c59e9 100644 --- a/src/widgets/configure.json +++ b/src/widgets/configure.json @@ -163,10 +163,17 @@ "condition": "features.rubberband", "output": [ "publicFeature", "feature" ] }, + "widgettextcontrol": { + "label": "QWidgetTextControl", + "purpose": "Provides text control functionality to other widgets.", + "section": "Widgets", + "output": [ "privateFeature" ] + }, "label": { "label": "QLabel", "purpose": "Provides a text or image display.", "section": "Widgets", + "condition": "features.widgettextcontrol", "output": [ "publicFeature" ] }, "formlayout": { @@ -193,6 +200,7 @@ "label": "QLineEdit", "purpose": "Provides single-line edits.", "section": "Widgets", + "condition": "features.widgettextcontrol", "output": [ "publicFeature", "feature" ] }, "radiobutton": { @@ -382,7 +390,7 @@ "label": "QGraphicsView", "purpose": "Provides a canvas/sprite framework.", "section": "Widgets", - "condition": "features.scrollarea", + "condition": "features.scrollarea && features.widgettextcontrol", "output": [ "publicFeature", "feature" ] }, "graphicseffect": { @@ -396,7 +404,7 @@ "label": "QTextEdit", "purpose": "Supports rich text editing.", "section": "Widgets", - "condition": "features.scrollarea && features.properties", + "condition": "features.scrollarea && features.properties && features.widgettextcontrol", "output": [ "publicFeature", "feature" ] }, "syntaxhighlighter": { diff --git a/src/widgets/widgets/qplaintextedit_p.h b/src/widgets/widgets/qplaintextedit_p.h index f0dd1c0ed40..803623c9744 100644 --- a/src/widgets/widgets/qplaintextedit_p.h +++ b/src/widgets/widgets/qplaintextedit_p.h @@ -60,11 +60,12 @@ #include "QtWidgets/qmenu.h" #include "QtGui/qabstracttextdocumentlayout.h" #include "QtCore/qbasictimer.h" -#include "private/qwidgettextcontrol_p.h" #include "qplaintextedit.h" #ifndef QT_NO_TEXTEDIT +#include "private/qwidgettextcontrol_p.h" + QT_BEGIN_NAMESPACE class QMimeData; diff --git a/src/widgets/widgets/qtextedit_p.h b/src/widgets/widgets/qtextedit_p.h index cca315ce307..13d0eb323a4 100644 --- a/src/widgets/widgets/qtextedit_p.h +++ b/src/widgets/widgets/qtextedit_p.h @@ -61,13 +61,14 @@ #include "QtGui/qabstracttextdocumentlayout.h" #include "QtCore/qbasictimer.h" #include "QtCore/qurl.h" -#include "private/qwidgettextcontrol_p.h" #include "qtextedit.h" -QT_BEGIN_NAMESPACE - #ifndef QT_NO_TEXTEDIT +#include "private/qwidgettextcontrol_p.h" + +QT_BEGIN_NAMESPACE + class QMimeData; class QTextEditPrivate : public QAbstractScrollAreaPrivate { @@ -135,9 +136,9 @@ public: QBasicTimer deleteAllTimer; #endif }; -#endif // QT_NO_TEXTEDIT - QT_END_NAMESPACE +#endif // QT_NO_TEXTEDIT + #endif // QTEXTEDIT_P_H diff --git a/src/widgets/widgets/qwidgettextcontrol_p.h b/src/widgets/widgets/qwidgettextcontrol_p.h index f540a3c9ada..e2539a30e76 100644 --- a/src/widgets/widgets/qwidgettextcontrol_p.h +++ b/src/widgets/widgets/qwidgettextcontrol_p.h @@ -65,6 +65,8 @@ #include #include +QT_REQUIRE_CONFIG(widgettextcontrol); + QT_BEGIN_NAMESPACE diff --git a/src/widgets/widgets/qwidgettextcontrol_p_p.h b/src/widgets/widgets/qwidgettextcontrol_p_p.h index 35027ff82ad..357ffdc6bd9 100644 --- a/src/widgets/widgets/qwidgettextcontrol_p_p.h +++ b/src/widgets/widgets/qwidgettextcontrol_p_p.h @@ -62,6 +62,8 @@ #include "QtCore/qpointer.h" #include "private/qobject_p.h" +QT_REQUIRE_CONFIG(widgettextcontrol); + QT_BEGIN_NAMESPACE class QMimeData; diff --git a/src/widgets/widgets/widgets.pri b/src/widgets/widgets/widgets.pri index 22e083a3d48..086585f0e64 100644 --- a/src/widgets/widgets/widgets.pri +++ b/src/widgets/widgets/widgets.pri @@ -65,8 +65,6 @@ HEADERS += \ widgets/qfocusframe.h \ widgets/qscrollarea.h \ widgets/qwidgetanimator_p.h \ - widgets/qwidgettextcontrol_p.h \ - widgets/qwidgettextcontrol_p_p.h \ widgets/qwidgetlinecontrol_p.h \ widgets/qtoolbararealayout_p.h \ widgets/qplaintextedit.h \ @@ -120,7 +118,6 @@ SOURCES += \ widgets/qfocusframe.cpp \ widgets/qscrollarea.cpp \ widgets/qwidgetanimator.cpp \ - widgets/qwidgettextcontrol.cpp \ widgets/qwidgetlinecontrol.cpp \ widgets/qtoolbararealayout.cpp \ widgets/qplaintextedit.cpp @@ -194,6 +191,15 @@ qtConfig(dialogbuttonbox) { widgets/qdialogbuttonbox.cpp } +qtConfig(widgettextcontrol) { + HEADERS += \ + widgets/qwidgettextcontrol_p.h \ + widgets/qwidgettextcontrol_p_p.h + + SOURCES += \ + widgets/qwidgettextcontrol.cpp +} + macx { HEADERS += \ widgets/qmacnativewidget_mac.h \ From 99fc96fd373b6ffdf9a66e4a346885de20645533 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 9 Mar 2017 13:44:00 +0100 Subject: [PATCH 35/75] QMetaType & QVariant: "load" and "save" std::nullptr_t We don't load and save pointers usually because the pointer value cannot be guaranteed to remain across program invocations. However, nullptr is an exception: a null pointer is always a null pointer. We don't actually have to read or write anything: there's only one value possible for a std::nullptr_t and it is nullptr. [ChangeLog][Important Behavior Changes] A QVariant containing a std::nullptr_t is now streamable to/from QDataStream. Task-number: QTBUG-59391 Change-Id: Iae839f6a131a4f0784bffffd14aa374f6475d283 Reviewed-by: Olivier Goffart (Woboq GmbH) Reviewed-by: Lars Knoll --- src/corelib/kernel/qmetatype.cpp | 6 ++++-- tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp | 11 ++++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp index 232a1347185..718c42ba55f 100644 --- a/src/corelib/kernel/qmetatype.cpp +++ b/src/corelib/kernel/qmetatype.cpp @@ -1255,7 +1255,6 @@ bool QMetaType::save(QDataStream &stream, int type, const void *data) case QMetaType::UnknownType: case QMetaType::Void: case QMetaType::VoidStar: - case QMetaType::Nullptr: case QMetaType::QObjectStar: case QMetaType::QModelIndex: case QMetaType::QPersistentModelIndex: @@ -1264,6 +1263,8 @@ bool QMetaType::save(QDataStream &stream, int type, const void *data) case QMetaType::QJsonArray: case QMetaType::QJsonDocument: return false; + case QMetaType::Nullptr: + return true; case QMetaType::Long: stream << qlonglong(*static_cast(data)); break; @@ -1477,7 +1478,6 @@ bool QMetaType::load(QDataStream &stream, int type, void *data) case QMetaType::UnknownType: case QMetaType::Void: case QMetaType::VoidStar: - case QMetaType::Nullptr: case QMetaType::QObjectStar: case QMetaType::QModelIndex: case QMetaType::QPersistentModelIndex: @@ -1486,6 +1486,8 @@ bool QMetaType::load(QDataStream &stream, int type, void *data) case QMetaType::QJsonArray: case QMetaType::QJsonDocument: return false; + case QMetaType::Nullptr: + return true; case QMetaType::Long: { qlonglong l; stream >> l; diff --git a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp index 7d9f56ef38e..7e1979dfb3d 100644 --- a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp +++ b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp @@ -1559,7 +1559,6 @@ DECLARE_NONSTREAMABLE(QJsonArray) DECLARE_NONSTREAMABLE(QJsonDocument) DECLARE_NONSTREAMABLE(QObject*) DECLARE_NONSTREAMABLE(QWidget*) -DECLARE_NONSTREAMABLE(std::nullptr_t) #define DECLARE_GUI_CLASS_NONSTREAMABLE(MetaTypeName, MetaTypeId, RealType) \ DECLARE_NONSTREAMABLE(RealType) @@ -1598,7 +1597,10 @@ void tst_QMetaType::saveAndLoadBuiltin() if (isStreamable) { QVERIFY(QMetaType::load(stream, type, value)); // Hmmm, shouldn't it return false? - QCOMPARE(stream.status(), QDataStream::ReadPastEnd); + + // std::nullptr_t is nullary: it doesn't actually read anything + if (type != QMetaType::Nullptr) + QCOMPARE(stream.status(), QDataStream::ReadPastEnd); } stream.device()->seek(0); @@ -1608,7 +1610,10 @@ void tst_QMetaType::saveAndLoadBuiltin() if (isStreamable) { QVERIFY(QMetaType::load(stream, type, value)); // Hmmm, shouldn't it return false? - QCOMPARE(stream.status(), QDataStream::ReadPastEnd); + + // std::nullptr_t is nullary: it doesn't actually read anything + if (type != QMetaType::Nullptr) + QCOMPARE(stream.status(), QDataStream::ReadPastEnd); } QMetaType::destroy(type, value); From c33ee0fe1517021ff2f22a8aab0331e4145c5f3f Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 20 Mar 2017 12:34:29 +0100 Subject: [PATCH 36/75] QDataWidgetMapper: replace an inefficient QList with std::vector WidgetMapper is larger than a void*, so holding it in QLists is needlessly inefficient. Worse, the code could come to depend on the fragile property of (inefficient) QLists that references to elements therein never are invalidated. Fix by holding it in a std::vector instead (tried QVector, too, but that produced almost exactly 1KiB more text size). Adapt to std API. There are a few changes in there which are not strictly necessary when using std::vector, but were done as part of the port to QVector: - dropping of WidgetMapper ctors (because QVector requires a default ctor, and I didn't want to provide one manually), - marking the type as movable (no effect with std::vector, but doesn't hurt and keeps the next guy from wondering), and - marking Private::flipEventFilters() const (to avoid a detach when using ranged for loops). Changes required by the port to std::vector: - at() -> op[] (not strictly necessary, but expands to less code even when compiling, as QtWidgets is, without exception support), - append() -> push_back() Saves 40B in text size on optimized GCC 6.1 Linux AMD64 builds (for comparison: QVector had 1240B more than QList). Change-Id: Iaae81d1a8bebe8000bf69e7fb8b2bcd6c38afafd Reviewed-by: Edward Welbourne Reviewed-by: Lars Knoll --- src/widgets/itemviews/qdatawidgetmapper.cpp | 58 ++++++++++----------- 1 file changed, 27 insertions(+), 31 deletions(-) diff --git a/src/widgets/itemviews/qdatawidgetmapper.cpp b/src/widgets/itemviews/qdatawidgetmapper.cpp index b213a0859c7..99704c79114 100644 --- a/src/widgets/itemviews/qdatawidgetmapper.cpp +++ b/src/widgets/itemviews/qdatawidgetmapper.cpp @@ -89,11 +89,11 @@ public: : model->index(itemPos, currentIdx(), rootIndex); } - inline void flipEventFilters(QAbstractItemDelegate *oldDelegate, - QAbstractItemDelegate *newDelegate) + void flipEventFilters(QAbstractItemDelegate *oldDelegate, + QAbstractItemDelegate *newDelegate) const { - for (QList::const_iterator it = widgetMap.cbegin(), end = widgetMap.cend(); it != end; ++it) { - QWidget *w = it->widget; + for (const WidgetMapper &e : widgetMap) { + QWidget *w = e.widget; if (!w) continue; w->removeEventFilter(oldDelegate); @@ -111,11 +111,6 @@ public: struct WidgetMapper { - inline WidgetMapper(QWidget *w = 0, int c = 0, const QModelIndex &i = QModelIndex()) - : widget(w), section(c), currentIndex(i) {} - inline WidgetMapper(QWidget *w, int c, const QModelIndex &i, const QByteArray &p) - : widget(w), section(c), currentIndex(i), property(p) {} - QPointer widget; int section; QPersistentModelIndex currentIndex; @@ -127,14 +122,15 @@ public: bool commit(const WidgetMapper &m); - QList widgetMap; + std::vector widgetMap; }; +Q_DECLARE_TYPEINFO(QDataWidgetMapperPrivate::WidgetMapper, Q_MOVABLE_TYPE); int QDataWidgetMapperPrivate::findWidget(QWidget *w) const { - for (QList::const_iterator it = widgetMap.cbegin(), end = widgetMap.cend(); it != end; ++it) { - if (it->widget == w) - return int(std::distance(widgetMap.cbegin(), it)); + for (const WidgetMapper &e : widgetMap) { + if (e.widget == w) + return int(&e - &widgetMap.front()); } return -1; } @@ -171,8 +167,8 @@ void QDataWidgetMapperPrivate::populate(WidgetMapper &m) void QDataWidgetMapperPrivate::populate() { - for (QList::iterator it = widgetMap.begin(), end = widgetMap.end(); it != end; ++it) - populate(*it); + for (WidgetMapper &e : widgetMap) + populate(e); } static bool qContainsIndex(const QModelIndex &idx, const QModelIndex &topLeft, @@ -187,9 +183,9 @@ void QDataWidgetMapperPrivate::_q_dataChanged(const QModelIndex &topLeft, const if (topLeft.parent() != rootIndex) return; // not in our hierarchy - for (QList::iterator it = widgetMap.begin(), end = widgetMap.end(); it != end; ++it) { - if (qContainsIndex(it->currentIndex, topLeft, bottomRight)) - populate(*it); + for (WidgetMapper &e : widgetMap) { + if (qContainsIndex(e.currentIndex, topLeft, bottomRight)) + populate(e); } } @@ -202,7 +198,7 @@ void QDataWidgetMapperPrivate::_q_commitData(QWidget *w) if (idx == -1) return; // not our widget - commit(widgetMap.at(idx)); + commit(widgetMap[idx]); } void QDataWidgetMapperPrivate::_q_closeEditor(QWidget *w, QAbstractItemDelegate::EndEditHint hint) @@ -479,7 +475,7 @@ void QDataWidgetMapper::addMapping(QWidget *widget, int section) Q_D(QDataWidgetMapper); removeMapping(widget); - d->widgetMap.append(QDataWidgetMapperPrivate::WidgetMapper(widget, section, d->indexAt(section))); + d->widgetMap.push_back({widget, section, d->indexAt(section), QByteArray()}); widget->installEventFilter(d->delegate); } @@ -497,7 +493,7 @@ void QDataWidgetMapper::addMapping(QWidget *widget, int section, const QByteArra Q_D(QDataWidgetMapper); removeMapping(widget); - d->widgetMap.append(QDataWidgetMapperPrivate::WidgetMapper(widget, section, d->indexAt(section), propertyName)); + d->widgetMap.push_back({widget, section, d->indexAt(section), propertyName}); widget->installEventFilter(d->delegate); } @@ -514,7 +510,7 @@ void QDataWidgetMapper::removeMapping(QWidget *widget) if (idx == -1) return; - d->widgetMap.removeAt(idx); + d->widgetMap.erase(d->widgetMap.begin() + idx); widget->removeEventFilter(d->delegate); } @@ -532,7 +528,7 @@ int QDataWidgetMapper::mappedSection(QWidget *widget) const if (idx == -1) return -1; - return d->widgetMap.at(idx).section; + return d->widgetMap[idx].section; } /*! @@ -550,7 +546,7 @@ QByteArray QDataWidgetMapper::mappedPropertyName(QWidget *widget) const int idx = d->findWidget(widget); if (idx == -1) return QByteArray(); - const QDataWidgetMapperPrivate::WidgetMapper &m = d->widgetMap.at(idx); + const auto &m = d->widgetMap[idx]; if (m.property.isEmpty()) return m.widget->metaObject()->userProperty().name(); else @@ -567,9 +563,9 @@ QWidget *QDataWidgetMapper::mappedWidgetAt(int section) const { Q_D(const QDataWidgetMapper); - for (QList::const_iterator it = d->widgetMap.cbegin(), end = d->widgetMap.cend(); it != end; ++it) { - if (it->section == section) - return it->widget; + for (auto &e : d->widgetMap) { + if (e.section == section) + return e.widget; } return 0; @@ -606,8 +602,8 @@ bool QDataWidgetMapper::submit() { Q_D(QDataWidgetMapper); - for (QList::const_iterator it = d->widgetMap.cbegin(), end = d->widgetMap.cend(); it != end; ++it) { - if (!d->commit(*it)) + for (auto &e : d->widgetMap) { + if (!d->commit(e)) return false; } @@ -746,9 +742,9 @@ void QDataWidgetMapper::clearMapping() { Q_D(QDataWidgetMapper); - QList copy; + decltype(d->widgetMap) copy; d->widgetMap.swap(copy); // a C++98 move - for (QList::const_reverse_iterator it = copy.crbegin(), end = copy.crend(); it != end; ++it) { + for (auto it = copy.crbegin(), end = copy.crend(); it != end; ++it) { if (it->widget) it->widget->removeEventFilter(d->delegate); } From a9383ef99a29c333a1edd32695ddc29ea0ba805d Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 20 Mar 2017 16:29:29 +0100 Subject: [PATCH 37/75] Diaglib: Output DPI and scale factors Also pass options to formatWindow(). Change-Id: Ifa506331ea010087bfd7ab8bd3f7dda531f142a8 Reviewed-by: Oliver Wolff --- tests/manual/diaglib/qwidgetdump.cpp | 6 ++++++ tests/manual/diaglib/qwindowdump.cpp | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/manual/diaglib/qwidgetdump.cpp b/tests/manual/diaglib/qwidgetdump.cpp index 10cfde510db..6c1e7d8f79d 100644 --- a/tests/manual/diaglib/qwidgetdump.cpp +++ b/tests/manual/diaglib/qwidgetdump.cpp @@ -96,6 +96,12 @@ static void dumpWidgetRecursion(QTextStream &str, const QWidget *w, str << "windowState=" << hex << showbase << states << dec << noshowbase << ' '; formatRect(str, w->geometry()); if (w->isWindow()) { + str << ' ' << w->logicalDpiX() << "DPI"; +#if QT_VERSION > 0x050600 + const qreal dpr = w->devicePixelRatioF(); + if (!qFuzzyCompare(dpr, qreal(1))) + str << " dpr=" << dpr; +#endif // Qt 5.6 const QRect normalGeometry = w->normalGeometry(); if (normalGeometry.isValid() && !normalGeometry.isEmpty() && normalGeometry != w->geometry()) { str << " normal="; diff --git a/tests/manual/diaglib/qwindowdump.cpp b/tests/manual/diaglib/qwindowdump.cpp index 4adb1da5f1b..0e613753efd 100644 --- a/tests/manual/diaglib/qwindowdump.cpp +++ b/tests/manual/diaglib/qwindowdump.cpp @@ -138,7 +138,7 @@ void formatWindow(QTextStream &str, const QWindow *w, FormatWindowOptions option str << " \"" << w->screen()->name() << "\" "; #if QT_VERSION >= 0x050600 if (QHighDpiScaling::isActive()) - str << "factor=" << QHighDpiScaling::factor(w) << ' '; + str << "factor=" << QHighDpiScaling::factor(w) << " dpr=" << w->devicePixelRatio(); #endif } if (!(options & DontPrintWindowFlags)) { @@ -161,7 +161,7 @@ static void dumpWindowRecursion(QTextStream &str, const QWindow *w, FormatWindowOptions options = 0, int depth = 0) { indentStream(str, 2 * depth); - formatWindow(str, w); + formatWindow(str, w, options); foreach (const QObject *co, w->children()) { if (co->isWindowType()) dumpWindowRecursion(str, static_cast(co), options, depth + 1); From 05924ddff901671063337f6e0e4bb84c915097ef Mon Sep 17 00:00:00 2001 From: David Faure Date: Tue, 21 Mar 2017 13:54:32 +0100 Subject: [PATCH 38/75] tst_qurl: skip test with ':' in filename, on Windows Task-number: QTBUG-59622 Change-Id: Ib4b458b5d0fc2dd9ea6758b8517a953f6d768a39 Reviewed-by: Liang Qi Reviewed-by: Shawn Rutledge --- tests/auto/corelib/io/qurl/tst_qurl.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/auto/corelib/io/qurl/tst_qurl.cpp b/tests/auto/corelib/io/qurl/tst_qurl.cpp index ac5340a2129..ebc240c2859 100644 --- a/tests/auto/corelib/io/qurl/tst_qurl.cpp +++ b/tests/auto/corelib/io/qurl/tst_qurl.cpp @@ -3088,7 +3088,11 @@ void tst_QUrl::fromUserInputWithCwd_data() } // Existing files - for (const char *fileName : {"file.txt", "file#a.txt", "file .txt", "file.txt ", "file:colon.txt"}) { + for (const char *fileName : {"file.txt", "file#a.txt", "file .txt", "file.txt " +#ifndef Q_OS_WIN + , "file:colon.txt" +#endif + }) { const QString filePath = base + '/' + fileName; QFile file(filePath); QVERIFY2(file.open(QIODevice::WriteOnly), qPrintable(filePath)); From 26bc4ac5cb56ce8f2d3d10125fa9c6a72140573a Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 21 Mar 2017 14:13:34 +0100 Subject: [PATCH 39/75] QToolBox: fix potential UB (invalid cast) in Private::_q_widgetDestroyed() Don't cast an expiring QObject down to QWidget. Cast the QWidgets stored internally up to QObject to perform the comparison. The result is the same, but no invalid casts are possible anymore. Found by independent review. Change-Id: Iffa8a66cf5cab0270961befe982637ac8e4f0f7b Reviewed-by: Friedemann Kleint --- src/widgets/widgets/qtoolbox.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/widgets/widgets/qtoolbox.cpp b/src/widgets/widgets/qtoolbox.cpp index 2c74b5fa9dd..8413827e300 100644 --- a/src/widgets/widgets/qtoolbox.cpp +++ b/src/widgets/widgets/qtoolbox.cpp @@ -117,7 +117,7 @@ public: void _q_buttonClicked(); void _q_widgetDestroyed(QObject*); - const Page *page(QWidget *widget) const; + const Page *page(const QObject *widget) const; const Page *page(int index) const; Page *page(int index); @@ -129,7 +129,7 @@ public: Page *currentPage; }; -const QToolBoxPrivate::Page *QToolBoxPrivate::page(QWidget *widget) const +const QToolBoxPrivate::Page *QToolBoxPrivate::page(const QObject *widget) const { if (!widget) return 0; @@ -449,11 +449,9 @@ void QToolBoxPrivate::relayout() void QToolBoxPrivate::_q_widgetDestroyed(QObject *object) { Q_Q(QToolBox); - // no verification - vtbl corrupted already - QWidget *p = (QWidget*)object; - const QToolBoxPrivate::Page *c = page(p); - if (!p || !c) + const QToolBoxPrivate::Page * const c = page(object); + if (!c) return; layout->removeWidget(c->sv); From 6d49311a5da483190136209dc902969d1ef4a217 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 17 Mar 2017 14:13:59 +0100 Subject: [PATCH 40/75] Teach QTestLib to read QTEST_ENVIRONMENT to expand blacklist keywords Can be used by CI system to set QTEST_ENVIRONMENT="ci", allowing test to be blacklisted only for the CI. Task-number: QTBUG-59564 Change-Id: I7088abb888c179bafc621f11191efbc45c37b179 Reviewed-by: Friedemann Kleint Reviewed-by: Paul Olav Tvete --- src/testlib/qtestblacklist.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/testlib/qtestblacklist.cpp b/src/testlib/qtestblacklist.cpp index 587930ca738..0ebc800fe1a 100644 --- a/src/testlib/qtestblacklist.cpp +++ b/src/testlib/qtestblacklist.cpp @@ -82,7 +82,9 @@ QT_BEGIN_NAMESPACE msvc-2010 Keys are lower-case. Distribution name and version are supported if - QSysInfo's productType() and productVersion() return them. + QSysInfo's productType() and productVersion() return them. Keys can be + added via the space-separated QTEST_ENVIRONMENT environment variable. + The other known keys are listed below: */ @@ -184,6 +186,11 @@ static QSet activeConditions() } } + if (qEnvironmentVariableIsSet("QTEST_ENVIRONMENT")) { + for (const QByteArray &k : qgetenv("QTEST_ENVIRONMENT").split(' ')) + result.insert(k); + } + return result; } From c9efdfd990b2084b0e0744030be581dba679f6a9 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 21 Mar 2017 13:44:28 +0100 Subject: [PATCH 41/75] QWizard: use the 3-int QColor ctor instead of the string one The value is hard-coded, there's no need to parse a string to extract the value. Change-Id: I987280d7a92b7a1eb75233b2a1f811b5177f0a63 Reviewed-by: Friedemann Kleint --- src/widgets/dialogs/qwizard.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/dialogs/qwizard.cpp b/src/widgets/dialogs/qwizard.cpp index 5e598ba990f..d1abbc85d2a 100644 --- a/src/widgets/dialogs/qwizard.cpp +++ b/src/widgets/dialogs/qwizard.cpp @@ -1089,7 +1089,7 @@ void QWizardPrivate::recreateLayout(const QWizardLayoutInfo &info) // ### hardcoded for now: titleFont = QFont(QLatin1String("Segoe UI"), 12); QPalette pal(titleLabel->palette()); - pal.setColor(QPalette::Text, "#003399"); + pal.setColor(QPalette::Text, QColor(0x00, 0x33, 0x99)); titleLabel->setPalette(pal); } From 524f39db899d68e0ef90184a268eb75ad4ac216e Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 20 Mar 2017 17:54:55 -0700 Subject: [PATCH 42/75] gtk3: Fix use of dangling pointers QString::toUtf8() returns QByteArray, which got implicitly converted to C strings and promptly deleted. Instead, return the QByteArray to the caller. Found by ASAN: ==13935==ERROR: AddressSanitizer: heap-use-after-free on address 0x6060000dffb8 at pc 0x7f764f27320b bp 0x7ffd49b11bb0 sp 0x7ffd49b11358 READ of size 7 at 0x6060000dffb8 thread T0 #1 0x7f7649d174e2 in g_strdup (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x684e2) #2 0x7f763f7abe5b (/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0+0x39e5b) #3 0x7f763f78915a in g_object_new_valist (/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0+0x1715a) #4 0x7f763f789520 in g_object_new (/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0+0x17520) #5 0x7f7640f6bcb0 in gtk_dialog_add_button (/usr/lib/x86_64-linux-gnu/libgtk-3.so.0+0x186cb0) #6 0x7f7640f8d2c9 in gtk_file_chooser_dialog_new (/usr/lib/x86_64-linux-gnu/libgtk-3.so.0+0x1a82c9) #7 0x7f7641727281 (/opt/Qt5.8.0/5.8/gcc_64/plugins/platformthemes/libqgtk3.so+0x13281) Task-number: QTBUG-59611 Change-Id: I37cc967e689f4523b504fffd14adbf944b53b754 Reviewed-by: J-P Nurmi --- src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp b/src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp index 699b0589326..8b6ec31400a 100644 --- a/src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp +++ b/src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp @@ -57,7 +57,7 @@ QT_BEGIN_NAMESPACE -static const char *standardButtonText(int button) +static QByteArray standardButtonText(int button) { return QGtk3Theme::defaultStandardButtonText(button).toUtf8(); } From cd58abb1db7f7dadae515e6aa7ec75b8d23b503d Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 16 Feb 2017 13:57:55 -0800 Subject: [PATCH 43/75] Autotest: make tst_QDir more reliable on tests being run out of order mkdir(data2) depended on mkdir(data1) being run before, or it would fail. In addition, the rmdir() test required the equivalent mkdir() test being run before. So drop these annoying dependencies and make the tests cleaner by having clear separation of the test data and merging the two tests into one The entryList() test still depends on the testdir being clean: it will fail if mkdirRmdir() previously failed. Change-Id: Iaddbecfbba5441c8b2e4fffd14a3e35972d2a3d8 Reviewed-by: David Faure --- tests/auto/corelib/io/qdir/tst_qdir.cpp | 65 +++++++++---------------- 1 file changed, 24 insertions(+), 41 deletions(-) diff --git a/tests/auto/corelib/io/qdir/tst_qdir.cpp b/tests/auto/corelib/io/qdir/tst_qdir.cpp index 6232ce4c66b..5a46c1159e5 100644 --- a/tests/auto/corelib/io/qdir/tst_qdir.cpp +++ b/tests/auto/corelib/io/qdir/tst_qdir.cpp @@ -99,14 +99,11 @@ private slots: void entryListWithSymLinks(); - void mkdir_data(); - void mkdir(); + void mkdirRmdir_data(); + void mkdirRmdir(); void makedirReturnCode(); - void rmdir_data(); - void rmdir(); - void removeRecursively_data(); void removeRecursively(); void removeRecursivelyFailure(); @@ -339,26 +336,29 @@ void tst_QDir::setPath() QCOMPARE(shared.entryList(), entries2); } -void tst_QDir::mkdir_data() +void tst_QDir::mkdirRmdir_data() { QTest::addColumn("path"); QTest::addColumn("recurse"); QStringList dirs; - dirs << QDir::currentPath() + "/testdir/one/two/three" - << QDir::currentPath() + "/testdir/two" - << QDir::currentPath() + "/testdir/two/three"; - QTest::newRow("data0") << dirs.at(0) << true; - QTest::newRow("data1") << dirs.at(1) << false; - QTest::newRow("data2") << dirs.at(2) << false; // note: requires data1 to have been run! + dirs << "testdir/one" + << "testdir/two/three/four" + << "testdir/../testdir/three"; + QTest::newRow("plain") << QDir::currentPath() + "/" + dirs.at(0) << false; + QTest::newRow("recursive") << QDir::currentPath() + "/" + dirs.at(1) << true; + QTest::newRow("with-..") << QDir::currentPath() + "/" + dirs.at(2) << false; + + QTest::newRow("relative-plain") << dirs.at(0) << false; + QTest::newRow("relative-recursive") << dirs.at(1) << true; + QTest::newRow("relative-with-..") << dirs.at(2) << false; // Ensure that none of these directories already exist - QDir dir; for (int i = 0; i < dirs.count(); ++i) - dir.rmpath(dirs.at(i)); + QVERIFY(!QFile::exists(dirs.at(i))); } -void tst_QDir::mkdir() +void tst_QDir::mkdirRmdir() { QFETCH(QString, path); QFETCH(bool, recurse); @@ -373,6 +373,15 @@ void tst_QDir::mkdir() //make sure it really exists (ie that mkdir returns the right value) QFileInfo fi(path); QVERIFY2(fi.exists() && fi.isDir(), msgDoesNotExist(path).constData()); + + if (recurse) + QVERIFY(dir.rmpath(path)); + else + QVERIFY(dir.rmdir(path)); + + //make sure it really doesn't exist (ie that rmdir returns the right value) + fi.refresh(); + QVERIFY(!fi.exists()); } void tst_QDir::makedirReturnCode() @@ -402,32 +411,6 @@ void tst_QDir::makedirReturnCode() f.remove(); } -void tst_QDir::rmdir_data() -{ - QTest::addColumn("path"); - QTest::addColumn("recurse"); - - QTest::newRow("data0") << QDir::currentPath() + "/testdir/one/two/three" << true; - QTest::newRow("data1") << QDir::currentPath() + "/testdir/two/three" << false; - QTest::newRow("data2") << QDir::currentPath() + "/testdir/two" << false; -} - -void tst_QDir::rmdir() -{ - QFETCH(QString, path); - QFETCH(bool, recurse); - - QDir dir; - if (recurse) - QVERIFY(dir.rmpath(path)); - else - QVERIFY(dir.rmdir(path)); - - //make sure it really doesn't exist (ie that rmdir returns the right value) - QFileInfo fi(path); - QVERIFY(!fi.exists()); -} - void tst_QDir::removeRecursively_data() { QTest::addColumn("path"); From 1ebd23a6703567f6ce9adbee420cb8208872392b Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 7 Mar 2017 13:53:31 +0100 Subject: [PATCH 44/75] tst_QArrayData: fix unused variable warning in reallocate() Trailing QFETCHes can be dropped. Change-Id: I4dbc5ff07a6bf418a09822424a8fb036d8349114 Reviewed-by: Thiago Macieira Reviewed-by: Olivier Goffart (Woboq GmbH) --- tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp b/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp index ba2adddca02..a00c9625109 100644 --- a/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp +++ b/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp @@ -750,7 +750,6 @@ void tst_QArrayData::reallocate() QFETCH(size_t, alignment); QFETCH(QArrayData::AllocationOptions, allocateOptions); QFETCH(bool, isCapacityReserved); - QFETCH(const QArrayData *, commonEmpty); // Maximum alignment that can be requested is that of QArrayData, // otherwise, we can't use reallocate(). From 8f7776df5e649a99377776d4f2b91c220632f36f Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 22 Mar 2017 10:06:43 +0100 Subject: [PATCH 45/75] QGuiVariant: fix unintended fall-through Found by GCC 7. Change-Id: I8a9cca5236f077335031afc90b2683a2846d3b79 Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/gui/kernel/qguivariant.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/kernel/qguivariant.cpp b/src/gui/kernel/qguivariant.cpp index bde0d20ea8b..090217187e6 100644 --- a/src/gui/kernel/qguivariant.cpp +++ b/src/gui/kernel/qguivariant.cpp @@ -291,6 +291,7 @@ static bool convert(const QVariant::Private *d, int t, default: break; } + break; } #endif #ifndef QT_NO_ICON From b07a06745eb79057ccc08bc908b2df866bc38ac0 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 3 Jan 2017 09:40:40 +0100 Subject: [PATCH 46/75] Windows QPA/Services: Do not invoke MailToProtocolHandler of url.dll As of Windows 10, MailToProtocolHandler is set as handler for mailto URLs if there is no mail client installed. As it silently fails or brings up a broken dialog after a long time, exclude it and fall back to ShellExecute() which brings up the URL assocation dialog. Task-number: QTBUG-57816 Change-Id: Ia8c09676bc44848e0549c06c3a82c9b5cce79279 Reviewed-by: Jesus Fernandez Reviewed-by: Joerg Bornemann --- src/plugins/platforms/windows/qwindowsservices.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/windows/qwindowsservices.cpp b/src/plugins/platforms/windows/qwindowsservices.cpp index 7f9c9bd205b..48332b35f80 100644 --- a/src/plugins/platforms/windows/qwindowsservices.cpp +++ b/src/plugins/platforms/windows/qwindowsservices.cpp @@ -98,7 +98,11 @@ static inline QString mailCommand() RegQueryValueEx(handle, L"", 0, 0, reinterpret_cast(command), &bufferSize); RegCloseKey(handle); } - if (!command[0]) + // QTBUG-57816: As of Windows 10, if there is no mail client installed, an entry like + // "rundll32.exe .. url.dll,MailToProtocolHandler %l" is returned. Launching it + // silently fails or brings up a broken dialog after a long time, so exclude it and + // fall back to ShellExecute() which brings up the URL assocation dialog. + if (!command[0] || wcsstr(command, L",MailToProtocolHandler") != nullptr) return QString(); wchar_t expandedCommand[MAX_PATH] = {0}; return ExpandEnvironmentStrings(command, expandedCommand, MAX_PATH) ? From 64475272a251b3ba773fec4bc6d00cfe46d1854b Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Thu, 16 Mar 2017 13:21:27 +0100 Subject: [PATCH 47/75] QMacPasteBoard - protect against dangling pointers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In QMacPasteboard we use converters from QMacInternalPasteboardMime, which has essentially a global QList of available converters. QMacInternalPasteboardMime and derived classes register/unregister their instances in this list (in ctors/dtors) and then QMacPasteboard is using converters from this list. Unfortunately, when we're un-registering converter (and this means we delete those objects) we do not remove dangling pointers from our pasteboard objects. Apparently, this problem can be seen only when working with macextras (thus having an access to this private API in client's code). Task-number: QTBUG-54832 Change-Id: Ie3aef4aaca8ef6c80544dc58821cf43fc26f84a1 Reviewed-by: Morten Johan Sørvig --- src/plugins/platforms/cocoa/qmacclipboard.mm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/plugins/platforms/cocoa/qmacclipboard.mm b/src/plugins/platforms/cocoa/qmacclipboard.mm index e09bb1e362b..f3467fdc732 100644 --- a/src/plugins/platforms/cocoa/qmacclipboard.mm +++ b/src/plugins/platforms/cocoa/qmacclipboard.mm @@ -139,10 +139,22 @@ OSStatus QMacPasteboard::promiseKeeper(PasteboardRef paste, PasteboardItemID id, const long promise_id = (long)id; // Find the kept promise + QList availableConverters + = QMacInternalPasteboardMime::all(QMacInternalPasteboardMime::MIME_ALL); const QString flavorAsQString = QString::fromCFString(flavor); QMacPasteboard::Promise promise; for (int i = 0; i < qpaste->promises.size(); i++){ QMacPasteboard::Promise tmp = qpaste->promises[i]; + if (!availableConverters.contains(tmp.convertor)) { + // promise.converter is a pointer initialized by the value found + // in QMacInternalPasteboardMime's global list of QMacInternalPasteboardMimes. + // We add pointers to this list in QMacInternalPasteboardMime's ctor; + // we remove these pointers in QMacInternalPasteboardMime's dtor. + // If tmp.converter was not found in this list, we probably have a + // dangling pointer so let's skip it. + continue; + } + if (tmp.itemId == promise_id && tmp.convertor->canConvert(tmp.mime, flavorAsQString)){ promise = tmp; break; From 87e14eb7cb964467f6dda83dd17668609e68a203 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 6 Mar 2017 20:08:07 +0100 Subject: [PATCH 48/75] don't try to use system zlib if it's not enabled ... as that would error out unhelpfully. but hypothetically, there could be dynamic builds of system libpng and sqlite3 against a static zlib, so allow it. however, it's a tad unlikely, so default to -qt-libpng when using -qt-zlib (and -qt-sqlite3 is the default anyway). amends dab013804. Change-Id: I74c41e8d8a7ee1ba5add395842383d176e23f142 Reviewed-by: Lars Knoll Reviewed-by: Joerg Bornemann --- src/gui/configure.json | 5 ++++- src/sql/configure.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gui/configure.json b/src/gui/configure.json index 81fa0db76f3..88c9858a346 100644 --- a/src/gui/configure.json +++ b/src/gui/configure.json @@ -161,7 +161,9 @@ { "libs": "-llibpng", "condition": "config.msvc" }, { "libs": "-lpng", "condition": "!config.msvc" } ], - "use": "zlib" + "use": [ + { "lib": "zlib", "condition": "features.system-zlib" } + ] }, "mirclient": { "label": "Mir client libraries", @@ -667,6 +669,7 @@ "label": " Using system libpng", "disable": "input.libpng == 'qt'", "enable": "input.libpng == 'system'", + "autoDetect": "features.system-zlib", "condition": "features.png && libs.libpng", "output": [ "privateFeature" ] }, diff --git a/src/sql/configure.json b/src/sql/configure.json index 45b3fd9dd1f..9555b64f39c 100644 --- a/src/sql/configure.json +++ b/src/sql/configure.json @@ -117,7 +117,7 @@ "-lsqlite3" ], "use": [ - { "lib": "zlib", "condition": "!config.win32" } + { "lib": "zlib", "condition": "!config.win32 && features.system-zlib" } ] } }, From 05a71c6c7f0749e10260092f3d3c6aee127b8292 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 10 Feb 2017 16:57:06 +0100 Subject: [PATCH 49/75] move freebsd device spec validation to configure amends 72efb2e6 in line with e58eb3d6f. Change-Id: I67e68e43662df6d2571579a1fed3c0f23e9416cd Reviewed-by: Jake Petroules Reviewed-by: Oleksandr Tymoshenko --- mkspecs/devices/common/freebsd_device_post.conf | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mkspecs/devices/common/freebsd_device_post.conf b/mkspecs/devices/common/freebsd_device_post.conf index 1d9694af31e..173eeb00adc 100644 --- a/mkspecs/devices/common/freebsd_device_post.conf +++ b/mkspecs/devices/common/freebsd_device_post.conf @@ -1,5 +1,7 @@ +defineTest(qtConfSanitizeMkspec) { + deviceSanityCheckCompiler() +} + QMAKE_CFLAGS += $$COMPILER_FLAGS QMAKE_CXXFLAGS += $$COMPILER_FLAGS QMAKE_LFLAGS += $$LINKER_FLAGS - -deviceSanityCheckCompiler() From 1b75a04336452bd4b5fc3764f26157d14c4e53a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Fri, 16 Dec 2016 10:27:58 +0100 Subject: [PATCH 50/75] Fix spelling: neccessary -> necessary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I7c1b1d4ef12391e1caf00eae4b816cdc6d08ee04 Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm | 2 +- src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm | 2 +- src/plugins/platforms/cocoa/qcocoaintegration.mm | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm index 7368aabf7dc..35ac7182af3 100644 --- a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm +++ b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm @@ -286,7 +286,7 @@ QT_END_NAMESPACE if (qEnvironmentVariableIsEmpty("QT_MAC_DISABLE_FOREGROUND_APPLICATION_TRANSFORM")) { if (QSysInfo::macVersion() >= QSysInfo::MV_10_12) { // Move the application window to front to avoid launching behind the terminal. - // Ignoring other apps is neccessary (we must ignore the terminal), but makes + // Ignoring other apps is necessary (we must ignore the terminal), but makes // Qt apps play slightly less nice with other apps when lanching from Finder // (See the activateIgnoringOtherApps docs.) [[NSApplication sharedApplication] activateIgnoringOtherApps:YES]; diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm index 234da57f59d..2aaad386595 100644 --- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm @@ -428,7 +428,7 @@ static QString strippedText(QString s) { // Call this functions if mFileMode, mFileOptions, // mNameFilterDropDownList or mQDirFilter changes. - // The savepanel does not contain the neccessary functions for this. + // The savepanel does not contain the necessary functions for this. const QFileDialogOptions::FileMode fileMode = mOptions->fileMode(); bool chooseFilesOnly = fileMode == QFileDialogOptions::ExistingFile || fileMode == QFileDialogOptions::ExistingFiles; diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm index 18340f4ee1e..fe4933ed6fb 100644 --- a/src/plugins/platforms/cocoa/qcocoaintegration.mm +++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm @@ -316,7 +316,7 @@ QCocoaIntegration::QCocoaIntegration(const QStringList ¶mList) // from the terminal. On 10.12+ this call has been moved to applicationDidFinishLauching // to work around issues with loss of focus at startup. if (QSysInfo::macVersion() < QSysInfo::MV_10_12) { - // Ignoring other apps is neccessary (we must ignore the terminal), but makes + // Ignoring other apps is necessary (we must ignore the terminal), but makes // Qt apps play slightly less nice with other apps when lanching from Finder // (See the activateIgnoringOtherApps docs.) [cocoaApplication activateIgnoringOtherApps : YES]; From 901ed36f3649fc77e5dc4078c0f0e485732feb7a Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Mon, 27 Feb 2017 14:41:19 +0100 Subject: [PATCH 51/75] xbm image format: avoid uninitialized pixels for truncated data xbm bitmaps are conventionally accepted as valid even if there is not enough data to fill the declared bitmap size: both ImageMagick and GIMP do this. Qt did too, but the uncovered areas would be uninitialized, and thus contain random junk bits. This commit adds clearing of the full QImage data. Task-number: QTBUG-54169 Change-Id: I84150d54d07dbd546a4947e7ec332f83f2d7ca41 Reviewed-by: Paul Olav Tvete --- src/gui/image/qxbmhandler.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/image/qxbmhandler.cpp b/src/gui/image/qxbmhandler.cpp index 19015c5dcde..155a4f88b43 100644 --- a/src/gui/image/qxbmhandler.cpp +++ b/src/gui/image/qxbmhandler.cpp @@ -143,6 +143,8 @@ static bool read_xbm_body(QIODevice *device, int w, int h, QImage *outImage) return false; } + outImage->fill(Qt::color0); // in case the image data does not cover the full image + outImage->setColorCount(2); outImage->setColor(0, qRgb(255,255,255)); // white outImage->setColor(1, qRgb(0,0,0)); // black From 97be8253fbe9d9e4954b6d345e8fe64bd566a395 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 23 Dec 2016 19:35:45 +0100 Subject: [PATCH 52/75] fix bootstrapped modules in framework builds, take 2 the borrowing of headers always happens from "proper" modules which are actually built as frameworks if so requested. that means that even though the borrowing module itself never is a framework, it needs a framework path and include paths that point into frameworks. amends 20c7ab44. Change-Id: Ic582060dd179cc592e9be7792ff02cebdfabd772 Reviewed-by: Ulf Hermann Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_module.prf | 8 ++++++-- mkspecs/features/qt_module_headers.prf | 6 ++++-- mkspecs/features/qt_module_pris.prf | 4 ++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf index ec31e457dbc..d5286ff3404 100644 --- a/mkspecs/features/qt_module.prf +++ b/mkspecs/features/qt_module.prf @@ -41,8 +41,12 @@ host_build { } } -CONFIG(shared, static|shared):qtConfig(framework): \ - CONFIG += lib_bundle +qtConfig(framework) { + minimal_syncqt: \ + CONFIG += module_frameworks + else: CONFIG(shared, static|shared): \ + CONFIG += module_frameworks lib_bundle +} CONFIG += relative_qt_rpath # Qt libraries should be relocatable diff --git a/mkspecs/features/qt_module_headers.prf b/mkspecs/features/qt_module_headers.prf index 0e04b46448b..190ce753ef5 100644 --- a/mkspecs/features/qt_module_headers.prf +++ b/mkspecs/features/qt_module_headers.prf @@ -59,7 +59,9 @@ load(qt_build_paths) # even beyond the module's own build. The implication of this is that # qmake might never use a framework's headers in a non-prefix build, # as there is no separate set of .pri files for users outside Qt. -prefix_build:lib_bundle: \ +# Borrowing is assumed to happen from modules which, in a framework build, +# actually are frameworks. +prefix_build:module_frameworks: \ fwd = _FWD # When using a split include path during the build, the installed module's # include path is also structurally different from that in the build dir. @@ -82,7 +84,7 @@ for(mod, MODULE_INCNAME) { generated_privates: \ MODULE$${sfwd}$${prv}_INCLUDES += $$mbibase/$$VERSION $$mbibase/$$VERSION/$$mod } - prefix_build:lib_bundle { + prefix_build:module_frameworks { mfbase = \$\$QT_MODULE_LIB_BASE/$${mod}.framework/Headers MODULE_INCLUDES += $$mfbase MODULE$${prv}_INCLUDES += $$mfbase/$$VERSION $$mfbase/$$VERSION/$$mod diff --git a/mkspecs/features/qt_module_pris.prf b/mkspecs/features/qt_module_pris.prf index bcaac230ec9..ffcd31db3b0 100644 --- a/mkspecs/features/qt_module_pris.prf +++ b/mkspecs/features/qt_module_pris.prf @@ -83,10 +83,10 @@ defineReplace(qtExportLibsForModule) { module_build_type = v2 static: \ module_build_type += staticlib - lib_bundle { + lib_bundle: \ module_build_type += lib_bundle + module_frameworks: \ MODULE_FRAMEWORKS = " \$\$QT_MODULE_LIB_BASE" - } internal_module: \ module_build_type += internal_module ltcg: \ From ee84af00d1ad28138a66ac422b1edb7be896512b Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 21 Mar 2017 13:43:28 +0100 Subject: [PATCH 53/75] Fix floating dock widget having the wrong parent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When dragging out a tabbed group which contains placeholder for floating QDockWidget, the floating QDockWidget would not be reparented to the new QDockWidgetGroupWindow. That's because QDockAreaLayoutInfo::reparentWidgets does not reparent floating widget (because of the item.skip test) However, we need to be careful when reparenting to pass the flags so it does not get docked. Also do not reparent QDockWidgetGroupWindow which may end up temporarily in the layout during animation when dragging a QDockWidgetGroupWindow onto another. Step to reproduce a crash that if fixed by this patch (with the mainwindow example): 1. Enable QMainWindow::GroupedDragging from the "Main window" menu 2. Add a new dock widget, "Foo", from the "Dock Widgets" 3. Tab "Foo" together with the black dock widget 4. Drag "Foo" out. (Now, Foo is still a child of the QMainWindow, and is still in the layout as tabbed, but is skipped) 5. Drag the black dockwidget out. (This, in fact, crates a QDockWidgetGroupWindow which contains the black dockwidget and the floating "Foo", but since "Foo" is floating, it is not reparented) 6. Destroy "Foo" using the "Dock Widgets" menu. (Since Foo's parent is the QMainWindow, it is not removed from the QDockWidgetGroupWindow's layout, which will cause crash on the next relayout)" This commits amends commits d57bb19902f863fc6db07674f6bd8881b0886b39 and 0feeb6f6d2cfaa964763ca1fcab65672812b4eef Change-Id: I600a56cdd889435b83d2b740598a24d81059bf44 Reviewed-by: Sérgio Martins --- src/widgets/widgets/qdockarealayout.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/widgets/widgets/qdockarealayout.cpp b/src/widgets/widgets/qdockarealayout.cpp index 8d9280ebb5c..53dbe490dcf 100644 --- a/src/widgets/widgets/qdockarealayout.cpp +++ b/src/widgets/widgets/qdockarealayout.cpp @@ -2092,15 +2092,15 @@ void QDockAreaLayoutInfo::reparentWidgets(QWidget *parent) const QDockAreaLayoutItem &item = item_list.at(i); if (item.flags & QDockAreaLayoutItem::GapItem) continue; - if (item.skip()) - continue; if (item.subinfo) item.subinfo->reparentWidgets(parent); if (item.widgetItem) { QWidget *w = item.widgetItem->widget(); + if (qobject_cast(w)) + continue; if (w->parent() != parent) { bool hidden = w->isHidden(); - w->setParent(parent); + w->setParent(parent, w->windowFlags()); if (!hidden) w->show(); } From c587036dc630bc3cd00ad5ffc1529f25df185a26 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Fri, 2 Dec 2016 18:14:45 +0100 Subject: [PATCH 54/75] Mark some methods in test code as overrides CustomTextWidgetIface marked its text() method as an override; DropOnOddRows marked its canDropMimeData() as an override; each neglected some other methods that are overrides. Convert Q_DECL_OVERRIDE to the keyword in affected classes, to match. Change-Id: I78b38e20a81e3e6aab282a1cb3d70cdf8a5f4135 Reviewed-by: Alexander Volkov Reviewed-by: Frederik Gladhorn --- .../tst_qsortfilterproxymodel.cpp | 6 +-- .../other/qaccessibility/accessiblewidgets.h | 37 ++++++++++--------- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp index 7b6c470dc4d..bc8f0c1c51d 100644 --- a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp +++ b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp @@ -3994,21 +3994,21 @@ class DropOnOddRows : public QAbstractListModel public: DropOnOddRows(QObject *parent = 0) : QAbstractListModel(parent) {} - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override { if (role == Qt::DisplayRole) return (index.row() % 2 == 0) ? "A" : "B"; return QVariant(); } - int rowCount(const QModelIndex &parent = QModelIndex()) const + int rowCount(const QModelIndex &parent = QModelIndex()) const override { Q_UNUSED(parent); return 10; } bool canDropMimeData(const QMimeData *, Qt::DropAction, - int row, int column, const QModelIndex &parent) const Q_DECL_OVERRIDE + int row, int column, const QModelIndex &parent) const override { Q_UNUSED(row); Q_UNUSED(column); diff --git a/tests/auto/other/qaccessibility/accessiblewidgets.h b/tests/auto/other/qaccessibility/accessiblewidgets.h index 35b1ec890ba..0c337a72f47 100644 --- a/tests/auto/other/qaccessibility/accessiblewidgets.h +++ b/tests/auto/other/qaccessibility/accessiblewidgets.h @@ -98,53 +98,54 @@ public: return 0; } CustomTextWidgetIface(CustomTextWidget *w): QAccessibleWidget(w) {} - void *interface_cast(QAccessible::InterfaceType t) { + void *interface_cast(QAccessible::InterfaceType t) override + { if (t == QAccessible::TextInterface) return static_cast(this); return 0; } // this is mostly to test the base implementation for textBefore/At/After - QString text(QAccessible::Text t) const Q_DECL_OVERRIDE + QString text(QAccessible::Text t) const override { if (t == QAccessible::Value) return textWidget()->text; return QAccessibleWidget::text(t); } - QString textBeforeOffset(int offset, QAccessible::TextBoundaryType boundaryType, int *startOffset, int *endOffset) const + QString textBeforeOffset(int offset, QAccessible::TextBoundaryType boundaryType, int *startOffset, int *endOffset) const override { if (offset == -2) offset = textWidget()->cursorPosition; return QAccessibleTextInterface::textBeforeOffset(offset, boundaryType, startOffset, endOffset); } - QString textAtOffset(int offset, QAccessible::TextBoundaryType boundaryType, int *startOffset, int *endOffset) const + QString textAtOffset(int offset, QAccessible::TextBoundaryType boundaryType, int *startOffset, int *endOffset) const override { if (offset == -2) offset = textWidget()->cursorPosition; return QAccessibleTextInterface::textAtOffset(offset, boundaryType, startOffset, endOffset); } - QString textAfterOffset(int offset, QAccessible::TextBoundaryType boundaryType, int *startOffset, int *endOffset) const + QString textAfterOffset(int offset, QAccessible::TextBoundaryType boundaryType, int *startOffset, int *endOffset) const override { if (offset == -2) offset = textWidget()->cursorPosition; return QAccessibleTextInterface::textAfterOffset(offset, boundaryType, startOffset, endOffset); } - void selection(int, int *startOffset, int *endOffset) const Q_DECL_OVERRIDE + void selection(int, int *startOffset, int *endOffset) const override { *startOffset = *endOffset = -1; } - int selectionCount() const Q_DECL_OVERRIDE { return 0; } - void addSelection(int, int) Q_DECL_OVERRIDE {} - void removeSelection(int) Q_DECL_OVERRIDE {} - void setSelection(int, int, int) Q_DECL_OVERRIDE {} - int cursorPosition() const Q_DECL_OVERRIDE { return textWidget()->cursorPosition; } - void setCursorPosition(int position) Q_DECL_OVERRIDE { textWidget()->cursorPosition = position; } - QString text(int startOffset, int endOffset) const Q_DECL_OVERRIDE { return textWidget()->text.mid(startOffset, endOffset); } - int characterCount() const Q_DECL_OVERRIDE { return textWidget()->text.length(); } - QRect characterRect(int) const Q_DECL_OVERRIDE { return QRect(); } - int offsetAtPoint(const QPoint &) const Q_DECL_OVERRIDE { return 0; } - void scrollToSubstring(int, int) Q_DECL_OVERRIDE {} - QString attributes(int, int *, int *) const Q_DECL_OVERRIDE + int selectionCount() const override { return 0; } + void addSelection(int, int) override {} + void removeSelection(int) override {} + void setSelection(int, int, int) override {} + int cursorPosition() const override { return textWidget()->cursorPosition; } + void setCursorPosition(int position) override { textWidget()->cursorPosition = position; } + QString text(int startOffset, int endOffset) const override { return textWidget()->text.mid(startOffset, endOffset); } + int characterCount() const override { return textWidget()->text.length(); } + QRect characterRect(int) const override { return QRect(); } + int offsetAtPoint(const QPoint &) const override { return 0; } + void scrollToSubstring(int, int) override {} + QString attributes(int, int *, int *) const override { return QString(); } private: From b1a7a7b250e3575579ad43979c5bc27283f3d5f2 Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Fri, 10 Mar 2017 13:20:12 +0100 Subject: [PATCH 55/75] Add feature.dialog Change-Id: I160d0f270d7f41671459358b9c180d71dd7786d6 Reviewed-by: Oswald Buddenhagen --- src/printsupport/configure.json | 1 + src/printsupport/dialogs/qabstractprintdialog.h | 11 +++++------ .../dialogs/qabstractprintdialog_p.h | 2 +- src/printsupport/dialogs/qpagesetupdialog.h | 9 +++++---- src/printsupport/dialogs/qpagesetupdialog_p.h | 3 ++- src/printsupport/dialogs/qprintdialog.h | 9 +++++---- src/printsupport/dialogs/qprintpreviewdialog.cpp | 3 ++- src/printsupport/dialogs/qprintpreviewdialog.h | 3 ++- src/widgets/configure.json | 16 +++++++++++++++- src/widgets/dialogs/dialogs.pri | 12 +++++++++--- src/widgets/dialogs/qcolordialog.h | 9 +++++---- src/widgets/dialogs/qdialog.h | 2 ++ src/widgets/dialogs/qdialog_p.h | 2 ++ src/widgets/dialogs/qerrormessage.h | 9 +++++---- src/widgets/dialogs/qfiledialog.h | 9 +++++---- src/widgets/dialogs/qfontdialog.h | 11 ++++++----- src/widgets/dialogs/qinputdialog.h | 11 ++++++----- src/widgets/dialogs/qmessagebox.h | 9 +++++---- src/widgets/dialogs/qprogressdialog.h | 9 +++++---- src/widgets/dialogs/qwizard.h | 5 +++-- src/widgets/itemviews/qitemdelegate.cpp | 1 - src/widgets/itemviews/qstyleditemdelegate.cpp | 1 - src/widgets/styles/qstylesheetstyle.cpp | 7 ++++++- src/widgets/widgets/qpushbutton.cpp | 13 ++++++++++++- src/widgets/widgets/qpushbutton_p.h | 4 ++++ 25 files changed, 113 insertions(+), 58 deletions(-) diff --git a/src/printsupport/configure.json b/src/printsupport/configure.json index cd775644c95..8d2a6334818 100644 --- a/src/printsupport/configure.json +++ b/src/printsupport/configure.json @@ -66,6 +66,7 @@ "features.buttongroup", "features.checkbox", "features.combobox", + "features.dialog", "features.datetimeedit", "features.dialogbuttonbox", "features.printer", diff --git a/src/printsupport/dialogs/qabstractprintdialog.h b/src/printsupport/dialogs/qabstractprintdialog.h index 6c57a301a64..e6d34cdb5bf 100644 --- a/src/printsupport/dialogs/qabstractprintdialog.h +++ b/src/printsupport/dialogs/qabstractprintdialog.h @@ -41,13 +41,14 @@ #define QABSTRACTPRINTDIALOG_H #include + +#if QT_CONFIG(printdialog) + #include QT_BEGIN_NAMESPACE -#ifndef QT_NO_PRINTER - class QAbstractPrintDialogPrivate; class QPrinter; @@ -81,7 +82,6 @@ public: Q_DECLARE_FLAGS(PrintDialogOptions, PrintDialogOption) Q_FLAG(PrintDialogOptions) -#ifndef QT_NO_PRINTDIALOG explicit QAbstractPrintDialog(QPrinter *printer, QWidget *parent = Q_NULLPTR); ~QAbstractPrintDialog(); @@ -114,13 +114,12 @@ protected: private: Q_DISABLE_COPY(QAbstractPrintDialog) -#endif // QT_NO_PRINTDIALOG }; Q_DECLARE_OPERATORS_FOR_FLAGS(QAbstractPrintDialog::PrintDialogOptions) -#endif // QT_NO_PRINTER - QT_END_NAMESPACE +#endif // QT_NO_PRINTDIALOG + #endif // QABSTRACTPRINTDIALOG_H diff --git a/src/printsupport/dialogs/qabstractprintdialog_p.h b/src/printsupport/dialogs/qabstractprintdialog_p.h index fe4e18cfc3e..12de4ee8824 100644 --- a/src/printsupport/dialogs/qabstractprintdialog_p.h +++ b/src/printsupport/dialogs/qabstractprintdialog_p.h @@ -52,10 +52,10 @@ // #include -#include "private/qdialog_p.h" #ifndef QT_NO_PRINTDIALOG +#include "private/qdialog_p.h" #include "QtPrintSupport/qabstractprintdialog.h" QT_BEGIN_NAMESPACE diff --git a/src/printsupport/dialogs/qpagesetupdialog.h b/src/printsupport/dialogs/qpagesetupdialog.h index 124d215700d..bc7462ebaa0 100644 --- a/src/printsupport/dialogs/qpagesetupdialog.h +++ b/src/printsupport/dialogs/qpagesetupdialog.h @@ -41,13 +41,14 @@ #define QPAGESETUPDIALOG_H #include + +#ifndef QT_NO_PRINTDIALOG + #include QT_BEGIN_NAMESPACE -#ifndef QT_NO_PRINTDIALOG - class QPrinter; class QPageSetupDialogPrivate; @@ -74,8 +75,8 @@ public: QPrinter *printer(); }; -#endif // QT_NO_PRINTDIALOG - QT_END_NAMESPACE +#endif // QT_NO_PRINTDIALOG + #endif // QPAGESETUPDIALOG_H diff --git a/src/printsupport/dialogs/qpagesetupdialog_p.h b/src/printsupport/dialogs/qpagesetupdialog_p.h index 46e178fef94..98b466ccdce 100644 --- a/src/printsupport/dialogs/qpagesetupdialog_p.h +++ b/src/printsupport/dialogs/qpagesetupdialog_p.h @@ -53,10 +53,11 @@ // #include -#include "private/qdialog_p.h" #ifndef QT_NO_PRINTDIALOG +#include "private/qdialog_p.h" + #include "qbytearray.h" #include "qpagesetupdialog.h" #include "qpointer.h" diff --git a/src/printsupport/dialogs/qprintdialog.h b/src/printsupport/dialogs/qprintdialog.h index f01e515af48..35d650a7fc1 100644 --- a/src/printsupport/dialogs/qprintdialog.h +++ b/src/printsupport/dialogs/qprintdialog.h @@ -41,13 +41,14 @@ #define QPRINTDIALOG_H #include + +#ifndef QT_NO_PRINTDIALOG + #include QT_BEGIN_NAMESPACE -#ifndef QT_NO_PRINTDIALOG - class QPrintDialogPrivate; class QPushButton; class QPrinter; @@ -101,8 +102,8 @@ private: # endif // Q_OS_UNIX }; -#endif // QT_NO_PRINTDIALOG - QT_END_NAMESPACE +#endif // QT_NO_PRINTDIALOG + #endif // QPRINTDIALOG_H diff --git a/src/printsupport/dialogs/qprintpreviewdialog.cpp b/src/printsupport/dialogs/qprintpreviewdialog.cpp index 4bed0b6454a..33ba842a1f1 100644 --- a/src/printsupport/dialogs/qprintpreviewdialog.cpp +++ b/src/printsupport/dialogs/qprintpreviewdialog.cpp @@ -40,7 +40,6 @@ #include "qprintpreviewdialog.h" #include "qprintpreviewwidget.h" #include -#include "private/qdialog_p.h" #include "qprintdialog.h" #include @@ -59,6 +58,8 @@ #ifndef QT_NO_PRINTPREVIEWDIALOG +#include "private/qdialog_p.h" + #include #include diff --git a/src/printsupport/dialogs/qprintpreviewdialog.h b/src/printsupport/dialogs/qprintpreviewdialog.h index 903083167c4..640369fdf3e 100644 --- a/src/printsupport/dialogs/qprintpreviewdialog.h +++ b/src/printsupport/dialogs/qprintpreviewdialog.h @@ -41,10 +41,11 @@ #define QPRINTPREVIEWDIALOG_H #include -#include #ifndef QT_NO_PRINTPREVIEWDIALOG +#include + QT_BEGIN_NAMESPACE diff --git a/src/widgets/configure.json b/src/widgets/configure.json index dedea8c59e9..13c7c774ed8 100644 --- a/src/widgets/configure.json +++ b/src/widgets/configure.json @@ -468,11 +468,17 @@ "condition": "features.lineedit && features.shortcut", "output": [ "publicFeature", "feature" ] }, + "dialog" : { + "label": "QDialog", + "purpose": "Base class of dialog windows.", + "section": "Dialogs", + "output": [ "publicFeature" ] + }, "dialogbuttonbox": { "label": "QDialogButtonBox", "purpose": "Presents buttons in a layout that is appropriate for the current widget style.", "section": "Dialogs", - "condition": "features.pushbutton", + "condition": "features.dialog && features.pushbutton", "output": [ "publicFeature" ] }, "messagebox": { @@ -481,6 +487,7 @@ "section": "Dialogs", "condition" : [ "features.checkbox", + "features.dialog", "features.dialogbuttonbox", "features.label", "features.pushbutton" @@ -492,6 +499,7 @@ "purpose": "Provides a dialog widget for specifying colors.", "section": "Dialogs", "condition": [ + "features.dialog", "features.dialogbuttonbox", "features.label", "features.pushbutton", @@ -506,6 +514,7 @@ "condition": [ "features.buttongroup", "features.combobox", + "features.dialog", "features.dialogbuttonbox", "features.dirmodel", "features.label", @@ -524,6 +533,7 @@ "condition": [ "features.checkbox", "features.combobox", + "features.dialog", "features.dialogbuttonbox", "features.groupbox", "features.label", @@ -538,6 +548,7 @@ "purpose": "Provides feedback on the progress of a slow operation.", "section": "Dialogs", "condition": [ + "features.dialog", "features.label", "features.pushbutton", "features.progressbar" @@ -550,6 +561,7 @@ "section": "Dialogs", "condition": [ "features.combobox", + "features.dialog", "features.dialogbuttonbox", "features.label", "features.pushbutton", @@ -565,6 +577,7 @@ "section": "Dialogs", "condition": [ "features.checkbox", + "features.dialog", "features.textedit", "features.label", "features.pushbutton", @@ -577,6 +590,7 @@ "purpose": "Provides a framework for multi-page click-through dialogs.", "section": "Dialogs", "condition": [ + "features.dialog", "features.pushbutton", "features.properties", "features.label" diff --git a/src/widgets/dialogs/dialogs.pri b/src/widgets/dialogs/dialogs.pri index 4f4a9b1517a..8614d2bcc63 100644 --- a/src/widgets/dialogs/dialogs.pri +++ b/src/widgets/dialogs/dialogs.pri @@ -3,8 +3,6 @@ HEADERS += \ dialogs/qcolordialog.h \ dialogs/qfscompleter_p.h \ - dialogs/qdialog.h \ - dialogs/qdialog_p.h \ dialogs/qerrormessage.h \ dialogs/qfiledialog.h \ dialogs/qfiledialog_p.h \ @@ -30,7 +28,6 @@ else: FORMS += dialogs/qfiledialog.ui INCLUDEPATH += $$PWD SOURCES += \ dialogs/qcolordialog.cpp \ - dialogs/qdialog.cpp \ dialogs/qerrormessage.cpp \ dialogs/qfiledialog.cpp \ dialogs/qfontdialog.cpp \ @@ -42,4 +39,13 @@ SOURCES += \ dialogs/qfileinfogatherer.cpp \ dialogs/qwizard.cpp \ +qtConfig(dialog) { + HEADERS += \ + dialogs/qdialog.h \ + dialogs/qdialog_p.h + + SOURCES += \ + dialogs/qdialog.cpp +} + RESOURCES += dialogs/qmessagebox.qrc diff --git a/src/widgets/dialogs/qcolordialog.h b/src/widgets/dialogs/qcolordialog.h index 3b56f0b5d14..fb5b843ce4d 100644 --- a/src/widgets/dialogs/qcolordialog.h +++ b/src/widgets/dialogs/qcolordialog.h @@ -41,13 +41,14 @@ #define QCOLORDIALOG_H #include + +#ifndef QT_NO_COLORDIALOG + #include QT_BEGIN_NAMESPACE -#ifndef QT_NO_COLORDIALOG - class QColorDialogPrivate; class Q_WIDGETS_EXPORT QColorDialog : public QDialog @@ -124,8 +125,8 @@ private: Q_DECLARE_OPERATORS_FOR_FLAGS(QColorDialog::ColorDialogOptions) -#endif // QT_NO_COLORDIALOG - QT_END_NAMESPACE +#endif // QT_NO_COLORDIALOG + #endif // QCOLORDIALOG_H diff --git a/src/widgets/dialogs/qdialog.h b/src/widgets/dialogs/qdialog.h index d88ff4a8413..72250172d33 100644 --- a/src/widgets/dialogs/qdialog.h +++ b/src/widgets/dialogs/qdialog.h @@ -43,6 +43,8 @@ #include #include +QT_REQUIRE_CONFIG(dialog); + QT_BEGIN_NAMESPACE diff --git a/src/widgets/dialogs/qdialog_p.h b/src/widgets/dialogs/qdialog_p.h index 6723edae384..9ee89863f6a 100644 --- a/src/widgets/dialogs/qdialog_p.h +++ b/src/widgets/dialogs/qdialog_p.h @@ -61,6 +61,8 @@ #endif #include +QT_REQUIRE_CONFIG(dialog); + QT_BEGIN_NAMESPACE class QSizeGrip; diff --git a/src/widgets/dialogs/qerrormessage.h b/src/widgets/dialogs/qerrormessage.h index 5ffa568c10f..976ba9abd5d 100644 --- a/src/widgets/dialogs/qerrormessage.h +++ b/src/widgets/dialogs/qerrormessage.h @@ -41,13 +41,14 @@ #define QERRORMESSAGE_H #include + +#ifndef QT_NO_ERRORMESSAGE + #include QT_BEGIN_NAMESPACE -#ifndef QT_NO_ERRORMESSAGE - class QErrorMessagePrivate; class Q_WIDGETS_EXPORT QErrorMessage: public QDialog @@ -72,8 +73,8 @@ private: Q_DISABLE_COPY(QErrorMessage) }; -#endif // QT_NO_ERRORMESSAGE - QT_END_NAMESPACE +#endif // QT_NO_ERRORMESSAGE + #endif // QERRORMESSAGE_H diff --git a/src/widgets/dialogs/qfiledialog.h b/src/widgets/dialogs/qfiledialog.h index 7959eebd7bf..733dd030926 100644 --- a/src/widgets/dialogs/qfiledialog.h +++ b/src/widgets/dialogs/qfiledialog.h @@ -44,13 +44,14 @@ #include #include #include + +#ifndef QT_NO_FILEDIALOG + #include QT_BEGIN_NAMESPACE -#ifndef QT_NO_FILEDIALOG - class QModelIndex; class QItemSelection; struct QFileDialogArgs; @@ -313,8 +314,8 @@ inline void QFileDialog::setDirectory(const QDir &adirectory) Q_DECLARE_OPERATORS_FOR_FLAGS(QFileDialog::Options) -#endif // QT_NO_FILEDIALOG - QT_END_NAMESPACE +#endif // QT_NO_FILEDIALOG + #endif // QFILEDIALOG_H diff --git a/src/widgets/dialogs/qfontdialog.h b/src/widgets/dialogs/qfontdialog.h index 276f8f5e838..da13a5ab997 100644 --- a/src/widgets/dialogs/qfontdialog.h +++ b/src/widgets/dialogs/qfontdialog.h @@ -42,14 +42,15 @@ #include #include -#include #include +#ifndef QT_NO_FONTDIALOG + +#include + QT_BEGIN_NAMESPACE -#ifndef QT_NO_FONTDIALOG - class QFontDialogPrivate; class Q_WIDGETS_EXPORT QFontDialog : public QDialog @@ -117,8 +118,8 @@ private: Q_DECLARE_OPERATORS_FOR_FLAGS(QFontDialog::FontDialogOptions) -#endif // QT_NO_FONTDIALOG - QT_END_NAMESPACE +#endif // QT_NO_FONTDIALOG + #endif // QFONTDIALOG_H diff --git a/src/widgets/dialogs/qinputdialog.h b/src/widgets/dialogs/qinputdialog.h index 2fbea908cb9..7b43e774a7c 100644 --- a/src/widgets/dialogs/qinputdialog.h +++ b/src/widgets/dialogs/qinputdialog.h @@ -41,15 +41,16 @@ #define QINPUTDIALOG_H #include -#include #include #include +#ifndef QT_NO_INPUTDIALOG + +#include + QT_BEGIN_NAMESPACE -#ifndef QT_NO_INPUTDIALOG - class QInputDialogPrivate; class Q_WIDGETS_EXPORT QInputDialog : public QDialog @@ -209,8 +210,8 @@ private: Q_DECLARE_OPERATORS_FOR_FLAGS(QInputDialog::InputDialogOptions) -#endif // QT_NO_INPUTDIALOG - QT_END_NAMESPACE +#endif // QT_NO_INPUTDIALOG + #endif // QINPUTDIALOG_H diff --git a/src/widgets/dialogs/qmessagebox.h b/src/widgets/dialogs/qmessagebox.h index 3e561a51610..40e5c701fef 100644 --- a/src/widgets/dialogs/qmessagebox.h +++ b/src/widgets/dialogs/qmessagebox.h @@ -41,13 +41,14 @@ #define QMESSAGEBOX_H #include + +#ifndef QT_NO_MESSAGEBOX + #include QT_BEGIN_NAMESPACE -#ifndef QT_NO_MESSAGEBOX - class QLabel; class QMessageBoxPrivate; class QAbstractButton; @@ -322,8 +323,8 @@ QString s = QApplication::tr("Executable '%1' requires Qt "\ str)).arg(QString::fromLatin1(qVersion())); QMessageBox::critical(0, QApplication::tr(\ "Incompatible Qt Library Error"), s, QMessageBox::Abort, 0); qFatal("%s", s.toLatin1().data()); }} -#endif // QT_NO_MESSAGEBOX - QT_END_NAMESPACE +#endif // QT_NO_MESSAGEBOX + #endif // QMESSAGEBOX_H diff --git a/src/widgets/dialogs/qprogressdialog.h b/src/widgets/dialogs/qprogressdialog.h index a5e333259f1..f4e63fb0885 100644 --- a/src/widgets/dialogs/qprogressdialog.h +++ b/src/widgets/dialogs/qprogressdialog.h @@ -41,13 +41,14 @@ #define QPROGRESSDIALOG_H #include + +#ifndef QT_NO_PROGRESSDIALOG + #include QT_BEGIN_NAMESPACE -#ifndef QT_NO_PROGRESSDIALOG - class QPushButton; class QLabel; class QProgressBar; @@ -127,8 +128,8 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_disconnectOnClose()) }; -#endif // QT_NO_PROGRESSDIALOG - QT_END_NAMESPACE +#endif // QT_NO_PROGRESSDIALOG + #endif // QPROGRESSDIALOG_H diff --git a/src/widgets/dialogs/qwizard.h b/src/widgets/dialogs/qwizard.h index 7915c9e7f88..3236ee90df5 100644 --- a/src/widgets/dialogs/qwizard.h +++ b/src/widgets/dialogs/qwizard.h @@ -41,13 +41,14 @@ #define QWIZARD_H #include + +#ifndef QT_NO_WIZARD + #include QT_BEGIN_NAMESPACE -#ifndef QT_NO_WIZARD - class QAbstractButton; class QWizardPage; class QWizardPrivate; diff --git a/src/widgets/itemviews/qitemdelegate.cpp b/src/widgets/itemviews/qitemdelegate.cpp index 747d5db7827..6a6220cd0ac 100644 --- a/src/widgets/itemviews/qitemdelegate.cpp +++ b/src/widgets/itemviews/qitemdelegate.cpp @@ -62,7 +62,6 @@ #include #include #include -#include #include #include diff --git a/src/widgets/itemviews/qstyleditemdelegate.cpp b/src/widgets/itemviews/qstyleditemdelegate.cpp index e4115c9e60f..4149d3ac3ab 100644 --- a/src/widgets/itemviews/qstyleditemdelegate.cpp +++ b/src/widgets/itemviews/qstyleditemdelegate.cpp @@ -67,7 +67,6 @@ #include #include #include -#include #include #include diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index 28860937321..94ded82ef59 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -77,7 +77,9 @@ #include #include #include +#if QT_CONFIG(dialog) #include +#endif #include #include #if QT_CONFIG(label) @@ -2819,7 +2821,10 @@ void QStyleSheetStyle::polish(QWidget *w) #ifndef QT_NO_MENUBAR || qobject_cast(w) #endif - || qobject_cast(w)) { +#if QT_CONFIG(dialog) + || qobject_cast(w) +#endif + ) { w->setAttribute(Qt::WA_StyledBackground, true); } QWidget *ew = embeddedWidget(w); diff --git a/src/widgets/widgets/qpushbutton.cpp b/src/widgets/widgets/qpushbutton.cpp index 20758679f0d..5b1e10eb322 100644 --- a/src/widgets/widgets/qpushbutton.cpp +++ b/src/widgets/widgets/qpushbutton.cpp @@ -40,8 +40,9 @@ #include "qapplication.h" #include "qbitmap.h" #include "qdesktopwidget.h" -#include "qdialog.h" +#if QT_CONFIG(dialog) #include +#endif #include "qdrawutil.h" #include "qevent.h" #include "qfontmetrics.h" @@ -292,6 +293,7 @@ QPushButton::~QPushButton() { } +#if QT_CONFIG(dialog) QDialog *QPushButtonPrivate::dialogParent() const { Q_Q(const QPushButton); @@ -303,6 +305,7 @@ QDialog *QPushButtonPrivate::dialogParent() const } return 0; } +#endif /*! Initialize \a option with the values from this QPushButton. This method is useful @@ -366,10 +369,12 @@ void QPushButton::setDefault(bool enable) if (d->defaultButton == enable) return; d->defaultButton = enable; +#if QT_CONFIG(dialog) if (d->defaultButton) { if (QDialog *dlg = d->dialogParent()) dlg->d_func()->setMainDefault(this); } +#endif update(); #ifndef QT_NO_ACCESSIBILITY QAccessible::State s; @@ -478,9 +483,11 @@ void QPushButton::focusInEvent(QFocusEvent *e) Q_D(QPushButton); if (e->reason() != Qt::PopupFocusReason && autoDefault() && !d->defaultButton) { d->defaultButton = true; +#if QT_CONFIG(dialog) QDialog *dlg = qobject_cast(window()); if (dlg) dlg->d_func()->setDefault(this); +#endif } QAbstractButton::focusInEvent(e); } @@ -492,11 +499,13 @@ void QPushButton::focusOutEvent(QFocusEvent *e) { Q_D(QPushButton); if (e->reason() != Qt::PopupFocusReason && autoDefault() && d->defaultButton) { +#if QT_CONFIG(dialog) QDialog *dlg = qobject_cast(window()); if (dlg) dlg->d_func()->setDefault(0); else d->defaultButton = false; +#endif } QAbstractButton::focusOutEvent(e); @@ -661,10 +670,12 @@ bool QPushButton::event(QEvent *e) { Q_D(QPushButton); if (e->type() == QEvent::ParentChange) { +#if QT_CONFIG(dialog) if (QDialog *dialog = d->dialogParent()) { if (d->defaultButton) dialog->d_func()->setMainDefault(this); } +#endif } else if (e->type() == QEvent::StyleChange #ifdef Q_OS_MAC || e->type() == QEvent::MacSizeChange diff --git a/src/widgets/widgets/qpushbutton_p.h b/src/widgets/widgets/qpushbutton_p.h index 198091503a5..a32b599b94d 100644 --- a/src/widgets/widgets/qpushbutton_p.h +++ b/src/widgets/widgets/qpushbutton_p.h @@ -81,7 +81,11 @@ public: #endif void resetLayoutItemMargins(); void _q_popupPressed(); +#if QT_CONFIG(dialog) QDialog *dialogParent() const; +#else + QDialog *dialogParent() const { return 0; }; +#endif QPointer menu; uint autoDefault : 2; From 329385a5d53f7c20d25b8b492acdd45a5c5ff194 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 9 Jan 2017 11:23:10 +0100 Subject: [PATCH 56/75] Build examples and tests only if their requirements are met If the respective modules aren't available we cannot build the tests and examples. We drop the qtConfig(opengl) requirement for the opengl examples as a, we would need to make the QtGui configuration available for that to work, and b, we should not add too much detail to the tests and examples build configurations. Checking each test and example for every feature it uses would be too much. Task-number: QTBUG-57255 Change-Id: Ifb043c81ec9e5c487765297bd65704812cd281fc Reviewed-by: Oswald Buddenhagen --- examples/examples.pro | 19 +++++++++---------- examples/sql/sql.pro | 2 +- examples/widgets/itemviews/itemviews.pro | 1 + tests/auto/auto.pro | 2 ++ tests/auto/corelib/io/io.pro | 5 +++++ tests/auto/corelib/itemmodels/itemmodels.pro | 10 +++++++--- .../mimetypes/qmimedatabase/qmimedatabase.pro | 6 ++++-- tests/auto/corelib/thread/thread.pro | 6 +++++- tests/auto/corelib/xml/xml.pro | 2 +- tests/auto/dbus/dbus.pro | 3 +++ tests/auto/gui/text/text.pro | 4 ++++ tests/tests.pro | 2 ++ 12 files changed, 44 insertions(+), 18 deletions(-) diff --git a/examples/examples.pro b/examples/examples.pro index f66c5cbf220..a3851c6d810 100644 --- a/examples/examples.pro +++ b/examples/examples.pro @@ -3,19 +3,18 @@ CONFIG += no_docs_target SUBDIRS = \ corelib \ - dbus \ embedded \ - gui \ - network \ qpa \ - qtconcurrent \ - qtestlib \ - sql \ - touch \ - widgets \ - xml + touch -qtHaveModule(gui):qtConfig(opengl): SUBDIRS += opengl +qtHaveModule(dbus): SUBDIRS += dbus +qtHaveModule(network): SUBDIRS += network +qtHaveModule(testlib): SUBDIRS += qtestlib +qtHaveModule(concurrent): SUBDIRS += qtconcurrent +qtHaveModule(sql): SUBDIRS += sql +qtHaveModule(widgets): SUBDIRS += widgets +qtHaveModule(xml): SUBDIRS += xml +qtHaveModule(gui): SUBDIRS += gui opengl aggregate.files = aggregate/examples.pro aggregate.path = $$[QT_INSTALL_EXAMPLES] diff --git a/examples/sql/sql.pro b/examples/sql/sql.pro index e7bf3e76d93..135d05b4e29 100644 --- a/examples/sql/sql.pro +++ b/examples/sql/sql.pro @@ -8,7 +8,7 @@ SUBDIRS = books \ relationaltablemodel \ sqlwidgetmapper -!wince: SUBDIRS += masterdetail +!wince:qtHaveModule(xml): SUBDIRS += masterdetail !wince: SUBDIRS += \ querymodel \ diff --git a/examples/widgets/itemviews/itemviews.pro b/examples/widgets/itemviews/itemviews.pro index a76c8a10770..787217a8e8f 100644 --- a/examples/widgets/itemviews/itemviews.pro +++ b/examples/widgets/itemviews/itemviews.pro @@ -20,3 +20,4 @@ SUBDIRS = addressbook \ stardelegate \ storageview contains(DEFINES, QT_NO_DRAGANDDROP): SUBDIRS -= puzzle +!qtHaveModule(xml): SUBDIRS -= simpledommodel diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index d3c4d470f5b..f4ab0d84646 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -31,6 +31,8 @@ else:!qtConfig(process): SUBDIRS -= tools !qtHaveModule(concurrent): SUBDIRS -= concurrent !qtHaveModule(network): SUBDIRS -= network !qtHaveModule(dbus): SUBDIRS -= dbus +!qtHaveModule(xml): SUBDIRS -= xml +!qtHaveModule(sql): SUBDIRS -= sql # Disable the QtDBus tests if we can't connect to the session bus !cross_compile:qtHaveModule(dbus) { diff --git a/tests/auto/corelib/io/io.pro b/tests/auto/corelib/io/io.pro index 5e20f5de5cc..ec2c803012c 100644 --- a/tests/auto/corelib/io/io.pro +++ b/tests/auto/corelib/io/io.pro @@ -49,6 +49,11 @@ SUBDIRS=\ qprocess \ qtextstream +!qtHaveModule(concurrent): SUBDIRS -= \ + qdebug \ + qlockfile \ + qurl + !qtConfig(private_tests): SUBDIRS -= \ qabstractfileengine \ qfileinfo \ diff --git a/tests/auto/corelib/itemmodels/itemmodels.pro b/tests/auto/corelib/itemmodels/itemmodels.pro index 7e0e3a0944a..c1d75cc2cb3 100644 --- a/tests/auto/corelib/itemmodels/itemmodels.pro +++ b/tests/auto/corelib/itemmodels/itemmodels.pro @@ -8,6 +8,10 @@ qtHaveModule(gui): SUBDIRS += \ qidentityproxymodel \ qitemselectionmodel \ -qtHaveModule(widgets): SUBDIRS += \ - qitemmodel \ - qsortfilterproxymodel \ +qtHaveModule(widgets) { + SUBDIRS += \ + qsortfilterproxymodel + + qtHaveModule(sql): SUBDIRS += \ + qitemmodel +} diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase.pro b/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase.pro index 536a6b64de8..f8217025648 100644 --- a/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase.pro +++ b/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase.pro @@ -1,3 +1,5 @@ TEMPLATE = subdirs -SUBDIRS = qmimedatabase-xml -unix:!mac:!qnx: SUBDIRS += qmimedatabase-cache +qtHaveModule(concurrent) { + SUBDIRS = qmimedatabase-xml + unix:!darwin:!qnx: SUBDIRS += qmimedatabase-cache +} diff --git a/tests/auto/corelib/thread/thread.pro b/tests/auto/corelib/thread/thread.pro index f18dad6a4cb..d3c669859bd 100644 --- a/tests/auto/corelib/thread/thread.pro +++ b/tests/auto/corelib/thread/thread.pro @@ -6,7 +6,6 @@ SUBDIRS=\ qresultstore \ qfuture \ qfuturesynchronizer \ - qfuturewatcher \ qmutex \ qmutexlocker \ qreadlocker \ @@ -18,3 +17,8 @@ SUBDIRS=\ qthreadstorage \ qwaitcondition \ qwritelocker + +qtHaveModule(concurrent) { + SUBDIRS += \ + qfuturewatcher +} diff --git a/tests/auto/corelib/xml/xml.pro b/tests/auto/corelib/xml/xml.pro index 20519edf1be..374e695aa70 100644 --- a/tests/auto/corelib/xml/xml.pro +++ b/tests/auto/corelib/xml/xml.pro @@ -1,3 +1,3 @@ TEMPLATE=subdirs -qtHaveModule(network): SUBDIRS= \ +qtHaveModule(network):qtHaveModule(xml): SUBDIRS= \ qxmlstream diff --git a/tests/auto/dbus/dbus.pro b/tests/auto/dbus/dbus.pro index 2c58d7e2354..6878c9341df 100644 --- a/tests/auto/dbus/dbus.pro +++ b/tests/auto/dbus/dbus.pro @@ -34,3 +34,6 @@ SUBDIRS+=\ qdbusabstractinterface \ qdbusinterface \ qdbusmarshall + +!qtHaveModule(xml): SUBDIRS -= \ + qdbusxmlparser diff --git a/tests/auto/gui/text/text.pro b/tests/auto/gui/text/text.pro index d1a3eda4fc0..6b033fb506d 100644 --- a/tests/auto/gui/text/text.pro +++ b/tests/auto/gui/text/text.pro @@ -35,3 +35,7 @@ win32:SUBDIRS -= qtextpiecetable qtextpiecetable \ qzip \ qtextodfwriter + +!qtHaveModule(xml): SUBDIRS -= \ + qcssparser \ + qtextdocument diff --git a/tests/tests.pro b/tests/tests.pro index 346102ab7bc..a3ca94a94f7 100644 --- a/tests/tests.pro +++ b/tests/tests.pro @@ -1,5 +1,7 @@ TEMPLATE = subdirs CONFIG += no_docs_target +requires(qtHaveModule(testlib)) + SUBDIRS = auto # benchmarks in debug mode is rarely sensible From 02d9225db5d286afae84876618ebf7fe7c8eaf30 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 22 Mar 2017 14:29:37 +0100 Subject: [PATCH 57/75] Fix uninitialized VCLinkerTool::DebugInfoOption Due to that uninitialized variable /DEBUG:FASTLINK ended up in vcxproj files for VS < 2015. However, that option is supported by VS >= 2015 only. Task-number: QTBUG-59630 Change-Id: I34d9eef1a3bf2262bac48962938afe84eb7de934 Reviewed-by: Oswald Buddenhagen --- qmake/generators/win32/msvc_objectmodel.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index 34975f2b7b0..1093d9849e9 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -1216,6 +1216,7 @@ VCLinkerTool::VCLinkerTool() : DataExecutionPrevention(unset), EnableCOMDATFolding(optFoldingDefault), GenerateDebugInformation(unset), + DebugInfoOption(linkerDebugOptionNone), GenerateMapFile(unset), HeapCommitSize(-1), HeapReserveSize(-1), From e0becd6a8aa5c036f67801910cf994b991cd9db5 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 22 Mar 2017 08:37:05 +0100 Subject: [PATCH 58/75] tst_QMdiArea::tabBetweenSubWindows(): Improve warning message The test has been observed to be flaky, printing warnings "Rubber band has different geometry". Output the geometries. Task-number: QTBUG-59641 Change-Id: I6c209f2a98a07655e8523c012c5562d602d217ad Reviewed-by: Marc Mutz --- tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp b/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp index 52d7a39406c..ceef88338aa 100644 --- a/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp +++ b/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp @@ -106,7 +106,8 @@ static bool tabBetweenSubWindowsIn(QMdiArea *mdiArea, int tabCount = -1, bool re } QMdiSubWindow *subWindow = subWindows.at(reverse ? subWindows.size() -1 - i : i); if (rubberBand->geometry() != subWindow->geometry()) { - qWarning("Rubber band has different geometry"); + qWarning().nospace() << "Rubber band of tab " << i << " has different geometry: " + << rubberBand->geometry() << " (sub window: " << subWindow->geometry() << ")."; return false; } } From 7a902e86ceb392b8b6cd0b3119afa19ea619868d Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 22 Mar 2017 12:19:47 +0100 Subject: [PATCH 59/75] Windows: Register windows for touch when a device is plugged in Call QWindowsWindow::registerTouchWindow() for all windows when a device is plugged in while the application is running. Guard registerTouchWindow() against repetitive invocation and wrong window types. This amends the crash fix 7daae2c2c706fd5d1c1ae44ace6847bc297803a0 and touch should then work. Task-number: QTBUG-48849 Change-Id: I8b257dda144f28d60bcc5c4e369a413a90263998 Reviewed-by: Joerg Bornemann --- src/plugins/platforms/windows/qtwindowsglobal.h | 3 +++ src/plugins/platforms/windows/qwindowscontext.cpp | 15 +++++++++++++++ src/plugins/platforms/windows/qwindowswindow.cpp | 3 ++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/windows/qtwindowsglobal.h b/src/plugins/platforms/windows/qtwindowsglobal.h index a5c05bf1a3a..e703b5d47e5 100644 --- a/src/plugins/platforms/windows/qtwindowsglobal.h +++ b/src/plugins/platforms/windows/qtwindowsglobal.h @@ -120,6 +120,7 @@ enum WindowsEventType // Simplify event types QueryEndSessionApplicationEvent = ApplicationEventFlag + 4, EndSessionApplicationEvent = ApplicationEventFlag + 5, AppCommandEvent = ApplicationEventFlag + 6, + DeviceChangeEvent = ApplicationEventFlag + 7, InputMethodStartCompositionEvent = InputMethodEventFlag + 1, InputMethodCompositionEvent = InputMethodEventFlag + 2, InputMethodEndCompositionEvent = InputMethodEventFlag + 3, @@ -271,6 +272,8 @@ inline QtWindows::WindowsEventType windowsEventType(UINT message, WPARAM wParamI #endif case WM_GESTURE: return QtWindows::GestureEvent; + case WM_DEVICECHANGE: + return QtWindows::DeviceChangeEvent; case WM_DPICHANGED: return QtWindows::DpiChangedEvent; default: diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index 5745fc6d19e..b7a866679fb 100644 --- a/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/src/plugins/platforms/windows/qwindowscontext.cpp @@ -79,6 +79,7 @@ #include #include #include +#include QT_BEGIN_NAMESPACE @@ -322,6 +323,13 @@ bool QWindowsContext::initTouch(unsigned integrationOptions) QWindowSystemInterface::registerTouchDevice(touchDevice); d->m_systemInfo |= QWindowsContext::SI_SupportsTouch; + + // A touch device was plugged while the app is running. Register all windows for touch. + if (QGuiApplicationPrivate::is_app_running) { + for (QWindowsWindow *w : qAsConst(d->m_windows)) + w->registerTouchWindow(); + } + return true; } @@ -965,6 +973,13 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message, } switch (et) { + case QtWindows::DeviceChangeEvent: + if (d->m_systemInfo & QWindowsContext::SI_SupportsTouch) + break; + // See if there are any touch devices added + if (wParam == DBT_DEVNODES_CHANGED) + initTouch(); + break; case QtWindows::KeyboardLayoutChangeEvent: if (QWindowsInputContext *wic = windowsInputContext()) wic->handleInputLanguageChanged(wParam, lParam); diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 79dce2fc43c..2875463e62f 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -2411,7 +2411,8 @@ void QWindowsWindow::setTouchWindowTouchTypeStatic(QWindow *window, QWindowsWind void QWindowsWindow::registerTouchWindow(QWindowsWindowFunctions::TouchWindowTouchTypes touchTypes) { - if ((QWindowsContext::instance()->systemInfo() & QWindowsContext::SI_SupportsTouch)) { + if ((QWindowsContext::instance()->systemInfo() & QWindowsContext::SI_SupportsTouch) + && !testFlag(TouchRegistered)) { ULONG touchFlags = 0; const bool ret = QWindowsContext::user32dll.isTouchWindow(m_data.hwnd, &touchFlags); // Return if it is not a touch window or the flags are already set by a hook From da4b91e2b2c6bb7949e2151a72be1f11c28768d6 Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Wed, 1 Mar 2017 17:39:25 +0200 Subject: [PATCH 60/75] Fix hang on sleep/wakeup This patch fixes the followings: - call "it.value()" only on valid iterators - destroySurface() doesn't remove the surfaceId from m_surfaces - the surfaceId is removed from m_surfaces when the QtSurface is really destroyed Task-number: QTBUG-59185 Change-Id: Iee37dde16fee16f19906812c55c1f0b0279b033c Reviewed-by: Mathias Hasselmann Reviewed-by: Eskil Abrahamsen Blomfeldt --- .../platforms/android/androidjnimain.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/plugins/platforms/android/androidjnimain.cpp b/src/plugins/platforms/android/androidjnimain.cpp index 1f681cc1a3c..0fabb252337 100644 --- a/src/plugins/platforms/android/androidjnimain.cpp +++ b/src/plugins/platforms/android/androidjnimain.cpp @@ -402,11 +402,6 @@ namespace QtAndroid if (surfaceId == -1) return; - QMutexLocker lock(&m_surfacesMutex); - const auto &it = m_surfaces.find(surfaceId); - if (it != m_surfaces.end()) - m_surfaces.remove(surfaceId); - QJNIEnvironmentPrivate env; if (!env) return; @@ -583,14 +578,18 @@ static void setSurface(JNIEnv *env, jobject /*thiz*/, jint id, jobject jSurface, { QMutexLocker lock(&m_surfacesMutex); const auto &it = m_surfaces.find(id); - if (it.value() == nullptr) // This should never happen... - return; - if (it == m_surfaces.end()) { qWarning()<<"Can't find surface" << id; return; } - it.value()->surfaceChanged(env, jSurface, w, h); + auto surfaceClient = it.value(); + if (!surfaceClient) // This should never happen... + return; + + surfaceClient->surfaceChanged(env, jSurface, w, h); + + if (!jSurface) + m_surfaces.erase(it); } static void setDisplayMetrics(JNIEnv */*env*/, jclass /*clazz*/, From 12a0e1b4f8c0e66b373b11b83956d1fa292c7ac4 Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Wed, 1 Mar 2017 18:34:14 +0200 Subject: [PATCH 61/75] Add gradle wrapper to Qt & update default Andriod gradle plugin We need to add gradle wrapper to Qt because it was removed from latest Android SDK. Adding it to Qt, will give us more control and will save us from pain in the future. Task-number: QTBUG-59237 Change-Id: I6419876f8be11c0feeac448b228a46f811065264 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/3rdparty/gradle/LICENSE-GRADLEW.txt | 965 ++++++++++++++++++ src/3rdparty/gradle/gradle.pro | 23 + .../gradle/gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 54213 bytes .../gradle/wrapper/gradle-wrapper.properties | 6 + src/3rdparty/gradle/gradlew | 172 ++++ src/3rdparty/gradle/gradlew.bat | 84 ++ src/3rdparty/gradle/qt_attribution.json | 13 + src/android/templates/build.gradle | 2 +- src/src.pro | 5 +- 9 files changed, 1268 insertions(+), 2 deletions(-) create mode 100644 src/3rdparty/gradle/LICENSE-GRADLEW.txt create mode 100644 src/3rdparty/gradle/gradle.pro create mode 100644 src/3rdparty/gradle/gradle/wrapper/gradle-wrapper.jar create mode 100644 src/3rdparty/gradle/gradle/wrapper/gradle-wrapper.properties create mode 100755 src/3rdparty/gradle/gradlew create mode 100644 src/3rdparty/gradle/gradlew.bat create mode 100644 src/3rdparty/gradle/qt_attribution.json diff --git a/src/3rdparty/gradle/LICENSE-GRADLEW.txt b/src/3rdparty/gradle/LICENSE-GRADLEW.txt new file mode 100644 index 00000000000..0f3f8864f62 --- /dev/null +++ b/src/3rdparty/gradle/LICENSE-GRADLEW.txt @@ -0,0 +1,965 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + + +============================================================================== +Gradle Subcomponents: + +------------------------------------------------------------------------------ +License for the slf4j package +------------------------------------------------------------------------------ +SLF4J License + +Copyright (c) 2004-2007 QOS.ch +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +These terms are identical to those of the MIT License, also called the X License or the X11 License, +which is a simple, permissive non-copyleft free software license. It is deemed compatible with virtually +all types of licenses, commercial or otherwise. In particular, the Free Software Foundation has declared it +compatible with GNU GPL. It is also known to be approved by the Apache Software Foundation as compatible +with Apache Software License. + + +------------------------------------------------------------------------------ +License for the JUnit package +------------------------------------------------------------------------------ +THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC +LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM +CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + +1. DEFINITIONS + +"Contribution" means: + +a) in the case of the initial Contributor, the initial code and +documentation distributed under this Agreement, and + +b) in the case of each subsequent Contributor: + +i) changes to the Program, and + +ii) additions to the Program; + +where such changes and/or additions to the Program originate from and are +distributed by that particular Contributor. A Contribution 'originates' from a +Contributor if it was added to the Program by such Contributor itself or anyone +acting on such Contributor's behalf. Contributions do not include additions to +the Program which: (i) are separate modules of software distributed in +conjunction with the Program under their own license agreement, and (ii) are not +derivative works of the Program. + +"Contributor" means any person or entity that distributes the Program. + +"Licensed Patents " mean patent claims licensable by a Contributor which are +necessarily infringed by the use or sale of its Contribution alone or when +combined with the Program. + +"Program" means the Contributions distributed in accordance with this Agreement. + +"Recipient" means anyone who receives the Program under this Agreement, +including all Contributors. + +2. GRANT OF RIGHTS + +a) Subject to the terms of this Agreement, each Contributor hereby grants +Recipient a non-exclusive, worldwide, royalty-free copyright license to +reproduce, prepare derivative works of, publicly display, publicly perform, +distribute and sublicense the Contribution of such Contributor, if any, and such +derivative works, in source code and object code form. + +b) Subject to the terms of this Agreement, each Contributor hereby grants +Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed +Patents to make, use, sell, offer to sell, import and otherwise transfer the +Contribution of such Contributor, if any, in source code and object code form. +This patent license shall apply to the combination of the Contribution and the +Program if, at the time the Contribution is added by the Contributor, such +addition of the Contribution causes such combination to be covered by the +Licensed Patents. The patent license shall not apply to any other combinations +which include the Contribution. No hardware per se is licensed hereunder. + +c) Recipient understands that although each Contributor grants the licenses +to its Contributions set forth herein, no assurances are provided by any +Contributor that the Program does not infringe the patent or other intellectual +property rights of any other entity. Each Contributor disclaims any liability to +Recipient for claims brought by any other entity based on infringement of +intellectual property rights or otherwise. As a condition to exercising the +rights and licenses granted hereunder, each Recipient hereby assumes sole +responsibility to secure any other intellectual property rights needed, if any. +For example, if a third party patent license is required to allow Recipient to +distribute the Program, it is Recipient's responsibility to acquire that license +before distributing the Program. + +d) Each Contributor represents that to its knowledge it has sufficient +copyright rights in its Contribution, if any, to grant the copyright license set +forth in this Agreement. + +3. REQUIREMENTS + +A Contributor may choose to distribute the Program in object code form under its +own license agreement, provided that: + +a) it complies with the terms and conditions of this Agreement; and + +b) its license agreement: + +i) effectively disclaims on behalf of all Contributors all warranties and +conditions, express and implied, including warranties or conditions of title and +non-infringement, and implied warranties or conditions of merchantability and +fitness for a particular purpose; + +ii) effectively excludes on behalf of all Contributors all liability for +damages, including direct, indirect, special, incidental and consequential +damages, such as lost profits; + +iii) states that any provisions which differ from this Agreement are offered +by that Contributor alone and not by any other party; and + +iv) states that source code for the Program is available from such +Contributor, and informs licensees how to obtain it in a reasonable manner on or +through a medium customarily used for software exchange. + +When the Program is made available in source code form: + +a) it must be made available under this Agreement; and + +b) a copy of this Agreement must be included with each copy of the Program. + +Contributors may not remove or alter any copyright notices contained within the +Program. + +Each Contributor must identify itself as the originator of its Contribution, if +any, in a manner that reasonably allows subsequent Recipients to identify the +originator of the Contribution. + +4. COMMERCIAL DISTRIBUTION + +Commercial distributors of software may accept certain responsibilities with +respect to end users, business partners and the like. While this license is +intended to facilitate the commercial use of the Program, the Contributor who +includes the Program in a commercial product offering should do so in a manner +which does not create potential liability for other Contributors. Therefore, if +a Contributor includes the Program in a commercial product offering, such +Contributor ("Commercial Contributor") hereby agrees to defend and indemnify +every other Contributor ("Indemnified Contributor") against any losses, damages +and costs (collectively "Losses") arising from claims, lawsuits and other legal +actions brought by a third party against the Indemnified Contributor to the +extent caused by the acts or omissions of such Commercial Contributor in +connection with its distribution of the Program in a commercial product +offering. The obligations in this section do not apply to any claims or Losses +relating to any actual or alleged intellectual property infringement. In order +to qualify, an Indemnified Contributor must: a) promptly notify the Commercial +Contributor in writing of such claim, and b) allow the Commercial Contributor to +control, and cooperate with the Commercial Contributor in, the defense and any +related settlement negotiations. The Indemnified Contributor may participate in +any such claim at its own expense. + +For example, a Contributor might include the Program in a commercial product +offering, Product X. That Contributor is then a Commercial Contributor. If that +Commercial Contributor then makes performance claims, or offers warranties +related to Product X, those performance claims and warranties are such +Commercial Contributor's responsibility alone. Under this section, the +Commercial Contributor would have to defend claims against the other +Contributors related to those performance claims and warranties, and if a court +requires any other Contributor to pay any damages as a result, the Commercial +Contributor must pay those damages. + +5. NO WARRANTY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR +IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, +NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each +Recipient is solely responsible for determining the appropriateness of using and +distributing the Program and assumes all risks associated with its exercise of +rights under this Agreement, including but not limited to the risks and costs of +program errors, compliance with applicable laws, damage to or loss of data, +programs or equipment, and unavailability or interruption of operations. + +6. DISCLAIMER OF LIABILITY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY +CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST +PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS +GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. GENERAL + +If any provision of this Agreement is invalid or unenforceable under applicable +law, it shall not affect the validity or enforceability of the remainder of the +terms of this Agreement, and without further action by the parties hereto, such +provision shall be reformed to the minimum extent necessary to make such +provision valid and enforceable. + +If Recipient institutes patent litigation against a Contributor with respect to +a patent applicable to software (including a cross-claim or counterclaim in a +lawsuit), then any patent licenses granted by that Contributor to such Recipient +under this Agreement shall terminate as of the date such litigation is filed. In +addition, if Recipient institutes patent litigation against any entity +(including a cross-claim or counterclaim in a lawsuit) alleging that the Program +itself (excluding combinations of the Program with other software or hardware) +infringes such Recipient's patent(s), then such Recipient's rights granted under +Section 2(b) shall terminate as of the date such litigation is filed. + +All Recipient's rights under this Agreement shall terminate if it fails to +comply with any of the material terms or conditions of this Agreement and does +not cure such failure in a reasonable period of time after becoming aware of +such noncompliance. If all Recipient's rights under this Agreement terminate, +Recipient agrees to cease use and distribution of the Program as soon as +reasonably practicable. However, Recipient's obligations under this Agreement +and any licenses granted by Recipient relating to the Program shall continue and +survive. + +Everyone is permitted to copy and distribute copies of this Agreement, but in +order to avoid inconsistency the Agreement is copyrighted and may only be +modified in the following manner. The Agreement Steward reserves the right to +publish new versions (including revisions) of this Agreement from time to time. +No one other than the Agreement Steward has the right to modify this Agreement. +IBM is the initial Agreement Steward. IBM may assign the responsibility to serve +as the Agreement Steward to a suitable separate entity. Each new version of the +Agreement will be given a distinguishing version number. The Program (including +Contributions) may always be distributed subject to the version of the Agreement +under which it was received. In addition, after a new version of the Agreement +is published, Contributor may elect to distribute the Program (including its +Contributions) under the new version. Except as expressly stated in Sections +2(a) and 2(b) above, Recipient receives no rights or licenses to the +intellectual property of any Contributor under this Agreement, whether +expressly, by implication, estoppel or otherwise. All rights in the Program not +expressly granted under this Agreement are reserved. + +This Agreement is governed by the laws of the State of New York and the +intellectual property laws of the United States of America. No party to this +Agreement will bring a legal action under this Agreement more than one year +after the cause of action arose. Each party waives its rights to a jury trial in +any resulting litigation. + +------------------------------------------------------------------------------ +License for the JCIFS package +------------------------------------------------------------------------------ +JCIFS License + + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + diff --git a/src/3rdparty/gradle/gradle.pro b/src/3rdparty/gradle/gradle.pro new file mode 100644 index 00000000000..bad41e34680 --- /dev/null +++ b/src/3rdparty/gradle/gradle.pro @@ -0,0 +1,23 @@ +CONFIG -= qt android_install + +gradle.files = \ + $$PWD/gradlew \ + $$PWD/gradlew.bat \ + $$PWD/gradle + +gradle.path = $$[QT_INSTALL_PREFIX]/src/3rdparty/gradle + +INSTALLS += gradle + +!prefix_build:!equals(OUT_PWD, $$PWD) { + RETURN = $$escape_expand(\\n\\t) + equals(QMAKE_HOST.os, Windows) { + RETURN = $$escape_expand(\\r\\n\\t) + } + OUT_PATH = $$shell_path($$OUT_PWD) + + QMAKE_POST_LINK += \ + $${QMAKE_COPY} $$shell_path($$PWD/gradlew) $$OUT_PATH $$RETURN \ + $${QMAKE_COPY} $$shell_path($$PWD/gradlew.bat) $$OUT_PATH $$RETURN \ + $${QMAKE_COPY_DIR} $$shell_path($$PWD/gradle) $$OUT_PATH +} diff --git a/src/3rdparty/gradle/gradle/wrapper/gradle-wrapper.jar b/src/3rdparty/gradle/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..2b338a935b508eb6286ed4b84a91176ee5fb93c5 GIT binary patch literal 54213 zcmaI7W3XjgkTrT(b!^+VZQHhOvyN@swr$(CZTqW^?*97Se)qi=aD0)rp{0Dyr3n3s!40Q|jx{^R!d0{?5$!b<$q;xZz%zyNapa2&?V6XpHup!C=N zhX0SFG{20vh_Ip(jkL&v^yGw;BsI+(v?Mjf^yEx~0^K6x?$P}u^{Dui^c1By6(GcU zuu<}1p$2&?Dsk~)p}}Z>6UIf_t;3xI;Q!-+n*Zy~K>j|^*1_~2FZI8DApgt9)Is0K z%J~1+74e_0t`7QkcE%3>uaNcc5Wo>I0D#25{$&3iqWYhq!fwWf&Q7)tG=^6Cj*dyH zVV;O9@IO^?RPO3fqiD7CVF17a@${~(@kp48o9}Yem=+7e>XMe8VU@@g$h%DD0v?5D z+Ut$@U9uh{je2vf;M{rAHy=Ddu|8Su9hE8ud5;e#FWa4IFBu0@lbT)kIjFk7YO#M{ z_UhnpU=OAk&ToalWXHkwGoip`@1`{c+$_;-A@{BrvWGd1n0C?8BkXAcUB}hJ9ifTd zXmGZt20UMPJ>A`K9d~etf4lL_aN-^=h4i~6pTIuc#?fUTya6@joGghByrRwEp6ns& zd&Qr~-rb(T@gNSHuKk&*dp$9}97J6mjOctPsOd%;PFee`sqIx2e8rg2HGO8p@5D2N zJx=u&A7;Ik{?$cw0C8-bXwMvJD{jWVnSq0IeuaU4jg5tdi++wN3k_ZD5gaT^Ec7l@ zUa~ZunVxelrCFSv!-1zS-V#TvVX@6od@PY3xJ>bsOEg6JdG z+K!pzxd`b3k$evQeZqTUAhmZe`x3ix`C8_(`>+zEQ}shDw<}~?e3?djT#2A`La?}p zj0O5dtyyJ+H zqUrjYQ4e+(l4AV;pwtqZhOgYr#WFAg%Zl0&ZaMV`k(g8ES^@~SDWgW;9h;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ty/gradle/gradle/wrapper/gradle-wrapper.properties b/src/3rdparty/gradle/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000000..4244097b7bb --- /dev/null +++ b/src/3rdparty/gradle/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Mon Feb 20 10:43:22 EST 2017 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-3.4-bin.zip diff --git a/src/3rdparty/gradle/gradlew b/src/3rdparty/gradle/gradlew new file mode 100755 index 00000000000..eeff5ccf0e3 --- /dev/null +++ b/src/3rdparty/gradle/gradlew @@ -0,0 +1,172 @@ +#!/usr/bin/env sh + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="-Xmx1024m -Dfile.encoding=UTF-8" + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save ( ) { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/src/3rdparty/gradle/gradlew.bat b/src/3rdparty/gradle/gradlew.bat new file mode 100644 index 00000000000..65b35a4602b --- /dev/null +++ b/src/3rdparty/gradle/gradlew.bat @@ -0,0 +1,84 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS=-Xmx1024m -Dfile.encoding=UTF-8 + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/src/3rdparty/gradle/qt_attribution.json b/src/3rdparty/gradle/qt_attribution.json new file mode 100644 index 00000000000..3545af0f0ca --- /dev/null +++ b/src/3rdparty/gradle/qt_attribution.json @@ -0,0 +1,13 @@ +{ + "Id": "android-gradle-wrapper", + "Name": "Gradle wrapper", + "Homepage": "https://gradle.org", + "Version": "3.4.1", + "DownloadLocation": "https://github.com/gradle/gradle/releases/tag/v3.4.1", + "QtUsage": "Needed to create Android packages", + + "License": "Apache License 2.0", + "LicenseId": "Apache-2.0", + "LicenseFile": "LICENSE-GRADLEW.txt", + "Copyright": "Copyright (C) 2017 Gradle Inc." +} diff --git a/src/android/templates/build.gradle b/src/android/templates/build.gradle index ef416b0b88c..dbe841255df 100644 --- a/src/android/templates/build.gradle +++ b/src/android/templates/build.gradle @@ -4,7 +4,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:1.1.0' + classpath 'com.android.tools.build:gradle:2.2.0' } } diff --git a/src/src.pro b/src/src.pro index c0366f32b6d..24c550a5cd0 100644 --- a/src/src.pro +++ b/src/src.pro @@ -91,6 +91,9 @@ src_3rdparty_libpng.target = sub-3rdparty-libpng src_3rdparty_freetype.subdir = $$PWD/3rdparty/freetype src_3rdparty_freetype.target = sub-3rdparty-freetype +src_3rdparty_gradle.subdir = $$PWD/3rdparty/gradle +src_3rdparty_gradle.target = sub-3rdparty-gradle + src_angle.subdir = $$PWD/angle src_angle.target = sub-angle @@ -200,7 +203,7 @@ SUBDIRS += src_plugins nacl: SUBDIRS -= src_network src_testlib -android: SUBDIRS += src_android +android: SUBDIRS += src_android src_3rdparty_gradle TR_EXCLUDE = \ src_tools_bootstrap src_tools_moc src_tools_rcc src_tools_uic src_tools_qlalr \ From d82d2f67161ed12d94edcc79914ec74df4cd40d3 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 2 Mar 2017 17:41:06 +0100 Subject: [PATCH 62/75] QSslSocket: fix connection to a international domain name RFC6125 section 6.4.2 specify we need to convert the IDN to ascii before comparison. Note that we don't need to toLower anymore because toAce takes care of it. Section 7.2 recommands that we dod not attempt to check for wildcard character embedded within the A-labels or U-labels of an internationalized domain name. So we reject names that contiains a '*' but starts with 'xn--'. Change-Id: Ib0830520a1f82bbf9fd11818718277a479527ee3 Reviewed-by: Timur Pocheptsov --- src/network/ssl/qsslsocket.cpp | 25 +++++++++++++----- src/network/ssl/qsslsocket_p.h | 3 ++- .../ssl/qsslsocket/certs/xn--schufele-2za.crt | 11 ++++++++ .../network/ssl/qsslsocket/tst_qsslsocket.cpp | 26 +++++++++++++++++++ 4 files changed, 58 insertions(+), 7 deletions(-) create mode 100644 tests/auto/network/ssl/qsslsocket/certs/xn--schufele-2za.crt diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp index 2fc779b2573..166907780b8 100644 --- a/src/network/ssl/qsslsocket.cpp +++ b/src/network/ssl/qsslsocket.cpp @@ -326,6 +326,7 @@ #include #include #include +#include #include #include #include @@ -2673,31 +2674,35 @@ QSharedPointer QSslSocketPrivate::sslContext(QSslSocket *socket) bool QSslSocketPrivate::isMatchingHostname(const QSslCertificate &cert, const QString &peerName) { - const QString lowerPeerName = peerName.toLower(); + const QString lowerPeerName = QString::fromLatin1(QUrl::toAce(peerName)); const QStringList commonNames = cert.subjectInfo(QSslCertificate::CommonName); for (const QString &commonName : commonNames) { - if (isMatchingHostname(commonName.toLower(), lowerPeerName)) + if (isMatchingHostname(commonName, lowerPeerName)) return true; } const auto subjectAlternativeNames = cert.subjectAlternativeNames(); const auto altNames = subjectAlternativeNames.equal_range(QSsl::DnsEntry); for (auto it = altNames.first; it != altNames.second; ++it) { - if (isMatchingHostname(it->toLower(), lowerPeerName)) + if (isMatchingHostname(*it, lowerPeerName)) return true; } return false; } +/*! \internal + Checks if the certificate's name \a cn matches the \a hostname. + \a hostname must be normalized in ASCII-Compatible Encoding, but \a cn is not normalized + */ bool QSslSocketPrivate::isMatchingHostname(const QString &cn, const QString &hostname) { int wildcard = cn.indexOf(QLatin1Char('*')); // Check this is a wildcard cert, if not then just compare the strings if (wildcard < 0) - return cn == hostname; + return QLatin1String(QUrl::toAce(cn)) == hostname; int firstCnDot = cn.indexOf(QLatin1Char('.')); int secondCnDot = cn.indexOf(QLatin1Char('.'), firstCnDot+1); @@ -2714,13 +2719,21 @@ bool QSslSocketPrivate::isMatchingHostname(const QString &cn, const QString &hos if (cn.lastIndexOf(QLatin1Char('*')) != wildcard) return false; + // Reject wildcard character embedded within the A-labels or U-labels of an internationalized + // domain name (RFC6125 section 7.2) + if (cn.startsWith(QLatin1String("xn--"), Qt::CaseInsensitive)) + return false; + // Check characters preceding * (if any) match - if (wildcard && (hostname.leftRef(wildcard) != cn.leftRef(wildcard))) + if (wildcard && hostname.leftRef(wildcard).compare(cn.leftRef(wildcard), Qt::CaseInsensitive) != 0) return false; // Check characters following first . match - if (hostname.midRef(hostname.indexOf(QLatin1Char('.'))) != cn.midRef(firstCnDot)) + int hnDot = hostname.indexOf(QLatin1Char('.')); + if (hostname.midRef(hnDot + 1) != cn.midRef(firstCnDot + 1) + && hostname.midRef(hnDot + 1) != QLatin1String(QUrl::toAce(cn.mid(firstCnDot + 1)))) { return false; + } // Check if the hostname is an IP address, if so then wildcards are not allowed QHostAddress addr(hostname); diff --git a/src/network/ssl/qsslsocket_p.h b/src/network/ssl/qsslsocket_p.h index cec61d07c1e..aec34374220 100644 --- a/src/network/ssl/qsslsocket_p.h +++ b/src/network/ssl/qsslsocket_p.h @@ -151,7 +151,8 @@ public: QRegExp::PatternSyntax syntax); static void addDefaultCaCertificate(const QSslCertificate &cert); static void addDefaultCaCertificates(const QList &certs); - static bool isMatchingHostname(const QSslCertificate &cert, const QString &peerName); + Q_AUTOTEST_EXPORT static bool isMatchingHostname(const QSslCertificate &cert, + const QString &peerName); Q_AUTOTEST_EXPORT static bool isMatchingHostname(const QString &cn, const QString &hostname); #if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) diff --git a/tests/auto/network/ssl/qsslsocket/certs/xn--schufele-2za.crt b/tests/auto/network/ssl/qsslsocket/certs/xn--schufele-2za.crt new file mode 100644 index 00000000000..b34847b8d25 --- /dev/null +++ b/tests/auto/network/ssl/qsslsocket/certs/xn--schufele-2za.crt @@ -0,0 +1,11 @@ +-----BEGIN CERTIFICATE----- +MIIBfTCCASegAwIBAgIJANTX9XvqKXllMA0GCSqGSIb3DQEBCwUAMBoxGDAWBgNV +BAMMDyouU0NIw4RVRkVMRS5ERTAeFw0xNzAzMDcwOTIwMzZaFw0xNzA0MDYwOTIw +MzZaMBoxGDAWBgNVBAMMDyouU0NIw4RVRkVMRS5ERTBcMA0GCSqGSIb3DQEBAQUA +A0sAMEgCQQDZGJFl85dMxps7EryuNyP1apWrBqp7mlwgfbCN9wboyUZBLCWM58UK +6oJPg0X19IJUv3UTxD8GH7qQteCXPl4bAgMBAAGjUDBOMB0GA1UdDgQWBBSLuHtk +CfEpYnW5Rw7XcO53P/1+jDAfBgNVHSMEGDAWgBSLuHtkCfEpYnW5Rw7XcO53P/1+ +jDAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA0EAXrGVzhGlekW5Zm78tASr +5lTF6wn3klqvd2zTqTKuAKWAuBNX46p79g8OGsfY76X9M+/RbUYa7h5BuTL9b45K +dw== +-----END CERTIFICATE----- diff --git a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp index 4eb26d17fec..8a8522760c8 100644 --- a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp +++ b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp @@ -191,6 +191,7 @@ private slots: void supportedCiphers(); void systemCaCertificates(); void wildcardCertificateNames(); + void isMatchingHostname(); void wildcard(); void setEmptyKey(); void spontaneousWrite(); @@ -1643,10 +1644,15 @@ void tst_QSslSocket::wildcardCertificateNames() { // Passing CN matches QCOMPARE( QSslSocketPrivate::isMatchingHostname(QString("www.example.com"), QString("www.example.com")), true ); + QCOMPARE( QSslSocketPrivate::isMatchingHostname(QString("WWW.EXAMPLE.COM"), QString("www.example.com")), true ); QCOMPARE( QSslSocketPrivate::isMatchingHostname(QString("*.example.com"), QString("www.example.com")), true ); QCOMPARE( QSslSocketPrivate::isMatchingHostname(QString("xxx*.example.com"), QString("xxxwww.example.com")), true ); QCOMPARE( QSslSocketPrivate::isMatchingHostname(QString("f*.example.com"), QString("foo.example.com")), true ); QCOMPARE( QSslSocketPrivate::isMatchingHostname(QString("192.168.0.0"), QString("192.168.0.0")), true ); + QCOMPARE( QSslSocketPrivate::isMatchingHostname(QString("foo.éxample.com"), QString("foo.xn--xample-9ua.com")), true ); + QCOMPARE( QSslSocketPrivate::isMatchingHostname(QString("*.éxample.com"), QString("foo.xn--xample-9ua.com")), true ); + QCOMPARE( QSslSocketPrivate::isMatchingHostname(QString("xn--kcry6tjko.example.org"), QString("xn--kcry6tjko.example.org")), true); + QCOMPARE( QSslSocketPrivate::isMatchingHostname(QString("*.xn--kcry6tjko.example.org"), QString("xn--kcr.xn--kcry6tjko.example.org")), true); // Failing CN matches QCOMPARE( QSslSocketPrivate::isMatchingHostname(QString("xxx.example.com"), QString("www.example.com")), false ); @@ -1661,6 +1667,26 @@ void tst_QSslSocket::wildcardCertificateNames() QCOMPARE( QSslSocketPrivate::isMatchingHostname(QString(""), QString("www")), false ); QCOMPARE( QSslSocketPrivate::isMatchingHostname(QString("*"), QString("www")), false ); QCOMPARE( QSslSocketPrivate::isMatchingHostname(QString("*.168.0.0"), QString("192.168.0.0")), false ); + QCOMPARE( QSslSocketPrivate::isMatchingHostname(QString("xn--kcry6tjko*.example.org"), QString("xn--kcry6tjkoanc.example.org")), false ); // RFC 6125 §7.2 + QCOMPARE( QSslSocketPrivate::isMatchingHostname(QString("å*.example.org"), QString("xn--la-xia.example.org")), false ); +} + +void tst_QSslSocket::isMatchingHostname() +{ + // with normalization: (the certificate has *.SCHÄUFELE.DE as a CN) + // openssl req -x509 -nodes -subj "/CN=*.SCHÄUFELE.DE" -newkey rsa:512 -keyout /dev/null -out xn--schufele-2za.crt + QList certs = QSslCertificate::fromPath(SRCDIR "certs/xn--schufele-2za.crt"); + QVERIFY(!certs.isEmpty()); + QSslCertificate cert = certs.first(); + + QCOMPARE(QSslSocketPrivate::isMatchingHostname(cert, QString::fromUtf8("WWW.SCHÄUFELE.DE")), true); + QCOMPARE(QSslSocketPrivate::isMatchingHostname(cert, QString::fromUtf8("www.xn--schufele-2za.de")), true); + QCOMPARE(QSslSocketPrivate::isMatchingHostname(cert, QString::fromUtf8("www.schäufele.de")), true); + QCOMPARE(QSslSocketPrivate::isMatchingHostname(cert, QString::fromUtf8("föo.schäufele.de")), true); + + QCOMPARE(QSslSocketPrivate::isMatchingHostname(cert, QString::fromUtf8("foo.foo.xn--schufele-2za.de")), false); + QCOMPARE(QSslSocketPrivate::isMatchingHostname(cert, QString::fromUtf8("www.schaufele.de")), false); + QCOMPARE(QSslSocketPrivate::isMatchingHostname(cert, QString::fromUtf8("www.schufele.de")), false); } void tst_QSslSocket::wildcard() From 9021a748afc9a380feb80dc4d1a824c4d77f2aa1 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 17 Mar 2017 14:03:08 -0700 Subject: [PATCH 63/75] QStorageInfo: Fix warning about unused variable Happens on non-Linux, non-macOS Unix systems (got it on FreeBSD). Change-Id: Ie67d35dff21147e99ad9fffd14acc7308b5ff17e Reviewed-by: Jake Petroules Reviewed-by: Oswald Buddenhagen --- src/corelib/io/qstorageinfo_unix.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/corelib/io/qstorageinfo_unix.cpp b/src/corelib/io/qstorageinfo_unix.cpp index fcc7b8ca509..b9c98836090 100644 --- a/src/corelib/io/qstorageinfo_unix.cpp +++ b/src/corelib/io/qstorageinfo_unix.cpp @@ -503,6 +503,8 @@ static QByteArray extractSubvolume(const QStorageIterator &it) // if we didn't find the subvolume name, return the subvolume ID return id; } +#else + Q_UNUSED(it); #endif return QByteArray(); } From e5c0371d18e285d7849cbd0569970e209bd01b49 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Fri, 3 Mar 2017 14:40:40 +0100 Subject: [PATCH 64/75] Fix propagation of locale from widget to its children Fix the condition in QWidgetPrivate::resolveLocale() to decide whether to propagate locale: make it match setLocale_helper()'s condition when deciding whether to propagate to descendants. This lead to a QDateTimeEdit's calendar popup not getting told what locale to use correctly, unless we setLocale() on it overtly, which then blocked propagation of locale changes to it unless QDateTimeEdit manually propagated the changes. Fix the documentation of WA_WindowPropagation to mention locale as also being propagated (which it was in several places, only neglecting this one in resolveLocale). [ChangeLog][QWidget][Qt::WA_WindowPropagation] Propagate locale consistently, along with font and palette, within the widget hierarchy. Previously, locale was propagated on ancestral setLocale(), but not on creation of the descendant. Task-number: QTBUG-59106 Change-Id: I92270f7789c8eda66a458274a658c84c7b0df754 Reviewed-by: David Faure --- src/corelib/global/qnamespace.qdoc | 4 +-- src/widgets/kernel/qwidget.cpp | 2 +- .../widgets/kernel/qwidget/tst_qwidget.cpp | 28 +++++++++++++++++++ 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 71cd9444d6a..59fa0b519c6 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -1151,8 +1151,8 @@ and Windows) the window will take a modified appearance. This flag is set or cleared by QWidget::setWindowModified(). - \value WA_WindowPropagation Makes a toplevel window inherit font and - palette from its parent. + \value WA_WindowPropagation Makes a toplevel window inherit font, palette + and locale from its parent. \value WA_MacAlwaysShowToolWindow On \macos, show the tool window even when the application is not active. By default, all tool windows are diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index cf90df6b9b3..7e9e4f0a981 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -5993,7 +5993,7 @@ void QWidgetPrivate::resolveLocale() Q_Q(const QWidget); if (!q->testAttribute(Qt::WA_SetLocale)) { - setLocale_helper(q->isWindow() + setLocale_helper(q->isWindow() && !q->testAttribute(Qt::WA_WindowPropagation) ? QLocale() : q->parentWidget()->locale()); } diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index 731a8c5d91a..2698777ac8e 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -277,6 +277,7 @@ private slots: #endif void setLocale(); + void propagateLocale(); void deleteStyle(); void multipleToplevelFocusCheck(); void setFocus(); @@ -1203,6 +1204,33 @@ void tst_QWidget::setLocale() QCOMPARE(child2.locale(), QLocale(QLocale::French)); } +void tst_QWidget::propagateLocale() +{ + QWidget parent; + parent.setLocale(QLocale::French); + // Non-window widget; propagates locale: + QWidget *child = new QWidget(&parent); + QVERIFY(!child->isWindow()); + QVERIFY(!child->testAttribute(Qt::WA_WindowPropagation)); + QCOMPARE(child->locale(), QLocale(QLocale::French)); + parent.setLocale(QLocale::Italian); + QCOMPARE(child->locale(), QLocale(QLocale::Italian)); + delete child; + // Window: doesn't propagate locale: + child = new QWidget(&parent, Qt::Window); + QVERIFY(child->isWindow()); + QVERIFY(!child->testAttribute(Qt::WA_WindowPropagation)); + QCOMPARE(child->locale(), QLocale()); + parent.setLocale(QLocale::French); + QCOMPARE(child->locale(), QLocale()); + // ... unless we tell it to: + child->setAttribute(Qt::WA_WindowPropagation, true); + QVERIFY(child->testAttribute(Qt::WA_WindowPropagation)); + QCOMPARE(child->locale(), QLocale(QLocale::French)); + parent.setLocale(QLocale::Italian); + QCOMPARE(child->locale(), QLocale(QLocale::Italian)); +} + void tst_QWidget::visible_setWindowOpacity() { QScopedPointer testWidget(new QWidget); From e26bcc4d5d879ffa9f0fa8cce0fa1ffbbaf47e59 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 23 Mar 2017 15:11:15 -0700 Subject: [PATCH 65/75] Disable -Werror for QNX's compiler The compiler is mostly GCC in disguise, but the libraries are not. Since the toolchain is not open, it's difficult to fix issues in it. Task-number: QTBUG-59671 Task-number: QTBUG-59672 Change-Id: Id92f4a61915b49ddaee6fffd14aea2639153f073 Reviewed-by: Jake Petroules --- mkspecs/features/qt_common.prf | 2 +- mkspecs/features/qt_module_headers.prf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mkspecs/features/qt_common.prf b/mkspecs/features/qt_common.prf index eaea8f2d4b6..7060b09dfef 100644 --- a/mkspecs/features/qt_common.prf +++ b/mkspecs/features/qt_common.prf @@ -88,7 +88,7 @@ warnings_are_errors:warning_clean { # (NULL in C++ is usually a literal 0) QMAKE_CXXFLAGS_WARN_ON += -Werror -ww177,1224,1478,1881 $$WERROR } - } else:gcc:!clang:!intel_icc { + } else:gcc:!clang:!intel_icc:!rim_qcc { # GCC 4.6-4.9, 5.x, ... ver = $${QT_GCC_MAJOR_VERSION}.$${QT_GCC_MINOR_VERSION} contains(ver, "(4\\.[6789]|[5-9]\\..)") { diff --git a/mkspecs/features/qt_module_headers.prf b/mkspecs/features/qt_module_headers.prf index 190ce753ef5..648723d6ffb 100644 --- a/mkspecs/features/qt_module_headers.prf +++ b/mkspecs/features/qt_module_headers.prf @@ -180,7 +180,7 @@ headersclean:!internal_module { -Dforeach=public: \ -Dforever=public: - gcc { + gcc:!rim_qcc { # Turn on some extra warnings not found in -Wall -Wextra. # Common to GCC, Clang and ICC (and other compilers that masquerade as GCC): hcleanFLAGS = -Wall -Wextra -Werror \ From e19fda916aa92f8890199dc4b9d56884c55d0cd8 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 23 Mar 2017 15:18:00 -0700 Subject: [PATCH 66/75] Fix some warnings found by QNX's compiler -Werror is now disabled for that compiler, but it doesn't hurt to fix. io/qstandardpaths_unix.cpp:149:32: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] qtestcase.cpp:2330:31: error: narrowing conversion of '(ms / 1000)' from 'int' to '_Timet {aka unsigned int}' inside { } [-Werror=narrowing] Change-Id: Id92f4a61915b49ddaee6fffd14aea2c1e686e8f2 Reviewed-by: Samuli Piippo --- src/corelib/io/qstandardpaths_unix.cpp | 2 +- src/testlib/qtestcase.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qstandardpaths_unix.cpp b/src/corelib/io/qstandardpaths_unix.cpp index 7974dc8ccae..f0ff46fe7f1 100644 --- a/src/corelib/io/qstandardpaths_unix.cpp +++ b/src/corelib/io/qstandardpaths_unix.cpp @@ -117,7 +117,7 @@ QString QStandardPaths::writableLocation(StandardLocation type) } case RuntimeLocation: { - const uid_t myUid = geteuid(); + const uint myUid = uint(geteuid()); // http://standards.freedesktop.org/basedir-spec/latest/ QFileInfo fileInfo; QString xdgRuntimeDir = QFile::decodeName(qgetenv("XDG_RUNTIME_DIR")); diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index d0f4f76fe57..ac71954a554 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -2246,7 +2246,7 @@ void QTest::qSleep(int ms) #elif defined(Q_OS_WIN) Sleep(uint(ms)); #else - struct timespec ts = { ms / 1000, (ms % 1000) * 1000 * 1000 }; + struct timespec ts = { time_t(ms / 1000), (ms % 1000) * 1000 * 1000 }; nanosleep(&ts, NULL); #endif } From 5ca7d56aca5d7cae3f6eefad181839f9b3a2ece6 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sat, 25 Mar 2017 08:09:03 +0100 Subject: [PATCH 67/75] QVarLengthArray: fix compilation with GCC 7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes a warning-turned-Werror in qdistancefield.cpp: In member function ‘void QVarLengthArray::realloc(int, int) [with T = bool; int Prealloc = 256]’, inlined from ‘void makeDistanceField(QDistanceFieldData*, const QPainterPath&, int, int)’ at ../../include/QtCore/../../../../qt5/qtbase/src/corelib/tools/qvarlengtharray.h:275:10: ../../include/QtCore/../../../../qt5/qtbase/src/corelib/tools/qvarlengtharray.h:390:19: error: ‘void* memcpy(void*, const void*, size_t)’: specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Werror=stringop-overflow=] memcpy(ptr, oldPtr, copySize * sizeof(T)); ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Apparently GCC cannot rule out that copySize may be negative in the call to memcpy. Put GCC on the right track by adding a Q_ASSUME. Change-Id: I63e3801e52ebe2a7f77e3a97ef03ec3869319c8c Reviewed-by: Thiago Macieira Reviewed-by: Konstantin Ritt Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/corelib/tools/qvarlengtharray.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h index 2d3c25a5dd5..8b9df7c12b6 100644 --- a/src/corelib/tools/qvarlengtharray.h +++ b/src/corelib/tools/qvarlengtharray.h @@ -350,6 +350,7 @@ Q_OUTOFLINE_TEMPLATE void QVarLengthArray::realloc(int asize, int a int osize = s; const int copySize = qMin(asize, osize); + Q_ASSUME(copySize >= 0); if (aalloc != a) { if (aalloc > Prealloc) { T* newPtr = reinterpret_cast(malloc(aalloc * sizeof(T))); From d8e2db017392cff7c57cab0d271e5677109f3bd7 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 22 Mar 2017 14:27:25 +0100 Subject: [PATCH 68/75] QDir: replace QLVA with QVLA ... as used in qstring.cpp, too. QChar is only marked as movable, not primitive, as it should have been and ushort is, and there's some hope that the template instantiations can be shared across TUs. Saves a rather disappointing 148B in text size on optimized GCC 7 Linux AMD64 builds. Change-Id: Ic9558a4d83611a6461cd5540c9090cbd4c4f2f4e Reviewed-by: Thiago Macieira --- src/corelib/io/qdir.cpp | 47 +++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index bfb91c131fb..6d144cb65d0 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -2105,11 +2105,11 @@ Q_AUTOTEST_EXPORT QString qt_normalizePathSegments(const QString &name, bool all return name; int i = len - 1; - QVarLengthArray outVector(len); + QVarLengthArray outVector(len); int used = len; - QChar *out = outVector.data(); - const QChar *p = name.unicode(); - const QChar *prefix = p; + ushort *out = outVector.data(); + const ushort *p = name.utf16(); + const ushort *prefix = p; int up = 0; const int prefixLength = rootLength(name, allowUncPaths); @@ -2117,39 +2117,39 @@ Q_AUTOTEST_EXPORT QString qt_normalizePathSegments(const QString &name, bool all i -= prefixLength; // replicate trailing slash (i > 0 checks for emptiness of input string p) - if (i > 0 && p[i].unicode() == '/') { - out[--used].unicode() = '/'; + if (i > 0 && p[i] == '/') { + out[--used] = '/'; --i; } while (i >= 0) { // remove trailing slashes - if (p[i].unicode() == '/') { + if (p[i] == '/') { --i; continue; } // remove current directory - if (p[i].unicode() == '.' && (i == 0 || p[i-1].unicode() == '/')) { + if (p[i] == '.' && (i == 0 || p[i-1] == '/')) { --i; continue; } // detect up dir - if (i >= 1 && p[i].unicode() == '.' && p[i-1].unicode() == '.' - && (i == 1 || (i >= 2 && p[i-2].unicode() == '/'))) { + if (i >= 1 && p[i] == '.' && p[i-1] == '.' + && (i == 1 || (i >= 2 && p[i-2] == '/'))) { ++up; i -= 2; continue; } // prepend a slash before copying when not empty - if (!up && used != len && out[used].unicode() != '/') - out[--used] = QLatin1Char('/'); + if (!up && used != len && out[used] != '/') + out[--used] = '/'; // skip or copy while (i >= 0) { - if (p[i].unicode() == '/') { // do not copy slashes + if (p[i] == '/') { // do not copy slashes --i; break; } @@ -2171,17 +2171,17 @@ Q_AUTOTEST_EXPORT QString qt_normalizePathSegments(const QString &name, bool all // add remaining '..' while (up) { - if (used != len && out[used].unicode() != '/') // is not empty and there isn't already a '/' - out[--used] = QLatin1Char('/'); - out[--used] = QLatin1Char('.'); - out[--used] = QLatin1Char('.'); + if (used != len && out[used] != '/') // is not empty and there isn't already a '/' + out[--used] = '/'; + out[--used] = '.'; + out[--used] = '.'; --up; } bool isEmpty = used == len; if (prefixLength) { - if (!isEmpty && out[used].unicode() == '/') { + if (!isEmpty && out[used] == '/') { // Eventhough there is a prefix the out string is a slash. This happens, if the input // string only consists of a prefix followed by one or more slashes. Just skip the slash. ++used; @@ -2192,18 +2192,19 @@ Q_AUTOTEST_EXPORT QString qt_normalizePathSegments(const QString &name, bool all if (isEmpty) { // After resolving the input path, the resulting string is empty (e.g. "foo/.."). Return // a dot in that case. - out[--used] = QLatin1Char('.'); - } else if (out[used].unicode() == '/') { + out[--used] = '.'; + } else if (out[used] == '/') { // After parsing the input string, out only contains a slash. That happens whenever all // parts are resolved and there is a trailing slash ("./" or "foo/../" for example). // Prepend a dot to have the correct return value. - out[--used] = QLatin1Char('.'); + out[--used] = '.'; } } // If path was not modified return the original value - QString ret = (used == 0 ? name : QString(out + used, len - used)); - return ret; + if (used == 0) + return name; + return QString::fromUtf16(out + used, len - used); } static QString qt_cleanPath(const QString &path, bool *ok) From 94e6e8dfc677a86ab1df33510dffb61021298007 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Sat, 25 Mar 2017 09:27:55 +0100 Subject: [PATCH 69/75] tst_moc: fix include guards Change-Id: I465c035cc741f94cb6737e86e33fbd1589ddaa8e Reviewed-by: Marc Mutz --- tests/auto/tools/moc/cxx17-namespaces.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/tools/moc/cxx17-namespaces.h b/tests/auto/tools/moc/cxx17-namespaces.h index 7c9f54d5f3f..97f534c6977 100644 --- a/tests/auto/tools/moc/cxx17-namespaces.h +++ b/tests/auto/tools/moc/cxx17-namespaces.h @@ -27,7 +27,7 @@ ****************************************************************************/ #ifndef CXX17_NAMESPACES_H -#define CXX11_NAMESPACES_H +#define CXX17_NAMESPACES_H #include #if defined(__cpp_nested_namespace_definitions) || defined(Q_MOC_RUN) From 38550c562d918e783bb609622bc8fb46de1bfec4 Mon Sep 17 00:00:00 2001 From: Marius Kittler Date: Mon, 27 Feb 2017 22:16:41 +0100 Subject: [PATCH 70/75] json encoder: Harmonize number serialization with ES6 Ensures that numbers representable as 64-bit integer are not printed using exponent notation. Some JSON implementations such as the one of the Go standard library expect this in the default conversion to int. Change-Id: Ic3ac718b7fd36462b4fcabbfb100a528a87798c8 Reviewed-by: Thiago Macieira --- src/corelib/json/qjsonwriter.cpp | 9 +++++--- tests/auto/corelib/json/tst_qtjson.cpp | 29 ++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/src/corelib/json/qjsonwriter.cpp b/src/corelib/json/qjsonwriter.cpp index b1544c749de..12ce20ef09a 100644 --- a/src/corelib/json/qjsonwriter.cpp +++ b/src/corelib/json/qjsonwriter.cpp @@ -38,6 +38,7 @@ ** ****************************************************************************/ +#include #include #include "qjsonwriter_p.h" #include "qjson_p.h" @@ -129,10 +130,12 @@ static void valueToJson(const QJsonPrivate::Base *b, const QJsonPrivate::Value & break; case QJsonValue::Double: { const double d = v.toDouble(b); - if (qIsFinite(d)) // +2 to format to ensure the expected precision - json += QByteArray::number(d, 'g', QLocale::FloatingPointShortest); - else + if (qIsFinite(d)) { // +2 to format to ensure the expected precision + const double abs = std::abs(d); + json += QByteArray::number(d, abs == static_cast(abs) ? 'f' : 'g', QLocale::FloatingPointShortest); + } else { json += "null"; // +INF || -INF || NaN (see RFC4627#section2.4) + } break; } case QJsonValue::String: diff --git a/tests/auto/corelib/json/tst_qtjson.cpp b/tests/auto/corelib/json/tst_qtjson.cpp index 6aa5165e242..b215364f0e9 100644 --- a/tests/auto/corelib/json/tst_qtjson.cpp +++ b/tests/auto/corelib/json/tst_qtjson.cpp @@ -32,6 +32,7 @@ #include "qjsonobject.h" #include "qjsonvalue.h" #include "qjsondocument.h" +#include "qregularexpression.h" #include #define INVALID_UNICODE "\xCE\xBA\xE1" @@ -49,6 +50,7 @@ private Q_SLOTS: void testNumbers(); void testNumbers_2(); void testNumbers_3(); + void testNumbers_4(); void testObjectSimple(); void testObjectSmallKeys(); @@ -375,6 +377,33 @@ void tst_QtJson::testNumbers_3() QVERIFY(d1_1 != d2_1); } +void tst_QtJson::testNumbers_4() +{ + // no exponent notation used to print numbers between -2^64 and 2^64 + QJsonArray array; + array << QJsonValue(+1000000000000000.0); + array << QJsonValue(-1000000000000000.0); + array << QJsonValue(+9007199254740992.0); + array << QJsonValue(-9007199254740992.0); + array << QJsonValue(+9223372036854775808.0); + array << QJsonValue(-9223372036854775808.0); + array << QJsonValue(+18446744073709551616.0); + array << QJsonValue(-18446744073709551616.0); + const QByteArray json(QJsonDocument(array).toJson()); + const QByteArray expected = + "[\n" + " 1000000000000000,\n" + " -1000000000000000,\n" + " 9007199254740992,\n" + " -9007199254740992,\n" + " 9223372036854776000,\n" + " -9223372036854776000,\n" + " 18446744073709552000,\n" + " -18446744073709552000\n" + "]\n"; + QCOMPARE(json, expected); +} + void tst_QtJson::testObjectSimple() { QJsonObject object; From 1dd54b5647d33416c39fb41fdab560c815356951 Mon Sep 17 00:00:00 2001 From: Kimmo Ollila Date: Tue, 21 Mar 2017 00:06:23 +0200 Subject: [PATCH 71/75] Increase the maximum recursive template depth on INTEGRITY Set the limit to 128 instead of the default 64 by adding QMAKE_CXXFLAGS += --pending_instantiations=128. This is needed by QMetaType::typeName array implementation. Change-Id: I3fd13967f862f492210572cfe7ee9ffc5e7c9745 Reviewed-by: Lars Knoll Reviewed-by: Thiago Macieira --- src/corelib/kernel/kernel.pri | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/corelib/kernel/kernel.pri b/src/corelib/kernel/kernel.pri index 461fbd78401..0e6ff17b8fa 100644 --- a/src/corelib/kernel/kernel.pri +++ b/src/corelib/kernel/kernel.pri @@ -175,6 +175,9 @@ unix|integrity { SOURCES += kernel/qsharedmemory_android.cpp \ kernel/qsystemsemaphore_android.cpp } + + # This is needed by QMetaType::typeName array implementation + integrity: QMAKE_CXXFLAGS += --pending_instantiations=128 } vxworks { From 197b55c93966939af6443656fc0fff72c0d67dbc Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 24 Mar 2017 21:59:03 +0100 Subject: [PATCH 72/75] iOS: Hide the overlay when the keyboard is hidden If the keyboard is hidden via the hide keyboard button then the edit menu should also hide with it. This ensures it behaves in the same way as native applications on iOS then. Change-Id: I4c714dd5c5cb27d8eaf310e2911dc38feb1cb74e Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/ios/qiostextinputoverlay.mm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/platforms/ios/qiostextinputoverlay.mm b/src/plugins/platforms/ios/qiostextinputoverlay.mm index 78f84729da6..9b97ce17bba 100644 --- a/src/plugins/platforms/ios/qiostextinputoverlay.mm +++ b/src/plugins/platforms/ios/qiostextinputoverlay.mm @@ -116,6 +116,11 @@ static void executeBlockWithoutAnimation(Block block) dispatch_async(dispatch_get_main_queue (), ^{ self.visible = YES; }); } }]; + [center addObserverForName:UIKeyboardDidHideNotification object:nil queue:nil + usingBlock:^(NSNotification *) { + self.visible = NO; + }]; + } return self; From 1e7795ef604fe22895b8ec5c2278fea4217f2c07 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Tue, 21 Mar 2017 12:26:36 +0100 Subject: [PATCH 73/75] Add documentation for TabletTrackingChange enum value Amends 6aaf8532222759226a9b406bfe6c57787236cbf1 Change-Id: I2c264db235ea552ce6b4eb003d7daeeb2cecde6f Reviewed-by: Friedemann Kleint Reviewed-by: Venugopal Shivashankar --- src/corelib/kernel/qcoreevent.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp index 64e73d23c53..4efc38ac890 100644 --- a/src/corelib/kernel/qcoreevent.cpp +++ b/src/corelib/kernel/qcoreevent.cpp @@ -216,6 +216,7 @@ QT_BEGIN_NAMESPACE \omitvalue OkRequest \value TabletEnterProximity Wacom tablet enter proximity event (QTabletEvent), sent to QApplication. \value TabletLeaveProximity Wacom tablet leave proximity event (QTabletEvent), sent to QApplication. + \value TabletTrackingChange The Wacom tablet tracking state has changed (since Qt 5.9). \omitvalue ThemeChange \value ThreadChange The object is moved to another thread. This is the last event sent to this object in the previous thread. See QObject::moveToThread(). \value Timer Regular timer events (QTimerEvent). From e8d03c5599e468937b0e4270309a3be3d710df8f Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 24 Mar 2017 08:20:22 +0100 Subject: [PATCH 74/75] Bump copyright year Task-number: QTBUG-59648 Change-Id: Ie2d08515f4ad177bab338210a0a3e52f5519dcc3 Reviewed-by: Lars Knoll --- src/widgets/dialogs/qmessagebox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp index 3b0a71518d0..fe32611ed81 100644 --- a/src/widgets/dialogs/qmessagebox.cpp +++ b/src/widgets/dialogs/qmessagebox.cpp @@ -1834,7 +1834,7 @@ void QMessageBox::aboutQt(QWidget *parent, const QString &title) "

Qt and the Qt logo are trademarks of The Qt Company Ltd.

" "

Qt is The Qt Company Ltd product developed as an open source " "project. See %3 for more information.

" - ).arg(QStringLiteral("2016"), + ).arg(QStringLiteral("2017"), QStringLiteral("qt.io/licensing"), QStringLiteral("qt.io")); QMessageBox *msgBox = new QMessageBox(parent); From 15fe60cfdada84ea519f08e905d59cc3fb6d20cd Mon Sep 17 00:00:00 2001 From: Kimmo Ollila Date: Sun, 26 Mar 2017 17:38:16 +0300 Subject: [PATCH 75/75] Workaround GHS compiler bug This temporary workaround allows to compile with GHS toolchain and should be removed when GHS provides patch to fix the compiler issue. Change-Id: I0d0eac8054e6ba2f448fed3d3c80a518e0d2af97 Reviewed-by: Lars Knoll --- src/widgets/widgets/qlineedit_p.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/widgets/widgets/qlineedit_p.cpp b/src/widgets/widgets/qlineedit_p.cpp index 1d81d1fcb5a..68be82c71db 100644 --- a/src/widgets/widgets/qlineedit_p.cpp +++ b/src/widgets/widgets/qlineedit_p.cpp @@ -534,7 +534,19 @@ QWidget *QLineEditPrivate::addAction(QAction *newAction, QAction *before, QLineE #endif } // If there is a 'before' action, it takes preference + + // There's a bug in GHS compiler that causes internal error on the following code. + // The affected GHS compiler versions are 2016.5.4 and 2017.1 + // This temporary workaround allows to compile with GHS toolchain and should be + // removed when GHS provides a patch to fix the compiler issue. + +#if defined(Q_CC_GHS) + const SideWidgetLocation loc = {position, -1}; + const auto location = before ? findSideWidget(before) : loc; +#else const auto location = before ? findSideWidget(before) : SideWidgetLocation{position, -1}; +#endif + SideWidgetEntryList &list = location.position == QLineEdit::TrailingPosition ? trailingSideWidgets : leadingSideWidgets; list.insert(location.isValid() ? list.begin() + location.index : list.end(), SideWidgetEntry(w, newAction, flags));