Merge "Merge remote-tracking branch 'origin/5.11' into 5.12" into refs/staging/5.12

This commit is contained in:
Liang Qi 2018-09-27 18:34:12 +00:00 committed by The Qt Project
commit 353a58ceb9
36 changed files with 214 additions and 124 deletions

58
dist/changes-5.11.2 vendored
View File

@ -17,10 +17,6 @@ https://bugreports.qt.io/
Each of these identifiers can be entered in the bug tracker to obtain more Each of these identifiers can be entered in the bug tracker to obtain more
information about a particular change. information about a particular change.
****************************************************************************
* Qt 5.11.2 Changes *
****************************************************************************
**************************************************************************** ****************************************************************************
* Licensing * * Licensing *
**************************************************************************** ****************************************************************************
@ -32,9 +28,12 @@ information about a particular change.
provided for builds from released branches of Qt. provided for builds from released branches of Qt.
**************************************************************************** ****************************************************************************
* QtCore * * Library *
**************************************************************************** ****************************************************************************
QtCore
------
- QFile: - QFile:
* [QTBUG-69417] Fixed a regression in QFile::copy() that caused the * [QTBUG-69417] Fixed a regression in QFile::copy() that caused the
original file not to be copied entirely if it was modified outside of original file not to be copied entirely if it was modified outside of
@ -85,9 +84,8 @@ information about a particular change.
prohibited Unicode codepoints to report isValid() == true, despite prohibited Unicode codepoints to report isValid() == true, despite
clearing the hostname. clearing the hostname.
**************************************************************************** QtGui
* QtGui * -----
****************************************************************************
- QMatrix: - QMatrix:
* The qHash() implementation for QMatrix has been changed. * The qHash() implementation for QMatrix has been changed.
@ -101,9 +99,10 @@ information about a particular change.
* [QTBUG-70096] Fixed a possible crash when combining QStaticText, * [QTBUG-70096] Fixed a possible crash when combining QStaticText,
QOpenGLWidget and Qt Quick in the same application. QOpenGLWidget and Qt Quick in the same application.
**************************************************************************** - Qt programs in Flatpak environment can now trigger IBus input method.
* QtWidgets *
**************************************************************************** QtWidgets
---------
- QMessageBox: - QMessageBox:
* [QTBUG-69526] A message box with two buttons, one of which is the "Show * [QTBUG-69526] A message box with two buttons, one of which is the "Show
@ -122,8 +121,39 @@ information about a particular change.
- [QTBUG-69271] PCRE2 was updated to version 10.31. - [QTBUG-69271] PCRE2 was updated to version 10.31.
**************************************************************************** ****************************************************************************
* plugins * * Tools *
**************************************************************************** ****************************************************************************
- ibus: configure & build system
* Qt programs in Flatpak environment can now trigger IBus input method. ------------------------
- [QTBUG-63452] Fixed re-configuring commercial builds after more than a day.
- [QTBUG-63483] Fixed -sysroot being ignored by various configure tests.
- [QTBUG-67443] Fixed build with some MinGW distributions.
- [QTBUG-69176] Fixed setting variables with digits in their names on
the configure command line.
- [MSVC][ICC] Fixed build with MSVC 2017 15.8.
- Fixed -L & -F being ignored by library configure tests.
- Added support for building with Wayland on macOS.
qmake
-----
- [QTBUG-22863][QTBUG-68635] Fixed support for file names containing colons
or hash marks - to a degree.
- [QTBUG-35713][Android@Win] Fixed building of static libraries with DESTDIR.
- [QTBUG-37592][Darwin] Switching the SDK version on an existing build will
now raise an error.
- [QTBUG-59967][VS2012+] Fixed handling of QMAKE_MANIFEST.
- [QTBUG-65072][Android@Win] Fixed inconsistent use of path separators in
generated dependencies with lead to build rules not being found.
- [QTBUG-69244][Xcode] Fixed shadow builds of SUBDIRS projects.
- [QTBUG-69279][Xcode] Fixed clobbering of build directory name in debug
builds of libraries with CONFIG+=create_prl when the path contains the
library name itself.
- [QTBUG-69770][VS] Fixed compilation of generated C++ sources with non-.cpp
file extensions.
- [QTBUG-69769][VS] Fixed QMAKE_EXTRA_COMPILERS for non-debug&release builds.
- [Darwin] Fixed QMAKE_BUNDLE not being used for the bundle identifier.
- Clang-based mkspecs now support CROSS_COMPILE.
- Added support for C++14/17 with MSVC 2017 15.7.

View File

@ -6,6 +6,7 @@
"Description": "IAccessible2 is a new accessibility API which complements Microsoft's earlier work on MSAA", "Description": "IAccessible2 is a new accessibility API which complements Microsoft's earlier work on MSAA",
"Homepage": "http://www.linuxfoundation.org/collaborate/workgroups/accessibility/iaccessible2", "Homepage": "http://www.linuxfoundation.org/collaborate/workgroups/accessibility/iaccessible2",
"Version": "1.3.0",
"License": "BSD 3-clause \"New\" or \"Revised\" License", "License": "BSD 3-clause \"New\" or \"Revised\" License",
"LicenseId": "BSD-3-Clause", "LicenseId": "BSD-3-Clause",
"LicenseFile": "LICENSE", "LicenseFile": "LICENSE",

View File

@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2016 The Qt Company Ltd. ** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the QtCore module of the Qt Toolkit. ** This file is part of the QtCore module of the Qt Toolkit.
@ -77,6 +77,7 @@
#define QT_CRYPTOGRAPHICHASH_ONLY_SHA1 #define QT_CRYPTOGRAPHICHASH_ONLY_SHA1
#define QT_FEATURE_cxx11_random (QT_HAS_INCLUDE(<random>) ? 1 : -1) #define QT_FEATURE_cxx11_random (QT_HAS_INCLUDE(<random>) ? 1 : -1)
#define QT_NO_DATASTREAM #define QT_NO_DATASTREAM
#define QT_FEATURE_datestring 1
#define QT_FEATURE_datetimeparser -1 #define QT_FEATURE_datetimeparser -1
#define QT_FEATURE_etw -1 #define QT_FEATURE_etw -1
#define QT_FEATURE_getauxval (QT_HAS_INCLUDE(<sys/auxv.h>) ? 1 : -1) #define QT_FEATURE_getauxval (QT_HAS_INCLUDE(<sys/auxv.h>) ? 1 : -1)
@ -115,6 +116,7 @@
#define QT_NO_SYSTEMLOCALE #define QT_NO_SYSTEMLOCALE
#define QT_FEATURE_systemsemaphore -1 #define QT_FEATURE_systemsemaphore -1
#define QT_FEATURE_temporaryfile 1 #define QT_FEATURE_temporaryfile 1
#define QT_FEATURE_textdate 1
#define QT_FEATURE_thread -1 #define QT_FEATURE_thread -1
#define QT_FEATURE_timezone -1 #define QT_FEATURE_timezone -1
#define QT_FEATURE_topleveldomain -1 #define QT_FEATURE_topleveldomain -1

View File

@ -267,7 +267,7 @@ QLibraryInfo::licensedProducts()
\deprecated \deprecated
This function used to return the installation date for this build of Qt, but now returns a constant date. This function used to return the installation date for this build of Qt, but now returns a constant date.
*/ */
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
#if QT_DEPRECATED_SINCE(5, 5) #if QT_DEPRECATED_SINCE(5, 5)
QDate QDate
QLibraryInfo::buildDate() QLibraryInfo::buildDate()
@ -275,7 +275,7 @@ QLibraryInfo::buildDate()
return QDate::fromString(QString::fromLatin1(qt_configure_installation + 12), Qt::ISODate); return QDate::fromString(QString::fromLatin1(qt_configure_installation + 12), Qt::ISODate);
} }
#endif #endif
#endif //QT_NO_DATESTRING #endif // datestring
#if defined(Q_CC_INTEL) // must be before GNU, Clang and MSVC because ICC/ICL claim to be them #if defined(Q_CC_INTEL) // must be before GNU, Clang and MSVC because ICC/ICL claim to be them
# ifdef __INTEL_CLANG_COMPILER # ifdef __INTEL_CLANG_COMPILER

View File

@ -56,11 +56,11 @@ public:
static QT_DEPRECATED QString licensedProducts(); static QT_DEPRECATED QString licensedProducts();
#endif #endif
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
#if QT_DEPRECATED_SINCE(5, 5) #if QT_DEPRECATED_SINCE(5, 5)
static QT_DEPRECATED QDate buildDate(); static QT_DEPRECATED QDate buildDate();
#endif // QT_DEPRECATED_SINCE(5, 5) #endif // QT_DEPRECATED_SINCE(5, 5)
#endif //QT_NO_DATESTRING #endif // datestring
static const char * build() Q_DECL_NOTHROW; static const char * build() Q_DECL_NOTHROW;

View File

@ -178,7 +178,7 @@ inline void qt_ignore_sigpipe()
#if defined(Q_PROCESSOR_X86_32) && defined(__GLIBC__) #if defined(Q_PROCESSOR_X86_32) && defined(__GLIBC__)
# if !__GLIBC_PREREQ(2, 22) # if !__GLIBC_PREREQ(2, 22)
int qt_open64(const char *pathname, int flags, mode_t); Q_CORE_EXPORT int qt_open64(const char *pathname, int flags, mode_t);
# undef QT_OPEN # undef QT_OPEN
# define QT_OPEN qt_open64 # define QT_OPEN qt_open64
# endif # endif

View File

@ -468,7 +468,7 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok)
case QVariant::Double: case QVariant::Double:
*str = QString::number(d->data.d, 'g', QLocale::FloatingPointShortest); *str = QString::number(d->data.d, 'g', QLocale::FloatingPointShortest);
break; break;
#if !defined(QT_NO_DATESTRING) #if QT_CONFIG(datestring)
case QVariant::Date: case QVariant::Date:
*str = v_cast<QDate>(d)->toString(Qt::ISODate); *str = v_cast<QDate>(d)->toString(Qt::ISODate);
break; break;
@ -617,7 +617,7 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok)
QDate *dt = static_cast<QDate *>(result); QDate *dt = static_cast<QDate *>(result);
if (d->type == QVariant::DateTime) if (d->type == QVariant::DateTime)
*dt = v_cast<QDateTime>(d)->date(); *dt = v_cast<QDateTime>(d)->date();
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
else if (d->type == QVariant::String) else if (d->type == QVariant::String)
*dt = QDate::fromString(*v_cast<QString>(d), Qt::ISODate); *dt = QDate::fromString(*v_cast<QString>(d), Qt::ISODate);
#endif #endif
@ -632,7 +632,7 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok)
case QVariant::DateTime: case QVariant::DateTime:
*t = v_cast<QDateTime>(d)->time(); *t = v_cast<QDateTime>(d)->time();
break; break;
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
case QVariant::String: case QVariant::String:
*t = QTime::fromString(*v_cast<QString>(d), Qt::ISODate); *t = QTime::fromString(*v_cast<QString>(d), Qt::ISODate);
break; break;
@ -645,7 +645,7 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok)
case QVariant::DateTime: { case QVariant::DateTime: {
QDateTime *dt = static_cast<QDateTime *>(result); QDateTime *dt = static_cast<QDateTime *>(result);
switch (d->type) { switch (d->type) {
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
case QVariant::String: case QVariant::String:
*dt = QDateTime::fromString(*v_cast<QString>(d), Qt::ISODate); *dt = QDateTime::fromString(*v_cast<QString>(d), Qt::ISODate);
break; break;

View File

@ -84,7 +84,7 @@ public:
int m_endian; int m_endian;
int m_bits; int m_bits;
int m_stringTableFileOffset; qelfoff_t m_stringTableFileOffset;
template <typename T> template <typename T>
T read(const char *s) T read(const char *s)

View File

@ -98,7 +98,9 @@ QT_BEGIN_NAMESPACE
/*! \fn template <typename T> QFutureWatcher<T>::QFutureWatcher(QObject *parent) /*! \fn template <typename T> QFutureWatcher<T>::QFutureWatcher(QObject *parent)
Constructs a new QFutureWatcher with the given \a parent. Constructs a new QFutureWatcher with the given \a parent. Until a future is
set with setFuture(), the functions isStarted(), isCanceled(), and
isFinished() return \c true.
*/ */
QFutureWatcherBase::QFutureWatcherBase(QObject *parent) QFutureWatcherBase::QFutureWatcherBase(QObject *parent)
:QObject(*new QFutureWatcherBasePrivate, parent) :QObject(*new QFutureWatcherBasePrivate, parent)
@ -241,7 +243,7 @@ QString QFutureWatcherBase::progressText() const
/*! \fn template <typename T> bool QFutureWatcher<T>::isStarted() const /*! \fn template <typename T> bool QFutureWatcher<T>::isStarted() const
Returns \c true if the asynchronous computation represented by the future() Returns \c true if the asynchronous computation represented by the future()
has been started; otherwise returns \c false. has been started, or if no future has been set; otherwise returns \c false.
*/ */
bool QFutureWatcherBase::isStarted() const bool QFutureWatcherBase::isStarted() const
{ {
@ -272,7 +274,7 @@ bool QFutureWatcherBase::isRunning() const
/*! \fn template <typename T> bool QFutureWatcher<T>::isCanceled() const /*! \fn template <typename T> bool QFutureWatcher<T>::isCanceled() const
Returns \c true if the asynchronous computation has been canceled with the Returns \c true if the asynchronous computation has been canceled with the
cancel() function; otherwise returns \c false. cancel() function, or if no future has been set; otherwise returns \c false.
Be aware that the computation may still be running even though this Be aware that the computation may still be running even though this
function returns \c true. See cancel() for more details. function returns \c true. See cancel() for more details.

View File

@ -171,7 +171,7 @@ static ParsedDate getDateFromJulianDay(qint64 julianDay)
static const char monthDays[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; static const char monthDays[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
#ifndef QT_NO_TEXTDATE #if QT_CONFIG(textdate)
static const char qt_shortMonthNames[][4] = { static const char qt_shortMonthNames[][4] = {
"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
@ -200,9 +200,9 @@ static int fromShortMonthName(const QStringRef &monthName)
} }
return -1; return -1;
} }
#endif // QT_NO_TEXTDATE #endif // textdate
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
struct ParsedRfcDateTime { struct ParsedRfcDateTime {
QDate date; QDate date;
QTime time; QTime time;
@ -241,7 +241,7 @@ static ParsedRfcDateTime rfcDateImpl(const QString &s)
return result; return result;
} }
#endif // QT_NO_DATESTRING #endif // datestring
// Return offset in [+-]HH:mm format // Return offset in [+-]HH:mm format
static QString toOffsetString(Qt::DateFormat format, int offset) static QString toOffsetString(Qt::DateFormat format, int offset)
@ -254,6 +254,7 @@ static QString toOffsetString(Qt::DateFormat format, int offset)
(qAbs(offset) / 60) % 60); (qAbs(offset) / 60) % 60);
} }
#if QT_CONFIG(datestring)
// Parse offset in [+-]HH[[:]mm] format // Parse offset in [+-]HH[[:]mm] format
static int fromOffsetString(const QStringRef &offsetString, bool *valid) Q_DECL_NOTHROW static int fromOffsetString(const QStringRef &offsetString, bool *valid) Q_DECL_NOTHROW
{ {
@ -298,6 +299,7 @@ static int fromOffsetString(const QStringRef &offsetString, bool *valid) Q_DECL_
*valid = true; *valid = true;
return sign * ((hour * 60) + minute) * 60; return sign * ((hour * 60) + minute) * 60;
} }
#endif // datestring
/***************************************************************************** /*****************************************************************************
QDate member functions QDate member functions
@ -612,7 +614,7 @@ int QDate::weekNumber(int *yearNumber) const
return week; return week;
} }
#if QT_DEPRECATED_SINCE(5, 11) && !defined(QT_NO_TEXTDATE) #if QT_DEPRECATED_SINCE(5, 11) && QT_CONFIG(textdate)
/*! /*!
\since 4.5 \since 4.5
\deprecated \deprecated
@ -774,11 +776,11 @@ QString QDate::longDayName(int weekday, MonthNameType type)
} }
return QString(); return QString();
} }
#endif // QT_NO_TEXTDATE && deprecated #endif // textdate && deprecated
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
#ifndef QT_NO_TEXTDATE #if QT_CONFIG(textdate)
static QString toStringTextDate(QDate date) static QString toStringTextDate(QDate date)
{ {
const ParsedDate pd = getDateFromJulianDay(date.toJulianDay()); const ParsedDate pd = getDateFromJulianDay(date.toJulianDay());
@ -788,7 +790,7 @@ static QString toStringTextDate(QDate date)
+ QString::number(pd.day) + sp + QString::number(pd.day) + sp
+ QString::number(pd.year); + QString::number(pd.year);
} }
#endif // QT_NO_TEXTDATE #endif // textdate
static QString toStringIsoDate(qint64 jd) static QString toStringIsoDate(qint64 jd)
{ {
@ -864,7 +866,7 @@ QString QDate::toString(Qt::DateFormat format) const
case Qt::RFC2822Date: case Qt::RFC2822Date:
return QLocale::c().toString(*this, QStringViewLiteral("dd MMM yyyy")); return QLocale::c().toString(*this, QStringViewLiteral("dd MMM yyyy"));
default: default:
#ifndef QT_NO_TEXTDATE #if QT_CONFIG(textdate)
case Qt::TextDate: case Qt::TextDate:
return toStringTextDate(*this); return toStringTextDate(*this);
#endif #endif
@ -938,7 +940,7 @@ QString QDate::toString(const QString &format) const
} }
#endif #endif
#endif //QT_NO_DATESTRING #endif // datestring
/*! /*!
\fn bool QDate::setYMD(int y, int m, int d) \fn bool QDate::setYMD(int y, int m, int d)
@ -1200,7 +1202,7 @@ qint64 QDate::daysTo(const QDate &d) const
\sa QTime::currentTime(), QDateTime::currentDateTime() \sa QTime::currentTime(), QDateTime::currentDateTime()
*/ */
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
/*! /*!
\fn QDate QDate::fromString(const QString &string, Qt::DateFormat format) \fn QDate QDate::fromString(const QString &string, Qt::DateFormat format)
@ -1233,7 +1235,7 @@ QDate QDate::fromString(const QString& string, Qt::DateFormat format)
case Qt::RFC2822Date: case Qt::RFC2822Date:
return rfcDateImpl(string).date; return rfcDateImpl(string).date;
default: default:
#ifndef QT_NO_TEXTDATE #if QT_CONFIG(textdate)
case Qt::TextDate: { case Qt::TextDate: {
QVector<QStringRef> parts = string.splitRef(QLatin1Char(' '), QString::SkipEmptyParts); QVector<QStringRef> parts = string.splitRef(QLatin1Char(' '), QString::SkipEmptyParts);
@ -1254,7 +1256,7 @@ QDate QDate::fromString(const QString& string, Qt::DateFormat format)
return QDate(year, month, parts.at(2).toInt()); return QDate(year, month, parts.at(2).toInt());
} }
#endif // QT_NO_TEXTDATE #endif // textdate
case Qt::ISODate: { case Qt::ISODate: {
// Semi-strict parsing, must be long enough and have non-numeric separators // Semi-strict parsing, must be long enough and have non-numeric separators
if (string.size() < 10 || string.at(4).isDigit() || string.at(7).isDigit() if (string.size() < 10 || string.at(4).isDigit() || string.at(7).isDigit()
@ -1349,7 +1351,7 @@ QDate QDate::fromString(const QString &string, const QString &format)
#endif #endif
return date; return date;
} }
#endif // QT_NO_DATESTRING #endif // datestring
/*! /*!
\overload \overload
@ -1566,7 +1568,7 @@ int QTime::msec() const
return ds() % 1000; return ds() % 1000;
} }
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
/*! /*!
\overload \overload
@ -1702,7 +1704,7 @@ QString QTime::toString(const QString &format) const
} }
#endif #endif
#endif //QT_NO_DATESTRING #endif // datestring
/*! /*!
Sets the time to hour \a h, minute \a m, seconds \a s and Sets the time to hour \a h, minute \a m, seconds \a s and
@ -1887,7 +1889,7 @@ int QTime::msecsTo(const QTime &t) const
operating system; not all systems provide 1-millisecond accuracy. operating system; not all systems provide 1-millisecond accuracy.
*/ */
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
static QTime fromIsoTimeString(const QStringRef &string, Qt::DateFormat format, bool *isMidnight24) static QTime fromIsoTimeString(const QStringRef &string, Qt::DateFormat format, bool *isMidnight24)
{ {
@ -2069,7 +2071,7 @@ QTime QTime::fromString(const QString &string, const QString &format)
return time; return time;
} }
#endif // QT_NO_DATESTRING #endif // datestring
/*! /*!
@ -3773,7 +3775,7 @@ void QDateTime::setTime_t(uint secsSince1Jan1970UTC)
} }
#endif #endif
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
/*! /*!
\fn QString QDateTime::toString(Qt::DateFormat format) const \fn QString QDateTime::toString(Qt::DateFormat format) const
@ -3848,7 +3850,7 @@ QString QDateTime::toString(Qt::DateFormat format) const
return buf; return buf;
} }
default: default:
#ifndef QT_NO_TEXTDATE #if QT_CONFIG(textdate)
case Qt::TextDate: { case Qt::TextDate: {
const QPair<QDate, QTime> p = getDateTime(d); const QPair<QDate, QTime> p = getDateTime(d);
buf = p.first.toString(Qt::TextDate); buf = p.first.toString(Qt::TextDate);
@ -3993,7 +3995,7 @@ QString QDateTime::toString(const QString &format) const
} }
#endif #endif
#endif //QT_NO_DATESTRING #endif // datestring
static inline void massageAdjustedDateTime(const QDateTimeData &d, QDate *date, QTime *time) static inline void massageAdjustedDateTime(const QDateTimeData &d, QDate *date, QTime *time)
{ {
@ -4722,7 +4724,7 @@ int QDateTime::utcOffset() const
} }
#endif // QT_DEPRECATED_SINCE #endif // QT_DEPRECATED_SINCE
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
/*! /*!
\fn QDateTime QDateTime::fromString(const QString &string, Qt::DateFormat format) \fn QDateTime QDateTime::fromString(const QString &string, Qt::DateFormat format)
@ -4827,7 +4829,7 @@ QDateTime QDateTime::fromString(const QString& string, Qt::DateFormat format)
date = date.addDays(1); date = date.addDays(1);
return QDateTime(date, time, spec, offset); return QDateTime(date, time, spec, offset);
} }
#if !defined(QT_NO_TEXTDATE) #if QT_CONFIG(textdate)
case Qt::TextDate: { case Qt::TextDate: {
QVector<QStringRef> parts = string.splitRef(QLatin1Char(' '), QString::SkipEmptyParts); QVector<QStringRef> parts = string.splitRef(QLatin1Char(' '), QString::SkipEmptyParts);
@ -4936,7 +4938,7 @@ QDateTime QDateTime::fromString(const QString& string, Qt::DateFormat format)
return QDateTime(date, time, Qt::UTC); return QDateTime(date, time, Qt::UTC);
} }
} }
#endif //QT_NO_TEXTDATE #endif // textdate
} }
return QDateTime(); return QDateTime();
@ -5071,7 +5073,7 @@ QDateTime QDateTime::fromString(const QString &string, const QString &format)
return QDateTime(); return QDateTime();
} }
#endif // QT_NO_DATESTRING #endif // datestring
/*! /*!
\fn QDateTime QDateTime::toLocalTime() const \fn QDateTime QDateTime::toLocalTime() const
@ -5330,7 +5332,7 @@ QDataStream &operator>>(QDataStream &in, QDateTime &dateTime)
Date / Time Debug Streams Date / Time Debug Streams
*****************************************************************************/ *****************************************************************************/
#if !defined(QT_NO_DEBUG_STREAM) && !defined(QT_NO_DATESTRING) #if !defined(QT_NO_DEBUG_STREAM) && QT_CONFIG(datestring)
QDebug operator<<(QDebug dbg, const QDate &date) QDebug operator<<(QDebug dbg, const QDate &date)
{ {
QDebugStateSaver saver(dbg); QDebugStateSaver saver(dbg);
@ -5382,7 +5384,7 @@ QDebug operator<<(QDebug dbg, const QDateTime &date)
} }
return dbg.nospace() << ')'; return dbg.nospace() << ')';
} }
#endif #endif // debug_stream && datestring
/*! \fn uint qHash(const QDateTime &key, uint seed = 0) /*! \fn uint qHash(const QDateTime &key, uint seed = 0)
\relates QHash \relates QHash

View File

@ -81,7 +81,7 @@ public:
int daysInYear() const; int daysInYear() const;
int weekNumber(int *yearNum = nullptr) const; int weekNumber(int *yearNum = nullptr) const;
#if QT_DEPRECATED_SINCE(5, 10) && !defined QT_NO_TEXTDATE #if QT_DEPRECATED_SINCE(5, 10) && QT_CONFIG(textdate)
QT_DEPRECATED_X("Use QLocale::monthName or QLocale::standaloneMonthName") QT_DEPRECATED_X("Use QLocale::monthName or QLocale::standaloneMonthName")
static QString shortMonthName(int month, MonthNameType type = DateFormat); static QString shortMonthName(int month, MonthNameType type = DateFormat);
QT_DEPRECATED_X("Use QLocale::dayName or QLocale::standaloneDayName") QT_DEPRECATED_X("Use QLocale::dayName or QLocale::standaloneDayName")
@ -90,8 +90,8 @@ public:
static QString longMonthName(int month, MonthNameType type = DateFormat); static QString longMonthName(int month, MonthNameType type = DateFormat);
QT_DEPRECATED_X("Use QLocale::dayName or QLocale::standaloneDayName") QT_DEPRECATED_X("Use QLocale::dayName or QLocale::standaloneDayName")
static QString longDayName(int weekday, MonthNameType type = DateFormat); static QString longDayName(int weekday, MonthNameType type = DateFormat);
#endif // QT_NO_TEXTDATE && deprecated #endif // textdate && deprecated
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
QString toString(Qt::DateFormat f = Qt::TextDate) const; QString toString(Qt::DateFormat f = Qt::TextDate) const;
#if QT_STRINGVIEW_LEVEL < 2 #if QT_STRINGVIEW_LEVEL < 2
QString toString(const QString &format) const; QString toString(const QString &format) const;
@ -123,7 +123,7 @@ QT_DEPRECATED inline bool setYMD(int y, int m, int d)
Q_DECL_CONSTEXPR bool operator>=(const QDate &other) const { return jd >= other.jd; } Q_DECL_CONSTEXPR bool operator>=(const QDate &other) const { return jd >= other.jd; }
static QDate currentDate(); static QDate currentDate();
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
static QDate fromString(const QString &s, Qt::DateFormat f = Qt::TextDate); static QDate fromString(const QString &s, Qt::DateFormat f = Qt::TextDate);
static QDate fromString(const QString &s, const QString &format); static QDate fromString(const QString &s, const QString &format);
#endif #endif
@ -167,7 +167,7 @@ public:
int minute() const; int minute() const;
int second() const; int second() const;
int msec() const; int msec() const;
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
QString toString(Qt::DateFormat f = Qt::TextDate) const; QString toString(Qt::DateFormat f = Qt::TextDate) const;
#if QT_STRINGVIEW_LEVEL < 2 #if QT_STRINGVIEW_LEVEL < 2
QString toString(const QString &format) const; QString toString(const QString &format) const;
@ -192,7 +192,7 @@ public:
Q_DECL_CONSTEXPR inline int msecsSinceStartOfDay() const { return mds == NullTime ? 0 : mds; } Q_DECL_CONSTEXPR inline int msecsSinceStartOfDay() const { return mds == NullTime ? 0 : mds; }
static QTime currentTime(); static QTime currentTime();
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
static QTime fromString(const QString &s, Qt::DateFormat f = Qt::TextDate); static QTime fromString(const QString &s, Qt::DateFormat f = Qt::TextDate);
static QTime fromString(const QString &s, const QString &format); static QTime fromString(const QString &s, const QString &format);
#endif #endif
@ -303,7 +303,7 @@ public:
void setMSecsSinceEpoch(qint64 msecs); void setMSecsSinceEpoch(qint64 msecs);
void setSecsSinceEpoch(qint64 secs); void setSecsSinceEpoch(qint64 secs);
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
QString toString(Qt::DateFormat f = Qt::TextDate) const; QString toString(Qt::DateFormat f = Qt::TextDate) const;
#if QT_STRINGVIEW_LEVEL < 2 #if QT_STRINGVIEW_LEVEL < 2
QString toString(const QString &format) const; QString toString(const QString &format) const;
@ -342,7 +342,7 @@ public:
static QDateTime currentDateTime(); static QDateTime currentDateTime();
static QDateTime currentDateTimeUtc(); static QDateTime currentDateTimeUtc();
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
static QDateTime fromString(const QString &s, Qt::DateFormat f = Qt::TextDate); static QDateTime fromString(const QString &s, Qt::DateFormat f = Qt::TextDate);
static QDateTime fromString(const QString &s, const QString &format); static QDateTime fromString(const QString &s, const QString &format);
#endif #endif
@ -386,7 +386,7 @@ private:
friend Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QDateTime &); friend Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QDateTime &);
#endif #endif
#if !defined(QT_NO_DEBUG_STREAM) && !defined(QT_NO_DATESTRING) #if !defined(QT_NO_DEBUG_STREAM) && QT_CONFIG(datestring)
friend Q_CORE_EXPORT QDebug operator<<(QDebug, const QDateTime &); friend Q_CORE_EXPORT QDebug operator<<(QDebug, const QDateTime &);
#endif #endif
}; };
@ -401,7 +401,7 @@ Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QDateTime &);
Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QDateTime &); Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QDateTime &);
#endif // QT_NO_DATASTREAM #endif // QT_NO_DATASTREAM
#if !defined(QT_NO_DEBUG_STREAM) && !defined(QT_NO_DATESTRING) #if !defined(QT_NO_DEBUG_STREAM) && QT_CONFIG(datestring)
Q_CORE_EXPORT QDebug operator<<(QDebug, const QDate &); Q_CORE_EXPORT QDebug operator<<(QDebug, const QDate &);
Q_CORE_EXPORT QDebug operator<<(QDebug, const QTime &); Q_CORE_EXPORT QDebug operator<<(QDebug, const QTime &);
Q_CORE_EXPORT QDebug operator<<(QDebug, const QDateTime &); Q_CORE_EXPORT QDebug operator<<(QDebug, const QDateTime &);

View File

@ -77,7 +77,7 @@ QDateTimeParser::~QDateTimeParser()
int QDateTimeParser::getDigit(const QDateTime &t, int index) const int QDateTimeParser::getDigit(const QDateTime &t, int index) const
{ {
if (index < 0 || index >= sectionNodes.size()) { if (index < 0 || index >= sectionNodes.size()) {
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
qWarning("QDateTimeParser::getDigit() Internal error (%s %d)", qWarning("QDateTimeParser::getDigit() Internal error (%s %d)",
qPrintable(t.toString()), index); qPrintable(t.toString()), index);
#else #else
@ -103,7 +103,7 @@ int QDateTimeParser::getDigit(const QDateTime &t, int index) const
default: break; default: break;
} }
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
qWarning("QDateTimeParser::getDigit() Internal error 2 (%s %d)", qWarning("QDateTimeParser::getDigit() Internal error 2 (%s %d)",
qPrintable(t.toString()), index); qPrintable(t.toString()), index);
#else #else
@ -127,7 +127,7 @@ int QDateTimeParser::getDigit(const QDateTime &t, int index) const
bool QDateTimeParser::setDigit(QDateTime &v, int index, int newVal) const bool QDateTimeParser::setDigit(QDateTime &v, int index, int newVal) const
{ {
if (index < 0 || index >= sectionNodes.size()) { if (index < 0 || index >= sectionNodes.size()) {
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
qWarning("QDateTimeParser::setDigit() Internal error (%s %d %d)", qWarning("QDateTimeParser::setDigit() Internal error (%s %d %d)",
qPrintable(v.toString()), index, newVal); qPrintable(v.toString()), index, newVal);
#else #else
@ -612,7 +612,7 @@ int QDateTimeParser::sectionSize(int sectionIndex) const
int QDateTimeParser::sectionMaxSize(Section s, int count) const int QDateTimeParser::sectionMaxSize(Section s, int count) const
{ {
#ifndef QT_NO_TEXTDATE #if QT_CONFIG(textdate)
int mcount = 12; int mcount = 12;
#endif #endif
@ -636,14 +636,14 @@ int QDateTimeParser::sectionMaxSize(Section s, int count) const
case DaySection: return 2; case DaySection: return 2;
case DayOfWeekSectionShort: case DayOfWeekSectionShort:
case DayOfWeekSectionLong: case DayOfWeekSectionLong:
#ifdef QT_NO_TEXTDATE #if !QT_CONFIG(textdate)
return 2; return 2;
#else #else
mcount = 7; mcount = 7;
Q_FALLTHROUGH(); Q_FALLTHROUGH();
#endif #endif
case MonthSection: case MonthSection:
#ifdef QT_NO_TEXTDATE #if !QT_CONFIG(textdate)
return 2; return 2;
#else #else
if (count <= 2) if (count <= 2)
@ -725,7 +725,7 @@ QString QDateTimeParser::sectionText(int sectionIndex) const
} }
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
QDateTimeParser::ParsedSection QDateTimeParser::ParsedSection
QDateTimeParser::parseSection(const QDateTime &currentValue, int sectionIndex, QDateTimeParser::parseSection(const QDateTime &currentValue, int sectionIndex,
@ -1727,7 +1727,7 @@ QDateTimeParser::AmPmFinder QDateTimeParser::findAmPm(QString &str, int sectionI
return PossibleBoth; return PossibleBoth;
return (!broken[amindex] ? PossibleAM : PossiblePM); return (!broken[amindex] ? PossibleAM : PossiblePM);
} }
#endif // QT_NO_DATESTRING #endif // datestring
/*! /*!
\internal \internal
@ -1958,7 +1958,7 @@ QString QDateTimeParser::stateName(State s) const
} }
} }
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
bool QDateTimeParser::fromString(const QString &t, QDate *date, QTime *time) const bool QDateTimeParser::fromString(const QString &t, QDate *date, QTime *time) const
{ {
QDateTime val(QDate(1900, 1, 1), QDATETIMEEDIT_TIME_MIN); QDateTime val(QDate(1900, 1, 1), QDATETIMEEDIT_TIME_MIN);
@ -1983,7 +1983,7 @@ bool QDateTimeParser::fromString(const QString &t, QDate *date, QTime *time) con
} }
return true; return true;
} }
#endif // QT_NO_DATESTRING #endif // datestring
QDateTime QDateTimeParser::getMinimum() const QDateTime QDateTimeParser::getMinimum() const
{ {

View File

@ -180,7 +180,7 @@ public:
LowerCase LowerCase
}; };
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
StateNode parse(QString input, int position, const QDateTime &defaultValue, bool fixup) const; StateNode parse(QString input, int position, const QDateTime &defaultValue, bool fixup) const;
bool fromString(const QString &text, QDate *date, QTime *time) const; bool fromString(const QString &text, QDate *date, QTime *time) const;
#endif #endif
@ -202,7 +202,7 @@ public:
private: private:
int sectionMaxSize(Section s, int count) const; int sectionMaxSize(Section s, int count) const;
QString sectionText(const QString &text, int sectionIndex, int index) const; QString sectionText(const QString &text, int sectionIndex, int index) const;
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
StateNode scanString(const QDateTime &defaultValue, StateNode scanString(const QDateTime &defaultValue,
bool fixup, QString *input) const; bool fixup, QString *input) const;
struct ParsedSection { struct ParsedSection {
@ -237,7 +237,7 @@ private:
PossibleBoth = 4 PossibleBoth = 4
}; };
AmPmFinder findAmPm(QString &str, int index, int *used = 0) const; AmPmFinder findAmPm(QString &str, int index, int *used = 0) const;
#endif // QT_NO_DATESTRING #endif // datestring
bool potentialValue(const QStringRef &str, int min, int max, int index, bool potentialValue(const QStringRef &str, int min, int max, int index,
const QDateTime &currentValue, int insert) const; const QDateTime &currentValue, int insert) const;

View File

@ -2074,7 +2074,7 @@ QString QLocale::dateTimeFormat(FormatType format) const
\sa timeFormat(), toDate(), toDateTime(), QTime::fromString() \sa timeFormat(), toDate(), toDateTime(), QTime::fromString()
*/ */
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
QTime QLocale::toTime(const QString &string, FormatType format) const QTime QLocale::toTime(const QString &string, FormatType format) const
{ {
return toTime(string, timeFormat(format)); return toTime(string, timeFormat(format));
@ -2092,7 +2092,7 @@ QTime QLocale::toTime(const QString &string, FormatType format) const
\sa dateFormat(), toTime(), toDateTime(), QDate::fromString() \sa dateFormat(), toTime(), toDateTime(), QDate::fromString()
*/ */
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
QDate QLocale::toDate(const QString &string, FormatType format) const QDate QLocale::toDate(const QString &string, FormatType format) const
{ {
return toDate(string, dateFormat(format)); return toDate(string, dateFormat(format));
@ -2111,7 +2111,7 @@ QDate QLocale::toDate(const QString &string, FormatType format) const
\sa dateTimeFormat(), toTime(), toDate(), QDateTime::fromString() \sa dateTimeFormat(), toTime(), toDate(), QDateTime::fromString()
*/ */
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
QDateTime QLocale::toDateTime(const QString &string, FormatType format) const QDateTime QLocale::toDateTime(const QString &string, FormatType format) const
{ {
return toDateTime(string, dateTimeFormat(format)); return toDateTime(string, dateTimeFormat(format));
@ -2129,7 +2129,7 @@ QDateTime QLocale::toDateTime(const QString &string, FormatType format) const
\sa timeFormat(), toDate(), toDateTime(), QTime::fromString() \sa timeFormat(), toDate(), toDateTime(), QTime::fromString()
*/ */
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
QTime QLocale::toTime(const QString &string, const QString &format) const QTime QLocale::toTime(const QString &string, const QString &format) const
{ {
QTime time; QTime time;
@ -2160,7 +2160,7 @@ QTime QLocale::toTime(const QString &string, const QString &format) const
\sa dateFormat(), toTime(), toDateTime(), QDate::fromString() \sa dateFormat(), toTime(), toDateTime(), QDate::fromString()
*/ */
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
QDate QLocale::toDate(const QString &string, const QString &format) const QDate QLocale::toDate(const QString &string, const QString &format) const
{ {
QDate date; QDate date;
@ -2191,7 +2191,7 @@ QDate QLocale::toDate(const QString &string, const QString &format) const
\sa dateTimeFormat(), toTime(), toDate(), QDateTime::fromString() \sa dateTimeFormat(), toTime(), toDate(), QDateTime::fromString()
*/ */
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
QDateTime QLocale::toDateTime(const QString &string, const QString &format) const QDateTime QLocale::toDateTime(const QString &string, const QString &format) const
{ {
#if QT_CONFIG(datetimeparser) #if QT_CONFIG(datetimeparser)

View File

@ -1004,7 +1004,7 @@ public:
QString dateFormat(FormatType format = LongFormat) const; QString dateFormat(FormatType format = LongFormat) const;
QString timeFormat(FormatType format = LongFormat) const; QString timeFormat(FormatType format = LongFormat) const;
QString dateTimeFormat(FormatType format = LongFormat) const; QString dateTimeFormat(FormatType format = LongFormat) const;
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
QDate toDate(const QString &string, FormatType = LongFormat) const; QDate toDate(const QString &string, FormatType = LongFormat) const;
QTime toTime(const QString &string, FormatType = LongFormat) const; QTime toTime(const QString &string, FormatType = LongFormat) const;
QDateTime toDateTime(const QString &string, FormatType format = LongFormat) const; QDateTime toDateTime(const QString &string, FormatType format = LongFormat) const;

View File

@ -5205,8 +5205,10 @@ void qBlendTexture(int count, const QSpan *spans, void *userData)
case QImage::Format_RGB16: case QImage::Format_RGB16:
proc = processTextureSpansRGB16[blendType]; proc = processTextureSpansRGB16[blendType];
break; break;
#if defined(__SSE2__) || defined(__ARM_NEON__) || (Q_PROCESSOR_WORDSIZE == 8)
case QImage::Format_ARGB32: case QImage::Format_ARGB32:
case QImage::Format_RGBA8888: case QImage::Format_RGBA8888:
#endif
case QImage::Format_BGR30: case QImage::Format_BGR30:
case QImage::Format_A2BGR30_Premultiplied: case QImage::Format_A2BGR30_Premultiplied:
case QImage::Format_RGB30: case QImage::Format_RGB30:

View File

@ -24,8 +24,7 @@ HEADERS += \
access/qabstractnetworkcache.h \ access/qabstractnetworkcache.h \
access/qnetworkfile_p.h \ access/qnetworkfile_p.h \
access/qhsts_p.h \ access/qhsts_p.h \
access/qhstspolicy.h \ access/qhstspolicy.h
access/qhstsstore_p.h
SOURCES += \ SOURCES += \
access/qnetworkaccessauthenticationmanager.cpp \ access/qnetworkaccessauthenticationmanager.cpp \
@ -45,8 +44,7 @@ SOURCES += \
access/qabstractnetworkcache.cpp \ access/qabstractnetworkcache.cpp \
access/qnetworkfile.cpp \ access/qnetworkfile.cpp \
access/qhsts.cpp \ access/qhsts.cpp \
access/qhstspolicy.cpp \ access/qhstspolicy.cpp
access/qhstsstore.cpp
qtConfig(ftp) { qtConfig(ftp) {
HEADERS += \ HEADERS += \
@ -66,6 +64,14 @@ qtConfig(networkdiskcache) {
SOURCES += access/qnetworkdiskcache.cpp SOURCES += access/qnetworkdiskcache.cpp
} }
qtConfig(settings) {
HEADERS += \
access/qhstsstore_p.h
SOURCES += \
access/qhstsstore.cpp
}
mac: LIBS_PRIVATE += -framework Security mac: LIBS_PRIVATE += -framework Security
wasm { wasm {

View File

@ -525,7 +525,7 @@ static void _q_parseUnixDir(const QStringList &tokens, const QString &userName,
// Resolve the modification date by parsing all possible formats // Resolve the modification date by parsing all possible formats
QDateTime dateTime; QDateTime dateTime;
int n = 0; int n = 0;
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
do { do {
dateTime = QLocale::c().toDateTime(dateString, formats.at(n++)); dateTime = QLocale::c().toDateTime(dateString, formats.at(n++));
} while (n < formats.size() && (!dateTime.isValid())); } while (n < formats.size() && (!dateTime.isValid()));
@ -600,7 +600,7 @@ static void _q_parseDosDir(const QStringList &tokens, const QString &userName, Q
info->setWritable(info->isFile()); info->setWritable(info->isFile());
QDateTime dateTime; QDateTime dateTime;
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
dateTime = QLocale::c().toDateTime(tokens.at(1), QLatin1String("MM-dd-yy hh:mmAP")); dateTime = QLocale::c().toDateTime(tokens.at(1), QLatin1String("MM-dd-yy hh:mmAP"));
if (dateTime.date().year() < 1971) { if (dateTime.date().year() < 1971) {
dateTime.setDate(QDate(dateTime.date().year() + 100, dateTime.setDate(QDate(dateTime.date().year() + 100,

View File

@ -37,13 +37,16 @@
** **
****************************************************************************/ ****************************************************************************/
#include "qhstsstore_p.h"
#include "qhsts_p.h" #include "qhsts_p.h"
#include "QtCore/private/qipaddress_p.h" #include "QtCore/private/qipaddress_p.h"
#include "QtCore/qvector.h" #include "QtCore/qvector.h"
#include "QtCore/qlist.h" #include "QtCore/qlist.h"
#if QT_CONFIG(settings)
#include "qhstsstore_p.h"
#endif // QT_CONFIG(settings)
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
static bool is_valid_domain_name(const QString &host) static bool is_valid_domain_name(const QString &host)
@ -83,8 +86,10 @@ void QHstsCache::updateFromHeaders(const QList<QPair<QByteArray, QByteArray>> &h
QHstsHeaderParser parser; QHstsHeaderParser parser;
if (parser.parse(headers)) { if (parser.parse(headers)) {
updateKnownHost(url.host(), parser.expirationDate(), parser.includeSubDomains()); updateKnownHost(url.host(), parser.expirationDate(), parser.includeSubDomains());
#if QT_CONFIG(settings)
if (hstsStore) if (hstsStore)
hstsStore->synchronize(); hstsStore->synchronize();
#endif // QT_CONFIG(settings)
} }
} }
@ -93,12 +98,14 @@ void QHstsCache::updateFromPolicies(const QVector<QHstsPolicy> &policies)
for (const auto &policy : policies) for (const auto &policy : policies)
updateKnownHost(policy.host(), policy.expiry(), policy.includesSubDomains()); updateKnownHost(policy.host(), policy.expiry(), policy.includesSubDomains());
#if QT_CONFIG(settings)
if (hstsStore && policies.size()) { if (hstsStore && policies.size()) {
// These policies are coming either from store or from QNAM's setter // These policies are coming either from store or from QNAM's setter
// function. As a result we can notice expired or new policies, time // function. As a result we can notice expired or new policies, time
// to sync ... // to sync ...
hstsStore->synchronize(); hstsStore->synchronize();
} }
#endif // QT_CONFIG(settings)
} }
void QHstsCache::updateKnownHost(const QUrl &url, const QDateTime &expires, void QHstsCache::updateKnownHost(const QUrl &url, const QDateTime &expires,
@ -108,8 +115,10 @@ void QHstsCache::updateKnownHost(const QUrl &url, const QDateTime &expires,
return; return;
updateKnownHost(url.host(), expires, includeSubDomains); updateKnownHost(url.host(), expires, includeSubDomains);
#if QT_CONFIG(settings)
if (hstsStore) if (hstsStore)
hstsStore->synchronize(); hstsStore->synchronize();
#endif // QT_CONFIG(settings)
} }
void QHstsCache::updateKnownHost(const QString &host, const QDateTime &expires, void QHstsCache::updateKnownHost(const QString &host, const QDateTime &expires,
@ -137,8 +146,10 @@ void QHstsCache::updateKnownHost(const QString &host, const QDateTime &expires,
} }
knownHosts.insert(pos, {hostName, newPolicy}); knownHosts.insert(pos, {hostName, newPolicy});
#if QT_CONFIG(settings)
if (hstsStore) if (hstsStore)
hstsStore->addToObserved(newPolicy); hstsStore->addToObserved(newPolicy);
#endif // QT_CONFIG(settings)
return; return;
} }
@ -149,8 +160,10 @@ void QHstsCache::updateKnownHost(const QString &host, const QDateTime &expires,
else else
return; return;
#if QT_CONFIG(settings)
if (hstsStore) if (hstsStore)
hstsStore->addToObserved(newPolicy); hstsStore->addToObserved(newPolicy);
#endif // QT_CONFIG(settings)
} }
bool QHstsCache::isKnownHost(const QUrl &url) const bool QHstsCache::isKnownHost(const QUrl &url) const
@ -187,10 +200,12 @@ bool QHstsCache::isKnownHost(const QUrl &url) const
if (pos != knownHosts.end()) { if (pos != knownHosts.end()) {
if (pos->second.isExpired()) { if (pos->second.isExpired()) {
knownHosts.erase(pos); knownHosts.erase(pos);
#if QT_CONFIG(settings)
if (hstsStore) { if (hstsStore) {
// Inform our store that this policy has expired. // Inform our store that this policy has expired.
hstsStore->addToObserved(pos->second); hstsStore->addToObserved(pos->second);
} }
#endif // QT_CONFIG(settings)
} else if (!superDomainMatch || pos->second.includesSubDomains()) { } else if (!superDomainMatch || pos->second.includesSubDomains()) {
return true; return true;
} }
@ -221,6 +236,7 @@ QVector<QHstsPolicy> QHstsCache::policies() const
return values; return values;
} }
#if QT_CONFIG(settings)
void QHstsCache::setStore(QHstsStore *store) void QHstsCache::setStore(QHstsStore *store)
{ {
// Caller retains ownership of store, which must outlive this cache. // Caller retains ownership of store, which must outlive this cache.
@ -248,6 +264,7 @@ void QHstsCache::setStore(QHstsStore *store)
updateFromPolicies(restored); updateFromPolicies(restored);
} }
} }
#endif // QT_CONFIG(settings)
// The parser is quite simple: 'nextToken' knowns exactly what kind of tokens // The parser is quite simple: 'nextToken' knowns exactly what kind of tokens
// are valid and it will return false if something else was found; then // are valid and it will return false if something else was found; then

View File

@ -69,8 +69,6 @@ QT_BEGIN_NAMESPACE
template<typename T> class QList; template<typename T> class QList;
template <typename T> class QVector; template <typename T> class QVector;
class QHstsStore;
class Q_AUTOTEST_EXPORT QHstsCache class Q_AUTOTEST_EXPORT QHstsCache
{ {
public: public:
@ -85,7 +83,9 @@ public:
QVector<QHstsPolicy> policies() const; QVector<QHstsPolicy> policies() const;
void setStore(QHstsStore *store); #if QT_CONFIG(settings)
void setStore(class QHstsStore *store);
#endif // QT_CONFIG(settings)
private: private:
@ -119,7 +119,9 @@ private:
}; };
mutable std::map<HostName, QHstsPolicy> knownHosts; mutable std::map<HostName, QHstsPolicy> knownHosts;
#if QT_CONFIG(settings)
QHstsStore *hstsStore = nullptr; QHstsStore *hstsStore = nullptr;
#endif // QT_CONFIG(settings)
}; };
class Q_AUTOTEST_EXPORT QHstsHeaderParser class Q_AUTOTEST_EXPORT QHstsHeaderParser

View File

@ -53,6 +53,8 @@
#include <QtNetwork/private/qtnetworkglobal_p.h> #include <QtNetwork/private/qtnetworkglobal_p.h>
QT_REQUIRE_CONFIG(settings);
#include <QtCore/qsettings.h> #include <QtCore/qsettings.h>
#include <QtCore/qvector.h> #include <QtCore/qvector.h>

View File

@ -423,7 +423,7 @@ void QNetworkAccessFtpBackend::ftpRawCommandReply(int code, const QString &text)
if (id == sizeId) { if (id == sizeId) {
// reply to the size command // reply to the size command
setHeader(QNetworkRequest::ContentLengthHeader, text.toLongLong()); setHeader(QNetworkRequest::ContentLengthHeader, text.toLongLong());
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
} else if (id == mdtmId) { } else if (id == mdtmId) {
QDateTime dt = QDateTime::fromString(text, QLatin1String("yyyyMMddHHmmss")); QDateTime dt = QDateTime::fromString(text, QLatin1String("yyyyMMddHHmmss"));
setHeader(QNetworkRequest::LastModifiedHeader, dt); setHeader(QNetworkRequest::LastModifiedHeader, dt);

View File

@ -48,6 +48,10 @@
#include "qhstspolicy.h" #include "qhstspolicy.h"
#include "qhsts_p.h" #include "qhsts_p.h"
#if QT_CONFIG(settings)
#include "qhstsstore_p.h"
#endif // QT_CONFIG(settings)
#include "QtNetwork/qnetworksession.h" #include "QtNetwork/qnetworksession.h"
#include "QtNetwork/private/qsharednetworksession_p.h" #include "QtNetwork/private/qsharednetworksession_p.h"
@ -763,9 +767,14 @@ bool QNetworkAccessManager::isStrictTransportSecurityEnabled() const
void QNetworkAccessManager::enableStrictTransportSecurityStore(bool enabled, const QString &storeDir) void QNetworkAccessManager::enableStrictTransportSecurityStore(bool enabled, const QString &storeDir)
{ {
#if QT_CONFIG(settings)
Q_D(QNetworkAccessManager); Q_D(QNetworkAccessManager);
d->stsStore.reset(enabled ? new QHstsStore(storeDir) : nullptr); d->stsStore.reset(enabled ? new QHstsStore(storeDir) : nullptr);
d->stsCache.setStore(d->stsStore.data()); d->stsCache.setStore(d->stsStore.data());
#else
Q_UNUSED(enabled) Q_UNUSED(storeDir)
qWarning("HSTS permanent store requires the feature 'settings' enabled");
#endif // QT_CONFIG(settings)
} }
/*! /*!
@ -779,8 +788,12 @@ void QNetworkAccessManager::enableStrictTransportSecurityStore(bool enabled, con
bool QNetworkAccessManager::isStrictTransportSecurityStoreEnabled() const bool QNetworkAccessManager::isStrictTransportSecurityStoreEnabled() const
{ {
#if QT_CONFIG(settings)
Q_D(const QNetworkAccessManager); Q_D(const QNetworkAccessManager);
return bool(d->stsStore.data()); return bool(d->stsStore.data());
#else
return false;
#endif // QT_CONFIG(settings)
} }
/*! /*!

View File

@ -56,7 +56,6 @@
#include "qnetworkaccesscache_p.h" #include "qnetworkaccesscache_p.h"
#include "qnetworkaccessbackend_p.h" #include "qnetworkaccessbackend_p.h"
#include "qnetworkrequest.h" #include "qnetworkrequest.h"
#include "qhstsstore_p.h"
#include "qhsts_p.h" #include "qhsts_p.h"
#include "private/qobject_p.h" #include "private/qobject_p.h"
#include "QtNetwork/qnetworkproxy.h" #include "QtNetwork/qnetworkproxy.h"
@ -66,6 +65,10 @@
#include "QtNetwork/qnetworkconfigmanager.h" #include "QtNetwork/qnetworkconfigmanager.h"
#endif #endif
#if QT_CONFIG(settings)
#include "qhstsstore_p.h"
#endif // QT_CONFIG(settings)
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QAuthenticator; class QAuthenticator;
@ -215,7 +218,9 @@ public:
Q_AUTOTEST_EXPORT static void clearConnectionCache(QNetworkAccessManager *manager); Q_AUTOTEST_EXPORT static void clearConnectionCache(QNetworkAccessManager *manager);
QHstsCache stsCache; QHstsCache stsCache;
#if QT_CONFIG(settings)
QScopedPointer<QHstsStore> stsStore; QScopedPointer<QHstsStore> stsStore;
#endif // QT_CONFIG(settings)
bool stsEnabled = false; bool stsEnabled = false;
#ifndef QT_NO_BEARERMANAGEMENT #ifndef QT_NO_BEARERMANAGEMENT

View File

@ -47,7 +47,7 @@
#include "QtCore/qdatetime.h" #include "QtCore/qdatetime.h"
#include <ctype.h> #include <ctype.h>
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
# include <stdio.h> # include <stdio.h>
#endif #endif
@ -1273,7 +1273,7 @@ QDateTime QNetworkHeadersPrivate::fromHttpDate(const QByteArray &value)
int pos = value.indexOf(','); int pos = value.indexOf(',');
QDateTime dt; QDateTime dt;
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
if (pos == -1) { if (pos == -1) {
// no comma -> asctime(3) format // no comma -> asctime(3) format
dt = QDateTime::fromString(QString::fromLatin1(value), Qt::TextDate); dt = QDateTime::fromString(QString::fromLatin1(value), Qt::TextDate);
@ -1300,7 +1300,7 @@ QDateTime QNetworkHeadersPrivate::fromHttpDate(const QByteArray &value)
dt = c.toDateTime(sansWeekday, QLatin1String("dd-MMM-yy hh:mm:ss 'GMT'")); dt = c.toDateTime(sansWeekday, QLatin1String("dd-MMM-yy hh:mm:ss 'GMT'"));
} }
} }
#endif // QT_NO_DATESTRING #endif // datestring
if (dt.isValid()) if (dt.isValid())
dt.setTimeSpec(Qt::UTC); dt.setTimeSpec(Qt::UTC);

View File

@ -761,7 +761,7 @@ QDebug operator<<(QDebug debug, const QSslCertificate &certificate)
<< ", " << certificate.issuerDisplayName() << ", " << certificate.issuerDisplayName()
<< ", " << certificate.subjectDisplayName() << ", " << certificate.subjectDisplayName()
<< ", " << certificate.subjectAlternativeNames() << ", " << certificate.subjectAlternativeNames()
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
<< ", " << certificate.effectiveDate() << ", " << certificate.effectiveDate()
<< ", " << certificate.expiryDate() << ", " << certificate.expiryDate()
#endif #endif

View File

@ -159,20 +159,20 @@ init_context:
case QSsl::TlsV1SslV3: case QSsl::TlsV1SslV3:
case QSsl::AnyProtocol: case QSsl::AnyProtocol:
minVersion = SSL3_VERSION; minVersion = SSL3_VERSION;
maxVersion = TLS_MAX_VERSION; maxVersion = 0;
break; break;
case QSsl::SecureProtocols: case QSsl::SecureProtocols:
case QSsl::TlsV1_0OrLater: case QSsl::TlsV1_0OrLater:
minVersion = TLS1_VERSION; minVersion = TLS1_VERSION;
maxVersion = TLS_MAX_VERSION; maxVersion = 0;
break; break;
case QSsl::TlsV1_1OrLater: case QSsl::TlsV1_1OrLater:
minVersion = TLS1_1_VERSION; minVersion = TLS1_1_VERSION;
maxVersion = TLS_MAX_VERSION; maxVersion = 0;
break; break;
case QSsl::TlsV1_2OrLater: case QSsl::TlsV1_2OrLater:
minVersion = TLS1_2_VERSION; minVersion = TLS1_2_VERSION;
maxVersion = TLS_MAX_VERSION; maxVersion = 0;
break; break;
#if QT_CONFIG(dtls) #if QT_CONFIG(dtls)
case QSsl::DtlsV1_0: case QSsl::DtlsV1_0:

View File

@ -45,6 +45,8 @@
#include <QtCore/QSharedDataPointer> #include <QtCore/QSharedDataPointer>
#include <QtCore/QMetaType> #include <QtCore/QMetaType>
QT_REQUIRE_CONFIG(ssl);
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QSslPreSharedKeyAuthenticatorPrivate; class QSslPreSharedKeyAuthenticatorPrivate;

View File

@ -130,7 +130,7 @@ static inline QByteArray fromUnicode(QTextCodec *tc, const QString &str)
static inline QVariant qDateFromString(const QString &val) static inline QVariant qDateFromString(const QString &val)
{ {
#ifdef QT_NO_DATESTRING #if !QT_CONFIG(datestring)
Q_UNUSED(val); Q_UNUSED(val);
return QVariant(val); return QVariant(val);
#else #else
@ -142,7 +142,7 @@ static inline QVariant qDateFromString(const QString &val)
static inline QVariant qTimeFromString(const QString &val) static inline QVariant qTimeFromString(const QString &val)
{ {
#ifdef QT_NO_DATESTRING #if !QT_CONFIG(datestring)
Q_UNUSED(val); Q_UNUSED(val);
return QVariant(val); return QVariant(val);
#else #else
@ -154,7 +154,7 @@ static inline QVariant qTimeFromString(const QString &val)
static inline QVariant qDateTimeFromString(QString &val) static inline QVariant qDateTimeFromString(QString &val)
{ {
#ifdef QT_NO_DATESTRING #if !QT_CONFIG(datestring)
Q_UNUSED(val); Q_UNUSED(val);
return QVariant(val); return QVariant(val);
#else #else

View File

@ -679,7 +679,7 @@ QVariant QPSQLResult::data(int i)
if (val[0] == '\0') { if (val[0] == '\0') {
return QVariant(QDate()); return QVariant(QDate());
} else { } else {
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
return QVariant(QDate::fromString(QString::fromLatin1(val), Qt::ISODate)); return QVariant(QDate::fromString(QString::fromLatin1(val), Qt::ISODate));
#else #else
return QVariant(QString::fromLatin1(val)); return QVariant(QString::fromLatin1(val));
@ -687,7 +687,7 @@ QVariant QPSQLResult::data(int i)
} }
case QVariant::Time: { case QVariant::Time: {
const QString str = QString::fromLatin1(val); const QString str = QString::fromLatin1(val);
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
if (str.isEmpty()) if (str.isEmpty())
return QVariant(QTime()); return QVariant(QTime());
else else
@ -698,7 +698,7 @@ QVariant QPSQLResult::data(int i)
} }
case QVariant::DateTime: { case QVariant::DateTime: {
QString dtval = QString::fromLatin1(val); QString dtval = QString::fromLatin1(val);
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
if (dtval.length() < 10) { if (dtval.length() < 10) {
return QVariant(QDateTime()); return QVariant(QDateTime());
} else { } else {
@ -1500,7 +1500,7 @@ QString QPSQLDriver::formatValue(const QSqlField &field, bool trimStrings) const
} else { } else {
switch (int(field.type())) { switch (int(field.type())) {
case QVariant::DateTime: case QVariant::DateTime:
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
if (field.value().toDateTime().isValid()) { if (field.value().toDateTime().isValid()) {
// we force the value to be considered with a timezone information, and we force it to be UTC // 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 // this is safe since postgresql stores only the UTC value and not the timezone offset (only used
@ -1513,10 +1513,10 @@ QString QPSQLDriver::formatValue(const QSqlField &field, bool trimStrings) const
} }
#else #else
r = QLatin1String("NULL"); r = QLatin1String("NULL");
#endif // QT_NO_DATESTRING #endif // datestring
break; break;
case QVariant::Time: case QVariant::Time:
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
if (field.value().toTime().isValid()) { if (field.value().toTime().isValid()) {
r = QLatin1Char('\'') + field.value().toTime().toString(QLatin1String("hh:mm:ss.zzz")) + QLatin1Char('\''); r = QLatin1Char('\'') + field.value().toTime().toString(QLatin1String("hh:mm:ss.zzz")) + QLatin1Char('\'');
} else } else

View File

@ -617,7 +617,7 @@ QString QSqlDriver::formatValue(const QSqlField &field, bool trimStrings) const
else else
r = field.value().toString(); r = field.value().toString();
break; break;
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
case QVariant::Date: case QVariant::Date:
if (field.value().toDate().isValid()) if (field.value().toDate().isValid())
r = QLatin1Char('\'') + field.value().toDate().toString(Qt::ISODate) r = QLatin1Char('\'') + field.value().toDate().toString(Qt::ISODate)

View File

@ -87,7 +87,7 @@ template<> inline char *toString(const QByteArray &ba)
return QTest::toPrettyCString(ba.constData(), ba.length()); return QTest::toPrettyCString(ba.constData(), ba.length());
} }
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
template<> inline char *toString(const QTime &time) template<> inline char *toString(const QTime &time)
{ {
return time.isValid() return time.isValid()
@ -108,7 +108,7 @@ template<> inline char *toString(const QDateTime &dateTime)
? qstrdup(qPrintable(dateTime.toString(QStringViewLiteral("yyyy/MM/dd hh:mm:ss.zzz[t]")))) ? qstrdup(qPrintable(dateTime.toString(QStringViewLiteral("yyyy/MM/dd hh:mm:ss.zzz[t]"))))
: qstrdup("Invalid QDateTime"); : qstrdup("Invalid QDateTime");
} }
#endif // QT_NO_DATESTRING #endif // datestring
template<> inline char *toString(const QChar &c) template<> inline char *toString(const QChar &c)
{ {

View File

@ -797,7 +797,7 @@ QString QFileSystemModelPrivate::time(const QModelIndex &index) const
{ {
if (!index.isValid()) if (!index.isValid())
return QString(); return QString();
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
return node(index)->lastModified().toString(Qt::SystemLocaleDate); return node(index)->lastModified().toString(Qt::SystemLocaleDate);
#else #else
Q_UNUSED(index); Q_UNUSED(index);

View File

@ -1319,7 +1319,7 @@ QString QDirModelPrivate::type(const QModelIndex &index) const
QString QDirModelPrivate::time(const QModelIndex &index) const QString QDirModelPrivate::time(const QModelIndex &index) const
{ {
#ifndef QT_NO_DATESTRING #if QT_CONFIG(datestring)
return node(index)->info.lastModified().toString(Qt::LocalDate); return node(index)->info.lastModified().toString(Qt::LocalDate);
#else #else
Q_UNUSED(index); Q_UNUSED(index);

View File

@ -2213,9 +2213,6 @@ void QHeaderViewPrivate::_q_sectionsAboutToBeChanged(const QList<QPersistentMode
? model->index(0, logical, root) ? model->index(0, logical, root)
: model->index(logical, 0, root), : model->index(logical, 0, root),
s}); s});
if (layoutChangePersistentSections.size() > 1000)
break;
} }
} }

View File

@ -1243,7 +1243,14 @@ void QCompleter::setPopup(QAbstractItemView *popup)
Qt::FocusPolicy origPolicy = Qt::NoFocus; Qt::FocusPolicy origPolicy = Qt::NoFocus;
if (d->widget) if (d->widget)
origPolicy = d->widget->focusPolicy(); origPolicy = d->widget->focusPolicy();
popup->setParent(nullptr, Qt::Popup);
// Mark the widget window as a popup, so that if the last non-popup window is closed by the
// user, the application should not be prevented from exiting. It needs to be set explicitly via
// setWindowFlag(), because passing the flag via setParent(parent, windowFlags) does not call
// QWidgetPrivate::adjustQuitOnCloseAttribute(), and causes an application not to exit if the
// popup ends up being the last window.
popup->setParent(nullptr);
popup->setWindowFlag(Qt::Popup);
popup->setFocusPolicy(Qt::NoFocus); popup->setFocusPolicy(Qt::NoFocus);
if (d->widget) if (d->widget)
d->widget->setFocusPolicy(origPolicy); d->widget->setFocusPolicy(origPolicy);