Merge remote-tracking branch 'origin/5.12' into dev

Change-Id: I5cbfd39cf728036bbdfdeec8e8739568e0a3025b
This commit is contained in:
Qt Forward Merge Bot 2018-10-09 01:00:47 +02:00
commit 69b6845edb
25 changed files with 4484 additions and 1703 deletions

View File

@ -8,7 +8,7 @@
"Homepage": "http://zlib.net/",
"Version": "1.2.11",
"License": "ZLib license",
"License": "zlib License",
"LicenseId": "Zlib",
"LicenseFile": "LICENSE",
"Copyright": "(C) 1995-2017 Jean-loup Gailly and Mark Adler"

View File

@ -46,6 +46,7 @@ import android.content.ServiceConnection;
import android.content.pm.ComponentInfo;
import android.content.pm.PackageInfo;
import android.content.res.AssetManager;
import android.os.Build;
import android.os.Bundle;
import android.os.IBinder;
import android.os.RemoteException;
@ -651,15 +652,26 @@ public abstract class QtLoader {
String themePath = m_context.getApplicationInfo().dataDir + "/qt-reserved-files/android-style/";
String stylePath = themePath + m_displayDensity + "/";
String extractOption = "full";
String extractOption = "default";
if (m_contextInfo.metaData.containsKey("android.app.extract_android_style")) {
extractOption = m_contextInfo.metaData.getString("android.app.extract_android_style");
if (!extractOption.equals("full") && !extractOption.equals("minimal") && !extractOption.equals("none")) {
Log.e(QtApplication.QtTAG, "Invalid extract_android_style option \"" + extractOption + "\", defaulting to full");
extractOption = "full";
if (!extractOption.equals("default") && !extractOption.equals("full") && !extractOption.equals("minimal") && !extractOption.equals("none")) {
Log.e(QtApplication.QtTAG, "Invalid extract_android_style option \"" + extractOption + "\", defaulting to \"default\"");
extractOption = "default";
}
}
// QTBUG-69810: The extraction code will trigger compatibility warnings on Android SDK version >= 28
// when the target SDK version is set to something lower then 28, so default to "none" and issue a warning
// if that is the case.
if (extractOption.equals("default")) {
final int targetSdkVersion = m_context.getApplicationInfo().targetSdkVersion;
if (targetSdkVersion < 28 && Build.VERSION.SDK_INT >= 28) {
Log.e(QtApplication.QtTAG, "extract_android_style option set to \"none\" when targetSdkVersion is less then 28");
extractOption = "none";
}
}
if (!(new File(stylePath)).exists() && !extractOption.equals("none")) {
loaderParams.putString(EXTRACT_STYLE_KEY, stylePath);
loaderParams.putBoolean(EXTRACT_STYLE_MINIMAL_KEY, extractOption.equals("minimal"));

View File

@ -57,11 +57,12 @@
<!-- extract android style -->
<!-- available android:values :
* default - In most cases this will be the same as "full", but it can also be something else if needed, e.g., for compatibility reasons
* full - useful QWidget & Quick Controls 1 apps
* minimal - useful for Quick Controls 2 apps, it is much faster than "full"
* none - useful for apps that don't use any of the above Qt modules
-->
<meta-data android:name="android.app.extract_android_style" android:value="full"/>
<meta-data android:name="android.app.extract_android_style" android:value="default"/>
<!-- extract android style -->
</activity>
@ -69,7 +70,7 @@
</application>
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="16"/>
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="28"/>
<supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>
<!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application.

View File

@ -298,7 +298,8 @@ QCborValue QCborArray::at(qsizetype i) const
\fn QCborValueRef QCborArray::operator[](qsizetype i)
Returns a reference to the QCborValue element at position \a i in the
array. The array must have at least \a i elements.
array. Indices beyond the end of the array will grow the array, filling
with undefined entries, until it has an entry at the specified index.
QCborValueRef has the exact same API as \l QCborValue, with one important
difference: if you assign new values to it, this map will be updated with
@ -312,27 +313,34 @@ QCborValue QCborArray::at(qsizetype i) const
\fn void QCborArray::insert(qsizetype i, const QCborValue &value)
\fn void QCborArray::insert(qsizetype i, QCborValue &&value)
Inserts \a value into the array at position \a i in this array. The array
must have at least \a i elements before the insertion.
Inserts \a value into the array at position \a i in this array. If \a i is
-1, the entry is appended to the array. Pads the array with invalid entries
if \a i is greater than the prior size of the array.
\sa at(), operator[](), first(), last(), prepend(), append(),
removeAt(), takeAt(), extract()
*/
void QCborArray::insert(qsizetype i, const QCborValue &value)
{
Q_ASSERT(size_t(i) <= size_t(size()) || i == -1);
if (i < 0)
if (i < 0) {
Q_ASSERT(i == -1);
i = size();
detach(qMax(i + 1, size()));
detach(i + 1);
} else {
d = QCborContainerPrivate::grow(d.data(), i); // detaches
}
d->insertAt(i, value);
}
void QCborArray::insert(qsizetype i, QCborValue &&value)
{
Q_ASSERT(size_t(i) <= size_t(size()) || i == -1);
if (i < 0)
if (i < 0) {
Q_ASSERT(i == -1);
i = size();
detach(qMax(i + 1, size()));
detach(i + 1);
} else {
d = QCborContainerPrivate::grow(d.data(), i); // detaches
}
d->insertAt(i, value, QCborContainerPrivate::MoveContainer);
QCborContainerPrivate::resetValue(value);
}

View File

@ -186,10 +186,15 @@ public:
QCborValue at(qsizetype i) const;
QCborValue first() const { return at(0); }
QCborValue last() const { return at(size() - 1); }
QCborValue operator[](qsizetype i) const { return at(i); }
const QCborValue operator[](qsizetype i) const { return at(i); }
QCborValueRef first() { Q_ASSERT(!isEmpty()); return begin()[0]; }
QCborValueRef last() { Q_ASSERT(!isEmpty()); return begin()[size() - 1]; }
QCborValueRef operator[](qsizetype i) { Q_ASSERT(i < size()); return begin()[i]; }
QCborValueRef operator[](qsizetype i)
{
if (i >= size())
insert(i, QCborValue());
return begin()[i];
}
void insert(qsizetype i, const QCborValue &value);
void insert(qsizetype i, QCborValue &&value);

View File

@ -196,14 +196,22 @@ public:
{ const_iterator it = find(key); return it == end() ? QCborValue() : it.value(); }
QCborValue value(const QCborValue &key) const
{ const_iterator it = find(key); return it == end() ? QCborValue() : it.value(); }
QCborValue operator[](qint64 key) const
#if !defined(QT_NO_CAST_FROM_ASCII) && !defined(QT_RESTRICTED_CAST_FROM_ASCII)
template<size_t N> QT_ASCII_CAST_WARN const QCborValue value(const char (&key)[N]) const
{ return value(QString::fromUtf8(key, N - 1)); }
#endif
const QCborValue operator[](qint64 key) const
{ const_iterator it = find(key); return it == end() ? QCborValue() : it.value(); }
QCborValue operator[](QLatin1String key) const
const QCborValue operator[](QLatin1String key) const
{ const_iterator it = find(key); return it == end() ? QCborValue() : it.value(); }
QCborValue operator[](const QString & key) const
const QCborValue operator[](const QString & key) const
{ const_iterator it = find(key); return it == end() ? QCborValue() : it.value(); }
QCborValue operator[](const QCborValue &key) const
const QCborValue operator[](const QCborValue &key) const
{ const_iterator it = find(key); return it == end() ? QCborValue() : it.value(); }
#if !defined(QT_NO_CAST_FROM_ASCII) && !defined(QT_RESTRICTED_CAST_FROM_ASCII)
template<size_t N> QT_ASCII_CAST_WARN const QCborValue operator[](const char (&key)[N]) const
{ return operator[](QString::fromUtf8(key, N - 1)); }
#endif
QCborValueRef operator[](qint64 key);
QCborValueRef operator[](QLatin1String key);
QCborValueRef operator[](const QString & key);

View File

@ -859,6 +859,23 @@ QCborContainerPrivate *QCborContainerPrivate::detach(QCborContainerPrivate *d, q
return d;
}
/*!
Prepare for an insertion at position \a index
Detaches and ensures there are at least index entries in the array, padding
with Undefined as needed.
*/
QCborContainerPrivate *QCborContainerPrivate::grow(QCborContainerPrivate *d, qsizetype index)
{
Q_ASSERT(index >= 0);
d = detach(d, index + 1);
Q_ASSERT(d);
int j = d->elements.size();
while (j < index)
d->append(Undefined());
return d;
}
// Copies or moves \a value into element at position \a e. If \a disp is
// CopyContainer, then this function increases the reference count of the
// container, but otherwise leaves it unmodified. If \a disp is MoveContainer,

View File

@ -136,6 +136,7 @@ public:
void compact(qsizetype reserved);
static QCborContainerPrivate *clone(QCborContainerPrivate *d, qsizetype reserved = -1);
static QCborContainerPrivate *detach(QCborContainerPrivate *d, qsizetype reserved);
static QCborContainerPrivate *grow(QCborContainerPrivate *d, qsizetype index);
qptrdiff addByteData(const char *block, qsizetype len)
{

View File

@ -1341,12 +1341,33 @@ QDateTimeParser::scanString(const QDateTime &defaultValue,
const QDate date(year, month, day);
const QTime time(hour, minute, second, msec);
return StateNode(
const QDateTime when =
#if QT_CONFIG(timezone)
tspec == Qt::TimeZone ? QDateTime(date, time, timeZone) :
tspec == Qt::TimeZone ? QDateTime(date, time, timeZone) :
#endif
QDateTime(date, time, tspec, zoneOffset),
state, padding, conflicts);
QDateTime(date, time, tspec, zoneOffset);
// If hour wasn't specified, check the default we're using exists on the
// given date (which might be a spring-forward, skipping an hour).
if (parserType == QVariant::DateTime && !(isSet & HourSectionMask) && !when.isValid()) {
qint64 msecs = when.toMSecsSinceEpoch();
// Fortunately, that gets a useful answer ...
const QDateTime replace =
#if QT_CONFIG(timezone)
tspec == Qt::TimeZone
? QDateTime::fromMSecsSinceEpoch(msecs, timeZone) :
#endif
QDateTime::fromMSecsSinceEpoch(msecs, tspec, zoneOffset);
const QTime tick = replace.time();
if (replace.date() == date
&& (!(isSet & MinuteSection) || tick.minute() == minute)
&& (!(isSet & SecondSection) || tick.second() == second)
&& (!(isSet & MSecSection) || tick.msec() == msec)) {
return StateNode(replace, state, padding, conflicts);
}
}
return StateNode(when, state, padding, conflicts);
}
/*!

View File

@ -413,7 +413,8 @@ private:
bool isValidIterator(const iterator &i) const Q_DECL_NOTHROW
{
return (constBegin().i <= i.i) && (i.i <= constEnd().i);
const std::less<const Node *> less = {};
return !less(i.i, cbegin().i) && !less(cend().i, i.i);
}
private:

View File

@ -440,7 +440,7 @@ QTimeZonePrivate::Data QTimeZonePrivate::dataForLocalTime(qint64 forLocalMSecs,
utcEpochMSecs = forStd;
} else {
// Invalid forLocalMSecs: in spring-forward gap.
const int dstStep = daylightTimeOffset(early < late ? imminent : recent);
const int dstStep = daylightTimeOffset(early < late ? imminent : recent) * 1000;
Q_ASSERT(dstStep); // There can't be a transition without it !
utcEpochMSecs = (hint > 0) ? forStd - dstStep : forDst + dstStep;
}

View File

@ -254,7 +254,8 @@ private:
bool isValidIterator(const const_iterator &i) const
{
return (i <= constEnd()) && (constBegin() <= i);
const std::less<const T*> less = {};
return !less(cend(), i) && !less(i, cbegin());
}
};

View File

@ -306,7 +306,8 @@ private:
void destruct(T *from, T *to);
bool isValidIterator(const iterator &i) const
{
return (i <= d->end()) && (d->begin() <= i);
const std::less<const T*> less = {};
return !less(d->end(), i) && !less(i, d->begin());
}
class AlignmentDummy { Data header; T array[1]; };
};

View File

@ -975,14 +975,12 @@
\li
\row \li \c meta
\li Meta-information
\li If a text encoding is specified using the \c{meta} tag,
it is picked up by Qt::codecForHtml().
Likewise, if an encoding is specified to
QTextDocument::toHtml(), the encoding is stored using
a \c meta tag, for example:
\snippet code/doc_src_richtext.qdoc 7
\li If a text encoding is specified using the \c{meta}
tag, it is picked up by Qt::codecForHtml(). Likewise,
if an encoding is specified to QTextDocument::toHtml(),
the encoding is stored using a \c meta tag, for
example:
\c {<meta http-equiv="Content-Type" content="text/html; charset=EUC-JP" />}
\row \li \c li
\li List item
\li

View File

@ -642,6 +642,10 @@ QList<QSslCertificate> QSslConfiguration::caCertificates() const
The CA certificate database is used by the socket during the
handshake phase to validate the peer's certificate.
\note The default configuration uses the system CA certificate database. If
that is not available (as is commonly the case on iOS), the default database
is empty.
\sa caCertificates()
*/
void QSslConfiguration::setCaCertificates(const QList<QSslCertificate> &certificates)

View File

@ -63,7 +63,7 @@ void QFreeTypeFontDatabase::populateFontDatabase()
if (!dir.exists()) {
qWarning("QFontDatabase: Cannot find font directory %s.\n"
"Note that Qt no longer ships fonts. Deploy some (from http://dejavu-fonts.org for example) or switch to fontconfig.",
"Note that Qt no longer ships fonts. Deploy some (from https://dejavu-fonts.github.io/ for example) or switch to fontconfig.",
qPrintable(fontpath));
return;
}

View File

@ -963,7 +963,6 @@ static inline bool isInputMessage(UINT m)
case WM_TOUCH:
case WM_MOUSEHOVER:
case WM_MOUSELEAVE:
case WM_NCHITTEST:
case WM_NCMOUSEHOVER:
case WM_NCMOUSELEAVE:
case WM_SIZING:

View File

@ -1,5 +1,5 @@
Copyright (C) 2000-2007 Julian Seward
Copyright (C) 2003-2007 Josef Weidendorfer. All rights reserved.
Copyright (C) 2000-2017 Julian Seward. All rights reserved.
Copyright (C) 2003-2017 Josef Weidendorfer. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions

View File

@ -13,7 +13,7 @@
This file is part of callgrind, a valgrind tool for cache simulation
and call tree tracing.
Copyright (C) 2003-2007 Josef Weidendorfer. All rights reserved.
Copyright (C) 2003-2017 Josef Weidendorfer. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@ -49,7 +49,7 @@
----------------------------------------------------------------
Notice that the above BSD-style license applies to this one file
(vgprof.h) only. The entire rest of Valgrind is licensed under
(callgrind.h) only. The entire rest of Valgrind is licensed under
the terms of the GNU General Public License, version 2. See the
COPYING file in the source distribution for details.
@ -82,53 +82,38 @@ typedef
} Vg_CallgrindClientRequest;
/* Dump current state of cost centers, and zero them afterwards */
#define CALLGRIND_DUMP_STATS \
{unsigned int _qzz_res; \
VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \
VG_USERREQ__DUMP_STATS, \
0, 0, 0, 0, 0); \
}
#define CALLGRIND_DUMP_STATS \
VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DUMP_STATS, \
0, 0, 0, 0, 0)
/* Dump current state of cost centers, and zero them afterwards.
The argument is appended to a string stating the reason which triggered
the dump. This string is written as a description field into the
profile data dump. */
#define CALLGRIND_DUMP_STATS_AT(pos_str) \
{unsigned int _qzz_res; \
VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \
VG_USERREQ__DUMP_STATS_AT, \
pos_str, 0, 0, 0, 0); \
}
#define CALLGRIND_DUMP_STATS_AT(pos_str) \
VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DUMP_STATS_AT, \
pos_str, 0, 0, 0, 0)
/* Zero cost centers */
#define CALLGRIND_ZERO_STATS \
{unsigned int _qzz_res; \
VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \
VG_USERREQ__ZERO_STATS, \
0, 0, 0, 0, 0); \
}
#define CALLGRIND_ZERO_STATS \
VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__ZERO_STATS, \
0, 0, 0, 0, 0)
/* Toggles collection state.
The collection state specifies whether the happening of events
should be noted or if they are to be ignored. Events are noted
by increment of counters in a cost center */
#define CALLGRIND_TOGGLE_COLLECT \
{unsigned int _qzz_res; \
VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \
VG_USERREQ__TOGGLE_COLLECT, \
0, 0, 0, 0, 0); \
}
#define CALLGRIND_TOGGLE_COLLECT \
VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__TOGGLE_COLLECT, \
0, 0, 0, 0, 0)
/* Start full callgrind instrumentation if not already switched on.
When cache simulation is done, it will flush the simulated cache;
this will lead to an artifical cache warmup phase afterwards with
this will lead to an artificial cache warmup phase afterwards with
cache misses which would not have happened in reality. */
#define CALLGRIND_START_INSTRUMENTATION \
{unsigned int _qzz_res; \
VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \
VG_USERREQ__START_INSTRUMENTATION, \
0, 0, 0, 0, 0); \
}
#define CALLGRIND_START_INSTRUMENTATION \
VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__START_INSTRUMENTATION, \
0, 0, 0, 0, 0)
/* Stop full callgrind instrumentation if not already switched off.
This flushes Valgrinds translation cache, and does no additional
@ -137,11 +122,8 @@ typedef
Use this to bypass Callgrind aggregation for uninteresting code parts.
To start Callgrind in this mode to ignore the setup phase, use
the option "--instr-atstart=no". */
#define CALLGRIND_STOP_INSTRUMENTATION \
{unsigned int _qzz_res; \
VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \
VG_USERREQ__STOP_INSTRUMENTATION, \
0, 0, 0, 0, 0); \
}
#define CALLGRIND_STOP_INSTRUMENTATION \
VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__STOP_INSTRUMENTATION, \
0, 0, 0, 0, 0)
#endif /* __CALLGRIND_H */

View File

@ -8,12 +8,12 @@
"Description": "An instrumentation framework for building dynamic analysis tools.",
"Homepage": "http://valgrind.org/",
"Version": "3.3.0",
"Version": "3.13.0",
"License": "BSD 4-clause \"Original\" or \"Old\" License",
"LicenseId": "BSD-4-Clause",
"LicenseFile": "VALGRIND_LICENSE.txt",
"Copyright": "Copyright (C) 2000-2007 Julian Seward
Copyright (C) 2003-2007 Josef Weidendorfer."
"Copyright": "Copyright (C) 2000-2017 Julian Seward
Copyright (C) 2003-2017 Josef Weidendorfer."
},
{
"Id": "cycle",

File diff suppressed because it is too large Load Diff

View File

@ -217,7 +217,7 @@ QAbstractItemModelTester::QAbstractItemModelTester(QAbstractItemModel *model, Fa
Q_D(QAbstractItemModelTester);
const auto &runAllTests = [d] { d->runAllTests(); };
auto runAllTests = [d] { d->runAllTests(); };
connect(model, &QAbstractItemModel::columnsAboutToBeInserted,
this, runAllTests);

View File

@ -643,7 +643,7 @@ void QStatusBar::hideOrShow()
}
#endif
repaint(d->messageRect());
update(d->messageRect());
}
/*!

View File

@ -417,6 +417,9 @@ void tst_QCborValue::mapDefaultInitialization()
QVERIFY(m.value(QLatin1String("Hello")).isUndefined());
QVERIFY(m.value(QStringLiteral("Hello")).isUndefined());
QVERIFY(m.value(QCborValue()).isUndefined());
#if !defined(QT_NO_CAST_FROM_ASCII) && !defined(QT_RESTRICTED_CAST_FROM_ASCII)
QVERIFY(m.value("Hello").isUndefined());
#endif
QVERIFY(m == m);
QVERIFY(m == QCborMap{});

View File

@ -2390,6 +2390,14 @@ void tst_QDateTime::fromStringStringFormat_data()
QTest::newRow("data16") << QString("2005-06-28T07:57:30.001Z")
<< QString("yyyy-MM-ddThh:mm:ss.zt")
<< QDateTime(QDate(2005, 06, 28), QTime(07, 57, 30, 1), Qt::UTC);
#if QT_CONFIG(timezone)
QTimeZone southBrazil("America/Sao_Paulo");
if (southBrazil.isValid()) {
QTest::newRow("spring-forward-midnight")
<< QString("2008-10-19 23:45.678 America/Sao_Paulo") << QString("yyyy-MM-dd mm:ss.zzz t")
<< QDateTime(QDate(2008, 10, 19), QTime(1, 23, 45, 678), southBrazil);
}
#endif
QTest::newRow("late") << QString("9999-12-31T23:59:59.999Z")
<< QString("yyyy-MM-ddThh:mm:ss.zZ")
<< QDateTime(QDate(9999, 12, 31), QTime(23, 59, 59, 999));