diff options
49 files changed, 216 insertions, 119 deletions
diff --git a/cmake/QtAndroidHelpers.cmake b/cmake/QtAndroidHelpers.cmake index b473c2c331b..59a469b1683 100644 --- a/cmake/QtAndroidHelpers.cmake +++ b/cmake/QtAndroidHelpers.cmake @@ -442,8 +442,9 @@ function(qt_internal_create_source_jar) add_dependencies(android_source_jars ${jar_target}) if(QT_WILL_INSTALL) + qt_path_join(destination "${INSTALL_DATADIR}" "android" "${module}") install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${jar_name}-${PROJECT_VERSION}.jar" - DESTINATION "${INSTALL_DATADIR}/android/${module}" + DESTINATION "${destination}" COMPONENT _install_android_source_jar_${module} EXCLUDE_FROM_ALL ) diff --git a/cmake/QtPublicCMakeVersionHelpers.cmake b/cmake/QtPublicCMakeVersionHelpers.cmake index 292d97c84e7..0207c087e1a 100644 --- a/cmake/QtPublicCMakeVersionHelpers.cmake +++ b/cmake/QtPublicCMakeVersionHelpers.cmake @@ -107,10 +107,9 @@ endfunction() # Handle force-assignment of CMP0156 policy when using CMake 3.29+. # # For Apple-platforms we set it to NEW, to avoid duplicate linker issues when using -ObjC flag. +# For Emscripten / WebAssembly we also set it to NEW, to avoid duplicate linker issues. # -# For non-Apple platforms we set it to OLD, because we haven't done the necessary testing to -# see which platforms / linkers can handle the new deduplication behavior, without breaking the -# various linking techniques that Qt uses for object library propagation. +# For other platforms, we leave the policy value as-is, without showing any warnings. function(__qt_internal_set_cmp0156) # Exit early if not using CMake 3.29+ if(NOT POLICY CMP0156) @@ -164,29 +163,32 @@ function(__qt_internal_set_cmp0156) set(default_policy_value NEW) set(unsupported_policy_value OLD) else() - # For non-Apple linkers, we keep the previous behavior of not deduplicating libraries, - # because we haven't done the necessary testing to identify on which platforms - # it is safe to deduplicate. - set(default_policy_value OLD) - set(unsupported_policy_value NEW) + # For other platforms we don't enforce any policy values and keep them as-is. + set(default_policy_value "") + set(unsupported_policy_value "") endif() # Force set the default policy value for the given platform, even if the policy value is # the same or empty. That's because in the calling function scope, the value can be empty # due to the cmake_minimum_required call in Qt6Config.cmake resetting the policy value. - get_cmake_property(debug_message_shown _qt_internal_cmp0156_debug_message_shown) - if(NOT debug_message_shown) - message(DEBUG "Force setting the CMP0156 policy to '${default_policy_value}' " - "for platform '${CMAKE_SYSTEM_NAME}'.") - set_property(GLOBAL PROPERTY _qt_internal_cmp0156_debug_message_shown TRUE) - endif() + if(default_policy_value) + get_cmake_property(debug_message_shown _qt_internal_cmp0156_debug_message_shown) + if(NOT debug_message_shown) + message(DEBUG "Force setting the CMP0156 policy to '${default_policy_value}' " + "for platform '${CMAKE_SYSTEM_NAME}'.") + set_property(GLOBAL PROPERTY _qt_internal_cmp0156_debug_message_shown TRUE) + endif() - cmake_policy(SET CMP0156 "${default_policy_value}") + cmake_policy(SET CMP0156 "${default_policy_value}") + endif() - # If the policy is explicitly set to a value other than the default, issue a warning. + # If the policy is explicitly set to a value other than the (non-empty) default, issue a + # warning. # Don't show the warning if the policy is unset, which would be the default for most # projects, because it's too much noise. Also don't show it for Qt builds. - if("${policy_value}" STREQUAL "${unsupported_policy_value}" AND NOT QT_BUILDING_QT) + if(unsupported_policy_value + AND "${policy_value}" STREQUAL "${unsupported_policy_value}" + AND NOT QT_BUILDING_QT) message(WARNING "CMP0156 is set to '${policy_value}'. Qt forces the '${default_policy_value}'" " behavior of this policy for the '${CMAKE_SYSTEM_NAME}' platform by default." diff --git a/examples/widgets/doc/src/draggableicons.qdoc b/examples/widgets/doc/src/draggableicons.qdoc index 0f1feacb7fb..3cf9b9b7266 100644 --- a/examples/widgets/doc/src/draggableicons.qdoc +++ b/examples/widgets/doc/src/draggableicons.qdoc @@ -4,6 +4,7 @@ /*! \example draganddrop/draggableicons \title Draggable Icons Example + \ingroup examples-user-input \examplecategory {User Interface Components} \brief The Draggable Icons example shows how to drag and drop image data between widgets diff --git a/examples/widgets/doc/src/draggabletext.qdoc b/examples/widgets/doc/src/draggabletext.qdoc index 3609ed5a1a1..f34e166ed89 100644 --- a/examples/widgets/doc/src/draggabletext.qdoc +++ b/examples/widgets/doc/src/draggabletext.qdoc @@ -4,6 +4,7 @@ /*! \example draganddrop/draggabletext \title Draggable Text Example + \ingroup examples-user-input \examplecategory {User Interface Components} \brief Illustrates how to drag and drop text between widgets. diff --git a/examples/widgets/doc/src/dropsite.qdoc b/examples/widgets/doc/src/dropsite.qdoc index 4c38ffc50d3..baa7b22fa8a 100644 --- a/examples/widgets/doc/src/dropsite.qdoc +++ b/examples/widgets/doc/src/dropsite.qdoc @@ -4,6 +4,7 @@ /*! \example draganddrop/dropsite \title Drop Site Example + \ingroup examples-user-input \examplecategory {User Interface Components} \brief The example shows how to distinguish the various MIME formats available diff --git a/examples/widgets/doc/src/tablet.qdoc b/examples/widgets/doc/src/tablet.qdoc index a18eb3249e7..f1238238df9 100644 --- a/examples/widgets/doc/src/tablet.qdoc +++ b/examples/widgets/doc/src/tablet.qdoc @@ -5,7 +5,7 @@ \example widgets/tablet \title Tablet Example \examplecategory {User Interface Components} - \ingroup examples-widgets + \ingroup examples-user-input \brief This example shows how to use a Wacom tablet in Qt applications. \image tabletexample.png {Application displaying a drawing area} diff --git a/examples/widgets/gestures/imagegestures/doc/src/imagegestures.qdoc b/examples/widgets/gestures/imagegestures/doc/src/imagegestures.qdoc index 03b31edabc5..63ca14787b6 100644 --- a/examples/widgets/gestures/imagegestures/doc/src/imagegestures.qdoc +++ b/examples/widgets/gestures/imagegestures/doc/src/imagegestures.qdoc @@ -5,6 +5,7 @@ \example gestures/imagegestures \title Image Gestures Example \examplecategory {User Interface Components} + \ingroup examples-user-input \brief Demonstrates the use of simple gestures in a widget. This example shows how to enable gestures for a widget and use gesture input diff --git a/examples/widgets/touch/knobs/doc/src/touch-knobs.qdoc b/examples/widgets/touch/knobs/doc/src/touch-knobs.qdoc index d229f54f5c7..38bd2016cab 100644 --- a/examples/widgets/touch/knobs/doc/src/touch-knobs.qdoc +++ b/examples/widgets/touch/knobs/doc/src/touch-knobs.qdoc @@ -6,6 +6,7 @@ \title Touch Knobs Example \examplecategory {User Interface Components} \ingroup touchinputexamples + \ingroup examples-user-input \brief Shows how to create custom controls that accept touch input. The Touch Knobs example shows how to create custom controls that diff --git a/src/corelib/doc/src/qtcore.qdoc b/src/corelib/doc/src/qtcore.qdoc index ea65d68da58..ec5fa564639 100644 --- a/src/corelib/doc/src/qtcore.qdoc +++ b/src/corelib/doc/src/qtcore.qdoc @@ -19,8 +19,7 @@ \module QtCorePrivate \title Qt Core Private C++ Classes \qtvariable core-private - \qtcmakepackage Core - \qtcmaketargetitem CorePrivate + \qtcmakepackage CorePrivate \preliminary \brief Provides private core functionality. @@ -28,7 +27,7 @@ private Qt Core APIs: \badcode - find_package(Qt6 REQUIRED COMPONENTS Core) + find_package(Qt6 REQUIRED COMPONENTS CorePrivate) target_link_libraries(mytarget PRIVATE Qt6::CorePrivate) \endcode */ diff --git a/src/corelib/global/qfloat16.h b/src/corelib/global/qfloat16.h index 01106abf34d..86d40b772f0 100644 --- a/src/corelib/global/qfloat16.h +++ b/src/corelib/global/qfloat16.h @@ -362,7 +362,7 @@ inline qfloat16::qfloat16(float f) noexcept #if defined(QT_COMPILER_SUPPORTS_F16C) && defined(__F16C__) __m128 packsingle = _mm_set_ss(f); __m128i packhalf = _mm_cvtps_ph(packsingle, 0); - b16 = _mm_extract_epi16(packhalf, 0); + b16 = quint16(_mm_extract_epi16(packhalf, 0)); #elif defined (__ARM_FP16_FORMAT_IEEE) __fp16 f16 = __fp16(f); memcpy(&b16, &f16, sizeof(quint16)); diff --git a/src/corelib/kernel/qwinregistry.cpp b/src/corelib/kernel/qwinregistry.cpp index fb315cacb7e..37bf3f99ae1 100644 --- a/src/corelib/kernel/qwinregistry.cpp +++ b/src/corelib/kernel/qwinregistry.cpp @@ -191,7 +191,9 @@ QVariant QWinRegistryKey::value(const QString &subKey) const // Otherwise, the resulting string (which may be empty) is returned. QString QWinRegistryKey::stringValue(const wchar_t *subKey) const { - return value<QString>(subKey).value_or(QString()); + if (auto v = value<QString>(subKey)) + return std::move(*v); + return QString(); } QString QWinRegistryKey::stringValue(const QString &subKey) const diff --git a/src/corelib/serialization/.gitignore b/src/corelib/serialization/.gitignore index 89f9ac04aac..8261c031991 100644 --- a/src/corelib/serialization/.gitignore +++ b/src/corelib/serialization/.gitignore @@ -1 +1,2 @@ +# Qt-Security score:insignificant reason:gitignore out/ diff --git a/src/corelib/serialization/make-xml-parser.sh b/src/corelib/serialization/make-xml-parser.sh index 18898337003..4174949154c 100755 --- a/src/corelib/serialization/make-xml-parser.sh +++ b/src/corelib/serialization/make-xml-parser.sh @@ -1,6 +1,7 @@ #!/bin/sh # Copyright (C) 2016 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +# Qt-Security score:insignificant reason:build-tool-containing-no-compiled-source me=$(dirname $0) mkdir -p $me/out diff --git a/src/corelib/serialization/qjsonparseerror.h b/src/corelib/serialization/qjsonparseerror.h index 803b04c53b6..d8fc94448e6 100644 --- a/src/corelib/serialization/qjsonparseerror.h +++ b/src/corelib/serialization/qjsonparseerror.h @@ -7,6 +7,7 @@ #include <QtCore/qtconfigmacros.h> #include <QtCore/qtcoreexports.h> +#include <QtCore/qtypes.h> QT_BEGIN_NAMESPACE @@ -34,7 +35,8 @@ struct Q_CORE_EXPORT QJsonParseError QString errorString() const; - int offset = -1; + std::conditional_t<QT_VERSION_MAJOR < 7, int, qint64> + offset = -1; ParseError error = NoError; }; diff --git a/src/corelib/serialization/qjsonparser.cpp b/src/corelib/serialization/qjsonparser.cpp index df266a76c79..779287adb1d 100644 --- a/src/corelib/serialization/qjsonparser.cpp +++ b/src/corelib/serialization/qjsonparser.cpp @@ -321,7 +321,9 @@ QCborValue Parser::parse(QJsonParseError *error) error: container.reset(); if (error) { - error->offset = json - head; + using OffType = decltype(error->offset); + error->offset = OffType(json - head); + Q_ASSERT(error->offset == json - head); error->error = lastError; } return QCborValue(); diff --git a/src/corelib/text/qcollator.cpp b/src/corelib/text/qcollator.cpp index 9ead847843b..6609d17adf4 100644 --- a/src/corelib/text/qcollator.cpp +++ b/src/corelib/text/qcollator.cpp @@ -1,6 +1,7 @@ // Copyright (C) 2021 The Qt Company Ltd. // Copyright (C) 2013 Aleix Pol Gonzalez <[email protected]> // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:critical reason:data-parser #include "qcollator_p.h" #include "qstringlist.h" diff --git a/src/corelib/text/qcollator.h b/src/corelib/text/qcollator.h index 870811fc48e..2b1e3963b0d 100644 --- a/src/corelib/text/qcollator.h +++ b/src/corelib/text/qcollator.h @@ -1,6 +1,7 @@ // Copyright (C) 2020 The Qt Company Ltd. // Copyright (C) 2013 Aleix Pol Gonzalez <[email protected]> // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant reason:trivial-impl-only #ifndef QCOLLATOR_H #define QCOLLATOR_H diff --git a/src/corelib/text/qcollator_icu.cpp b/src/corelib/text/qcollator_icu.cpp index 84f9c515374..e13e96285ef 100644 --- a/src/corelib/text/qcollator_icu.cpp +++ b/src/corelib/text/qcollator_icu.cpp @@ -1,6 +1,7 @@ // Copyright (C) 2020 The Qt Company Ltd. // Copyright (C) 2013 Aleix Pol Gonzalez <[email protected]> // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:critical reason:data-parser #include "qcollator_p.h" #include "qlocale_p.h" diff --git a/src/corelib/text/qcollator_macx.cpp b/src/corelib/text/qcollator_macx.cpp index 23c23bd53a2..c0561877dd1 100644 --- a/src/corelib/text/qcollator_macx.cpp +++ b/src/corelib/text/qcollator_macx.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2020 Aleix Pol Gonzalez <[email protected]> // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:critical reason:data-parser #include "qcollator_p.h" #include "qlocale_p.h" diff --git a/src/corelib/text/qcollator_p.h b/src/corelib/text/qcollator_p.h index b96cdbaa32a..400cafc0c8a 100644 --- a/src/corelib/text/qcollator_p.h +++ b/src/corelib/text/qcollator_p.h @@ -1,6 +1,7 @@ // Copyright (C) 2016 The Qt Company Ltd. // Copyright (C) 2013 Aleix Pol Gonzalez <[email protected]> // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant reason:trivial-impl-only #ifndef QCOLLATOR_P_H #define QCOLLATOR_P_H diff --git a/src/corelib/text/qcollator_posix.cpp b/src/corelib/text/qcollator_posix.cpp index 5ed80c1b8ea..2712133521c 100644 --- a/src/corelib/text/qcollator_posix.cpp +++ b/src/corelib/text/qcollator_posix.cpp @@ -1,6 +1,7 @@ // Copyright (C) 2021 The Qt Company Ltd. // Copyright (C) 2013 Aleix Pol Gonzalez <[email protected]> // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:critical reason:data-parser #include "qcollator_p.h" #include "qstringlist.h" diff --git a/src/corelib/text/qcollator_win.cpp b/src/corelib/text/qcollator_win.cpp index b588f5ff46a..54228b79b31 100644 --- a/src/corelib/text/qcollator_win.cpp +++ b/src/corelib/text/qcollator_win.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2020 Aleix Pol Gonzalez <[email protected]> // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:critical reason:data-parser #include "qcollator_p.h" #include "qlocale_p.h" diff --git a/src/corelib/text/qlocale.qdoc b/src/corelib/text/qlocale.qdoc index 3980e9d9a6d..bc88b27477d 100644 --- a/src/corelib/text/qlocale.qdoc +++ b/src/corelib/text/qlocale.qdoc @@ -1,5 +1,6 @@ // Copyright (C) 2021 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only +// Qt-Security score:insignificant reason:docs /*! \class QLocale diff --git a/src/corelib/text/qtliterals.qdoc b/src/corelib/text/qtliterals.qdoc index c4671415ee4..8be03a02236 100644 --- a/src/corelib/text/qtliterals.qdoc +++ b/src/corelib/text/qtliterals.qdoc @@ -1,5 +1,6 @@ // Copyright (C) 2021 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only +// Qt-Security score:insignificant reason:docs /*! \namespace QtLiterals @@ -43,4 +44,8 @@ // in the Qt namespace using namespace Qt; \endcode + + The latter is discouraged, because it doesn't allow you to pick which literal + operators you want in case Qt adds conflicting operators in different + namespaces within Qt::Literals. */ diff --git a/src/gui/doc/src/qtgui.qdoc b/src/gui/doc/src/qtgui.qdoc index a89872e70f6..f5d60699deb 100644 --- a/src/gui/doc/src/qtgui.qdoc +++ b/src/gui/doc/src/qtgui.qdoc @@ -17,8 +17,7 @@ /*! \module QtGuiPrivate \title Qt GUI Private C++ Classes - \qtcmakepackage Gui - \qtcmaketargetitem GuiPrivate + \qtcmakepackage GuiPrivate \qtvariable gui-private \brief Provides access to private GUI functionality. diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp index c7b6e4ebff3..bb71f8fb6fc 100644 --- a/src/gui/kernel/qkeysequence.cpp +++ b/src/gui/kernel/qkeysequence.cpp @@ -1298,7 +1298,10 @@ QString QKeySequencePrivate::keyName(Qt::Key key, QKeySequence::SequenceFormat f bool nativeText = (format == QKeySequence::NativeText); QString p; - if (key && key < Qt::Key_Escape && key != Qt::Key_Space) { + if (nativeText && (key > 0x00 && key <= 0x1f)) { + // Map C0 control codes to the corresponding Control Pictures + p = QChar::fromUcs2(0x2400 + key); + } else if (key && key < Qt::Key_Escape && key != Qt::Key_Space) { if (!QChar::requiresSurrogates(key)) { p = QChar::fromUcs2(key).toUpper(); } else { diff --git a/src/gui/text/qtextformat.cpp b/src/gui/text/qtextformat.cpp index 53a984306c6..d722bceb289 100644 --- a/src/gui/text/qtextformat.cpp +++ b/src/gui/text/qtextformat.cpp @@ -657,8 +657,8 @@ Q_GUI_EXPORT QDataStream &operator>>(QDataStream &stream, QTextTableCellFormat & \value FontStyleName \value FontPointSize \value FontPixelSize - \value FontSizeAdjustment Specifies the change in size given to the fontsize already set using - FontPointSize or FontPixelSize. + \value FontSizeAdjustment Specifies an integer adjustment added to the base font size set using + \c FontPointSize or \c FontPixelSize. \value FontFixedPitch \omitvalue FontSizeIncrement \value FontWeight diff --git a/src/gui/util/qundostack.cpp b/src/gui/util/qundostack.cpp index 3d1d8a2b788..27b131cd733 100644 --- a/src/gui/util/qundostack.cpp +++ b/src/gui/util/qundostack.cpp @@ -425,16 +425,16 @@ void QUndoStackPrivate::setIndex(int idx, bool clean) emit q->indexChanged(index); } - const ActionState newUndoState{q->canUndo(), q->undoText()}; - if (indexChanged || newUndoState != undoActionState) { - undoActionState = newUndoState; + if (ActionState newUndoState{q->canUndo(), q->undoText()}; + indexChanged || newUndoState != undoActionState) { + undoActionState = std::move(newUndoState); emit q->canUndoChanged(undoActionState.enabled); emit q->undoTextChanged(undoActionState.text); } - const ActionState newRedoState{q->canRedo(), q->redoText()}; - if (indexChanged || newRedoState != redoActionState) { - redoActionState = newRedoState; + if (ActionState newRedoState{q->canRedo(), q->redoText()}; + indexChanged || newRedoState != redoActionState) { + redoActionState = std::move(newRedoState); emit q->canRedoChanged(redoActionState.enabled); emit q->redoTextChanged(redoActionState.text); } diff --git a/src/gui/util/qundostack_p.h b/src/gui/util/qundostack_p.h index fea201ce62d..6bdcf5fb20b 100644 --- a/src/gui/util/qundostack_p.h +++ b/src/gui/util/qundostack_p.h @@ -59,10 +59,17 @@ public: bool enabled = false; QString text; - bool operator!=(const ActionState &other) const noexcept - { - return enabled != other.enabled || text != other.text; - } + friend bool operator==(const ActionState &lhs, const ActionState &rhs) noexcept +#ifdef __cpp_impl_three_way_comparison + = default; +#else + { return lhs.enabled == rhs.enabled && lhs.text == rhs.text; } + friend bool operator!=(const ActionState &lhs, const ActionState &rhs) noexcept + { return !(lhs == rhs); } +#endif + // some compiler's reject seed = 0) = delete, overload instead: + friend void qHash(const ActionState &key, size_t seed) = delete; + friend void qHash(const ActionState &key) = delete; }; QList<QUndoCommand*> command_list; diff --git a/src/plugins/platforms/android/qandroidplatformscreen.cpp b/src/plugins/platforms/android/qandroidplatformscreen.cpp index c8555cdc659..f64742ff133 100644 --- a/src/plugins/platforms/android/qandroidplatformscreen.cpp +++ b/src/plugins/platforms/android/qandroidplatformscreen.cpp @@ -291,7 +291,7 @@ void QAndroidPlatformScreen::topVisibleWindowChanged() if (w && w->handle()) { QAndroidPlatformWindow *platformWindow = static_cast<QAndroidPlatformWindow *>(w->handle()); if (platformWindow) { - platformWindow->updateSystemUiVisibility(); + platformWindow->updateSystemUiVisibility(w->windowStates(), w->flags()); platformWindow->updateFocusedEditText(); } } diff --git a/src/plugins/platforms/android/qandroidplatformwindow.cpp b/src/plugins/platforms/android/qandroidplatformwindow.cpp index 96c4bfa06f1..c4245998772 100644 --- a/src/plugins/platforms/android/qandroidplatformwindow.cpp +++ b/src/plugins/platforms/android/qandroidplatformwindow.cpp @@ -56,15 +56,12 @@ void QAndroidPlatformWindow::initialize() isForeignWindow(), m_nativeParentQtWindow, listener); m_nativeViewId = m_nativeQtWindow.callMethod<jint>("getId"); - m_windowFlags = Qt::Widget; - m_windowState = Qt::WindowNoState; // the surfaceType is overwritten in QAndroidPlatformOpenGLWindow ctor so let's save // the fact that it's a raster window for now m_isRaster = window->surfaceType() == QSurface::RasterSurface; - setWindowState(window->windowStates()); // the following is in relation to the virtual geometry - const bool forceMaximize = m_windowState & (Qt::WindowMaximized | Qt::WindowFullScreen); + const bool forceMaximize = window->windowStates() & (Qt::WindowMaximized | Qt::WindowFullScreen); const QRect nativeScreenGeometry = platformScreen()->availableGeometry(); if (forceMaximize) { setGeometry(nativeScreenGeometry); @@ -123,7 +120,7 @@ void QAndroidPlatformWindow::raise() QWindowSystemInterface::handleFocusWindowChanged(window(), Qt::ActiveWindowFocusReason); return; } - updateSystemUiVisibility(); + updateSystemUiVisibility(window()->windowStates(), window()->flags()); platformScreen()->raise(this); } @@ -167,13 +164,13 @@ void QAndroidPlatformWindow::setVisible(bool visible) if (!visible && window() == qGuiApp->focusWindow()) { platformScreen()->topVisibleWindowChanged(); } else { - updateSystemUiVisibility(); - if ((m_windowState & Qt::WindowFullScreen) - || (window()->flags() & Qt::ExpandedClientAreaHint)) { + const Qt::WindowStates states = window()->windowStates(); + const Qt::WindowFlags flags = window()->flags(); + updateSystemUiVisibility(states, flags); + if (states & Qt::WindowFullScreen || flags & Qt::ExpandedClientAreaHint) setGeometry(platformScreen()->geometry()); - } else if (m_windowState & Qt::WindowMaximized) { + else if (states & Qt::WindowMaximized) setGeometry(platformScreen()->availableGeometry()); - } requestActivateWindow(); } } @@ -188,27 +185,18 @@ void QAndroidPlatformWindow::setVisible(bool visible) void QAndroidPlatformWindow::setWindowState(Qt::WindowStates state) { - if (m_windowState == state) - return; - QPlatformWindow::setWindowState(state); - m_windowState = state; if (window()->isVisible()) - updateSystemUiVisibility(); + updateSystemUiVisibility(state, window()->flags()); } void QAndroidPlatformWindow::setWindowFlags(Qt::WindowFlags flags) { - if (m_windowFlags == flags) - return; + QPlatformWindow::setWindowFlags(flags); - m_windowFlags = flags; -} - -Qt::WindowFlags QAndroidPlatformWindow::windowFlags() const -{ - return m_windowFlags; + if (window()->isVisible()) + updateSystemUiVisibility(window()->windowStates(), flags); } void QAndroidPlatformWindow::setParent(const QPlatformWindow *window) @@ -256,16 +244,15 @@ void QAndroidPlatformWindow::requestActivateWindow() raise(); } -void QAndroidPlatformWindow::updateSystemUiVisibility() +void QAndroidPlatformWindow::updateSystemUiVisibility(Qt::WindowStates states, Qt::WindowFlags flags) { - const int flags = window()->flags(); const bool isNonRegularWindow = flags & (Qt::Popup | Qt::Dialog | Qt::Sheet) & ~Qt::Window; if (!isNonRegularWindow) { auto iface = qGuiApp->nativeInterface<QNativeInterface::QAndroidApplication>(); iface->runOnAndroidMainThread([=]() { using namespace QtJniTypes; auto activity = iface->context().object<Activity>(); - if (m_windowState & Qt::WindowFullScreen) + if (states & Qt::WindowFullScreen) QtWindowInsetsController::callStaticMethod("showFullScreen", activity); else if (flags & Qt::ExpandedClientAreaHint) QtWindowInsetsController::callStaticMethod("showExpanded", activity); diff --git a/src/plugins/platforms/android/qandroidplatformwindow.h b/src/plugins/platforms/android/qandroidplatformwindow.h index 07f4e12b35c..826a8d30ade 100644 --- a/src/plugins/platforms/android/qandroidplatformwindow.h +++ b/src/plugins/platforms/android/qandroidplatformwindow.h @@ -43,7 +43,6 @@ public: void setWindowState(Qt::WindowStates state) override; void setWindowFlags(Qt::WindowFlags flags) override; - Qt::WindowFlags windowFlags() const; void setParent(const QPlatformWindow *window) override; WId winId() const override; @@ -58,7 +57,7 @@ public: void propagateSizeHints() override; void requestActivateWindow() override; - void updateSystemUiVisibility(); + void updateSystemUiVisibility(Qt::WindowStates states, Qt::WindowFlags flags); void updateFocusedEditText(); inline bool isRaster() const { return m_isRaster; } bool isExposed() const override; @@ -82,8 +81,6 @@ protected: bool isEmbeddingContainer() const; virtual void clearSurface() {} - Qt::WindowFlags m_windowFlags; - Qt::WindowStates m_windowState; bool m_isRaster; int m_nativeViewId = -1; diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 82a86d6ff3a..01716fba60c 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -4019,9 +4019,11 @@ void QWindowsWindow::requestUpdate() // request or we are waiting for the event loop to process // the Posted event on the GUI thread. if (m_vsyncUpdatePending.testAndSetAcquire(UpdateState::Requested, UpdateState::Posted)) { - QMetaObject::invokeMethod(w, [w] { + QWindowsWindow *oldSelf = this; + QMetaObject::invokeMethod(w, [w, oldSelf] { + // 'oldSelf' is only used for comparison, don't access it directly! auto *self = static_cast<QWindowsWindow *>(w->handle()); - if (self) { + if (self && self == oldSelf) { // The platform window is still alive self->m_vsyncUpdatePending.storeRelease(UpdateState::Ready); self->deliverUpdateRequest(); diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm index 5ba6f3e1649..0b05a31ca5c 100644 --- a/src/plugins/styles/mac/qmacstyle_mac.mm +++ b/src/plugins/styles/mac/qmacstyle_mac.mm @@ -5849,6 +5849,9 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex const auto aquaSize = d->effectiveAquaSizeConstrain(opt, widget); const auto cw = QMacStylePrivate::CocoaControl(QMacStylePrivate::Stepper, aquaSize); NSStepperCell *cell = static_cast<NSStepperCell *>(d->cocoaCell(cw)); + const auto controlSize = cell.controlSize; + if (qt_apple_runningWithLiquidGlass()) + cell.controlSize = NSControlSizeMini; cell.enabled = (sb->state & State_Enabled); const CGRect newRect = [cell drawingRectForBounds:updown.toCGRect()]; @@ -5869,6 +5872,8 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex [cell stopTracking:pressPoint at:pressPoint inView:d->backingStoreNSView mouseIsUp:NO]; d->restoreNSGraphicsContext(cg); + if (qt_apple_runningWithLiquidGlass()) + cell.controlSize = controlSize; } } break; diff --git a/src/plugins/tls/schannel/qtls_schannel.cpp b/src/plugins/tls/schannel/qtls_schannel.cpp index 12c2625f39d..667f2d8a6c3 100644 --- a/src/plugins/tls/schannel/qtls_schannel.cpp +++ b/src/plugins/tls/schannel/qtls_schannel.cpp @@ -1238,9 +1238,10 @@ bool TlsCryptographSchannel::createContext() }; #endif + const QString encodedTargetName = QUrl::fromUserInput(targetName()).host(QUrl::EncodeUnicode); auto status = InitializeSecurityContext(&credentialHandle, // phCredential nullptr, // phContext - const_reinterpret_cast<SEC_WCHAR *>(targetName().utf16()), // pszTargetName + const_reinterpret_cast<SEC_WCHAR *>(encodedTargetName.utf16()), // pszTargetName contextReq, // fContextReq 0, // Reserved1 0, // TargetDataRep (unused) diff --git a/src/tools/androidtestrunner/main.cpp b/src/tools/androidtestrunner/main.cpp index 0e04d10e692..b517d85c5fb 100644 --- a/src/tools/androidtestrunner/main.cpp +++ b/src/tools/androidtestrunner/main.cpp @@ -328,6 +328,53 @@ static bool processAndroidManifest() return true; } +static QStringList queryDangerousPermissions() +{ + QByteArray output; + const QStringList args({ "shell"_L1, "dumpsys"_L1, "package"_L1, "permissions"_L1 }); + if (!execAdbCommand(args, &output, false)) { + qWarning("Failed to query permissions via dumpsys"); + return {}; + } + + /* + * Permissions section from this command look like: + * + * Permission [android.permission.INTERNET] (c8cafdc): + * sourcePackage=android + * uid=1000 gids=[3003] type=0 prot=normal|instant + * perm=PermissionInfo{5f5bfbb android.permission.INTERNET} + * flags=0x0 + */ + const static QRegularExpression regex("^\\s*Permission\\s+\\[([^\\]]+)\\]\\s+\\(([^)]+)\\):"_L1); + QStringList dangerousPermissions; + QString currentPerm; + + const QStringList lines = QString::fromUtf8(output).split(u'\n'); + for (const QString &line : lines) { + QRegularExpressionMatch match = regex.match(line); + if (match.hasMatch()) { + currentPerm = match.captured(1); + continue; + } + + if (currentPerm.isEmpty()) + continue; + + int protIndex = line.indexOf("prot="_L1); + if (protIndex == -1) + continue; + + QString protectionTypes = line.mid(protIndex + 5).trimmed(); + if (protectionTypes.contains("dangerous"_L1, Qt::CaseInsensitive)) { + dangerousPermissions.append(currentPerm); + currentPerm.clear(); + } + } + + return dangerousPermissions; +} + static void setOutputFile(QString file, QString format) { if (format.isEmpty()) @@ -938,7 +985,11 @@ int main(int argc, char *argv[]) return EXIT_ERROR; } + const QStringList dangerousPermisisons = queryDangerousPermissions(); for (const auto &permission : g_options.permissions) { + if (!dangerousPermisisons.contains(permission)) + continue; + if (!execAdbCommand({ "shell"_L1, "pm"_L1, "grant"_L1, g_options.package, permission }, nullptr)) { qWarning("Unable to grant '%s' to '%s'. Probably the Android version mismatch.", diff --git a/src/widgets/doc/src/qtwidgets-examples.qdoc b/src/widgets/doc/src/qtwidgets-examples.qdoc index 45677c471ba..364c985b310 100644 --- a/src/widgets/doc/src/qtwidgets-examples.qdoc +++ b/src/widgets/doc/src/qtwidgets-examples.qdoc @@ -164,3 +164,15 @@ regular expressions for the Widget-based applications. */ +/*! + \group examples-user-input + \ingroup all-examples + \title User Input Examples + \brief Using user input in Qt Widgets applications. + + \image imagegestures-example.png {Application handling touch gestures} + + Qt provides the functionality for handling user input and drag-and-drop in + widget-based applications. + +*/ diff --git a/src/widgets/doc/src/qtwidgets-toc.qdoc b/src/widgets/doc/src/qtwidgets-toc.qdoc index bc447b8bd58..beddf853a22 100644 --- a/src/widgets/doc/src/qtwidgets-toc.qdoc +++ b/src/widgets/doc/src/qtwidgets-toc.qdoc @@ -53,6 +53,7 @@ \li \l{Rich Text Examples} \li \l{Graphics View Examples} \li \l{Widget Tools Examples} + \li \l{User Input Examples} \endlist \endlist diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp index 7d4228709be..3177ed5c2d4 100644 --- a/src/widgets/widgets/qmenu.cpp +++ b/src/widgets/widgets/qmenu.cpp @@ -2971,7 +2971,7 @@ void QMenu::mouseReleaseEvent(QMouseEvent *e) #endif d->activateAction(action, QAction::Trigger); } - } else if (!action || action->isEnabled()) { + } else if ((!action || action->isEnabled()) && !action->isSeparator()) { d->hideUpToMenuBar(); } } diff --git a/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp b/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp index b9e239af31d..fde06d2edd9 100644 --- a/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp +++ b/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp @@ -2411,7 +2411,7 @@ void tst_QDateTime::springForward_data() QTest::newRow("PT from day after") << pacific << QDate(2015, 3, 8) << QTime(2, 30) << -1 << -420; } - if (const QTimeZone eastern("America/Ottawa"); eastern.isValid()) { + if (const QTimeZone eastern("America/Toronto"); eastern.isValid()) { QTest::newRow("ET from day before") << eastern << QDate(2015, 3, 8) << QTime(2, 30) << 1 << -300; QTest::newRow("ET from day after") @@ -3500,11 +3500,11 @@ void tst_QDateTime::fromStringStringFormat_localTimeZone_data() QTest::newRow("local-timezone-ttt-with-zone:Etc/GMT+3") << "GMT"_ba << u"2008-10-13 Etc/GMT+3 11.50"_s << u"yyyy-MM-dd ttt hh.mm"_s << 1900 << QDateTime(); // Zone name not valid when offset expected - QTimeZone gmtWithOffset("GMT-2"); + QTimeZone gmtWithOffset("GMT-0"); if (gmtWithOffset.isValid()) { lacksRows = false; - QTest::newRow("local-timezone-with-offset:GMT-2") - << "GMT"_ba << u"2008-10-13 GMT-2 11.50"_s << u"yyyy-MM-dd t hh.mm"_s << 1900 + QTest::newRow("local-timezone-with-offset:GMT-0") + << "GMT"_ba << u"2008-10-13 GMT-0 11.50"_s << u"yyyy-MM-dd t hh.mm"_s << 1900 << QDateTime(QDate(2008, 10, 13), QTime(11, 50), gmtWithOffset); } QTimeZone gmt("GMT"); diff --git a/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp b/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp index 3b66ad76a2f..6a72b5ddf38 100644 --- a/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp +++ b/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp @@ -1887,12 +1887,14 @@ void tst_QTimeZone::roundtripDisplayNames_data() "UTC"_ba, // Those named overtly in tst_QDateTime - special cases first: "UTC-02:00"_ba, "UTC+02:00"_ba, "UTC+12:00"_ba, - "Etc/GMT+3"_ba, "GMT-2"_ba, "GMT"_ba, + "Etc/GMT+3"_ba, "GMT-0"_ba, "GMT"_ba, // ... then ordinary names in alphabetic order: - "America/New_York"_ba, "America/Sao_Paulo"_ba, "America/Vancouver"_ba, - "Asia/Kathmandu"_ba, "Asia/Singapore"_ba, + "America/Anchorage"_ba, "America/Metlakatla"_ba, "America/New_York"_ba, + "America/Sao_Paulo"_ba, "America/Toronto"_ba, "America/Vancouver"_ba, + "Asia/Kathmandu"_ba, "Asia/Manila"_ba, "Asia/Singapore"_ba, "Australia/Brisbane"_ba, "Australia/Eucla"_ba, "Australia/Sydney"_ba, - "Europe/Berlin"_ba, "Europe/Helsinki"_ba, "Europe/Rome"_ba, "Europe/Oslo"_ba, + "Europe/Berlin"_ba, "Europe/Helsinki"_ba, "Europe/Lisbon"_ba, "Europe/Oslo"_ba, + "Europe/Rome"_ba, "Pacific/Apia"_ba, "Pacific/Auckland"_ba, "Pacific/Kiritimati"_ba, "Vulcan/ShiKahr"_ba // Invalid: also worth testing. }; diff --git a/tests/auto/gui/kernel/qsurfaceformat/tst_qsurfaceformat.cpp b/tests/auto/gui/kernel/qsurfaceformat/tst_qsurfaceformat.cpp index 3f655bd905d..28085e1405f 100644 --- a/tests/auto/gui/kernel/qsurfaceformat/tst_qsurfaceformat.cpp +++ b/tests/auto/gui/kernel/qsurfaceformat/tst_qsurfaceformat.cpp @@ -54,10 +54,10 @@ void tst_QSurfaceFormat::versionCheck() format.setMinorVersion(formatMinor); format.setMajorVersion(formatMajor); - QCOMPARE(format.version() >= qMakePair(compareMajor, compareMinor), expected); + QCOMPARE(format.version() >= std::pair(compareMajor, compareMinor), expected); format.setVersion(formatMajor, formatMinor); - QCOMPARE(format.version() >= qMakePair(compareMajor, compareMinor), expected); + QCOMPARE(format.version() >= std::pair(compareMajor, compareMinor), expected); } #include <tst_qsurfaceformat.moc> diff --git a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp index 64add80907a..19e5bfad81f 100644 --- a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp +++ b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp @@ -3843,26 +3843,23 @@ void tst_QPainter::linearGradientSymmetry_data() QTest::addColumn<QGradientStops>("stops"); if (sizeof(qreal) != sizeof(float)) { - QGradientStops stops; - stops << qMakePair(qreal(0.0), QColor(Qt::blue)); - stops << qMakePair(qreal(0.2), QColor(220, 220, 220, 0)); - stops << qMakePair(qreal(0.6), QColor(Qt::red)); - stops << qMakePair(qreal(0.9), QColor(220, 220, 220, 255)); - stops << qMakePair(qreal(1.0), QColor(Qt::black)); + QGradientStops stops = {{qreal(0.0), QColor(Qt::blue)}, + {qreal(0.2), QColor(220, 220, 220, 0)}, + {qreal(0.6), QColor(Qt::red)}, + {qreal(0.9), QColor(220, 220, 220, 255)}, + {qreal(1.0), QColor(Qt::black)}}; QTest::newRow("multiple stops") << stops; } { - QGradientStops stops; - stops << qMakePair(qreal(0.0), QColor(Qt::blue)); - stops << qMakePair(qreal(1.0), QColor(Qt::black)); + QGradientStops stops = {{qreal(0.0), QColor(Qt::blue)}, + {qreal(1.0), QColor(Qt::black)}}; QTest::newRow("two stops") << stops; } if (sizeof(qreal) != sizeof(float)) { - QGradientStops stops; - stops << qMakePair(qreal(0.3), QColor(Qt::blue)); - stops << qMakePair(qreal(0.6), QColor(Qt::black)); + QGradientStops stops = {{qreal(0.3), QColor(Qt::blue)}, + {qreal(0.6), QColor(Qt::black)}}; QTest::newRow("two stops 2") << stops; } } @@ -3913,12 +3910,10 @@ void tst_QPainter::gradientPixelFormat() QImage a(8, 64, QImage::Format_ARGB32_Premultiplied); QImage b(8, 64, format); - - QGradientStops stops; - stops << qMakePair(qreal(0.0), QColor(Qt::blue)); - stops << qMakePair(qreal(0.3), QColor(Qt::red)); - stops << qMakePair(qreal(0.6), QColor(Qt::green)); - stops << qMakePair(qreal(1.0), QColor(Qt::black)); + QGradientStops stops = {{qreal(0.0), QColor(Qt::blue)}, + {qreal(0.3), QColor(Qt::red)}, + {qreal(0.6), QColor(Qt::green)}, + {qreal(1.0), QColor(Qt::black)}}; a.fill(0); b.fill(0); diff --git a/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp b/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp index ab0e8693644..511007e0ae4 100644 --- a/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp +++ b/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp @@ -3525,7 +3525,7 @@ void tst_QRhi::renderToTextureMultipleUniformBuffersAndDynamicOffset() // "see" an all zero matrix and zero opacity, thus leading to different // rendering output. This way we can verify if using dynamic offsets, and // more than one at the same time, is functional. - QVarLengthArray<QPair<int, quint32>, 2> dynamicOffset = { + QVarLengthArray<std::pair<int, quint32>, 2> dynamicOffset = { { 0, quint32(ubufElemSize * 2) }, { 1, quint32(ubuf2ElemSize * 3) }, }; diff --git a/tests/auto/gui/rhi/qshader/tst_qshader.cpp b/tests/auto/gui/rhi/qshader/tst_qshader.cpp index 9e179c95c35..371da0d800c 100644 --- a/tests/auto/gui/rhi/qshader/tst_qshader.cpp +++ b/tests/auto/gui/rhi/qshader/tst_qshader.cpp @@ -279,7 +279,7 @@ void tst_QShader::mslResourceMapping() QCOMPARE(resMap.size(), 2); QCOMPARE(resMap.value(0).first, 0); // mapped to native buffer index 0 - QCOMPARE(resMap.value(1), qMakePair(0, 0)); // mapped to native texture index 0 and sampler index 0 + QCOMPARE(resMap.value(1), std::pair(0, 0)); // mapped to native texture index 0 and sampler index 0 } void tst_QShader::serializeShaderDesc() @@ -667,7 +667,8 @@ void tst_QShader::loadV7() QCOMPARE(tese.description().inputBuiltinVariables()[3].type, QShaderDescription::TessCoordBuiltin); QCOMPARE(tese.nativeResourceBindingMap(QShaderKey(QShader::MslShader, QShaderVersion(12))).size(), 1); - QCOMPARE(tese.nativeResourceBindingMap(QShaderKey(QShader::MslShader, QShaderVersion(12))).value(0), qMakePair(0, -1)); + QCOMPARE(tese.nativeResourceBindingMap(QShaderKey(QShader::MslShader, QShaderVersion(12))).value(0), + std::pair(0, -1)); QShader frag = getShader(QLatin1String(":/data/metal_enabled_tessellation_v7.frag.qsb")); QVERIFY(frag.isValid()); diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp index fa1d70a942b..fdc2dde7921 100644 --- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp @@ -781,7 +781,7 @@ private: void parseContentLength() { - int index = receivedData.indexOf("content-length:"); + int index = receivedData.toLower().indexOf("content-length:"); if (index == -1) return; @@ -3620,7 +3620,7 @@ void tst_QNetworkReply::connectToIPv6Address() QByteArray content = reply->readAll(); //qDebug() << server.receivedData; QByteArray hostinfo = "\r\nhost: " + hostfield + ':' + QByteArray::number(server.serverPort()) + "\r\n"; - QVERIFY(server.receivedData.contains(hostinfo)); + QVERIFY(server.receivedData.toLower().contains(hostinfo)); QCOMPARE(content, dataToSend); QCOMPARE(reply->url(), request.url()); QCOMPARE(reply->error(), error); @@ -8793,7 +8793,11 @@ void tst_QNetworkReply::httpUserAgent() QVERIFY(reply->isFinished()); QCOMPARE(reply->error(), QNetworkReply::NoError); - QVERIFY(server.receivedData.contains("\r\nuser-agent: abcDEFghi\r\n")); + const char userAgentSearch[] = "\r\nuser-agent: "; + qsizetype userAgentIndex = server.receivedData.toLower().indexOf(userAgentSearch); + QCOMPARE_NE(userAgentIndex, -1); + userAgentIndex += sizeof(userAgentSearch) - 1; + QVERIFY(server.receivedData.slice(userAgentIndex).startsWith("abcDEFghi\r\n")); } void tst_QNetworkReply::synchronousAuthenticationCache() @@ -8813,7 +8817,7 @@ void tst_QNetworkReply::synchronousAuthenticationCache() "content-type: text/plain\r\n" "\r\n" "auth"; - QRegularExpression rx("authorization: Basic ([^\r\n]*)\r\n"); + QRegularExpression rx("[Aa]uthorization: Basic ([^\r\n]*)\r\n"); QRegularExpressionMatch match = rx.match(receivedData); if (match.hasMatch()) { if (QByteArray::fromBase64(match.captured(1).toLatin1()) == "login:password") { @@ -9526,7 +9530,7 @@ void tst_QNetworkReply::ioHttpCookiesDuringRedirect() manager.setRedirectPolicy(oldRedirectPolicy); QVERIFY(waitForFinish(reply) == Success); - QVERIFY(target.receivedData.contains("\r\ncookie: hello=world\r\n")); + QVERIFY(target.receivedData.toLower().contains("\r\ncookie: hello=world\r\n")); QVERIFY(validateRedirectedResponseHeaders(reply)); } @@ -10439,7 +10443,7 @@ void tst_QNetworkReply::contentEncoding() { // Check that we included the content encoding method in our Accept-Encoding header const QByteArray &receivedData = server.receivedData; - int start = receivedData.indexOf("accept-encoding"); + int start = receivedData.toLower().indexOf("accept-encoding"); QVERIFY(start != -1); int end = receivedData.indexOf("\r\n", start); QVERIFY(end != -1); diff --git a/tests/auto/network/access/qnetworkreply_local/minihttpserver.h b/tests/auto/network/access/qnetworkreply_local/minihttpserver.h index daad88cdbcc..ae1069d7a7d 100644 --- a/tests/auto/network/access/qnetworkreply_local/minihttpserver.h +++ b/tests/auto/network/access/qnetworkreply_local/minihttpserver.h @@ -152,7 +152,7 @@ private: void parseContentLength(State &st, QByteArrayView header) { - qsizetype index = header.indexOf("\r\ncontent-length:"); + qsizetype index = header.toByteArray().toLower().indexOf("\r\ncontent-length:"); if (index == -1) return; st.foundContentLength = true; diff --git a/tests/auto/network/access/qnetworkreply_local/tst_qnetworkreply_local.cpp b/tests/auto/network/access/qnetworkreply_local/tst_qnetworkreply_local.cpp index 8bed904c230..977a047c58e 100644 --- a/tests/auto/network/access/qnetworkreply_local/tst_qnetworkreply_local.cpp +++ b/tests/auto/network/access/qnetworkreply_local/tst_qnetworkreply_local.cpp @@ -270,7 +270,7 @@ void tst_QNetworkReply_local::fullServerName() QVERIFY(receivedData.startsWith(expectedGet)); const QByteArray expectedHost = "host: " % url.host().toUtf8() % "\r\n"; - QVERIFY(receivedData.contains(expectedHost)); + QVERIFY(receivedData.toLower().contains(expectedHost)); } #endif diff --git a/tests/benchmarks/corelib/time/qtimezone/tst_bench_qtimezone.cpp b/tests/benchmarks/corelib/time/qtimezone/tst_bench_qtimezone.cpp index 3b58b6927ae..fbcce88fe81 100644 --- a/tests/benchmarks/corelib/time/qtimezone/tst_bench_qtimezone.cpp +++ b/tests/benchmarks/corelib/time/qtimezone/tst_bench_qtimezone.cpp @@ -41,15 +41,17 @@ static QList<QByteArray> enoughZones() QByteArray("UTC"), // Those named overtly in tst_QDateTime - special cases first: QByteArray("UTC-02:00"), QByteArray("UTC+02:00"), QByteArray("UTC+12:00"), - QByteArray("Etc/GMT+3"), QByteArray("GMT-2"), QByteArray("GMT"), + QByteArray("Etc/GMT+3"), QByteArray("GMT-0"), QByteArray("GMT"), // ... then ordinary names in alphabetic order: + QByteArray("America/Anchorage"), QByteArray("America/Metlakatla"), QByteArray("America/New_York"), QByteArray("America/Sao_Paulo"), - QByteArray("America/Vancouver"), - QByteArray("Asia/Kathmandu"), QByteArray("Asia/Singapore"), + QByteArray("America/Toronto"), QByteArray("America/Vancouver"), + QByteArray("Asia/Kathmandu"), QByteArray("Asia/Manila"), QByteArray("Asia/Singapore"), QByteArray("Australia/Brisbane"), QByteArray("Australia/Eucla"), QByteArray("Australia/Sydney"), QByteArray("Europe/Berlin"), QByteArray("Europe/Helsinki"), - QByteArray("Europe/Rome"), QByteArray("Europe/Oslo"), + QByteArray("Europe/Lisbon"), QByteArray("Europe/Oslo"), + QByteArray("Europe/Rome"), QByteArray("Pacific/Apia"), QByteArray("Pacific/Auckland"), QByteArray("Pacific/Kiritimati") }; |