Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/5.9' into 5.10
Browse files Browse the repository at this point in the history
 Conflicts:
	src/corelib/global/qconfig-bootstrapped.h
	src/corelib/global/qglobal.h
	src/corelib/tools/qcryptographichash.cpp
	src/corelib/tools/qcryptographichash.h
	src/corelib/tools/qmessageauthenticationcode.cpp
	src/plugins/platforms/windows/qwindowswindow.h
	tests/auto/gui/kernel/qwindow/BLACKLIST
	tests/auto/widgets/itemviews/qitemdelegate/BLACKLIST

Change-Id: Ib68112de985a3d714c2071f47c10e907e4f0229a
  • Loading branch information
liangqi committed Oct 4, 2017
2 parents b8947e9 + 3faf8f4 commit bc5f450
Show file tree
Hide file tree
Showing 62 changed files with 779 additions and 270 deletions.
2 changes: 1 addition & 1 deletion mkspecs/common/msvc-version.conf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ greaterThan(QMAKE_MSC_VER, 1699) {
# Visual Studio 2012 (11.0) / Visual C++ 17.0 and up
MSVC_VER = 11.0
COMPAT_MKSPEC = win32-msvc2012
QMAKE_CXXFLAGS_EXCEPTIONS_OFF = -D_HAS_EXCEPTIONS=0
QMAKE_CXXFLAGS_EXCEPTIONS_OFF = /wd4530 /wd4577
QT_CONFIG += c++11
CONFIG += c++11
}
Expand Down
2 changes: 1 addition & 1 deletion mkspecs/common/winrt_winphone/qmake.conf
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ QMAKE_CXXFLAGS_STL_OFF =
QMAKE_CXXFLAGS_RTTI_ON = -GR
QMAKE_CXXFLAGS_RTTI_OFF =
QMAKE_CXXFLAGS_EXCEPTIONS_ON = -EHsc
QMAKE_CXXFLAGS_EXCEPTIONS_OFF = -D_HAS_EXCEPTIONS=0
QMAKE_CXXFLAGS_EXCEPTIONS_OFF = /wd4530 /wd4577

QMAKE_INCDIR =

Expand Down
4 changes: 2 additions & 2 deletions mkspecs/features/toolchain.prf
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ isEmpty($${target_prefix}.INCDIRS) {
}
}
}
!darwin:clang {
if(!darwin:clang)|intel_icc {
# Clang on a non-Apple system (that is, a system without ld64 -- say, with GNU ld
# or gold under Linux) will not print any library search path. Need to use another
# invocation with different options (which in turn doesn't print include search
Expand Down Expand Up @@ -205,7 +205,7 @@ isEmpty($${target_prefix}.COMPILER_MACROS) {
vars = $$qtVariablesFromGCC($$QMAKE_CXX)
}
for (v, vars) {
isEmpty(v)|contains(v, $${LITERAL_HASH}.*): next()
contains(v, $${LITERAL_HASH}.*)|contains(v, " *"): next()
# Set both <varname> for the outer scope ...
eval($$v)
v ~= s/ .*//
Expand Down
4 changes: 2 additions & 2 deletions qmake/doc/src/qmake-manual.qdoc
Original file line number Diff line number Diff line change
Expand Up @@ -3800,8 +3800,8 @@
compiled (see QLibraryInfo::DataPath).
\endlist

\note The \c QMAKESPEC path will automatically be added to the
\l{INCLUDEPATH} system variable.
\note The \c QMAKESPEC path will be automatically added to the generated
Makefile after the contents of the \l{INCLUDEPATH} system variable.

\target cache
\section1 Cache File
Expand Down
8 changes: 7 additions & 1 deletion src/corelib/configure.json
Original file line number Diff line number Diff line change
Expand Up @@ -815,10 +815,16 @@
},
"timezone": {
"label": "QTimeZone",
"purpose": "Provides support for timezone handling.",
"purpose": "Provides support for time-zone handling.",
"section": "Utilities",
"output": [ "publicFeature" ]
},
"datetimeparser": {
"label": "QDateTimeParser",
"purpose": "Provides support for parsing date-time texts.",
"section": "Utilities",
"output": [ "privateFeature" ]
},
"commandlineparser": {
"label": "QCommandlineParser",
"purpose": "Provides support for command line parsing.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ template<> class QTypeInfo<A> : public QTypeInfoMerger<A, B, C, D> {};
void overloadedFunction(int, QString);
void overloadedFunction(int, QString) const;
};
... qConstOverload<>(&Foo::overloadedFunction)
... qConstOverload<int, QString>(&Foo::overloadedFunction)
... qNonConstOverload<int, QString>(&Foo::overloadedFunction)
//! [54]

Expand Down
14 changes: 8 additions & 6 deletions src/corelib/global/qconfig-bootstrapped.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,21 @@
#define QT_NO_USING_NAMESPACE
#define QT_NO_DEPRECATED

#define QT_CRYPTOGRAPHICHASH_ONLY_SHA1
#define QT_NO_DATASTREAM
// Keep feature-test macros in alphabetic order by feature name:
#define QT_FEATURE_alloca 1
#define QT_FEATURE_alloca_h -1
#ifdef _WIN32
# define QT_FEATURE_alloca_malloc_h 1
#else
# define QT_FEATURE_alloca_malloc_h -1
#endif
#define QT_CRYPTOGRAPHICHASH_ONLY_SHA1
#define QT_FEATURE_cxx11_random (QT_HAS_INCLUDE(<random>) ? 1 : -1)
#define QT_NO_DATASTREAM
#define QT_FEATURE_datetimeparser -1
#define QT_FEATURE_getauxval (QT_HAS_INCLUDE(<sys/auxv.h>) ? 1 : -1)
#define QT_FEATURE_getentropy -1
#define QT_NO_GEOM_VARIANT
#define QT_FEATURE_iconv -1
#define QT_FEATURE_icu -1
#define QT_FEATURE_journald -1
Expand All @@ -86,20 +89,19 @@
#define QT_FEATURE_library -1
#define QT_NO_QOBJECT
#define QT_FEATURE_process -1
#define QT_NO_SYSTEMLOCALE
#define QT_FEATURE_renameat2 -1
#define QT_FEATURE_sharedmemory -1
#define QT_FEATURE_slog2 -1
#define QT_FEATURE_statx -1
#define QT_FEATURE_syslog -1
#define QT_NO_SYSTEMLOCALE
#define QT_FEATURE_systemsemaphore -1
#define QT_FEATURE_temporaryfile 1
#define QT_NO_THREAD
#define QT_FEATURE_timezone -1
#define QT_FEATURE_topleveldomain -1
#define QT_NO_TRANSLATION
#define QT_FEATURE_translation -1
#define QT_NO_GEOM_VARIANT
#define QT_FEATURE_sharedmemory -1
#define QT_FEATURE_systemsemaphore -1

#ifdef QT_BUILD_QMAKE
#define QT_FEATURE_commandlineparser -1
Expand Down
2 changes: 1 addition & 1 deletion src/corelib/global/qglobal.h
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ typedef double qreal;
#if !defined(QT_NAMESPACE) && defined(__cplusplus) && !defined(Q_QDOC)
extern "C"
#endif
Q_CORE_EXPORT Q_DECL_CONST_FUNCTION const char *qVersion() Q_DECL_NOTHROW;
Q_CORE_EXPORT Q_DECL_CONST_FUNCTION const char *qVersion(void) Q_DECL_NOTHROW;

#if defined(__cplusplus)

Expand Down
40 changes: 23 additions & 17 deletions src/corelib/tools/qcryptographichash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,9 @@ void QCryptographicHashPrivate::sha3Finish(int bitCount, Sha3Variant sha3Variant
\note In Qt versions before 5.9, when asked to generate a SHA3 hash sum,
QCryptographicHash actually calculated Keccak. If you need compatibility with
SHA-3 hashes produced by those versions of Qt, use the \c{Keccak_} enumerators.
SHA-3 hashes produced by those versions of Qt, use the \c{Keccak_}
enumerators. Alternatively, if source compatibility is required, define the
macro \c QT_SHA3_KECCAK_COMPAT.
\value Md4 Generate an MD4 hash sum
\value Md5 Generate an MD5 hash sum
Expand All @@ -267,10 +269,14 @@ void QCryptographicHashPrivate::sha3Finish(int bitCount, Sha3Variant sha3Variant
\value Sha3_256 Generate an SHA3-256 hash sum. Introduced in Qt 5.1
\value Sha3_384 Generate an SHA3-384 hash sum. Introduced in Qt 5.1
\value Sha3_512 Generate an SHA3-512 hash sum. Introduced in Qt 5.1
\value Keccak_224 \deprecated Generate a Keccak-224 hash sum. Introduced in Qt 5.10
\value Keccak_256 \deprecated Generate a Keccak-256 hash sum. Introduced in Qt 5.10
\value Keccak_384 \deprecated Generate a Keccak-384 hash sum. Introduced in Qt 5.10
\value Keccak_512 \deprecated Generate a Keccak-512 hash sum. Introduced in Qt 5.10
\value Keccak_224 Generate a Keccak-224 hash sum. Introduced in Qt 5.9.2
\value Keccak_256 Generate a Keccak-256 hash sum. Introduced in Qt 5.9.2
\value Keccak_384 Generate a Keccak-384 hash sum. Introduced in Qt 5.9.2
\value Keccak_512 Generate a Keccak-512 hash sum. Introduced in Qt 5.9.2
\omitvalue RealSha3_224
\omitvalue RealSha3_256
\omitvalue RealSha3_384
\omitvalue RealSha3_512
*/

/*!
Expand Down Expand Up @@ -324,19 +330,19 @@ void QCryptographicHash::reset()
case Sha512:
SHA512Reset(&d->sha512Context);
break;
case Sha3_224:
case RealSha3_224:
case Keccak_224:
sha3Init(&d->sha3Context, 224);
break;
case Sha3_256:
case RealSha3_256:
case Keccak_256:
sha3Init(&d->sha3Context, 256);
break;
case Sha3_384:
case RealSha3_384:
case Keccak_384:
sha3Init(&d->sha3Context, 384);
break;
case Sha3_512:
case RealSha3_512:
case Keccak_512:
sha3Init(&d->sha3Context, 512);
break;
Expand Down Expand Up @@ -379,19 +385,19 @@ void QCryptographicHash::addData(const char *data, int length)
case Sha512:
SHA512Input(&d->sha512Context, reinterpret_cast<const unsigned char *>(data), length);
break;
case Sha3_224:
case RealSha3_224:
case Keccak_224:
sha3Update(&d->sha3Context, reinterpret_cast<const BitSequence *>(data), length*8);
break;
case Sha3_256:
case RealSha3_256:
case Keccak_256:
sha3Update(&d->sha3Context, reinterpret_cast<const BitSequence *>(data), length*8);
break;
case Sha3_384:
case RealSha3_384:
case Keccak_384:
sha3Update(&d->sha3Context, reinterpret_cast<const BitSequence *>(data), length*8);
break;
case Sha3_512:
case RealSha3_512:
case Keccak_512:
sha3Update(&d->sha3Context, reinterpret_cast<const BitSequence *>(data), length*8);
break;
Expand Down Expand Up @@ -491,19 +497,19 @@ QByteArray QCryptographicHash::result() const
SHA512Result(&copy, reinterpret_cast<unsigned char *>(d->result.data()));
break;
}
case Sha3_224: {
case RealSha3_224: {
d->sha3Finish(224, QCryptographicHashPrivate::Sha3Variant::Sha3);
break;
}
case Sha3_256: {
case RealSha3_256: {
d->sha3Finish(256, QCryptographicHashPrivate::Sha3Variant::Sha3);
break;
}
case Sha3_384: {
case RealSha3_384: {
d->sha3Finish(384, QCryptographicHashPrivate::Sha3Variant::Sha3);
break;
}
case Sha3_512: {
case RealSha3_512: {
d->sha3Finish(512, QCryptographicHashPrivate::Sha3Variant::Sha3);
break;
}
Expand Down
25 changes: 18 additions & 7 deletions src/corelib/tools/qcryptographichash.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,26 @@ class Q_CORE_EXPORT QCryptographicHash
Sha256,
Sha384,
Sha512,
Sha3_224,
Sha3_256,
Sha3_384,
Sha3_512,
// ### Qt 6: remove the Keccak enumerators
Keccak_224,

Keccak_224 = 7,
Keccak_256,
Keccak_384,
Keccak_512
Keccak_512,
RealSha3_224 = 11,
RealSha3_256,
RealSha3_384,
RealSha3_512,
# ifndef QT_SHA3_KECCAK_COMPAT
Sha3_224 = RealSha3_224,
Sha3_256 = RealSha3_256,
Sha3_384 = RealSha3_384,
Sha3_512 = RealSha3_512
# else
Sha3_224 = Keccak_224,
Sha3_256 = Keccak_256,
Sha3_384 = Keccak_384,
Sha3_512 = Keccak_512
# endif
#endif
};
Q_ENUM(Algorithm)
Expand Down
8 changes: 5 additions & 3 deletions src/corelib/tools/qdatetime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@

#include "qplatformdefs.h"
#include "private/qdatetime_p.h"
#if QT_CONFIG(datetimeparser)
#include "private/qdatetimeparser_p.h"
#endif

#include "qdatastream.h"
#include "qset.h"
Expand Down Expand Up @@ -1337,7 +1339,7 @@ QDate QDate::fromString(const QString& string, Qt::DateFormat format)
QDate QDate::fromString(const QString &string, const QString &format)
{
QDate date;
#if QT_CONFIG(timezone)
#if QT_CONFIG(datetimeparser)
QDateTimeParser dt(QVariant::Date, QDateTimeParser::FromString);
// dt.setDefaultLocale(QLocale::c()); ### Qt 6
if (dt.parseFormat(format))
Expand Down Expand Up @@ -2055,7 +2057,7 @@ QTime QTime::fromString(const QString& string, Qt::DateFormat format)
QTime QTime::fromString(const QString &string, const QString &format)
{
QTime time;
#if QT_CONFIG(timezone)
#if QT_CONFIG(datetimeparser)
QDateTimeParser dt(QVariant::Time, QDateTimeParser::FromString);
// dt.setDefaultLocale(QLocale::c()); ### Qt 6
if (dt.parseFormat(format))
Expand Down Expand Up @@ -5055,7 +5057,7 @@ QDateTime QDateTime::fromString(const QString& string, Qt::DateFormat format)

QDateTime QDateTime::fromString(const QString &string, const QString &format)
{
#if QT_CONFIG(timezone)
#if QT_CONFIG(datetimeparser)
QTime time;
QDate date;

Expand Down
4 changes: 0 additions & 4 deletions src/corelib/tools/qdatetimeparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@

QT_BEGIN_NAMESPACE

#ifndef QT_BOOTSTRAPPED

QDateTimeParser::~QDateTimeParser()
{
}
Expand Down Expand Up @@ -1996,6 +1994,4 @@ bool operator==(const QDateTimeParser::SectionNode &s1, const QDateTimeParser::S
return (s1.type == s2.type) && (s1.pos == s2.pos) && (s1.count == s2.count);
}

#endif // QT_BOOTSTRAPPED

QT_END_NAMESPACE
6 changes: 2 additions & 4 deletions src/corelib/tools/qdatetimeparser_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
#include "QtCore/qvector.h"
#include "QtCore/qcoreapplication.h"

QT_REQUIRE_CONFIG(datetimeparser);

#define QDATETIMEEDIT_TIME_MIN QTime(0, 0, 0, 0)
#define QDATETIMEEDIT_TIME_MAX QTime(23, 59, 59, 999)
#define QDATETIMEEDIT_DATE_MIN QDate(100, 1, 1)
Expand All @@ -75,8 +77,6 @@

QT_BEGIN_NAMESPACE

#ifndef QT_BOOTSTRAPPED

class Q_CORE_EXPORT QDateTimeParser
{
Q_DECLARE_TR_FUNCTIONS(QDateTimeParser)
Expand Down Expand Up @@ -305,8 +305,6 @@ Q_CORE_EXPORT bool operator==(const QDateTimeParser::SectionNode &s1, const QDat
Q_DECLARE_OPERATORS_FOR_FLAGS(QDateTimeParser::Sections)
Q_DECLARE_OPERATORS_FOR_FLAGS(QDateTimeParser::FieldInfo)

#endif // QT_BOOTSTRAPPED

QT_END_NAMESPACE

#endif // QDATETIME_P_H
8 changes: 5 additions & 3 deletions src/corelib/tools/qlocale.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@
#include "qlocale.h"
#include "qlocale_p.h"
#include "qlocale_tools_p.h"
#if QT_CONFIG(datetimeparser)
#include "qdatetimeparser_p.h"
#endif
#include "qnamespace.h"
#include "qdatetime.h"
#include "qstringlist.h"
Expand Down Expand Up @@ -2084,7 +2086,7 @@ QDateTime QLocale::toDateTime(const QString &string, FormatType format) const
QTime QLocale::toTime(const QString &string, const QString &format) const
{
QTime time;
#ifndef QT_BOOTSTRAPPED
#if QT_CONFIG(datetimeparser)
QDateTimeParser dt(QVariant::Time, QDateTimeParser::FromString);
dt.setDefaultLocale(*this);
if (dt.parseFormat(format))
Expand Down Expand Up @@ -2115,7 +2117,7 @@ QTime QLocale::toTime(const QString &string, const QString &format) const
QDate QLocale::toDate(const QString &string, const QString &format) const
{
QDate date;
#ifndef QT_BOOTSTRAPPED
#if QT_CONFIG(datetimeparser)
QDateTimeParser dt(QVariant::Date, QDateTimeParser::FromString);
dt.setDefaultLocale(*this);
if (dt.parseFormat(format))
Expand Down Expand Up @@ -2145,7 +2147,7 @@ QDate QLocale::toDate(const QString &string, const QString &format) const
#ifndef QT_NO_DATESTRING
QDateTime QLocale::toDateTime(const QString &string, const QString &format) const
{
#ifndef QT_BOOTSTRAPPED
#if QT_CONFIG(datetimeparser)
QTime time;
QDate date;

Expand Down
Loading

0 comments on commit bc5f450

Please sign in to comment.