/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3 as published by the Free Software ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef MOCKAUDIOROLECONTROL_H #define MOCKAUDIOROLECONTROL_H #include class MockAudioRoleControl : public QAudioRoleControl { friend class MockMediaPlayerService; public: MockAudioRoleControl() : QAudioRoleControl() , m_audioRole(QAudio::UnknownRole) { } QAudio::Role audioRole() const { return m_audioRole; } void setAudioRole(QAudio::Role role) { if (role != m_audioRole) emit audioRoleChanged(m_audioRole = role); } QList supportedAudioRoles() const { return QList() << QAudio::MusicRole << QAudio::AlarmRole << QAudio::NotificationRole; } QAudio::Role m_audioRole; }; #endif // MOCKAUDIOROLECONTROL_H Qt Base (Core, Gui, Widgets, Network, ...)
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2020-02-06 01:00:58 +0100
committerEdward Welbourne <edward.welbourne@qt.io>2020-02-06 11:10:34 +0100
commit8ce0ad805d59da7be377233874a2783303f381f8 (patch)
treea8d35d76f0d8ad775958c8a7ae16bcd41e6ee7e2
parent74a2467edd1bf0800cbaf1878984c6bccd42570d (diff)
parentd29aaf598ab565600af2619d91e05459f7bad0aa (diff)
Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts: src/network/ssl/qsslsocket_openssl_symbols.cpp Change-Id: I8c13b5c48a8ecce96540b39c6d5f8ca146eb2339
-rw-r--r--src/corelib/text/qcollator_icu.cpp7
-rw-r--r--src/corelib/text/qcollator_macx.cpp7
-rw-r--r--src/corelib/text/qcollator_posix.cpp7
-rw-r--r--src/corelib/text/qcollator_win.cpp7
-rw-r--r--src/corelib/time/qdatetimeparser.cpp37
-rw-r--r--src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp5
-rw-r--r--src/plugins/platforms/android/qandroidplatformfiledialoghelper.cpp1
-rw-r--r--src/tools/uic/cpp/cppwriteinitialization.cpp2
-rw-r--r--src/widgets/kernel/qwidget.cpp4
-rw-r--r--tests/auto/corelib/text/qcollator/tst_qcollator.cpp14
-rw-r--r--tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp6
-rw-r--r--tests/auto/tools/uic/baseline/config.ui.py2
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp51
13 files changed, 126 insertions, 24 deletions
diff --git a/src/corelib/text/qcollator_icu.cpp b/src/corelib/text/qcollator_icu.cpp
index 8acda45070..0dca1ee9c9 100644
--- a/src/corelib/text/qcollator_icu.cpp
+++ b/src/corelib/text/qcollator_icu.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Copyright (C) 2013 Aleix Pol Gonzalez <aleixpol@kde.org>
** Contact: https://www.qt.io/licensing/
**
@@ -109,6 +109,11 @@ void QCollatorPrivate::cleanup()
int QCollator::compare(QStringView s1, QStringView s2) const
{
+ if (!s1.size())
+ return s2.size() ? -1 : 0;
+ if (!s2.size())
+ return +1;
+
if (d->dirty)
d->init();
diff --git a/src/corelib/text/qcollator_macx.cpp b/src/corelib/text/qcollator_macx.cpp
index 071d7c048f..cb8e073d4a 100644
--- a/src/corelib/text/qcollator_macx.cpp
+++ b/src/corelib/text/qcollator_macx.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2013 Aleix Pol Gonzalez <aleixpol@kde.org>
+** Copyright (C) 2020 Aleix Pol Gonzalez <aleixpol@kde.org>
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -94,6 +94,11 @@ void QCollatorPrivate::cleanup()
int QCollator::compare(QStringView s1, QStringView s2) const
{
+ if (!s1.size())
+ return s2.size() ? -1 : 0;
+ if (!s2.size())
+ return +1;
+
if (d->dirty)
d->init();
if (!d->collator)
diff --git a/src/corelib/text/qcollator_posix.cpp b/src/corelib/text/qcollator_posix.cpp
index 9cbc539ebe..ffcd214cfb 100644
--- a/src/corelib/text/qcollator_posix.cpp
+++ b/src/corelib/text/qcollator_posix.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2013 Aleix Pol Gonzalez <aleixpol@kde.org>
+** Copyright (C) 2020 Aleix Pol Gonzalez <aleixpol@kde.org>
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -75,6 +75,11 @@ static void stringToWCharArray(QVarLengthArray<wchar_t> &ret, QStringView string
int QCollator::compare(QStringView s1, QStringView s2) const
{
+ if (!s1.size())
+ return s2.size() ? -1 : 0;
+ if (!s2.size())
+ return +1;
+
if (d->isC())
return s1.compare(s2, caseSensitivity());
if (d->dirty)
diff --git a/src/corelib/text/qcollator_win.cpp b/src/corelib/text/qcollator_win.cpp
index 9d81de882f..54f57f1d24 100644
--- a/src/corelib/text/qcollator_win.cpp
+++ b/src/corelib/text/qcollator_win.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2013 Aleix Pol Gonzalez <aleixpol@kde.org>
+** Copyright (C) 2020 Aleix Pol Gonzalez <aleixpol@kde.org>
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -89,6 +89,11 @@ void QCollatorPrivate::cleanup()
int QCollator::compare(QStringView s1, QStringView s2) const
{
+ if (!s1.size())
+ return s2.size() ? -1 : 0;
+ if (!s2.size())
+ return +1;
+
if (d->isC())
return s1.compare(s2, d->caseSensitivity);
diff --git a/src/corelib/time/qdatetimeparser.cpp b/src/corelib/time/qdatetimeparser.cpp
index c9ebc3fab3..790c20004a 100644
--- a/src/corelib/time/qdatetimeparser.cpp
+++ b/src/corelib/time/qdatetimeparser.cpp
@@ -219,7 +219,8 @@ int QDateTimeParser::absoluteMax(int s, const QDateTime &cur) const
const SectionNode &sn = sectionNode(s);
switch (sn.type) {
#if QT_CONFIG(timezone)
- case TimeZoneSection: return QTimeZone::MaxUtcOffsetSecs;
+ case TimeZoneSection:
+ return QTimeZone::MaxUtcOffsetSecs;
#endif
case Hour24Section:
case Hour12Section:
@@ -227,20 +228,25 @@ int QDateTimeParser::absoluteMax(int s, const QDateTime &cur) const
// We want it to be 23 for the stepBy case.
return 23;
case MinuteSection:
- case SecondSection: return 59;
- case MSecSection: return 999;
+ case SecondSection:
+ return 59;
+ case MSecSection:
+ return 999;
case YearSection2Digits:
case YearSection:
// sectionMaxSize will prevent people from typing in a larger number in
// count == 2 sections; stepBy() will work on real years anyway.
return 9999;
- case MonthSection: return calendar.maximumMonthsInYear();
+ case MonthSection:
+ return calendar.maximumMonthsInYear();
case DaySection:
case DayOfWeekSectionShort:
case DayOfWeekSectionLong:
return cur.isValid() ? cur.date().daysInMonth(calendar) : calendar.maximumDaysInMonth();
- case AmPmSection: return 1;
- default: break;
+ case AmPmSection:
+ return 1;
+ default:
+ break;
}
qWarning("QDateTimeParser::absoluteMax() Internal error (%ls)",
qUtf16Printable(sn.name()));
@@ -620,7 +626,8 @@ int QDateTimeParser::sectionMaxSize(Section s, int count) const
switch (s) {
case FirstSection:
case NoSection:
- case LastSection: return 0;
+ case LastSection:
+ return 0;
case AmPmSection: {
const int lowerMax = qMax(getAmPmText(AmText, LowerCase).size(),
@@ -634,7 +641,9 @@ int QDateTimeParser::sectionMaxSize(Section s, int count) const
case Hour12Section:
case MinuteSection:
case SecondSection:
- case DaySection: return 2;
+ case DaySection:
+ return 2;
+
case DayOfWeekSectionShort:
case DayOfWeekSectionLong:
#if !QT_CONFIG(textdate)
@@ -663,11 +672,15 @@ int QDateTimeParser::sectionMaxSize(Section s, int count) const
return ret;
}
#endif
- case MSecSection: return 3;
- case YearSection: return 4;
- case YearSection2Digits: return 2;
+ case MSecSection:
+ return 3;
+ case YearSection:
+ return 4;
+ case YearSection2Digits:
+ return 2;
+ case TimeZoneSection:
// Arbitrarily many tokens (each up to 14 bytes) joined with / separators:
- case TimeZoneSection: return std::numeric_limits<int>::max();
+ return std::numeric_limits<int>::max();
case CalendarPopupSection:
case Internal:
diff --git a/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp b/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp
index 625473964d..ca16efe34f 100644
--- a/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp
+++ b/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp