summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2019-02-08 09:28:00 +0100
committerEdward Welbourne <edward.welbourne@qt.io>2019-02-08 12:31:02 +0100
commitfbfacd33be482fa3cf0aa5cffaf7006d538a2f92 (patch)
tree92da72786b3740e37004623612c4fc1c9640d30f /src/corelib
parentc1f4286a5cbc1794fe7be5bdbbd6a0bf29ef84d4 (diff)
parent74e04d6ace7aa949db97ae2e46c38a4dc0d4d36a (diff)
Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts: src/android/templates/AndroidManifest.xml src/network/ssl/qsslsocket_mac.cpp src/widgets/styles/qstylesheetstyle.cpp tests/auto/corelib/kernel/qtimer/BLACKLIST tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp tests/auto/testlib/selftests/expected_blacklisted.lightxml tests/auto/testlib/selftests/expected_blacklisted.tap tests/auto/testlib/selftests/expected_blacklisted.teamcity tests/auto/testlib/selftests/expected_blacklisted.txt tests/auto/testlib/selftests/expected_blacklisted.xml tests/auto/testlib/selftests/expected_blacklisted.xunitxml tests/auto/testlib/selftests/expected_float.tap tests/auto/testlib/selftests/expected_float.teamcity tests/auto/testlib/selftests/expected_float.txt tests/auto/testlib/selftests/expected_float.xunitxml Done-With: Christian Ehrlicher <ch.ehrlicher@gmx.de> Done-With: Edward Welbourne <edward.welbourne@qt.io> Done-With: Timur Pocheptsov <timur.pocheptsov@qt.io> Change-Id: If93cc432a56ae3ac1b6533d0028e4dc497415a52
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/global/qnamespace.qdoc6
-rw-r--r--src/corelib/kernel/qobject.cpp11
-rw-r--r--src/corelib/kernel/qvariant.cpp4
-rw-r--r--src/corelib/serialization/qcborvalue.cpp12
-rw-r--r--src/corelib/serialization/qcborvalue.h10
-rw-r--r--src/corelib/serialization/qjsoncbor.cpp7
-rw-r--r--src/corelib/tools/qdatetime.cpp42
-rw-r--r--src/corelib/tools/qlocale.cpp4
-rw-r--r--src/corelib/tools/qsimd.cpp4
9 files changed, 81 insertions, 19 deletions
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 652efb10bf..5bba8c5fe5 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -2208,6 +2208,12 @@
\value MSWindowsFixedSizeDialogHint Gives the window a thin dialog border on Windows.
This style is traditionally used for fixed-size dialogs.
+ \note The use of this flag is not recommended in multi-monitor
+ environments. This is because the system will enforce that the window
+ maintains its native size when moving it across screens. This is
+ particularly undesirable when using monitors with different
+ resolutions.
+
\value MSWindowsOwnDC Gives the window its own display
context on Windows.
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index c0c009f254..2cdb9eaaa6 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -5074,11 +5074,14 @@ bool QObjectPrivate::disconnect(const QObject *sender, int signal_index, void **
/*! \class QMetaObject::Connection
\inmodule QtCore
- Represents a handle to a signal-slot connection.
- It can be used to disconnect that connection, or check if
- the connection was successful
+ Represents a handle to a signal-slot (or signal-functor) connection.
- \sa QObject::disconnect()
+ It can be used to check if the connection is valid and to disconnect it using
+ QObject::disconnect(). For a signal-functor connection without a context object,
+ it is the only way to selectively disconnect that connection.
+
+ As Connection is just a handle, the underlying signal-slot connection is unaffected
+ when Connection is destroyed or reassigned.
*/
/*!
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index 6541b97595..090436a3c7 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -1052,11 +1052,13 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok)
return false;
#ifndef QT_BOOTSTRAPPED
+#if QT_CONFIG(regularexpression)
case QMetaType::QRegularExpression:
if (d->type != QMetaType::QCborValue || !v_cast<QCborValue>(d)->isRegularExpression())
return false;
*static_cast<QRegularExpression *>(result) = v_cast<QCborValue>(d)->toRegularExpression();
break;
+#endif
case QMetaType::QJsonValue:
switch (d->type) {
case QMetaType::Nullptr:
@@ -1232,9 +1234,11 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok)
case QVariant::Url:
*static_cast<QCborValue *>(result) = QCborValue(*v_cast<QUrl>(d));
break;
+#if QT_CONFIG(regularexpression)
case QVariant::RegularExpression:
*static_cast<QCborValue *>(result) = QCborValue(*v_cast<QRegularExpression>(d));
break;
+#endif
case QVariant::Uuid:
*static_cast<QCborValue *>(result) = QCborValue(*v_cast<QUuid>(d));
break;
diff --git a/src/corelib/serialization/qcborvalue.cpp b/src/corelib/serialization/qcborvalue.cpp
index 9e8c98837c..c99782bb1e 100644
--- a/src/corelib/serialization/qcborvalue.cpp
+++ b/src/corelib/serialization/qcborvalue.cpp
@@ -1772,6 +1772,7 @@ QCborValue::QCborValue(const QUrl &url)
container->elements[1].type = String;
}
+#if QT_CONFIG(regularexpression)
/*!
Creates a QCborValue object of the regular expression pattern extended type
and containing the value represented by \a rx. The value can later be retrieved
@@ -1790,6 +1791,7 @@ QCborValue::QCborValue(const QRegularExpression &rx)
// change type
t = RegularExpression;
}
+#endif // QT_CONFIG(regularexpression)
/*!
Creates a QCborValue object of the UUID extended type and containing the
@@ -1943,6 +1945,7 @@ QUrl QCborValue::toUrl(const QUrl &defaultValue) const
return QUrl::fromEncoded(byteData->asByteArrayView());
}
+#if QT_CONFIG(regularexpression)
/*!
Returns the regular expression value stored in this QCborValue, if it is of
the regular expression pattern extended type. Otherwise, it returns \a
@@ -1961,6 +1964,7 @@ QRegularExpression QCborValue::toRegularExpression(const QRegularExpression &def
Q_ASSERT(n == -1);
return QRegularExpression(container->stringAt(1));
}
+#endif // QT_CONFIG(regularexpression)
/*!
Returns the UUID value stored in this QCborValue, if it is of the UUID
@@ -2870,12 +2874,16 @@ uint qHash(const QCborValue &value, uint seed)
return qHash(value.toDateTime(), seed);
case QCborValue::Url:
return qHash(value.toUrl(), seed);
+#if QT_CONFIG(regularexpression)
case QCborValue::RegularExpression:
return qHash(value.toRegularExpression(), seed);
+#endif
case QCborValue::Uuid:
return qHash(value.toUuid(), seed);
case QCborValue::Invalid:
return seed;
+ default:
+ break;
}
Q_ASSERT(value.isSimpleType());
@@ -2920,12 +2928,16 @@ static QDebug debugContents(QDebug &dbg, const QCborValue &v)
return dbg << v.toDateTime();
case QCborValue::Url:
return dbg << v.toUrl();
+#if QT_CONFIG(regularexpression)
case QCborValue::RegularExpression:
return dbg << v.toRegularExpression();
+#endif
case QCborValue::Uuid:
return dbg << v.toUuid();
case QCborValue::Invalid:
return dbg << "<invalid>";
+ default:
+ break;
}
if (v.isSimpleType())
return dbg << v.toSimpleType();
diff --git a/src/corelib/serialization/qcborvalue.h b/src/corelib/serialization/qcborvalue.h
index e6e73e1fb6..f542e44c47 100644
--- a/src/corelib/serialization/qcborvalue.h
+++ b/src/corelib/serialization/qcborvalue.h
@@ -43,7 +43,9 @@
#include <QtCore/qbytearray.h>
#include <QtCore/qdatetime.h>
#include <QtCore/qcborcommon.h>
-#include <QtCore/qregularexpression.h>
+#if QT_CONFIG(regularexpression)
+# include <QtCore/qregularexpression.h>
+#endif
#include <QtCore/qstring.h>
#include <QtCore/qstringview.h>
#include <QtCore/qurl.h>
@@ -157,7 +159,9 @@ public:
explicit QCborValue(const QDateTime &dt);
explicit QCborValue(const QUrl &url);
+#if QT_CONFIG(regularexpression)
explicit QCborValue(const QRegularExpression &rx);
+#endif
explicit QCborValue(const QUuid &uuid);
~QCborValue() { if (container) dispose(); }
@@ -235,7 +239,9 @@ public:
QString toString(const QString &defaultValue = {}) const;
QDateTime toDateTime(const QDateTime &defaultValue = {}) const;
QUrl toUrl(const QUrl &defaultValue = {}) const;
+#if QT_CONFIG(regularexpression)
QRegularExpression toRegularExpression(const QRegularExpression &defaultValue = {}) const;
+#endif
QUuid toUuid(const QUuid &defaultValue = {}) const;
// only forward-declared, need split functions
@@ -380,8 +386,10 @@ public:
{ return concrete().toDateTime(defaultValue); }
QUrl toUrl(const QUrl &defaultValue = {}) const
{ return concrete().toUrl(defaultValue); }
+#if QT_CONFIG(regularexpression)
QRegularExpression toRegularExpression(const QRegularExpression &defaultValue = {}) const
{ return concrete().toRegularExpression(defaultValue); }
+#endif
QUuid toUuid(const QUuid &defaultValue = {}) const
{ return concrete().toUuid(defaultValue); }
diff --git a/src/corelib/serialization/qjsoncbor.cpp b/src/corelib/serialization/qjsoncbor.cpp
index b4d3b4db18..dc5f384108 100644
--- a/src/corelib/serialization/qjsoncbor.cpp
+++ b/src/corelib/serialization/qjsoncbor.cpp
@@ -543,14 +543,19 @@ QVariant QCborValue::toVariant() const
case Url:
return toUrl();
+#if QT_CONFIG(regularexpression)
case RegularExpression:
return toRegularExpression();
+#endif
case Uuid:
return toUuid();
case Invalid:
return QVariant();
+
+ default:
+ break;
}
if (isSimpleType())
@@ -714,8 +719,10 @@ QCborValue QCborValue::fromVariant(const QVariant &variant)
case QVariant::Hash:
return QCborMap::fromVariantHash(variant.toHash());
#ifndef QT_BOOTSTRAPPED
+#if QT_CONFIG(regularexpression)
case QVariant::RegularExpression:
return QCborValue(variant.toRegularExpression());
+#endif
case QMetaType::QJsonValue:
return fromJsonValue(variant.toJsonValue());
case QMetaType::QJsonObject:
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index 600bd1e0e5..80d6dada60 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -908,10 +908,16 @@ QString QDate::toString(Qt::DateFormat format) const
a minus sign is prepended in addition.
\endtable
- All other input characters will be ignored. Any sequence of characters that
- are enclosed in single quotes will be treated as text and not be used as an
- expression. Two consecutive single quotes ("''") are replaced by a singlequote
- in the output. Formats without separators (e.g. "ddMM") are currently not supported.
+ Any sequence of characters enclosed in single quotes will be included
+ verbatim in the output string (stripped of the quotes), even if it contains
+ formatting characters. Two consecutive single quotes ("''") are replaced by
+ a single quote in the output. All other characters in the format string are
+ included verbatim in the output string.
+
+ Formats without separators (e.g. "ddMM") are supported but must be used with
+ care, as the resulting strings aren't always reliably readable (e.g. if "dM"
+ produces "212" it could mean either the 2nd of December or the 21st of
+ February).
Example format strings (assuming that the QDate is the 20 July
1969):
@@ -1672,10 +1678,16 @@ QString QTime::toString(Qt::DateFormat format) const
\row \li t \li the timezone (for example "CEST")
\endtable
- All other input characters will be ignored. Any sequence of characters that
- are enclosed in single quotes will be treated as text and not be used as an
- expression. Two consecutive single quotes ("''") are replaced by a singlequote
- in the output. Formats without separators (e.g. "HHmm") are currently not supported.
+ Any sequence of characters enclosed in single quotes will be included
+ verbatim in the output string (stripped of the quotes), even if it contains
+ formatting characters. Two consecutive single quotes ("''") are replaced by
+ a single quote in the output. All other characters in the format string are
+ included verbatim in the output string.
+
+ Formats without separators (e.g. "ddMM") are supported but must be used with
+ care, as the resulting strings aren't always reliably readable (e.g. if "dM"
+ produces "212" it could mean either the 2nd of December or the 21st of
+ February).
Example format strings (assuming that the QTime is 14:13:09.042 and the system
locale is \c{en_US})
@@ -3952,10 +3964,16 @@ QString QDateTime::toString(Qt::DateFormat format) const
\row \li t \li the timezone (for example "CEST")
\endtable
- All other input characters will be ignored. Any sequence of characters that
- are enclosed in single quotes will be treated as text and not be used as an
- expression. Two consecutive single quotes ("''") are replaced by a singlequote
- in the output. Formats without separators (e.g. "HHmm") are currently not supported.
+ Any sequence of characters enclosed in single quotes will be included
+ verbatim in the output string (stripped of the quotes), even if it contains
+ formatting characters. Two consecutive single quotes ("''") are replaced by
+ a single quote in the output. All other characters in the format string are
+ included verbatim in the output string.
+
+ Formats without separators (e.g. "ddMM") are supported but must be used with
+ care, as the resulting strings aren't always reliably readable (e.g. if "dM"
+ produces "212" it could mean either the 2nd of December or the 21st of
+ February).
Example format strings (assumed that the QDateTime is 21 May 2001
14:13:09.120):
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index 86b73bf634..79ecdb0a54 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
-** Copyright (C) 2016 Intel Corporation.
+** Copyright (C) 2019 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -788,7 +788,7 @@ static const int locale_data_size = sizeof(locale_data)/sizeof(QLocaleData) - 1;
Q_GLOBAL_STATIC_WITH_ARGS(QSharedDataPointer<QLocalePrivate>, defaultLocalePrivate,
(QLocalePrivate::create(defaultData(), default_number_options)))
-Q_GLOBAL_STATIC_WITH_ARGS(QSharedDataPointer<QLocalePrivate>, systemLocalePrivate,
+Q_GLOBAL_STATIC_WITH_ARGS(QExplicitlySharedDataPointer<QLocalePrivate>, systemLocalePrivate,
(QLocalePrivate::create(systemData())))
static QLocalePrivate *localePrivateByName(const QString &name)
diff --git a/src/corelib/tools/qsimd.cpp b/src/corelib/tools/qsimd.cpp
index 1508681021..ddd715f745 100644
--- a/src/corelib/tools/qsimd.cpp
+++ b/src/corelib/tools/qsimd.cpp
@@ -290,6 +290,10 @@ static void cpuidFeatures07_00(uint &ebx, uint &ecx, uint &edx)
ebx = info[1];
ecx = info[2];
edx = info[3];
+#else
+ Q_UNUSED(ebx);
+ Q_UNUSED(ecx);
+ Q_UNUSED(edx);
#endif
}