Merge remote-tracking branch 'origin/5.15' into dev

Conflicts:
	examples/opengl/doc/src/cube.qdoc
	src/corelib/global/qlibraryinfo.cpp
	src/corelib/text/qbytearray_p.h
	src/corelib/text/qlocale_data_p.h
	src/corelib/time/qhijricalendar_data_p.h
	src/corelib/time/qjalalicalendar_data_p.h
	src/corelib/time/qromancalendar_data_p.h
	src/network/ssl/qsslcertificate.h
	src/widgets/doc/src/graphicsview.qdoc
	src/widgets/widgets/qcombobox.cpp
	src/widgets/widgets/qcombobox.h
	tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp
	tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
	tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro
	tests/manual/diaglib/debugproxystyle.cpp
	tests/manual/diaglib/qwidgetdump.cpp
	tests/manual/diaglib/qwindowdump.cpp
	tests/manual/diaglib/textdump.cpp
	util/locale_database/cldr2qlocalexml.py
	util/locale_database/qlocalexml.py
	util/locale_database/qlocalexml2cpp.py

Resolution of util/locale_database/ are based on:
https://codereview.qt-project.org/c/qt/qtbase/+/294250
and src/corelib/{text,time}/*_data_p.h were then regenerated by
running those scripts.

Updated CMakeLists.txt in each of
	tests/auto/corelib/serialization/qcborstreamreader/
	tests/auto/corelib/serialization/qcborvalue/
	tests/auto/gui/kernel/
and generated new ones in each of
	tests/auto/gui/kernel/qaddpostroutine/
	tests/auto/gui/kernel/qhighdpiscaling/
	tests/libfuzzer/corelib/text/qregularexpression/optimize/
	tests/libfuzzer/gui/painting/qcolorspace/fromiccprofile/
	tests/libfuzzer/gui/text/qtextdocument/sethtml/
	tests/libfuzzer/gui/text/qtextdocument/setmarkdown/
	tests/libfuzzer/gui/text/qtextlayout/beginlayout/
by running util/cmake/pro2cmake.py on their changed .pro files.

Changed target name in
	tests/auto/gui/kernel/qaction/qaction.pro
	tests/auto/gui/kernel/qaction/qactiongroup.pro
	tests/auto/gui/kernel/qshortcut/qshortcut.pro
to ensure unique target names for CMake

Changed tst_QComboBox::currentIndex to not test the
currentIndexChanged(QString), as that one does not exist in Qt 6
anymore.

Change-Id: I9a85705484855ae1dc874a81f49d27a50b0dcff7
This commit is contained in:
Qt Forward Merge Bot 2020-04-07 01:00:12 +02:00 committed by Fabian Kosmale
commit 8823bb8d30
399 changed files with 8868 additions and 4421 deletions

5
configure vendored
View File

@ -363,12 +363,9 @@ macSDKify()
val=$(echo $sdk_val $(echo $val | cut -s -d ' ' -f 2-))
echo "$var=$val"
;;
QMAKE_CFLAGS=*|QMAKE_CXXFLAGS=*)
QMAKE_CFLAGS=*|QMAKE_CXXFLAGS=*|QMAKE_LFLAGS=*)
echo "$line -isysroot $sysroot $version_min_flag"
;;
QMAKE_LFLAGS=*)
echo "$line -Wl,-syslibroot,$sysroot $version_min_flag"
;;
*)
echo "$line"
;;

117
dist/changes-5.14.2 vendored Normal file
View File

@ -0,0 +1,117 @@
Qt 5.14.2 is a bug-fix release. It maintains both forward and backward
compatibility (source and binary) with Qt 5.14.0 through 5.14.1.
For more details, refer to the online documentation included in this
distribution. The documentation is also available online:
https://doc.qt.io/qt-5/index.html
The Qt version 5.14 series is binary compatible with the 5.13.x series.
Applications compiled for 5.13 will continue to run with 5.14.
Some of the changes listed in this file include issue tracking numbers
corresponding to tasks in the Qt Bug Tracker:
https://bugreports.qt.io/
Each of these identifiers can be entered in the bug tracker to obtain more
information about a particular change.
****************************************************************************
* QtCore *
****************************************************************************
- QCollator:
* QTBUG-81673: Fixed a regression introduced in 5.14.0 that caused
QCollator not to operate with default-constructed QStrings and print a
warning on Windows.
- QString, codecs:
* QTBUG-62011: ZWNBS is no longer discarded (mistaken for a BOM despite
not being at the start) when converting UCS4 to QString's UCS2.
- QLocale:
* QTBUG-80459: Skip digit-grouping if the system locale is configured to
use an empty group separator.
* QTBUG-81530: Use "+" if MS reports empty for the system locale's plus
sign, as documented in MS's API for the relevant query.
- QLockFile:
* Suppressed the warning on QNX that said 'setNativeLocks failed:
"Function not implemented"'. There is no difference in behavior: Qt
will continue not to be able to apply an OS- level file lock, which
means the lock could be accidentally stolen by buggy software. Correct
software using QLockFile should not be affected.
- QObject:
* For the purposes of QT_NO_NARROWING_CONVERSIONS_IN_CONNECT, pointer
(incl. pointer-to-member) to bool conversions are now considered
narrowing. This matches the resolution of a defect report in C++
itself.
- QStorageInfo:
* Improved discovery of device nodes on Linux if the /dev entry was
renamed after the filesystem was mounted and udev is in use.
****************************************************************************
* QtGui *
****************************************************************************
- QTextMarkdownImporter:
* Text in Markdown format is assumed to be UTF-8.
* The "title" in a Markdown hyperlink is now used as the tooltip,
not the anchor name.
* Fixed vulnerability oss-fuzz-20450 (invalid input resulted in an
attempt to insert items into a list that no longer exists).
****************************************************************************
* QtWidgets *
****************************************************************************
- QLineEdit:
* the inputMask property has allowed any Letter or Number category
character for the respective mask characters, not just ASCII. The
documentation has been updated accordingly.
****************************************************************************
* qmake *
****************************************************************************
- To remove the NDEBUG define that is added by default in MSVC mkspecs,
write DEFINES_RELEASE -= NDEBUG in your .pro file.
- Install/uninstall rules are now generated for target.targets on Windows.
This mirrors the behavior on Unix.
****************************************************************************
* Third-Party Code *
****************************************************************************
- md4c was updated to 0.4.3. This fixes vulnerability oss-fuzz-20580.
- QtSQL, sqlite:
* Updated to v3.31.1
* [QTBUG-82533] Fixed CVE-2020-9327
****************************************************************************
* CMake *
****************************************************************************
- Windows:
* Fixed linking with Qt static build
****************************************************************************
* MSVC *
****************************************************************************
- Fixed a compatibility issue found when linking code compiled with
version 16.6 to a Qt compiled with 16.5.
****************************************************************************
* MinGW *
****************************************************************************
- Fixed build regressions.
- The -debug-and-release configuration has been fixed. In this
configuration, Qt libraries again have a 'd' suffix.
- In the -debug configuration, libraries do not have a 'd' suffix, similar
to Unix platforms.

View File

@ -19,27 +19,11 @@ HTML.headerstyles = \
" }, 0);\n" \
" </script>\n"
HTML.postheader = \
"<body>\n" \
"<div class=\"header\" id=\"qtdocheader\">\n"\
" <div class=\"main\">\n" \
" <div class=\"main-rounded\">\n" \
" <div class=\"navigationbar\">\n" \
" <table><tr>\n"
HTML.postpostheader = \
" </tr></table>\n"\
" </div>\n" \
" </div>\n" \
"<div class=\"content\">\n" \
"<div class=\"line\">\n" \
"<div class=\"content mainContent\">\n"
HTML.navigationseparator = \
"<span class=\"naviSeparator\"> &#9702; </span>\n"
# Add some padding around code snippets, as we cannot
# currectly style them for QTextBrowser using only CSS.
codeindent = 2
codeprefix = "\n\n"
codesuffix = "\n\n"
codeindent = 1
codeprefix = "\n"
codesuffix = "\n"

View File

@ -297,11 +297,14 @@ table.buildversion {
#buildversion {
font-style: italic;
font-size: small;
float: right;
margin-right: 5px;
}
#buildversion a {
background: none;
}
/*
/* table of content

View File

@ -126,8 +126,7 @@ Client::Client(QWidget *parent)
connect(sctpSocket, &QSctpSocket::connected, this, &Client::connected);
connect(sctpSocket, &QSctpSocket::disconnected, this, &Client::disconnected);
connect(sctpSocket, &QSctpSocket::channelReadyRead, this, &Client::readDatagram);
connect(sctpSocket, QOverload<QAbstractSocket::SocketError>::of(&QSctpSocket::error),
this, &Client::displayError);
connect(sctpSocket, &QSctpSocket::errorOccurred, this, &Client::displayError);
connect(consumers[SctpChannels::Time], &Consumer::writeDatagram, this, &Client::writeDatagram);
connect(consumers[SctpChannels::Chat], &Consumer::writeDatagram, this, &Client::writeDatagram);

View File

@ -226,7 +226,7 @@ void SslClient::setupSecureSocket()
this, &SslClient::socketStateChanged);
connect(socket, &QSslSocket::encrypted,
this, &SslClient::socketEncrypted);
connect(socket, QOverload<QAbstractSocket::SocketError>::of(&QSslSocket::error),
connect(socket, &QSslSocket::errorOccurred,
this, &SslClient::socketError);
connect(socket, QOverload<const QList<QSslError> &>::of(&QSslSocket::sslErrors),
this, &SslClient::sslErrors);

View File

@ -183,7 +183,7 @@ MainWindow::MainWindow(QWidget *parent)
bottomBar->addWidget((uploadLimitLabel = new QLabel(tr("0 KB/s"))));
uploadLimitLabel->setFixedSize(QSize(fm.horizontalAdvance(tr("99999 KB/s")), fm.lineSpacing()));
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
setUnifiedTitleAndToolBarOnMac(true);
#endif

View File

@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.

View File

@ -111,7 +111,7 @@ void Window::setVisible(bool visible)
//! [2]
void Window::closeEvent(QCloseEvent *event)
{
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
if (!event->spontaneous() || !isVisible()) {
return;
}

View File

@ -120,7 +120,7 @@ void MainWindow::actionTriggered(QAction *action)
void MainWindow::setupToolBar()
{
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
setUnifiedTitleAndToolBarOnMac(true);
#endif
@ -178,7 +178,7 @@ void MainWindow::setupMenuBar()
for (int i = 0; i < toolBars.count(); ++i)
toolBarMenu->addMenu(toolBars.at(i)->toolbarMenu());
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
toolBarMenu->addSeparator();
action = toolBarMenu->addAction(tr("Unified"));

View File

@ -96,7 +96,7 @@ const QString rsrcPath = ":/images/win";
TextEdit::TextEdit(QWidget *parent)
: QMainWindow(parent)
{
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
setUnifiedTitleAndToolBarOnMac(true);
#endif
setWindowTitle(QCoreApplication::applicationName());

View File

@ -157,10 +157,10 @@ void MainWindow::createActions()
QAction *openIniFileAct = fileMenu->addAction(tr("Open I&NI File..."), this, &MainWindow::openIniFile);
openIniFileAct->setShortcut(tr("Ctrl+N"));
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
QAction *openPropertyListAct = fileMenu->addAction(tr("Open Apple &Property List..."), this, &MainWindow::openPropertyList);
openPropertyListAct->setShortcut(tr("Ctrl+P"));
#endif // Q_OS_OSX
#endif // Q_OS_MACOS
#ifdef Q_OS_WIN
QAction *openRegistryPathAct = fileMenu->addAction(tr("Open Windows &Registry Path..."), this, &MainWindow::openRegistryPath);

View File

@ -29,4 +29,9 @@ greaterThan(QMAKE_MSC_VER, 1910) {
COMPAT_MKSPEC =
}
greaterThan(QMAKE_MSC_VER, 1919) {
# Visual Studio 2019 (16.0) / Visual C++ 19.20 and up
MSVC_VER = 16.0
}
!isEmpty(COMPAT_MKSPEC):!$$COMPAT_MKSPEC: CONFIG += $$COMPAT_MKSPEC

View File

@ -6,7 +6,8 @@
xmlns:uap=\"http://schemas.microsoft.com/appx/manifest/uap/windows10\"
xmlns:uap3=\"http://schemas.microsoft.com/appx/manifest/uap/windows10/3\"
xmlns:mobile=\"http://schemas.microsoft.com/appx/manifest/mobile/windows10\"
IgnorableNamespaces=\"uap uap3 mp mobile\">
xmlns:iot=\"http://schemas.microsoft.com/appx/manifest/iot/windows10\"
IgnorableNamespaces=\"uap uap3 mp mobile iot\">
<Identity
Name=\"$${WINRT_MANIFEST.identity}\"

View File

@ -1,4 +1,3 @@
if (CMAKE_VERSION VERSION_LESS 3.1.0)
message(FATAL_ERROR \"Qt 5 $${CMAKE_MODULE_NAME} module requires at least CMake version 3.1.0\")
endif()
@ -406,8 +405,12 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
!!ENDIF
endif()
!!IF equals(TEMPLATE, aux)
add_library(Qt5::$${CMAKE_MODULE_NAME} INTERFACE IMPORTED)
!!ELSE
add_library(Qt5::$${CMAKE_MODULE_NAME} STATIC IMPORTED)
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY IMPORTED_LINK_INTERFACE_LANGUAGES "CXX")
!!ENDIF
!!ELSE
!!IF equals(TEMPLATE, aux)
add_library(Qt5::$${CMAKE_MODULE_NAME} INTERFACE IMPORTED)
@ -566,8 +569,13 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
!!ENDIF // TEMPLATE != aux
!!IF isEmpty(CMAKE_INTERNAL_MODULE)
file(GLOB pluginTargets \"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}_*Plugin.cmake\")
# In Qt 5.15 the glob pattern was relaxed to also catch plugins not literally named "Plugin".
# Define QT5_STRICT_PLUGIN_GLOB or ModuleName_STRICT_PLUGIN_GLOB to revert to old behavior.
if (QT5_STRICT_PLUGIN_GLOB OR Qt5$${CMAKE_MODULE_NAME}_STRICT_PLUGIN_GLOB)
file(GLOB pluginTargets \"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}_*Plugin.cmake\")
else()
file(GLOB pluginTargets \"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}_*.cmake\")
endif()
macro(_populate_$${CMAKE_MODULE_NAME}_plugin_properties Plugin Configuration PLUGIN_LOCATION
IsDebugAndRelease)
@ -628,10 +636,8 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
include(${pluginTarget})
endforeach()
endif()
!!ENDIF // isEmpty(CMAKE_INTERNAL_MODULE)
!!IF !isEmpty(CMAKE_MODULE_EXTRAS)
include(\"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}ConfigExtras.cmake\")
!!ENDIF
@ -640,6 +646,5 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
include(\"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}Macros.cmake\")
!!ENDIF
_qt5_$${CMAKE_MODULE_NAME}_check_file_exists(\"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}ConfigVersion.cmake\")
_qt5_$${CMAKE_MODULE_NAME}_check_file_exists(\"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}ConfigVersion.cmake\")
endif()

View File

@ -198,7 +198,7 @@ macx-xcode {
-isysroot$$xcodeSDKInfo(Path, $$sdk)
QMAKE_XARCH_LFLAGS_$${arch} = $$version_min_flags \
-Xarch_$${arch} \
-Wl,-syslibroot,$$xcodeSDKInfo(Path, $$sdk)
-isysroot$$xcodeSDKInfo(Path, $$sdk)
QMAKE_XARCH_CFLAGS += $(EXPORT_QMAKE_XARCH_CFLAGS_$${arch})
QMAKE_XARCH_LFLAGS += $(EXPORT_QMAKE_XARCH_LFLAGS_$${arch})
@ -222,7 +222,7 @@ macx-xcode {
version_min_flag = -m$${version_identifier}-version-min=$$deployment_target
QMAKE_CFLAGS += -isysroot $$sysroot_path $$version_min_flag
QMAKE_CXXFLAGS += -isysroot $$sysroot_path $$version_min_flag
QMAKE_LFLAGS += -Wl,-syslibroot,$$sysroot_path $$version_min_flag
QMAKE_LFLAGS += -isysroot $$sysroot_path $$version_min_flag
}
# Enable precompiled headers for multiple architectures

View File

@ -279,7 +279,15 @@ contains(all_qt_module_deps, qml): \
for (QMLPATH, QMLPATHS): \
IMPORTPATHS += -importPath $$system_quote($$QMLPATH)
#message(run $$QMLIMPORTSCANNER $$_PRO_FILE_PWD_ $$IMPORTPATHS)
# add qrc files, too
!isEmpty(RESOURCES) {
IMPORTPATHS += -qrcFiles
for (RESOURCE, RESOURCES): \
IMPORTPATHS += $$absolute_path($$system_quote($$RESOURCE), $$_PRO_FILE_PWD_)
}
# message(run $$QMLIMPORTSCANNER $$_PRO_FILE_PWD_ $$IMPORTPATHS)
JSON = $$system($$QMLIMPORTSCANNER $$system_quote($$_PRO_FILE_PWD_) $$IMPORTPATHS)
parseJson(JSON, IMPORTS)| error("Failed to parse qmlimportscanner output.")

View File

@ -60,7 +60,7 @@ win32|CONFIG(static, static|shared) {
"QMAKE_DEFINES_$${ucmodule} = $$val_escape(MODULE_DEFINES)"
android {
MODULE_PRI_CONT += "QMAKE_LIBS_$${ucmodule} ="
} else: qtConfig(debug_and_release): {
} else: if(msvc|qtConfig(debug_and_release)): {
win32: \
MODULE_DEBUG_LIBS = $$DESTDIR/$$prefix$${TARGET}d.$$suffix
else: darwin: \

View File

@ -1,5 +1,5 @@
defineReplace(qtEmccRecommendedVersion) {
return (1.38.27)
return (1.39.8)
}
defineReplace(qtSystemEmccVersion) {

View File

@ -3,8 +3,9 @@ QT_FOR_CONFIG += gui
defineTest(prependOpenGlLib) {
path = $$QT.core.libs/$$QMAKE_PREFIX_STATICLIB$$1
ext = .$$QMAKE_EXTENSION_STATICLIB
!mingw|qtConfig(debug_and_release): debug_suffix = "d"
QMAKE_LIBS_OPENGL_ES2 = $${path}$${ext} $$QMAKE_LIBS_OPENGL_ES2
QMAKE_LIBS_OPENGL_ES2_DEBUG = $${path}d$${ext} $$QMAKE_LIBS_OPENGL_ES2_DEBUG
QMAKE_LIBS_OPENGL_ES2_DEBUG = $${path}$${debug_suffix}$${ext} $$QMAKE_LIBS_OPENGL_ES2_DEBUG
export(QMAKE_LIBS_OPENGL_ES2)
export(QMAKE_LIBS_OPENGL_ES2_DEBUG)
}

View File

@ -123,6 +123,8 @@
UAP3_CAPABILITIES += backgroundMediaPlayback remoteSystem userNotificationListener
IOT_CAPABILITIES += systemManagement
# Capabilities are given as a string list and may change with the configuration (network, sensors, etc.)
WINRT_MANIFEST.capabilities = $$unique(WINRT_MANIFEST.capabilities)
WINRT_MANIFEST.capabilities_device = $$unique(WINRT_MANIFEST.capabilities_device)
@ -133,6 +135,8 @@
MANIFEST_CAPABILITIES += " <uap:Capability Name=\"$$CAPABILITY\" />"
else:contains(UAP3_CAPABILITIES, $$CAPABILITY): \
MANIFEST_CAPABILITIES += " <uap3:Capability Name=\"$$CAPABILITY\" />"
else:contains(IOT_CAPABILITIES, $$CAPABILITY): \
MANIFEST_CAPABILITIES += " <iot:Capability Name=\"$$CAPABILITY\" />"
else: \
MANIFEST_CAPABILITIES += " <Capability Name=\"$$CAPABILITY\" />"
}

View File

@ -8,17 +8,20 @@ include(../common/clang.conf)
load(device_config)
load(emcc_ver)
# Support setting WASM_OBJECT_FILES with -device-option WASM_OBJECT_FILES=1
!isEmpty(WASM_OBJECT_FILES): {
!equals(WASM_OBJECT_FILES, 1):!equals(WASM_OBJECT_FILES, 0): \
message(Error: The value for WASM_OBJECT_FILES must be 0 or 1)
QMAKE_CFLAGS += -s WASM_OBJECT_FILES=$$WASM_OBJECT_FILES
QMAKE_CXXFLAGS += -s WASM_OBJECT_FILES=$$WASM_OBJECT_FILES
QMAKE_LFLAGS += -s WASM_OBJECT_FILES=$$WASM_OBJECT_FILES
} else {
EMSCRIPTEN_VERSION=$$qtSystemEmccVersion()
lessThan(EMSCRIPTEN_VERSION, 1.39) {
EMCC_COMMON_LFLAGS += -s \"BINARYEN_TRAP_MODE=\'clamp\'\"
# Support enabling asyncify by configuring with "-device-option EMSCRIPTEN_ASYNCIFY=1"
!isEmpty(EMSCRIPTEN_ASYNCIFY): {
!equals(EMSCRIPTEN_ASYNCIFY, 1):!equals(EMSCRIPTEN_ASYNCIFY, 0): \
message(Error: The value for EMSCRIPTEN_ASYNCIFY must be 0 or 1)
equals(EMSCRIPTEN_ASYNCIFY, 1): {
QMAKE_CFLAGS += -DQT_HAVE_EMSCRIPTEN_ASYNCIFY
QMAKE_CXXFLAGS += -DQT_HAVE_EMSCRIPTEN_ASYNCIFY
QMAKE_LFLAGS += -s ASYNCIFY
# Emscripten recommends building with optimizations when using asyncify
# in order to reduce wasm file size, and may also generate broken wasm
# (with "wasm validation error: too many locals" type errors) if optimizations
# are omitted. Enable optimizations also for debug builds.
QMAKE_LFLAGS_DEBUG += -Os
}
}
@ -37,7 +40,8 @@ EMCC_COMMON_LFLAGS += \
-s NO_EXIT_RUNTIME=0 \
-s ERROR_ON_UNDEFINED_SYMBOLS=1 \
-s EXTRA_EXPORTED_RUNTIME_METHODS=[\"UTF16ToString\",\"stringToUTF16\"] \
--bind
--bind \
-s FETCH=1
# The -s arguments can also be used with release builds,
# but are here in debug for clarity.

View File

@ -2608,6 +2608,14 @@
Specifies the module name to be used for automatically generated QML type
registrations. For more information, see \l {Defining QML Types from C++}.
\section1 QML_FOREIGN_METATYPES
Specifies further JSON files with metatypes to be considered when generating
qmltypes files. Use this when external libraries provide types that are
exposed to QML, either directly or as base types or properties of other
types. Qt types will automatically be considered and don't have to be added
here.
\section1 QT
Specifies the \l{All Modules}{Qt modules} that are used by your project. For

View File

@ -31,7 +31,6 @@ struct TranslatedAttribute;
// The order of this enum governs priority of 'getLatestBufferStorage'.
enum BufferUsage
{
BUFFER_USAGE_SYSTEM_MEMORY,
BUFFER_USAGE_STAGING,
BUFFER_USAGE_VERTEX_OR_TRANSFORM_FEEDBACK,
BUFFER_USAGE_INDEX,
@ -40,6 +39,7 @@ enum BufferUsage
BUFFER_USAGE_PIXEL_UNPACK,
BUFFER_USAGE_PIXEL_PACK,
BUFFER_USAGE_UNIFORM,
BUFFER_USAGE_SYSTEM_MEMORY,
BUFFER_USAGE_EMULATED_INDEXED_VERTEX,
BUFFER_USAGE_COUNT,

View File

@ -845,7 +845,7 @@ EGLint SwapChain11::copyOffscreenToBackbuffer(const gl::Context *context,
stateManager->setRenderTarget(mBackBufferRTView.get(), nullptr);
// Set the viewport
stateManager->setSimpleViewport(mWidth, mHeight);
stateManager->setSimpleViewport(width, height);
// Apply textures
stateManager->setSimplePixelTextureAndSampler(mOffscreenSRView, mPassThroughSampler);

View File

@ -168,7 +168,7 @@ HRESULT NativeWindow11Win32::createSwapChain(ID3D11Device *device,
nullptr, nullptr, &swapChain1);
if (SUCCEEDED(result))
{
factory2->MakeWindowAssociation(getNativeWindow(), DXGI_MWA_NO_ALT_ENTER);
factory2->MakeWindowAssociation(getNativeWindow(), DXGI_MWA_NO_WINDOW_CHANGES);
*swapChain = static_cast<IDXGISwapChain *>(swapChain1);
}
SafeRelease(factory2);
@ -196,7 +196,7 @@ HRESULT NativeWindow11Win32::createSwapChain(ID3D11Device *device,
HRESULT result = factory->CreateSwapChain(device, &swapChainDesc, swapChain);
if (SUCCEEDED(result))
{
factory->MakeWindowAssociation(getNativeWindow(), DXGI_MWA_NO_ALT_ENTER);
factory->MakeWindowAssociation(getNativeWindow(), DXGI_MWA_NO_WINDOW_CHANGES);
}
return result;
}

View File

@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2019 Intel Corporation.
** Copyright (C) 2020 Intel Corporation.
** Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
**
** Permission is hereby granted, free of charge, to any person obtaining a copy
@ -29,6 +29,11 @@
#include "forkfd.h"
/* Macros fine-tuning the build: */
//#define FORKFD_NO_FORKFD 1 /* disable the forkfd() function */
//#define FORKFD_NO_SPAWNFD 1 /* disable the spawnfd() function */
//#define FORKFD_DISABLE_FORK_FALLBACK 1 /* disable falling back to fork() from system_forkfd() */
#include <sys/types.h>
#if defined(__OpenBSD__) || defined(__NetBSD__)
# include <sys/param.h>
@ -94,7 +99,17 @@
static int system_has_forkfd(void);
static int system_forkfd(int flags, pid_t *ppid, int *system);
static int system_forkfd_wait(int ffd, struct forkfd_info *info, struct rusage *rusage);
static int system_forkfd_wait(int ffd, struct forkfd_info *info, int ffdwoptions, struct rusage *rusage);
static int disable_fork_fallback(void)
{
#ifdef FORKFD_DISABLE_FORK_FALLBACK
/* if there's no system forkfd, we have to use the fallback */
return system_has_forkfd();
#else
return false;
#endif
}
#define CHILDREN_IN_SMALL_ARRAY 16
#define CHILDREN_IN_BIG_ARRAY 256
@ -225,6 +240,16 @@ static void convertStatusToForkfdInfo(int status, struct forkfd_info *info)
}
}
static int convertForkfdWaitFlagsToWaitFlags(int ffdoptions)
{
int woptions = WEXITED;
if (ffdoptions & FFDW_NOWAIT)
woptions |= WNOWAIT;
if (ffdoptions & FFDW_NOHANG)
woptions |= WNOHANG;
return woptions;
}
static int tryReaping(pid_t pid, struct pipe_payload *payload)
{
/* reap the child */
@ -586,12 +611,18 @@ static int create_pipe(int filedes[], int flags)
* descriptor. You probably want to set this flag, since forkfd() does not work
* if the original parent process dies.
*
* @li @C FFD_USE_FORK Tell forkfd() to actually call fork() instead of a
* @li @c FFD_USE_FORK Tell forkfd() to actually call fork() instead of a
* different system implementation that may be available. On systems where a
* different implementation is available, its behavior may differ from that of
* fork(), such as not calling the functions registered with pthread_atfork().
* If that's necessary, pass this flag.
*
* @li @c FFD_VFORK_SEMANTICS Tell forkfd() to use semantics similar to
* vfork(), if that's available. For example, on Linux with pidfd support
* available, this will add the CLONE_VFORK option. On most other systems,
* including Linux without pidfd support, this option does nothing, as using
* the actual vfork() system call would cause a race condition.
*
* The file descriptor returned by forkfd() supports the following operations:
*
* @li read(2) When the child process exits, then the buffer supplied to
@ -619,9 +650,12 @@ int forkfd(int flags, pid_t *ppid)
int efd;
#endif
if (disable_fork_fallback())
flags &= ~FFD_USE_FORK;
if ((flags & FFD_USE_FORK) == 0) {
fd = system_forkfd(flags, ppid, &ret);
if (ret)
if (ret || disable_fork_fallback())
return fd;
}
@ -800,14 +834,17 @@ out:
}
#endif // _POSIX_SPAWN && !FORKFD_NO_SPAWNFD
int forkfd_wait(int ffd, struct forkfd_info *info, struct rusage *rusage)
int forkfd_wait4(int ffd, struct forkfd_info *info, int options, struct rusage *rusage)
{
struct pipe_payload payload;
int ret;
if (system_has_forkfd())
return system_forkfd_wait(ffd, info, rusage);
if (system_has_forkfd()) {
/* if this is one of our pipes, not a procdesc/pidfd, we'll get an EBADF */
ret = system_forkfd_wait(ffd, info, options, rusage);
if (disable_fork_fallback() || ret != -1 || errno != EBADF)
return ret;
}
ret = read(ffd, &payload, sizeof(payload));
if (ret == -1)
@ -846,10 +883,11 @@ int system_forkfd(int flags, pid_t *ppid, int *system)
return -1;
}
int system_forkfd_wait(int ffd, struct forkfd_info *info, struct rusage *rusage)
int system_forkfd_wait(int ffd, struct forkfd_info *info, int options, struct rusage *rusage)
{
(void)ffd;
(void)info;
(void)options;
(void)rusage;
return -1;
}

View File

@ -38,19 +38,27 @@
extern "C" {
#endif
#define FFD_CLOEXEC 1
#define FFD_NONBLOCK 2
#define FFD_USE_FORK 4
#define FFD_CLOEXEC 1
#define FFD_NONBLOCK 2
#define FFD_USE_FORK 4
#define FFD_VFORK_SEMANTICS 8
#define FFD_CHILD_PROCESS (-2)
#define FFDW_NOHANG 1 /* WNOHANG */
#define FFDW_NOWAIT 2 /* WNOWAIT */
struct forkfd_info {
int32_t code;
int32_t status;
};
int forkfd(int flags, pid_t *ppid);
int forkfd_wait(int ffd, struct forkfd_info *info, struct rusage *rusage);
int forkfd_wait4(int ffd, struct forkfd_info *info, int options, struct rusage *rusage);
static inline int forkfd_wait(int ffd, struct forkfd_info *info, struct rusage *rusage)
{
return forkfd_wait4(ffd, info, 0, rusage);
}
int forkfd_close(int ffd);
#if _POSIX_SPAWN > 0

View File

@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2019 Intel Corporation.
** Copyright (C) 2020 Intel Corporation.
**
** Permission is hereby granted, free of charge, to any person obtaining a copy
** of this software and associated documentation files (the "Software"), to deal
@ -29,6 +29,10 @@
#include "forkfd_atomic.h"
// in forkfd.c
static int convertForkfdWaitFlagsToWaitFlags(int ffdoptions);
static void convertStatusToForkfdInfo(int status, struct forkfd_info *info);
#if __FreeBSD__ >= 10
/* On FreeBSD 10, PROCDESC was enabled by default. On v11, it's not an option
* anymore and can't be disabled. */
@ -81,19 +85,23 @@ int system_forkfd(int flags, pid_t *ppid, int *system)
return ret;
}
int system_forkfd_wait(int ffd, struct forkfd_info *info, struct rusage *rusage)
int system_forkfd_wait(int ffd, struct forkfd_info *info, int ffdoptions, struct rusage *rusage)
{
pid_t pid;
int status;
int options = WEXITED;
int options = convertForkfdWaitFlagsToWaitFlags(ffdoptions);
int ret = pdgetpid(ffd, &pid);
if (ret == -1)
return ret;
ret = fcntl(ffd, F_GETFL);
if (ret == -1)
return ret;
options |= (ret & O_NONBLOCK) ? WNOHANG : 0;
if ((options & WNOHANG) == 0) {
/* check if the file descriptor is non-blocking */
ret = fcntl(ffd, F_GETFL);
if (ret == -1)
return ret;
options |= (ret & O_NONBLOCK) ? WNOHANG : 0;
}
ret = wait4(pid, &status, options, rusage);
if (ret != -1 && info)
convertStatusToForkfdInfo(status, info);

View File

@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2019 Intel Corporation.
** Copyright (C) 2020 Intel Corporation.
**
** Permission is hereby granted, free of charge, to any person obtaining a copy
** of this software and associated documentation files (the "Software"), to deal
@ -51,6 +51,10 @@
# define P_PIDFD 3
#endif
// in forkfd.c
static int convertForkfdWaitFlagsToWaitFlags(int ffdoptions);
static void convertStatusToForkfdInfo(int status, struct forkfd_info *info);
static ffd_atomic_int system_forkfd_state = FFD_ATOMIC_INIT(0);
static int sys_waitid(int which, int pid_or_pidfd, siginfo_t *infop, int options,
@ -143,7 +147,10 @@ int system_forkfd(int flags, pid_t *ppid, int *system)
}
*system = 1;
pid = sys_clone(CLONE_PIDFD, &pidfd);
unsigned long cloneflags = CLONE_PIDFD;
if (flags & FFD_VFORK_SEMANTICS)
cloneflags |= CLONE_VFORK;
pid = sys_clone(cloneflags, &pidfd);
if (ppid)
*ppid = pid;
@ -162,15 +169,20 @@ int system_forkfd(int flags, pid_t *ppid, int *system)
return pidfd;
}
int system_forkfd_wait(int ffd, struct forkfd_info *info, struct rusage *rusage)
int system_forkfd_wait(int ffd, struct forkfd_info *info, int ffdoptions, struct rusage *rusage)
{
siginfo_t si;
int options = WEXITED | __WALL;
int ret = fcntl(ffd, F_GETFL);
if (ret == -1)
return ret;
if (ret & O_NONBLOCK)
options |= WNOHANG;
int ret;
int options = __WALL | convertForkfdWaitFlagsToWaitFlags(ffdoptions);
if ((options & WNOHANG) == 0) {
/* check if the file descriptor is non-blocking */
ret = fcntl(ffd, F_GETFL);
if (ret == -1)
return ret;
if (ret & O_NONBLOCK)
options |= WNOHANG;
}
ret = sys_waitid(P_PIDFD, ffd, &si, options, rusage);
if (ret == -1 && errno == ECHILD) {

View File

@ -2,7 +2,7 @@
#define JPEG_LIB_VERSION 80
#define LIBJPEG_TURBO_VERSION 2.0.3
#define LIBJPEG_TURBO_VERSION 2.0.4
#define LIBJPEG_TURBO_VERSION_NUMBER 2000002

View File

@ -8,7 +8,7 @@
#define PACKAGE_NAME "libjpeg-turbo"
#define VERSION "2.0.3"
#define VERSION "2.0.4"
#if SIZE_MAX == 0xffffffff
#define SIZEOF_SIZE_T 4

View File

@ -6,7 +6,7 @@
"Description": "The Independent JPEG Group's JPEG software",
"Homepage": "http://libjpeg-turbo.virtualgl.org/",
"Version": "2.0.3",
"Version": "2.0.4",
"License": "Independent JPEG Group License",
"LicenseId": "IJG",
"LicenseFile": "LICENSE",

View File

@ -1,3 +1,44 @@
2.0.4
=====
### Significant changes relative to 2.0.3:
1. Fixed a regression in the Windows packaging system (introduced by
2.0 beta1[2]) whereby, if both the 64-bit libjpeg-turbo SDK for GCC and the
64-bit libjpeg-turbo SDK for Visual C++ were installed on the same system, only
one of them could be uninstalled.
2. Fixed a signed integer overflow and subsequent segfault that occurred when
attempting to decompress images with more than 715827882 pixels using the
64-bit C version of TJBench.
3. Fixed out-of-bounds write in `tjDecompressToYUV2()` and
`tjDecompressToYUVPlanes()` (sometimes manifesting as a double free) that
occurred when attempting to decompress grayscale JPEG images that were
compressed with a sampling factor other than 1 (for instance, with
`cjpeg -grayscale -sample 2x2`).
4. Fixed a regression introduced by 2.0.2[5] that caused the TurboJPEG API to
incorrectly identify some JPEG images with unusual sampling factors as 4:4:4
JPEG images. This was known to cause a buffer overflow when attempting to
decompress some such images using `tjDecompressToYUV2()` or
`tjDecompressToYUVPlanes()`.
5. Fixed an issue, detected by ASan, whereby attempting to losslessly transform
a specially-crafted malformed JPEG image containing an extremely-high-frequency
coefficient block (junk image data that could never be generated by a
legitimate JPEG compressor) could cause the Huffman encoder's local buffer to
be overrun. (Refer to 1.4.0[9] and 1.4beta1[15].) Given that the buffer
overrun was fully contained within the stack and did not cause a segfault or
other user-visible errant behavior, and given that the lossless transformer
(unlike the decompressor) is not generally exposed to arbitrary data exploits,
this issue did not likely pose a security risk.
6. The ARM 64-bit (ARMv8) NEON SIMD assembly code now stores constants in a
separate read-only data section rather than in the text section, to support
execute-only memory layouts.
2.0.3
=====
@ -138,10 +179,11 @@ would produce a "Bogus message code" error message if the underlying bitmap and
PPM readers/writers threw an error that was specific to the readers/writers
(as opposed to a general libjpeg API error.)
4. Fixed an issue whereby a specially-crafted malformed BMP file, one in which
the header specified an image width of 1073741824 pixels, would trigger a
floating point exception (division by zero) in the `tjLoadImage()` function
when attempting to load the BMP file into a 4-component image buffer.
4. Fixed an issue (CVE-2018-1152) whereby a specially-crafted malformed BMP
file, one in which the header specified an image width of 1073741824 pixels,
would trigger a floating point exception (division by zero) in the
`tjLoadImage()` function when attempting to load the BMP file into a
4-component image buffer.
5. Fixed an issue whereby certain combinations of calls to
`jpeg_skip_scanlines()` and `jpeg_read_scanlines()` could trigger an infinite
@ -155,10 +197,10 @@ a 4:2:2 or 4:2:0 JPEG image using the merged (non-fancy) upsampling algorithms
7. The new CMake-based build system will now disable the MIPS DSPr2 SIMD
extensions if it detects that the compiler does not support DSPr2 instructions.
8. Fixed out-of-bounds read in cjpeg that occurred when attempting to compress
a specially-crafted malformed color-index (8-bit-per-sample) BMP file in which
some of the samples (color indices) exceeded the bounds of the BMP file's color
table.
8. Fixed out-of-bounds read in cjpeg (CVE-2018-14498) that occurred when
attempting to compress a specially-crafted malformed color-index
(8-bit-per-sample) BMP file in which some of the samples (color indices)
exceeded the bounds of the BMP file's color table.
9. Fixed a signed integer overflow in the progressive Huffman decoder, detected
by the Clang and GCC undefined behavior sanitizers, that could be triggered by
@ -318,8 +360,8 @@ write scanlines in bottom-up order.) djpeg will now exit gracefully if an
output format other than PPM/PGM, GIF, or Targa is selected along with the
`-crop` option.
4. Fixed an issue whereby `jpeg_skip_scanlines()` would segfault if color
quantization was enabled.
4. Fixed an issue (CVE-2017-15232) whereby `jpeg_skip_scanlines()` would
segfault if color quantization was enabled.
5. TJBench (both C and Java versions) will now display usage information if any
command-line argument is unrecognized. This prevents the program from silently
@ -946,13 +988,13 @@ and IDCT algorithms (both are used during JPEG decompression.) For unknown
reasons (probably related to clang), this code cannot currently be compiled for
iOS.
15. Fixed an extremely rare bug that could cause the Huffman encoder's local
buffer to overrun when a very high-frequency MCU is compressed using quality
100 and no subsampling, and when the JPEG output buffer is being dynamically
resized by the destination manager. This issue was so rare that, even with a
test program specifically designed to make the bug occur (by injecting random
high-frequency YUV data into the compressor), it was reproducible only once in
about every 25 million iterations.
15. Fixed an extremely rare bug (CVE-2014-9092) that could cause the Huffman
encoder's local buffer to overrun when a very high-frequency MCU is compressed
using quality 100 and no subsampling, and when the JPEG output buffer is being
dynamically resized by the destination manager. This issue was so rare that,
even with a test program specifically designed to make the bug occur (by
injecting random high-frequency YUV data into the compressor), it was
reproducible only once in about every 25 million iterations.
16. Fixed an oversight in the TurboJPEG C wrapper: if any of the JPEG
compression functions was called repeatedly with the same
@ -987,8 +1029,9 @@ entropy coding (by passing arguments of `-progressive -arithmetic` to cjpeg or
jpegtran, for instance) would result in an error, `Requested feature was
omitted at compile time`.
4. Fixed a couple of issues whereby malformed JPEG images would cause
libjpeg-turbo to use uninitialized memory during decompression.
4. Fixed a couple of issues (CVE-2013-6629 and CVE-2013-6630) whereby malformed
JPEG images would cause libjpeg-turbo to use uninitialized memory during
decompression.
5. Fixed an error (`Buffer passed to JPEG library is too small`) that occurred
when calling the TurboJPEG YUV encoding function with a very small (< 5x5)
@ -1127,9 +1170,9 @@ correct behavior of the colorspace extensions when merged upsampling is used.
upper 64 bits of xmm6 and xmm7 on Win64 platforms, which violated the Win64
calling conventions.
4. Fixed a regression caused by 1.2.0[6] whereby decompressing corrupt JPEG
images (specifically, images in which the component count was erroneously set
to a large value) would cause libjpeg-turbo to segfault.
4. Fixed a regression (CVE-2012-2806) caused by 1.2.0[6] whereby decompressing
corrupt JPEG images (specifically, images in which the component count was
erroneously set to a large value) would cause libjpeg-turbo to segfault.
5. Worked around a severe performance issue with "Bobcat" (AMD Embedded APU)
processors. The `MASKMOVDQU` instruction, which was used by the libjpeg-turbo

View File

@ -1,14 +1,14 @@
Background
==========
libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2,
AVX2, NEON, AltiVec) to accelerate baseline JPEG compression and decompression
on x86, x86-64, ARM, and PowerPC systems, as well as progressive JPEG
compression on x86 and x86-64 systems. On such systems, libjpeg-turbo is
generally 2-6x as fast as libjpeg, all else being equal. On other types of
systems, libjpeg-turbo can still outperform libjpeg by a significant amount, by
virtue of its highly-optimized Huffman coding routines. In many cases, the
performance of libjpeg-turbo rivals that of proprietary high-speed JPEG codecs.
libjpeg-turbo is a JPEG image codec that uses SIMD instructions to accelerate
baseline JPEG compression and decompression on x86, x86-64, ARM, PowerPC, and
MIPS systems, as well as progressive JPEG compression on x86 and x86-64
systems. On such systems, libjpeg-turbo is generally 2-6x as fast as libjpeg,
all else being equal. On other types of systems, libjpeg-turbo can still
outperform libjpeg by a significant amount, by virtue of its highly-optimized
Huffman coding routines. In many cases, the performance of libjpeg-turbo
rivals that of proprietary high-speed JPEG codecs.
libjpeg-turbo implements both the traditional libjpeg API as well as the less
powerful but more straightforward TurboJPEG API. libjpeg-turbo also features
@ -145,14 +145,14 @@ supported and which aren't.
#### Fully supported
- **libjpeg: IDCT scaling extensions in decompressor**<br>
- **libjpeg API: IDCT scaling extensions in decompressor**<br>
libjpeg-turbo supports IDCT scaling with scaling factors of 1/8, 1/4, 3/8,
1/2, 5/8, 3/4, 7/8, 9/8, 5/4, 11/8, 3/2, 13/8, 7/4, 15/8, and 2/1 (only 1/4
and 1/2 are SIMD-accelerated.)
- **libjpeg: Arithmetic coding**
- **libjpeg API: Arithmetic coding**
- **libjpeg: In-memory source and destination managers**<br>
- **libjpeg API: In-memory source and destination managers**<br>
See notes below.
- **cjpeg: Separate quality settings for luminance and chrominance**<br>
@ -184,14 +184,14 @@ means of quality improvement. The reader is invited to peruse the research at
but it is the general belief of our project that these features have not
demonstrated sufficient usefulness to justify inclusion in libjpeg-turbo.
- **libjpeg: DCT scaling in compressor**<br>
- **libjpeg API: DCT scaling in compressor**<br>
`cinfo.scale_num` and `cinfo.scale_denom` are silently ignored.
There is no technical reason why DCT scaling could not be supported when
emulating the libjpeg v7+ API/ABI, but without the SmartScale extension (see
below), only scaling factors of 1/2, 8/15, 4/7, 8/13, 2/3, 8/11, 4/5, and
8/9 would be available, which is of limited usefulness.
- **libjpeg: SmartScale**<br>
- **libjpeg API: SmartScale**<br>
`cinfo.block_size` is silently ignored.
SmartScale is an extension to the JPEG format that allows for DCT block
sizes other than 8x8. Providing support for this new format would be
@ -204,7 +204,7 @@ demonstrated sufficient usefulness to justify inclusion in libjpeg-turbo.
interest in providing this feature would be as a means of supporting
additional DCT scaling factors.
- **libjpeg: Fancy downsampling in compressor**<br>
- **libjpeg API: Fancy downsampling in compressor**<br>
`cinfo.do_fancy_downsampling` is silently ignored.
This requires the DCT scaling feature, which is not supported.
@ -252,8 +252,8 @@ building libjpeg-turbo. This will restore the pre-1.3 behavior, in which
libjpeg v8 API/ABI.
On Un*x systems, including the in-memory source/destination managers changes
the dynamic library version from 62.1.0 to 62.2.0 if using libjpeg v6b API/ABI
emulation and from 7.1.0 to 7.2.0 if using libjpeg v7 API/ABI emulation.
the dynamic library version from 62.2.0 to 62.3.0 if using libjpeg v6b API/ABI
emulation and from 7.2.0 to 7.3.0 if using libjpeg v7 API/ABI emulation.
Note that, on most Un*x systems, the dynamic linker will not look for a
function in a library until that function is actually used. Thus, if a program
@ -329,7 +329,7 @@ in a way that makes the rest of the libjpeg infrastructure happy, so it is
necessary to use the slow Huffman decoder when decompressing a JPEG image that
has restart markers. This can cause the decompression performance to drop by
as much as 20%, but the performance will still be much greater than that of
libjpeg. Many consumer packages, such as PhotoShop, use restart markers when
libjpeg. Many consumer packages, such as Photoshop, use restart markers when
generating JPEG images, so images generated by those programs will experience
this issue.

View File

@ -43,8 +43,8 @@
*/
/* NOTE: Both GCC and Clang define __GNUC__ */
#if defined __GNUC__ && (defined __arm__ || defined __aarch64__)
#if !defined __thumb__ || defined __thumb2__
#if defined(__GNUC__) && (defined(__arm__) || defined(__aarch64__))
#if !defined(__thumb__) || defined(__thumb2__)
#define USE_CLZ_INTRINSIC
#endif
#endif
@ -432,7 +432,7 @@ dump_buffer(working_state *state)
* scanning order-- 1, 8, 16, etc.), then this will produce an encoded block
* larger than 200 bytes.
*/
#define BUFSIZE (DCTSIZE2 * 4)
#define BUFSIZE (DCTSIZE2 * 8)
#define LOAD_BUFFER() { \
if (state->free_in_buffer < BUFSIZE) { \

View File

@ -52,8 +52,8 @@
*/
/* NOTE: Both GCC and Clang define __GNUC__ */
#if defined __GNUC__ && (defined __arm__ || defined __aarch64__)
#if !defined __thumb__ || defined __thumb2__
#if defined(__GNUC__) && (defined(__arm__) || defined(__aarch64__))
#if !defined(__thumb__) || defined(__thumb2__)
#define USE_CLZ_INTRINSIC
#endif
#endif

View File

@ -1,7 +1,7 @@
/*
* jfdctint.c
*
* This file was part of the Independent JPEG Group's software.
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1996, Thomas G. Lane.
* libjpeg-turbo Modifications:
* Copyright (C) 2015, D. R. Commander.

View File

@ -1,7 +1,7 @@
/*
* jidctint.c
*
* This file was part of the Independent JPEG Group's software.
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1998, Thomas G. Lane.
* Modification developed 2002-2009 by Guido Vollbeding.
* libjpeg-turbo Modifications:

View File

@ -1,7 +1,7 @@
/*
* jidctred.c
*
* This file was part of the Independent JPEG Group's software.
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1994-1998, Thomas G. Lane.
* libjpeg-turbo Modifications:
* Copyright (C) 2015, D. R. Commander.

View File

@ -0,0 +1,203 @@
From 63566d1fff2665b777650594eec6eefd3587e177 Mon Sep 17 00:00:00 2001
From: Andy Shaw <andy.shaw@qt.io>
Date: Wed, 4 Mar 2020 07:44:22 +0100
Subject: [PATCH] Fix CVE-2020-9327 in SQLite
This was taken from abc473fb8fb99900 in SQLite, ref:
https://www.sqlite.org/cgi/src/info/abc473fb8fb99900
Fixes: QTBUG-82533
Change-Id: I9840e29f19a0b861229987f5b59d8585ba2e55dc
---
.../0001-Fix-CVE-2020-9327-in-SQLite.patch | 96 +++++++++++++++++++
src/3rdparty/sqlite/sqlite3.c | 31 ++++--
2 files changed, 118 insertions(+), 9 deletions(-)
create mode 100644 src/3rdparty/sqlite/patches/0001-Fix-CVE-2020-9327-in-SQLite.patch
diff --git a/src/3rdparty/sqlite/patches/0001-Fix-CVE-2020-9327-in-SQLite.patch b/src/3rdparty/sqlite/patches/0001-Fix-CVE-2020-9327-in-SQLite.patch
new file mode 100644
index 0000000000..e0e8206db5
--- /dev/null
+++ b/src/3rdparty/sqlite/patches/0001-Fix-CVE-2020-9327-in-SQLite.patch
@@ -0,0 +1,96 @@
+From f79860e0fe251e3267a3cd5558dce98f918e0caa Mon Sep 17 00:00:00 2001
+From: Andy Shaw <andy.shaw@qt.io>
+Date: Wed, 4 Mar 2020 07:44:22 +0100
+Subject: [PATCH] Fix CVE-2020-9327 in SQLite
+
+Fixes: QTBUG-82533
+Change-Id: I9840e29f19a0b861229987f5b59d8585ba2e55dc
+---
+ src/3rdparty/sqlite/sqlite3.c | 31 ++++++++++++++++++++++---------
+ 1 file changed, 22 insertions(+), 9 deletions(-)
+
+diff --git a/src/3rdparty/sqlite/sqlite3.c b/src/3rdparty/sqlite/sqlite3.c
+index 55dc686ee0..dfe5323a59 100644
+--- a/src/3rdparty/sqlite/sqlite3.c
++++ b/src/3rdparty/sqlite/sqlite3.c
+@@ -17428,8 +17428,11 @@ struct Table {
+ */
+ #ifndef SQLITE_OMIT_VIRTUALTABLE
+ # define IsVirtual(X) ((X)->nModuleArg)
++# define ExprIsVtab(X) \
++ ((X)->op==TK_COLUMN && (X)->y.pTab!=0 && (X)->y.pTab->nModuleArg)
+ #else
+ # define IsVirtual(X) 0
++# define ExprIsVtab(X) 0
+ #endif
+
+ /*
+@@ -104133,19 +104136,25 @@ static int impliesNotNullRow(Walker *pWalker, Expr *pExpr){
+ case TK_LT:
+ case TK_LE:
+ case TK_GT:
+- case TK_GE:
++ case TK_GE: {
++ Expr *pLeft = pExpr->pLeft;
++ Expr *pRight = pExpr->pRight;
+ testcase( pExpr->op==TK_EQ );
+ testcase( pExpr->op==TK_NE );
+ testcase( pExpr->op==TK_LT );
+ testcase( pExpr->op==TK_LE );
+ testcase( pExpr->op==TK_GT );
+ testcase( pExpr->op==TK_GE );
+- if( (pExpr->pLeft->op==TK_COLUMN && IsVirtual(pExpr->pLeft->y.pTab))
+- || (pExpr->pRight->op==TK_COLUMN && IsVirtual(pExpr->pRight->y.pTab))
++ /* The y.pTab=0 assignment in wherecode.c always happens after the
++ ** impliesNotNullRow() test */
++ if( (pLeft->op==TK_COLUMN && ALWAYS(pLeft->y.pTab!=0)
++ && IsVirtual(pLeft->y.pTab))
++ || (pRight->op==TK_COLUMN && ALWAYS(pRight->y.pTab!=0)
++ && IsVirtual(pRight->y.pTab))
+ ){
+- return WRC_Prune;
++ return WRC_Prune;
+ }
+-
++ }
+ default:
+ return WRC_Continue;
+ }
+@@ -142591,7 +142600,8 @@ static int isAuxiliaryVtabOperator(
+ ** MATCH(expression,vtab_column)
+ */
+ pCol = pList->a[1].pExpr;
+- if( pCol->op==TK_COLUMN && IsVirtual(pCol->y.pTab) ){
++ testcase( pCol->op==TK_COLUMN && pCol->y.pTab==0 );
++ if( ExprIsVtab(pCol) ){
+ for(i=0; i<ArraySize(aOp); i++){
+ if( sqlite3StrICmp(pExpr->u.zToken, aOp[i].zOp)==0 ){
+ *peOp2 = aOp[i].eOp2;
+@@ -142613,7 +142623,8 @@ static int isAuxiliaryVtabOperator(
+ ** with function names in an arbitrary case.
+ */
+ pCol = pList->a[0].pExpr;
+- if( pCol->op==TK_COLUMN && IsVirtual(pCol->y.pTab) ){
++ testcase( pCol->op==TK_COLUMN && pCol->y.pTab==0 );
++ if( ExprIsVtab(pCol) ){
+ sqlite3_vtab *pVtab;
+ sqlite3_module *pMod;
+ void (*xNotUsed)(sqlite3_context*,int,sqlite3_value**);
+@@ -142636,10 +142647,12 @@ static int isAuxiliaryVtabOperator(
+ int res = 0;
+ Expr *pLeft = pExpr->pLeft;
+ Expr *pRight = pExpr->pRight;
+- if( pLeft->op==TK_COLUMN && IsVirtual(pLeft->y.pTab) ){
++ testcase( pLeft->op==TK_COLUMN && pLeft->y.pTab==0 );
++ if( ExprIsVtab(pLeft) ){
+ res++;
+ }
+- if( pRight && pRight->op==TK_COLUMN && IsVirtual(pRight->y.pTab) ){
++ testcase( pRight && pRight->op==TK_COLUMN && pRight->y.pTab==0 );
++ if( pRight && ExprIsVtab(pRight) ){
+ res++;
+ SWAP(Expr*, pLeft, pRight);
+ }
+--
+2.21.0 (Apple Git-122.2)
+
diff --git a/src/3rdparty/sqlite/sqlite3.c b/src/3rdparty/sqlite/sqlite3.c
index 55dc686ee0..dfe5323a59 100644
--- a/src/3rdparty/sqlite/sqlite3.c
+++ b/src/3rdparty/sqlite/sqlite3.c
@@ -17428,8 +17428,11 @@ struct Table {
*/
#ifndef SQLITE_OMIT_VIRTUALTABLE
# define IsVirtual(X) ((X)->nModuleArg)
+# define ExprIsVtab(X) \
+ ((X)->op==TK_COLUMN && (X)->y.pTab!=0 && (X)->y.pTab->nModuleArg)
#else
# define IsVirtual(X) 0
+# define ExprIsVtab(X) 0
#endif
/*
@@ -104133,19 +104136,25 @@ static int impliesNotNullRow(Walker *pWalker, Expr *pExpr){
case TK_LT:
case TK_LE:
case TK_GT:
- case TK_GE:
+ case TK_GE: {
+ Expr *pLeft = pExpr->pLeft;
+ Expr *pRight = pExpr->pRight;
testcase( pExpr->op==TK_EQ );
testcase( pExpr->op==TK_NE );
testcase( pExpr->op==TK_LT );
testcase( pExpr->op==TK_LE );
testcase( pExpr->op==TK_GT );
testcase( pExpr->op==TK_GE );
- if( (pExpr->pLeft->op==TK_COLUMN && IsVirtual(pExpr->pLeft->y.pTab))
- || (pExpr->pRight->op==TK_COLUMN && IsVirtual(pExpr->pRight->y.pTab))
+ /* The y.pTab=0 assignment in wherecode.c always happens after the
+ ** impliesNotNullRow() test */
+ if( (pLeft->op==TK_COLUMN && ALWAYS(pLeft->y.pTab!=0)
+ && IsVirtual(pLeft->y.pTab))
+ || (pRight->op==TK_COLUMN && ALWAYS(pRight->y.pTab!=0)
+ && IsVirtual(pRight->y.pTab))
){
- return WRC_Prune;
+ return WRC_Prune;
}
-
+ }
default:
return WRC_Continue;
}
@@ -142591,7 +142600,8 @@ static int isAuxiliaryVtabOperator(
** MATCH(expression,vtab_column)
*/
pCol = pList->a[1].pExpr;
- if( pCol->op==TK_COLUMN && IsVirtual(pCol->y.pTab) ){
+ testcase( pCol->op==TK_COLUMN && pCol->y.pTab==0 );
+ if( ExprIsVtab(pCol) ){
for(i=0; i<ArraySize(aOp); i++){
if( sqlite3StrICmp(pExpr->u.zToken, aOp[i].zOp)==0 ){
*peOp2 = aOp[i].eOp2;
@@ -142613,7 +142623,8 @@ static int isAuxiliaryVtabOperator(
** with function names in an arbitrary case.
*/
pCol = pList->a[0].pExpr;
- if( pCol->op==TK_COLUMN && IsVirtual(pCol->y.pTab) ){
+ testcase( pCol->op==TK_COLUMN && pCol->y.pTab==0 );
+ if( ExprIsVtab(pCol) ){
sqlite3_vtab *pVtab;
sqlite3_module *pMod;
void (*xNotUsed)(sqlite3_context*,int,sqlite3_value**);
@@ -142636,10 +142647,12 @@ static int isAuxiliaryVtabOperator(
int res = 0;
Expr *pLeft = pExpr->pLeft;
Expr *pRight = pExpr->pRight;
- if( pLeft->op==TK_COLUMN && IsVirtual(pLeft->y.pTab) ){
+ testcase( pLeft->op==TK_COLUMN && pLeft->y.pTab==0 );
+ if( ExprIsVtab(pLeft) ){
res++;
}
- if( pRight && pRight->op==TK_COLUMN && IsVirtual(pRight->y.pTab) ){
+ testcase( pRight && pRight->op==TK_COLUMN && pRight->y.pTab==0 );
+ if( pRight && ExprIsVtab(pRight) ){
res++;
SWAP(Expr*, pLeft, pRight);
}
--
2.21.0 (Apple Git-122.2)

View File

@ -17428,8 +17428,11 @@ struct Table {
*/
#ifndef SQLITE_OMIT_VIRTUALTABLE
# define IsVirtual(X) ((X)->nModuleArg)
# define ExprIsVtab(X) \
((X)->op==TK_COLUMN && (X)->y.pTab!=0 && (X)->y.pTab->nModuleArg)
#else
# define IsVirtual(X) 0
# define ExprIsVtab(X) 0
#endif
/*
@ -104133,19 +104136,25 @@ static int impliesNotNullRow(Walker *pWalker, Expr *pExpr){
case TK_LT:
case TK_LE:
case TK_GT:
case TK_GE:
case TK_GE: {
Expr *pLeft = pExpr->pLeft;
Expr *pRight = pExpr->pRight;
testcase( pExpr->op==TK_EQ );
testcase( pExpr->op==TK_NE );
testcase( pExpr->op==TK_LT );
testcase( pExpr->op==TK_LE );
testcase( pExpr->op==TK_GT );
testcase( pExpr->op==TK_GE );
if( (pExpr->pLeft->op==TK_COLUMN && IsVirtual(pExpr->pLeft->y.pTab))
|| (pExpr->pRight->op==TK_COLUMN && IsVirtual(pExpr->pRight->y.pTab))
/* The y.pTab=0 assignment in wherecode.c always happens after the
** impliesNotNullRow() test */
if( (pLeft->op==TK_COLUMN && ALWAYS(pLeft->y.pTab!=0)
&& IsVirtual(pLeft->y.pTab))
|| (pRight->op==TK_COLUMN && ALWAYS(pRight->y.pTab!=0)
&& IsVirtual(pRight->y.pTab))
){
return WRC_Prune;
return WRC_Prune;
}
}
default:
return WRC_Continue;
}
@ -142591,7 +142600,8 @@ static int isAuxiliaryVtabOperator(
** MATCH(expression,vtab_column)
*/
pCol = pList->a[1].pExpr;
if( pCol->op==TK_COLUMN && IsVirtual(pCol->y.pTab) ){
testcase( pCol->op==TK_COLUMN && pCol->y.pTab==0 );
if( ExprIsVtab(pCol) ){
for(i=0; i<ArraySize(aOp); i++){
if( sqlite3StrICmp(pExpr->u.zToken, aOp[i].zOp)==0 ){
*peOp2 = aOp[i].eOp2;
@ -142613,7 +142623,8 @@ static int isAuxiliaryVtabOperator(
** with function names in an arbitrary case.
*/
pCol = pList->a[0].pExpr;
if( pCol->op==TK_COLUMN && IsVirtual(pCol->y.pTab) ){
testcase( pCol->op==TK_COLUMN && pCol->y.pTab==0 );
if( ExprIsVtab(pCol) ){
sqlite3_vtab *pVtab;
sqlite3_module *pMod;
void (*xNotUsed)(sqlite3_context*,int,sqlite3_value**);
@ -142636,10 +142647,12 @@ static int isAuxiliaryVtabOperator(
int res = 0;
Expr *pLeft = pExpr->pLeft;
Expr *pRight = pExpr->pRight;
if( pLeft->op==TK_COLUMN && IsVirtual(pLeft->y.pTab) ){
testcase( pLeft->op==TK_COLUMN && pLeft->y.pTab==0 );
if( ExprIsVtab(pLeft) ){
res++;
}
if( pRight && pRight->op==TK_COLUMN && IsVirtual(pRight->y.pTab) ){
testcase( pRight && pRight->op==TK_COLUMN && pRight->y.pTab==0 );
if( pRight && ExprIsVtab(pRight) ){
res++;
SWAP(Expr*, pLeft, pRight);
}

View File

@ -338,7 +338,7 @@ void addValidationColumns()
QTest::addColumn<CborError>("expectedError");
}
void addValidationData()
void addValidationData(size_t minInvalid = ~size_t(0))
{
// illegal numbers are future extension points
QTest::newRow("illegal-number-in-unsigned-1") << raw("\x81\x1c") << 0 << CborErrorIllegalNumber;
@ -488,26 +488,35 @@ void addValidationData()
QTest::newRow("map-break-after-value-tag2") << raw("\x81\xbf\0\xd8\x20\xff") << 0 << CborErrorUnexpectedBreak;
// check for pointer additions wrapping over the limit of the address space
CborError tooLargeOn32bit = (sizeof(void *) == 4) ? CborErrorDataTooLarge : CborErrorUnexpectedEOF;
auto wraparoundError = [minInvalid](uint64_t encodedSize) {
if (encodedSize > minInvalid)
return CborErrorDataTooLarge;
return CborErrorUnexpectedEOF;
};
constexpr uint64_t FourGB = UINT32_MAX + UINT64_C(1);
// on 32-bit systems, this is a -1
QTest::newRow("bytearray-wraparound1") << raw("\x81\x5a\xff\xff\xff\xff") << 0 << CborErrorUnexpectedEOF;
QTest::newRow("string-wraparound1") << raw("\x81\x7a\xff\xff\xff\xff") << 0 << CborErrorUnexpectedEOF;
QTest::newRow("bytearray-wraparound1") << raw("\x81\x5a\xff\xff\xff\xff") << 0 << wraparoundError(UINT32_MAX);
QTest::newRow("string-wraparound1") << raw("\x81\x7a\xff\xff\xff\xff") << 0 << wraparoundError(UINT32_MAX);
// on 32-bit systems, a 4GB addition could be dropped
QTest::newRow("bytearray-wraparound2") << raw("\x81\x5b\0\0\0\1\0\0\0\0") << 0 << tooLargeOn32bit;
QTest::newRow("string-wraparound2") << raw("\x81\x7b\0\0\0\1\0\0\0\0") << 0 << tooLargeOn32bit;
QTest::newRow("bytearray-wraparound2") << raw("\x81\x5b\0\0\0\1\0\0\0\0") << 0 << wraparoundError(FourGB);
QTest::newRow("string-wraparound2") << raw("\x81\x7b\0\0\0\1\0\0\0\0") << 0 << wraparoundError(FourGB);
// on 64-bit systems, this could be a -1
QTest::newRow("bytearray-wraparound3") << raw("\x81\x5b\xff\xff\xff\xff\xff\xff\xff\xff") << 0 << tooLargeOn32bit;
QTest::newRow("string-wraparound3") << raw("\x81\x7b\xff\xff\xff\xff\xff\xff\xff\xff") << 0 << tooLargeOn32bit;
QTest::newRow("bytearray-wraparound3") << raw("\x81\x5b\xff\xff\xff\xff\xff\xff\xff\xff") << 0
<< wraparoundError(UINT64_MAX);
QTest::newRow("string-wraparound3") << raw("\x81\x7b\xff\xff\xff\xff\xff\xff\xff\xff") << 0
<< wraparoundError(UINT64_MAX);
// ditto on chunks
QTest::newRow("bytearray-chunk-wraparound1") << raw("\x81\x5f\x5a\xff\xff\xff\xff") << 0 << CborErrorUnexpectedEOF;
QTest::newRow("string-chunk-wraparound1") << raw("\x81\x7f\x7a\xff\xff\xff\xff") << 0 << CborErrorUnexpectedEOF;
QTest::newRow("bytearray-chunk-wraparound1") << raw("\x81\x5f\x5a\xff\xff\xff\xff") << 0 << wraparoundError(UINT32_MAX);
QTest::newRow("string-chunk-wraparound1") << raw("\x81\x7f\x7a\xff\xff\xff\xff") << 0 << wraparoundError(UINT32_MAX);
// on 32-bit systems, a 4GB addition could be dropped
QTest::newRow("bytearray-chunk-wraparound2") << raw("\x81\x5f\x5b\0\0\0\1\0\0\0\0") << 0 << tooLargeOn32bit;
QTest::newRow("string-chunk-wraparound2") << raw("\x81\x7f\x7b\0\0\0\1\0\0\0\0") << 0 << tooLargeOn32bit;
QTest::newRow("bytearray-chunk-wraparound2") << raw("\x81\x5f\x5b\0\0\0\1\0\0\0\0") << 0 << wraparoundError(FourGB);
QTest::newRow("string-chunk-wraparound2") << raw("\x81\x7f\x7b\0\0\0\1\0\0\0\0") << 0 << wraparoundError(FourGB);
// on 64-bit systems, this could be a -1
QTest::newRow("bytearray-chunk-wraparound3") << raw("\x81\x5f\x5b\xff\xff\xff\xff\xff\xff\xff\xff") << 0 << tooLargeOn32bit;
QTest::newRow("string-chunk-wraparound3") << raw("\x81\x7f\x7b\xff\xff\xff\xff\xff\xff\xff\xff") << 0 << tooLargeOn32bit;
QTest::newRow("bytearray-chunk-wraparound3") << raw("\x81\x5f\x5b\xff\xff\xff\xff\xff\xff\xff\xff") << 0
<< wraparoundError(UINT64_MAX);
QTest::newRow("string-chunk-wraparound3") << raw("\x81\x7f\x7b\xff\xff\xff\xff\xff\xff\xff\xff") << 0
<< wraparoundError(UINT64_MAX);
QTest::newRow("eof-after-array") << raw("\x81") << 0 << CborErrorUnexpectedEOF;
QTest::newRow("eof-after-array2") << raw("\x81\x78\x20") << 0 << CborErrorUnexpectedEOF;

View File

@ -0,0 +1,37 @@
From b215999d63d6e6b087e53e24a47b8b60520ec9e4 Mon Sep 17 00:00:00 2001
From: Oliver Wolff <oliver.wolff@qt.io>
Date: Wed, 11 Mar 2020 13:59:39 +0100
Subject: [PATCH] ANGLE: Fix severe performance regression
The changed buffer usage priority that was introduced in our ANGLE
update caused severe performance regressions for Qt applications.
Fixes: QTBUG-73835
Change-Id: I49839bb272cdeec0027264f2751b88bc149665ad
---
src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Buffer11.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Buffer11.h b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Buffer11.h
index ddbeeb90d2..f92a68454b 100644
--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Buffer11.h
+++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Buffer11.h
@@ -31,7 +31,6 @@ struct TranslatedAttribute;
// The order of this enum governs priority of 'getLatestBufferStorage'.
enum BufferUsage
{
- BUFFER_USAGE_SYSTEM_MEMORY,
BUFFER_USAGE_STAGING,
BUFFER_USAGE_VERTEX_OR_TRANSFORM_FEEDBACK,
BUFFER_USAGE_INDEX,
@@ -40,6 +39,7 @@ enum BufferUsage
BUFFER_USAGE_PIXEL_UNPACK,
BUFFER_USAGE_PIXEL_PACK,
BUFFER_USAGE_UNIFORM,
+ BUFFER_USAGE_SYSTEM_MEMORY,
BUFFER_USAGE_EMULATED_INDEXED_VERTEX,
BUFFER_USAGE_COUNT,
--
2.20.1.windows.1

View File

@ -0,0 +1,27 @@
From 029d42d1049dcde7950c11fb9adf07c07a8c4c02 Mon Sep 17 00:00:00 2001
From: Oliver Wolff <oliver.wolff@qt.io>
Date: Wed, 18 Mar 2020 10:56:53 +0100
Subject: [PATCH] ANGLE: Fix resizing of windows (Take 2)
Task-number: QTBUG-62475
Change-Id: I0ea17e7875906508941ae64bb396a4236928b0f9
---
.../angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp
index e8f13b388f..9ece77ecbc 100644
--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp
+++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp
@@ -845,7 +845,7 @@ EGLint SwapChain11::copyOffscreenToBackbuffer(const gl::Context *context,
stateManager->setRenderTarget(mBackBufferRTView.get(), nullptr);
// Set the viewport
- stateManager->setSimpleViewport(mWidth, mHeight);
+ stateManager->setSimpleViewport(width, height);
// Apply textures
stateManager->setSimplePixelTextureAndSampler(mOffscreenSRView, mPassThroughSampler);
--
2.20.1.windows.1

View File

@ -0,0 +1,45 @@
From 3d23de2ad72968d0bf43dac4a9a0f237cc9e03e2 Mon Sep 17 00:00:00 2001
From: Oliver Wolff <oliver.wolff@qt.io>
Date: Wed, 1 Apr 2020 14:48:48 +0200
Subject: [PATCH] ANGLE: d3d11: Do not register windows message hooks for d3d11
windows
These message hooks are used to handle ALT+ENTER to enter/exit fullscreen
mode and PRINTSCREEN to take screenshots. Qt is implementing these
functionalities itself so we do not have to register these hooks.
If too many of these hooks are registered, callbacks are no longer called
and Qt's message queue is no longer handling messages. By saving these
hooks we can make sure that more Qt windows at the same time are possible
without getting unresponsive due to too many hooks being registered.
Change-Id: I5354f91f08cbfeda5e8dc3ad7f824fbd5b3b2932
---
.../src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow11Win32.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow11Win32.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow11Win32.cpp
index 5394e3d..f5e6c93 100644
--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow11Win32.cpp
+++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow11Win32.cpp
@@ -168,7 +168,7 @@ HRESULT NativeWindow11Win32::createSwapChain(ID3D11Device *device,
nullptr, nullptr, &swapChain1);
if (SUCCEEDED(result))
{
- factory2->MakeWindowAssociation(getNativeWindow(), DXGI_MWA_NO_ALT_ENTER);
+ factory2->MakeWindowAssociation(getNativeWindow(), DXGI_MWA_NO_WINDOW_CHANGES);
*swapChain = static_cast<IDXGISwapChain *>(swapChain1);
}
SafeRelease(factory2);
@@ -196,7 +196,7 @@ HRESULT NativeWindow11Win32::createSwapChain(ID3D11Device *device,
HRESULT result = factory->CreateSwapChain(device, &swapChainDesc, swapChain);
if (SUCCEEDED(result))
{
- factory->MakeWindowAssociation(getNativeWindow(), DXGI_MWA_NO_ALT_ENTER);
+ factory->MakeWindowAssociation(getNativeWindow(), DXGI_MWA_NO_WINDOW_CHANGES);
}
return result;
}
--
2.7.4.windows.1

View File

@ -0,0 +1,507 @@
#=============================================================================
# Copyright 2005-2011 Kitware, Inc.
# Copyright (C) 2020 The Qt Company Ltd.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# * Neither the name of Kitware, Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#=============================================================================
######################################
#
# Macros for building Qt files
#
######################################
include(CMakeParseArguments)
function(_qt5_warn_deprecated command_name)
if(NOT DEFINED _QT5_INTERNAL_SCOPE)
message(AUTHOR_WARNING
"${command_name} is not part of the official API, and might be removed in Qt 6.")
endif()
endfunction()
# macro used to create the names of output files preserving relative dirs
macro(qt5_make_output_file infile prefix ext outfile )
_qt5_warn_deprecated("qt5_make_output_file")
string(LENGTH ${CMAKE_CURRENT_BINARY_DIR} _binlength)
string(LENGTH ${infile} _infileLength)
set(_checkinfile ${CMAKE_CURRENT_SOURCE_DIR})
if(_infileLength GREATER _binlength)
string(SUBSTRING "${infile}" 0 ${_binlength} _checkinfile)
if(_checkinfile STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
file(RELATIVE_PATH rel ${CMAKE_CURRENT_BINARY_DIR} ${infile})
else()
file(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile})
endif()
else()
file(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile})
endif()
if(WIN32 AND rel MATCHES "^([a-zA-Z]):(.*)$") # absolute path
set(rel "${CMAKE_MATCH_1}_${CMAKE_MATCH_2}")
endif()
set(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${rel}")
string(REPLACE ".." "__" _outfile ${_outfile})
get_filename_component(outpath ${_outfile} PATH)
if(CMAKE_VERSION VERSION_LESS "3.14")
get_filename_component(_outfile_ext ${_outfile} EXT)
get_filename_component(_outfile_ext ${_outfile_ext} NAME_WE)
get_filename_component(_outfile ${_outfile} NAME_WE)
string(APPEND _outfile ${_outfile_ext})
else()
get_filename_component(_outfile ${_outfile} NAME_WLE)
endif()
file(MAKE_DIRECTORY ${outpath})
set(${outfile} ${outpath}/${prefix}${_outfile}.${ext})
endmacro()
macro(qt5_get_moc_flags _moc_flags)
_qt5_warn_deprecated("qt5_get_moc_flags")
set(${_moc_flags})
get_directory_property(_inc_DIRS INCLUDE_DIRECTORIES)
if(CMAKE_INCLUDE_CURRENT_DIR)
list(APPEND _inc_DIRS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
endif()
foreach(_current ${_inc_DIRS})
if("${_current}" MATCHES "\\.framework/?$")
string(REGEX REPLACE "/[^/]+\\.framework" "" framework_path "${_current}")
set(${_moc_flags} ${${_moc_flags}} "-F${framework_path}")
else()
set(${_moc_flags} ${${_moc_flags}} "-I${_current}")
endif()
endforeach()
get_directory_property(_defines COMPILE_DEFINITIONS)
foreach(_current ${_defines})
set(${_moc_flags} ${${_moc_flags}} "-D${_current}")
endforeach()
if(WIN32)
set(${_moc_flags} ${${_moc_flags}} -DWIN32)
endif()
if (MSVC)
set(${_moc_flags} ${${_moc_flags}} --compiler-flavor=msvc)
endif()
endmacro()
# helper macro to set up a moc rule
function(qt5_create_moc_command infile outfile moc_flags moc_options moc_target moc_depends)
_qt5_warn_deprecated("qt5_create_moc_command")
# Pass the parameters in a file. Set the working directory to
# be that containing the parameters file and reference it by
# just the file name. This is necessary because the moc tool on
# MinGW builds does not seem to handle spaces in the path to the
# file given with the @ syntax.
get_filename_component(_moc_outfile_name "${outfile}" NAME)
get_filename_component(_moc_outfile_dir "${outfile}" PATH)
if(_moc_outfile_dir)
set(_moc_working_dir WORKING_DIRECTORY ${_moc_outfile_dir})
endif()
set (_moc_parameters_file ${outfile}_parameters)
set (_moc_parameters ${moc_flags} ${moc_options} -o "${outfile}" "${infile}")
string (REPLACE ";" "\n" _moc_parameters "${_moc_parameters}")
if(moc_target)
set(_moc_parameters_file ${_moc_parameters_file}$<$<BOOL:$<CONFIGURATION>>:_$<CONFIGURATION>>)
set(targetincludes "$<TARGET_PROPERTY:${moc_target},INCLUDE_DIRECTORIES>")
set(targetdefines "$<TARGET_PROPERTY:${moc_target},COMPILE_DEFINITIONS>")
set(targetincludes "$<$<BOOL:${targetincludes}>:-I$<JOIN:${targetincludes},\n-I>\n>")
set(targetdefines "$<$<BOOL:${targetdefines}>:-D$<JOIN:${targetdefines},\n-D>\n>")
file (GENERATE
OUTPUT ${_moc_parameters_file}
CONTENT "${targetdefines}${targetincludes}${_moc_parameters}\n"
)
set(targetincludes)
set(targetdefines)
else()
file(WRITE ${_moc_parameters_file} "${_moc_parameters}\n")
endif()
set(_moc_extra_parameters_file @${_moc_parameters_file})
add_custom_command(OUTPUT ${outfile}
COMMAND ${Qt5Core_MOC_EXECUTABLE} ${_moc_extra_parameters_file}
DEPENDS ${infile} ${moc_depends}
${_moc_working_dir}
VERBATIM)
set_source_files_properties(${infile} PROPERTIES SKIP_AUTOMOC ON)
set_source_files_properties(${outfile} PROPERTIES SKIP_AUTOMOC ON)
set_source_files_properties(${outfile} PROPERTIES SKIP_AUTOUIC ON)
endfunction()
function(qt5_generate_moc infile outfile )
set(_QT5_INTERNAL_SCOPE ON)
# get include dirs and flags
qt5_get_moc_flags(moc_flags)
get_filename_component(abs_infile ${infile} ABSOLUTE)
set(_outfile "${outfile}")
if(NOT IS_ABSOLUTE "${outfile}")
set(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${outfile}")
endif()
if ("x${ARGV2}" STREQUAL "xTARGET")
set(moc_target ${ARGV3})
endif()
qt5_create_moc_command(${abs_infile} ${_outfile} "${moc_flags}" "" "${moc_target}" "")
endfunction()
if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
function(qt_generate_moc)
if(QT_DEFAULT_MAJOR_VERSION EQUAL 5)
qt5_generate_moc(${ARGV})
elseif(QT_DEFAULT_MAJOR_VERSION EQUAL 6)
qt6_generate_moc(${ARGV})
endif()
endfunction()
endif()
# qt5_wrap_cpp(outfiles inputfile ... )
function(qt5_wrap_cpp outfiles)
set(_QT5_INTERNAL_SCOPE ON)
# get include dirs
qt5_get_moc_flags(moc_flags)
set(options)
set(oneValueArgs TARGET)
set(multiValueArgs OPTIONS DEPENDS)
cmake_parse_arguments(_WRAP_CPP "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
set(moc_files ${_WRAP_CPP_UNPARSED_ARGUMENTS})
set(moc_options ${_WRAP_CPP_OPTIONS})
set(moc_target ${_WRAP_CPP_TARGET})
set(moc_depends ${_WRAP_CPP_DEPENDS})
foreach(it ${moc_files})
get_filename_component(it ${it} ABSOLUTE)
qt5_make_output_file(${it} moc_ cpp outfile)
qt5_create_moc_command(${it} ${outfile} "${moc_flags}" "${moc_options}" "${moc_target}" "${moc_depends}")
list(APPEND ${outfiles} ${outfile})
endforeach()
set(${outfiles} ${${outfiles}} PARENT_SCOPE)
endfunction()
# This will override the CMake upstream command, because that one is for Qt 3.
if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
function(qt_wrap_cpp outfiles)
if(QT_DEFAULT_MAJOR_VERSION EQUAL 5)
qt5_wrap_cpp("${outfiles}" ${ARGN})
elseif(QT_DEFAULT_MAJOR_VERSION EQUAL 6)
qt6_wrap_cpp("${outfiles}" ${ARGN})
endif()
set("${outfiles}" "${${outfiles}}" PARENT_SCOPE)
endfunction()
endif()
# _qt5_parse_qrc_file(infile _out_depends _rc_depends)
# internal
function(_qt5_parse_qrc_file infile _out_depends _rc_depends)
get_filename_component(rc_path ${infile} PATH)
if(EXISTS "${infile}")
# parse file for dependencies
# all files are absolute paths or relative to the location of the qrc file
file(READ "${infile}" RC_FILE_CONTENTS)
string(REGEX MATCHALL "<file[^<]+" RC_FILES "${RC_FILE_CONTENTS}")
foreach(RC_FILE ${RC_FILES})
string(REGEX REPLACE "^<file[^>]*>" "" RC_FILE "${RC_FILE}")
if(NOT IS_ABSOLUTE "${RC_FILE}")
set(RC_FILE "${rc_path}/${RC_FILE}")
endif()
set(RC_DEPENDS ${RC_DEPENDS} "${RC_FILE}")
endforeach()
# Since this cmake macro is doing the dependency scanning for these files,
# let's make a configured file and add it as a dependency so cmake is run
# again when dependencies need to be recomputed.
qt5_make_output_file("${infile}" "" "qrc.depends" out_depends)
configure_file("${infile}" "${out_depends}" COPYONLY)
else()
# The .qrc file does not exist (yet). Let's add a dependency and hope
# that it will be generated later
set(out_depends)
endif()
set(${_out_depends} ${out_depends} PARENT_SCOPE)
set(${_rc_depends} ${RC_DEPENDS} PARENT_SCOPE)
endfunction()
# qt5_add_binary_resources(target inputfiles ... )
function(qt5_add_binary_resources target)
set(_QT5_INTERNAL_SCOPE ON)
set(options)
set(oneValueArgs DESTINATION)
set(multiValueArgs OPTIONS)
cmake_parse_arguments(_RCC "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
set(rcc_files ${_RCC_UNPARSED_ARGUMENTS})
set(rcc_options ${_RCC_OPTIONS})
set(rcc_destination ${_RCC_DESTINATION})
if(NOT rcc_destination)
set(rcc_destination ${CMAKE_CURRENT_BINARY_DIR}/${target}.rcc)
endif()
foreach(it ${rcc_files})
get_filename_component(infile ${it} ABSOLUTE)
_qt5_parse_qrc_file(${infile} _out_depends _rc_depends)
set_source_files_properties(${infile} PROPERTIES SKIP_AUTORCC ON)
set(infiles ${infiles} ${infile})
set(out_depends ${out_depends} ${_out_depends})
set(rc_depends ${rc_depends} ${_rc_depends})
endforeach()
add_custom_command(OUTPUT ${rcc_destination}
COMMAND ${Qt5Core_RCC_EXECUTABLE}
ARGS ${rcc_options} --binary --name ${target} --output ${rcc_destination} ${infiles}
DEPENDS ${rc_depends} ${out_depends} ${infiles} VERBATIM)
add_custom_target(${target} ALL DEPENDS ${rcc_destination})
endfunction()
if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
function(qt_add_binary_resources)
if(QT_DEFAULT_MAJOR_VERSION EQUAL 5)
qt5_add_binary_resources(${ARGV})
elseif(QT_DEFAULT_MAJOR_VERSION EQUAL 6)
qt6_add_binary_resources(${ARGV})
endif()
endfunction()
endif()
# qt5_add_resources(outfiles inputfile ... )
function(qt5_add_resources outfiles)
set(_QT5_INTERNAL_SCOPE ON)
set(options)
set(oneValueArgs)
set(multiValueArgs OPTIONS)
cmake_parse_arguments(_RCC "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
set(rcc_files ${_RCC_UNPARSED_ARGUMENTS})
set(rcc_options ${_RCC_OPTIONS})
if("${rcc_options}" MATCHES "-binary")
message(WARNING "Use qt5_add_binary_resources for binary option")
endif()
foreach(it ${rcc_files})
get_filename_component(outfilename ${it} NAME_WE)
get_filename_component(infile ${it} ABSOLUTE)
set(outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}.cpp)
_qt5_parse_qrc_file(${infile} _out_depends _rc_depends)
set_source_files_properties(${infile} PROPERTIES SKIP_AUTORCC ON)
add_custom_command(OUTPUT ${outfile}
COMMAND ${Qt5Core_RCC_EXECUTABLE}
ARGS ${rcc_options} --name ${outfilename} --output ${outfile} ${infile}
MAIN_DEPENDENCY ${infile}
DEPENDS ${_rc_depends} "${_out_depends}" VERBATIM)
set_source_files_properties(${outfile} PROPERTIES SKIP_AUTOMOC ON)
set_source_files_properties(${outfile} PROPERTIES SKIP_AUTOUIC ON)
list(APPEND ${outfiles} ${outfile})
endforeach()
set(${outfiles} ${${outfiles}} PARENT_SCOPE)
endfunction()
if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
function(qt_add_resources outfiles)
if(QT_DEFAULT_MAJOR_VERSION EQUAL 5)
qt5_add_resources("${outfiles}" ${ARGN})
elseif(QT_DEFAULT_MAJOR_VERSION EQUAL 6)
qt6_add_resources("${outfiles}" ${ARGN})
endif()
set("${outfiles}" "${${outfiles}}" PARENT_SCOPE)
endfunction()
endif()
# qt5_add_big_resources(outfiles inputfile ... )
function(qt5_add_big_resources outfiles)
set(_QT5_INTERNAL_SCOPE ON)
if (CMAKE_VERSION VERSION_LESS 3.9)
message(FATAL_ERROR, "qt5_add_big_resources requires CMake 3.9 or newer")
endif()
set(options)
set(oneValueArgs)
set(multiValueArgs OPTIONS)
cmake_parse_arguments(_RCC "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
set(rcc_files ${_RCC_UNPARSED_ARGUMENTS})
set(rcc_options ${_RCC_OPTIONS})
if("${rcc_options}" MATCHES "-binary")
message(WARNING "Use qt5_add_binary_resources for binary option")
endif()
foreach(it ${rcc_files})
get_filename_component(outfilename ${it} NAME_WE)
get_filename_component(infile ${it} ABSOLUTE)
set(tmpoutfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}tmp.cpp)
set(outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}.o)
_qt5_parse_qrc_file(${infile} _out_depends _rc_depends)
set_source_files_properties(${infile} PROPERTIES SKIP_AUTORCC ON)
add_custom_command(OUTPUT ${tmpoutfile}
COMMAND ${Qt5Core_RCC_EXECUTABLE} ${rcc_options} --name ${outfilename} --pass 1 --output ${tmpoutfile} ${infile}
DEPENDS ${infile} ${_rc_depends} "${out_depends}" VERBATIM)
add_custom_target(big_resources_${outfilename} ALL DEPENDS ${tmpoutfile})
add_library(rcc_object_${outfilename} OBJECT ${tmpoutfile})
set_target_properties(rcc_object_${outfilename} PROPERTIES AUTOMOC OFF)
set_target_properties(rcc_object_${outfilename} PROPERTIES AUTOUIC OFF)
add_dependencies(rcc_object_${outfilename} big_resources_${outfilename})
# The modification of TARGET_OBJECTS needs the following change in cmake
# https://gitlab.kitware.com/cmake/cmake/commit/93c89bc75ceee599ba7c08b8fe1ac5104942054f
add_custom_command(OUTPUT ${outfile}
COMMAND ${Qt5Core_RCC_EXECUTABLE}
ARGS ${rcc_options} --name ${outfilename} --pass 2 --temp $<TARGET_OBJECTS:rcc_object_${outfilename}> --output ${outfile} ${infile}
DEPENDS rcc_object_${outfilename}
VERBATIM)
list(APPEND ${outfiles} ${outfile})
endforeach()
set(${outfiles} ${${outfiles}} PARENT_SCOPE)
endfunction()
if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
function(qt_add_big_resources outfiles)
if(QT_DEFAULT_MAJOR_VERSION EQUAL 5)
qt5_add_big_resources(${outfiles} ${ARGN})
elseif(QT_DEFAULT_MAJOR_VERSION EQUAL 6)
qt6_add_big_resources(${outfiles} ${ARGN})
endif()
set("${outfiles}" "${${outfiles}}" PARENT_SCOPE)
endfunction()
endif()
set(_Qt5_COMPONENT_PATH "${CMAKE_CURRENT_LIST_DIR}/..")
macro(qt5_use_modules _target _link_type)
_qt5_warn_deprecated("qt5_use_modules")
if (NOT TARGET ${_target})
message(FATAL_ERROR "The first argument to qt5_use_modules must be an existing target.")
endif()
if ("${_link_type}" STREQUAL "LINK_PUBLIC" OR "${_link_type}" STREQUAL "LINK_PRIVATE" )
set(_qt5_modules ${ARGN})
set(_qt5_link_type ${_link_type})
else()
set(_qt5_modules ${_link_type} ${ARGN})
endif()
if ("${_qt5_modules}" STREQUAL "")
message(FATAL_ERROR "qt5_use_modules requires at least one Qt module to use.")
endif()
foreach(_module ${_qt5_modules})
if (NOT Qt5${_module}_FOUND)
find_package(Qt5${_module} PATHS "${_Qt5_COMPONENT_PATH}" NO_DEFAULT_PATH)
if (NOT Qt5${_module}_FOUND)
message(FATAL_ERROR "Cannot use \"${_module}\" module which has not yet been found.")
endif()
endif()
target_link_libraries(${_target} ${_qt5_link_type} ${Qt5${_module}_LIBRARIES})
set_property(TARGET ${_target} APPEND PROPERTY INCLUDE_DIRECTORIES ${Qt5${_module}_INCLUDE_DIRS})
set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS ${Qt5${_module}_COMPILE_DEFINITIONS})
set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS_RELEASE QT_NO_DEBUG)
set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO QT_NO_DEBUG)
set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS_MINSIZEREL QT_NO_DEBUG)
if (Qt5_POSITION_INDEPENDENT_CODE
AND (NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
OR CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0))
set_property(TARGET ${_target} PROPERTY POSITION_INDEPENDENT_CODE ${Qt5_POSITION_INDEPENDENT_CODE})
endif()
endforeach()
endmacro()
function(qt5_import_plugins TARGET_NAME)
set(_doing "")
foreach(_arg ${ARGN})
if(_arg STREQUAL "INCLUDE")
set(_doing "INCLUDE")
elseif(_arg STREQUAL "EXCLUDE")
set(_doing "EXCLUDE")
elseif(_arg STREQUAL "INCLUDE_BY_TYPE")
set(_doing "INCLUDE_BY_TYPE")
elseif(_arg STREQUAL "EXCLUDE_BY_TYPE")
set(_doing "EXCLUDE_BY_TYPE")
else()
if(_doing STREQUAL "INCLUDE")
set_property(TARGET ${TARGET_NAME} APPEND PROPERTY QT_PLUGINS "${_arg}")
elseif(_doing STREQUAL "EXCLUDE")
set_property(TARGET ${TARGET_NAME} APPEND PROPERTY QT_NO_PLUGINS "${_arg}")
elseif(_doing STREQUAL "INCLUDE_BY_TYPE")
string(REGEX REPLACE "[-/]" "_" _plugin_type "${_arg}")
set(_doing "INCLUDE_BY_TYPE_PLUGINS")
elseif(_doing STREQUAL "INCLUDE_BY_TYPE_PLUGINS")
set_property(TARGET ${TARGET_NAME} APPEND PROPERTY "QT_PLUGINS_${_plugin_type}" "${_arg}")
elseif(_doing STREQUAL "EXCLUDE_BY_TYPE")
string(REGEX REPLACE "[-/]" "_" _plugin_type "${_arg}")
set_property(TARGET ${TARGET_NAME} PROPERTY "QT_PLUGINS_${_plugin_type}" -)
else()
message(FATAL_ERROR "Unexpected extra argument: \"${_arg}\"")
endif()
endif()
endforeach()
endfunction()
if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
function(qt_import_plugins)
if(QT_DEFAULT_MAJOR_VERSION EQUAL 5)
qt5_import_plugins(${ARGV})
elseif(QT_DEFAULT_MAJOR_VERSION EQUAL 6)
qt6_import_plugins(${ARGV})
endif()
endfunction()
endif()

View File

@ -402,7 +402,8 @@
"# Block futimens() on Apple platforms unless it's available on ALL",
"# deployment targets. This simplifies the logic at the call site",
"# dramatically, as it isn't strictly needed compared to futimes().",
"darwin: QMAKE_CXXFLAGS += -Werror=unguarded-availability"
"darwin: QMAKE_CXXFLAGS += -Werror=unguarded-availability -Werror=unguarded-availability-new",
"CONFIG += warn_on"
]
}
},

View File

@ -102,6 +102,10 @@
a vector can be quite slow, because it can lead to large numbers
of items having to be moved by one position in memory.
\row \li \l{QVarLengthArray}<T, Prealloc>
\li This provides a low-level variable-length array. It can be used
instead of QVector in places where speed is particularly important.
\row \li \l{QStack}<T>
\li This is a convenience subclass of QVector that provides
"last in, first out" (LIFO) semantics. It adds the following
@ -594,15 +598,11 @@
\section1 Other Container-Like Classes
Qt includes three template classes that resemble containers in
Qt includes other template classes that resemble containers in
some respects. These classes don't provide iterators and cannot
be used with the \c foreach keyword.
\list
\li QVarLengthArray<T, Prealloc> provides a low-level
variable-length array. It can be used instead of QVector in
places where speed is particularly important.
\li QCache<Key, T> provides a cache to store objects of a certain
type T associated with keys of type Key.

View File

@ -39,3 +39,8 @@
QJsonValueRefPtr QAbstractConcatenable QStringBuilderCommon
QTextCodec::ConverterState QThreadStorageData QTextStreamManipulator)
*/
/*!
\internal
\namespace QTextStreamFunctions
*/

View File

@ -2117,7 +2117,7 @@ QT_WARNING_DISABLE_DEPRECATED
QSysInfo::MacVersion QSysInfo::macVersion()
{
const auto version = QOperatingSystemVersion::current();
#if defined(Q_OS_OSX)
#if defined(Q_OS_MACOS)
return QSysInfo::MacVersion(Q_MV_OSX(version.majorVersion(), version.minorVersion()));
#elif defined(Q_OS_IOS)
return QSysInfo::MacVersion(Q_MV_IOS(version.majorVersion(), version.minorVersion()));

View File

@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Copyright (C) 2020 The Qt Company Ltd.
** Copyright (C) 2016 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
@ -660,7 +660,7 @@ static QString getHostPrefixFromHostBinDir()
#endif
#ifndef QT_BUILD_QMAKE_BOOTSTRAP
static const char *getPrefix(
static QString getPrefix(
#ifdef QT_BUILD_QMAKE
QLibraryInfo::PathGroup group
#endif
@ -669,17 +669,15 @@ static const char *getPrefix(
#if defined(QT_BUILD_QMAKE)
# if QT_CONFIGURE_CROSSBUILD
if (group == QLibraryInfo::DevicePaths)
return QT_CONFIGURE_PREFIX_PATH;
return QString::fromLocal8Bit(QT_CONFIGURE_PREFIX_PATH);
# else
Q_UNUSED(group);
# endif
static QByteArray extPrefixPath = getExtPrefixFromHostBinDir().toLatin1();
return extPrefixPath.constData();
return getExtPrefixFromHostBinDir();
#elif QT_CONFIG(relocatable)
static QByteArray prefixPath = getRelocatablePrefix().toLatin1();
return prefixPath.constData();
return getRelocatablePrefix();
#else
return QT_CONFIGURE_PREFIX_PATH;
return QString::fromLocal8Bit(QT_CONFIGURE_PREFIX_PATH);
#endif
}
#endif // QT_BUILD_QMAKE_BOOTSTRAP
@ -800,7 +798,7 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group)
// strlen is meaningless.
const char * volatile path = nullptr;
if (loc == PrefixPath) {
path = getPrefix(
ret = getPrefix(
#ifdef QT_BUILD_QMAKE
group
#endif

View File

@ -272,7 +272,7 @@ QDateTime &QFileInfoPrivate::getFileTime(QAbstractFileEngine::FileTime request)
info objects, just append one to the file name given to the constructors
or setFile().
The file's dates are returned by created(), lastModified(), lastRead() and
The file's dates are returned by birthTime(), lastModified(), lastRead() and
fileTime(). Information about the file's access permissions is
obtained with isReadable(), isWritable() and isExecutable(). The
file's ownership is available from owner(), ownerId(), group() and

View File

@ -69,7 +69,7 @@
# include <CoreFoundation/CFBundle.h>
#endif
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
#include <CoreServices/CoreServices.h>
#endif

View File

@ -58,7 +58,7 @@
# include "qfilesystemwatcher_inotify_p.h"
#elif defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD) || defined(Q_OS_OPENBSD) || defined(QT_PLATFORM_UIKIT)
# include "qfilesystemwatcher_kqueue_p.h"
#elif defined(Q_OS_OSX)
#elif defined(Q_OS_MACOS)
# include "qfilesystemwatcher_fsevents_p.h"
#endif
@ -79,7 +79,7 @@ QFileSystemWatcherEngine *QFileSystemWatcherPrivate::createNativeEngine(QObject
return QInotifyFileSystemWatcherEngine::create(parent);
#elif defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD) || defined(Q_OS_OPENBSD) || defined(QT_PLATFORM_UIKIT)
return QKqueueFileSystemWatcherEngine::create(parent);
#elif defined(Q_OS_OSX)
#elif defined(Q_OS_MACOS)
return QFseventsFileSystemWatcherEngine::create(parent);
#else
Q_UNUSED(parent);

View File

@ -199,7 +199,7 @@ void QFseventsFileSystemWatcherEngine::processEvent(ConstFSEventStreamRef stream
const FSEventStreamEventFlags eventFlags[],
const FSEventStreamEventId eventIds[])
{
#if defined(Q_OS_OSX)
#if defined(Q_OS_MACOS)
Q_UNUSED(streamRef);
bool needsRestart = false;

View File

@ -68,7 +68,7 @@
#include <signal.h> // kill
#include <unistd.h> // gethostname
#if defined(Q_OS_OSX)
#if defined(Q_OS_MACOS)
# include <libproc.h>
#elif defined(Q_OS_LINUX)
# include <unistd.h>
@ -222,7 +222,7 @@ bool QLockFilePrivate::isProcessRunning(qint64 pid, const QString &appname)
QString QLockFilePrivate::processNameByPid(qint64 pid)
{
#if defined(Q_OS_OSX)
#if defined(Q_OS_MACOS)
char name[1024];
proc_name(pid, name, sizeof(name) / sizeof(char));
return QFile::decodeName(name);

View File

@ -450,12 +450,19 @@ void QProcessPrivate::startProcess()
workingDirPtr = encodedWorkingDirectory.constData();
}
// Start the process manager, and fork off the child process.
// ### Qt6: revisit whether the change in behavior due to not using fork()
// is acceptable for derived classes.
// Select FFD_USE_FORK and FFD_VFORK_SEMANTICS based on whether there's
// user code running in the child process: if there is, we don't know what
// the user will want to do, so we err on the safe side and request an
// actual fork() (for example, the user could attempt to do some
// synchronization with the parent process). But if there isn't, then our
// code in execChild() is just a handful of dup2() and a chdir(), so it's
// safe with vfork semantics: suspend the parent execution until the child
// either execve()s or _exit()s.
int ffdflags = FFD_CLOEXEC;
if (typeid(*q) != typeid(QProcess))
ffdflags |= FFD_USE_FORK;
else
ffdflags |= FFD_VFORK_SEMANTICS;
pid_t childPid;
forkfd = ::forkfd(ffdflags , &childPid);
int lastForkErrno = errno;

View File

@ -1473,6 +1473,9 @@ bool QItemSelectionModel::isSelected(const QModelIndex &index) const
Note that this function is usually faster than calling isSelected()
on all items in the same row and that unselectable items are
ignored.
\note Since Qt 5.15, the default argument for \a parent is an empty
model index.
*/
bool QItemSelectionModel::isRowSelected(int row, const QModelIndex &parent) const
{
@ -1545,6 +1548,9 @@ bool QItemSelectionModel::isRowSelected(int row, const QModelIndex &parent) cons
Note that this function is usually faster than calling isSelected()
on all items in the same column and that unselectable items are
ignored.
\note Since Qt 5.15, the default argument for \a parent is an empty
model index.
*/
bool QItemSelectionModel::isColumnSelected(int column, const QModelIndex &parent) const
{
@ -1616,6 +1622,9 @@ bool QItemSelectionModel::isColumnSelected(int column, const QModelIndex &parent
/*!
Returns \c true if there are any items selected in the \a row with the given
\a parent.
\note Since Qt 5.15, the default argument for \a parent is an empty
model index.
*/
bool QItemSelectionModel::rowIntersectsSelection(int row, const QModelIndex &parent) const
{
@ -1649,6 +1658,9 @@ bool QItemSelectionModel::rowIntersectsSelection(int row, const QModelIndex &par
/*!
Returns \c true if there are any items selected in the \a column with the given
\a parent.
\note Since Qt 5.15, the default argument for \a parent is an empty
model index.
*/
bool QItemSelectionModel::columnIntersectsSelection(int column, const QModelIndex &parent) const
{

View File

@ -2678,12 +2678,19 @@ void QSortFilterProxyModel::setFilterKeyColumn(int column)
\property QSortFilterProxyModel::filterCaseSensitivity
\brief the case sensitivity of the QRegExp pattern used to filter the
contents of the source model
contents of the source model.
By default, the filter is case sensitive.
\sa filterRegExp, sortCaseSensitivity
*/
/*!
\since 5.15
\fn void QSortFilterProxyModel::filterCaseSensitivityChanged(Qt::CaseSensitivity filterCaseSensitivity)
\brief This signal is emitted when the case sensitivity of the filter
changes to \a filterCaseSensitivity.
*/
Qt::CaseSensitivity QSortFilterProxyModel::filterCaseSensitivity() const
{
Q_D(const QSortFilterProxyModel);
@ -2710,6 +2717,13 @@ void QSortFilterProxyModel::setFilterCaseSensitivity(Qt::CaseSensitivity cs)
\sa filterCaseSensitivity, lessThan()
*/
/*!
\since 5.15
\fn void QSortFilterProxyModel::sortCaseSensitivityChanged(Qt::CaseSensitivity sortCaseSensitivity)
\brief This signal is emitted when the case sensitivity for sorting
changes to \a sortCaseSensitivity.
*/
Qt::CaseSensitivity QSortFilterProxyModel::sortCaseSensitivity() const
{
Q_D(const QSortFilterProxyModel);
@ -2736,6 +2750,13 @@ void QSortFilterProxyModel::setSortCaseSensitivity(Qt::CaseSensitivity cs)
\sa sortCaseSensitivity, lessThan()
*/
/*!
\since 5.15
\fn void QSortFilterProxyModel::sortLocaleAwareChanged(bool sortLocaleAware)
\brief This signal is emitted when the locale aware setting
changes to \a sortLocaleAware.
*/
bool QSortFilterProxyModel::isSortLocaleAware() const
{
Q_D(const QSortFilterProxyModel);
@ -2856,12 +2877,19 @@ void QSortFilterProxyModel::setDynamicSortFilter(bool enable)
/*!
\since 4.2
\property QSortFilterProxyModel::sortRole
\brief the item role that is used to query the source model's data when sorting items
\brief the item role that is used to query the source model's data when
sorting items.
The default value is Qt::DisplayRole.
\sa lessThan()
*/
/*!
\since 5.15
\fn void QSortFilterProxyModel::sortRoleChanged(int sortRole)
\brief This signal is emitted when the sort role changes to \a sortRole.
*/
int QSortFilterProxyModel::sortRole() const
{
Q_D(const QSortFilterProxyModel);
@ -2881,12 +2909,19 @@ void QSortFilterProxyModel::setSortRole(int role)
/*!
\since 4.2
\property QSortFilterProxyModel::filterRole
\brief the item role that is used to query the source model's data when filtering items
\brief the item role that is used to query the source model's data when
filtering items.
The default value is Qt::DisplayRole.
\sa filterAcceptsRow()
*/
/*!
\since 5.15
\fn void QSortFilterProxyModel::filterRoleChanged(int filterRole)
\brief This signal is emitted when the filter role changes to \a filterRole.
*/
int QSortFilterProxyModel::filterRole() const
{
Q_D(const QSortFilterProxyModel);
@ -2914,6 +2949,13 @@ void QSortFilterProxyModel::setFilterRole(int role)
\sa filterAcceptsRow()
*/
/*!
\since 5.15
\fn void QSortFilterProxyModel::recursiveFilteringEnabledChanged(int recursiveFilteringEnabled)
\brief This signal is emitted when the recursive filter setting is changed
to \a recursiveFilteringEnabled.
*/
bool QSortFilterProxyModel::isRecursiveFilteringEnabled() const
{
Q_D(const QSortFilterProxyModel);

View File

@ -458,7 +458,7 @@ QMacRootLevelAutoReleasePool::~QMacRootLevelAutoReleasePool()
// -------------------------------------------------------------------------
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
// Use this method to keep all the information in the TextSegment. As long as it is ordered
// we are in OK shape, and we can influence that ourselves.
@ -598,7 +598,7 @@ Qt::Key qt_mac_cocoaKey2QtKey(QChar keyCode)
return i->qtKey;
}
#endif // Q_OS_OSX
#endif // Q_OS_MACOS
void qt_apple_check_os_version()
{

View File

@ -48,7 +48,7 @@
#include <limits>
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
# include <AppKit/NSApplication.h>
#elif defined(Q_OS_WATCHOS)
# include <WatchKit/WatchKit.h>

View File

@ -84,10 +84,8 @@ enum {
WM_QT_ACTIVATENOTIFIERS = WM_USER + 2
};
// WM_QT_SENDPOSTEDEVENTS message parameter
enum {
WMWP_QT_TOFOREIGNLOOP = 0,
WMWP_QT_FROMWAKEUP
SendPostedEventsTimerId = ~1u
};
class QEventDispatcherWin32Private;
@ -100,8 +98,8 @@ LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPA
QEventDispatcherWin32Private::QEventDispatcherWin32Private()
: threadId(GetCurrentThreadId()), interrupt(false), internalHwnd(0),
getMessageHook(0), wakeUps(0), activateNotifiersPosted(false),
winEventNotifierActivatedEvent(NULL)
getMessageHook(0), sendPostedEventsTimerId(0), wakeUps(0),
activateNotifiersPosted(false), winEventNotifierActivatedEvent(NULL)
{
}
@ -129,6 +127,18 @@ void WINAPI QT_WIN_CALLBACK qt_fast_timer_proc(uint timerId, uint /*reserved*/,
QCoreApplication::postEvent(t->dispatcher, new QTimerEvent(t->timerId));
}
static inline UINT inputQueueMask()
{
UINT result = QS_ALLEVENTS;
// QTBUG 28513, QTBUG-29097, QTBUG-29435: QS_TOUCH, QS_POINTER became part of
// QS_INPUT in Windows Kit 8. They should not be used when running on pre-Windows 8.
#if WINVER > 0x0601
if (QOperatingSystemVersion::current() < QOperatingSystemVersion::Windows8)
result &= ~(QS_TOUCH | QS_POINTER);
#endif // WINVER > 0x0601
return result;
}
LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPARAM lp)
{
if (message == WM_NCCREATE)
@ -240,47 +250,39 @@ LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPA
case WM_TIMER:
Q_ASSERT(d != 0);
d->sendTimerEvent(wp);
if (wp == d->sendPostedEventsTimerId)
q->sendPostedEvents();
else
d->sendTimerEvent(wp);
return 0;
case WM_QT_SENDPOSTEDEVENTS:
Q_ASSERT(d != 0);
// We send posted events manually, if the window procedure was invoked
// by the foreign event loop (e.g. from the native modal dialog).
q->sendPostedEvents();
// Skip sending, if the message queue is not empty.
// sendPostedEventsTimer will deliver posted events later.
static const UINT mask = inputQueueMask();
if (HIWORD(GetQueueStatus(mask)) == 0)
q->sendPostedEvents();
return 0;
} // switch (message)
return DefWindowProc(hwnd, message, wp, lp);
}
static inline UINT inputQueueMask()
{
UINT result = QS_ALLEVENTS;
// QTBUG 28513, QTBUG-29097, QTBUG-29435: QS_TOUCH, QS_POINTER became part of
// QS_INPUT in Windows Kit 8. They should not be used when running on pre-Windows 8.
#if WINVER > 0x0601
if (QOperatingSystemVersion::current() < QOperatingSystemVersion::Windows8)
result &= ~(QS_TOUCH | QS_POINTER);
#endif // WINVER > 0x0601
return result;
}
LRESULT QT_WIN_CALLBACK qt_GetMessageHook(int code, WPARAM wp, LPARAM lp)
{
QEventDispatcherWin32 *q = qobject_cast<QEventDispatcherWin32 *>(QAbstractEventDispatcher::instance());
Q_ASSERT(q != 0);
QEventDispatcherWin32Private *d = q->d_func();
MSG *msg = reinterpret_cast<MSG *>(lp);
static const UINT mask = inputQueueMask();
if (HIWORD(GetQueueStatus(mask)) == 0 && wp == PM_REMOVE) {
// Allow posting WM_QT_SENDPOSTEDEVENTS message.
d->wakeUps.storeRelaxed(0);
if (!(msg->hwnd == d->internalHwnd && msg->message == WM_QT_SENDPOSTEDEVENTS)) {
PostMessage(d->internalHwnd, WM_QT_SENDPOSTEDEVENTS,
WMWP_QT_TOFOREIGNLOOP, 0);
}
if (msg->hwnd == d->internalHwnd && msg->message == WM_QT_SENDPOSTEDEVENTS
&& wp == PM_REMOVE && d->sendPostedEventsTimerId == 0) {
// Start a timer to deliver posted events when the message queue is emptied.
d->sendPostedEventsTimerId = SetTimer(d->internalHwnd, SendPostedEventsTimerId,
USER_TIMER_MINIMUM, NULL);
}
return d->getMessageHook ? CallNextHookEx(0, code, wp, lp) : 0;
}
@ -571,12 +573,15 @@ bool QEventDispatcherWin32::processEvents(QEventLoop::ProcessEventsFlags flags)
}
if (haveMessage) {
if (d->internalHwnd == msg.hwnd && msg.message == WM_QT_SENDPOSTEDEVENTS) {
// Set result to 'true', if the message was sent by wakeUp().
if (msg.wParam == WMWP_QT_FROMWAKEUP)
retVal = true;
// Set result to 'true' because the message was sent by wakeUp().
retVal = true;
continue;
}
if (msg.message == WM_TIMER) {
// Skip timer event intended for use inside foreign loop.
if (d->internalHwnd == msg.hwnd && msg.wParam == d->sendPostedEventsTimerId)
continue;
// avoid live-lock by keeping track of the timers we've already sent
bool found = false;
for (int i = 0; !found && i < processedTimers.count(); ++i) {
@ -968,8 +973,7 @@ void QEventDispatcherWin32::wakeUp()
Q_D(QEventDispatcherWin32);
if (d->internalHwnd && d->wakeUps.testAndSetAcquire(0, 1)) {
// post a WM_QT_SENDPOSTEDEVENTS to this thread if there isn't one already pending
if (!PostMessage(d->internalHwnd, WM_QT_SENDPOSTEDEVENTS,
WMWP_QT_FROMWAKEUP, 0))
if (!PostMessage(d->internalHwnd, WM_QT_SENDPOSTEDEVENTS, 0, 0))
qErrnoWarning("QEventDispatcherWin32::wakeUp: Failed to post a message");
}
}
@ -1015,6 +1019,10 @@ void QEventDispatcherWin32::closingDown()
if (d->getMessageHook)
UnhookWindowsHookEx(d->getMessageHook);
d->getMessageHook = 0;
if (d->sendPostedEventsTimerId != 0)
KillTimer(d->internalHwnd, d->sendPostedEventsTimerId);
d->sendPostedEventsTimerId = 0;
}
bool QEventDispatcherWin32::event(QEvent *e)
@ -1056,6 +1064,14 @@ bool QEventDispatcherWin32::event(QEvent *e)
void QEventDispatcherWin32::sendPostedEvents()
{
Q_D(QEventDispatcherWin32);
if (d->sendPostedEventsTimerId != 0)
KillTimer(d->internalHwnd, d->sendPostedEventsTimerId);
d->sendPostedEventsTimerId = 0;
// Allow posting WM_QT_SENDPOSTEDEVENTS message.
d->wakeUps.storeRelaxed(0);
QCoreApplicationPrivate::sendPostedEvents(0, 0, d->threadData.loadRelaxed());
}

View File

@ -171,6 +171,7 @@ public:
HHOOK getMessageHook;
// for controlling when to send posted events
UINT_PTR sendPostedEventsTimerId;
QAtomicInt wakeUps;
// timers

View File

@ -3532,6 +3532,7 @@ bool QMetaProperty::isQProperty() const
\sa isDesignable(), isScriptable(), isStored()
*/
#if QT_DEPRECATED_SINCE(5, 15)
bool QMetaProperty::isEditable(const QObject *object) const
{
if (!mobj)
@ -3545,6 +3546,7 @@ bool QMetaProperty::isEditable(const QObject *object) const
}
return b;
}
#endif
/*!
\class QMetaClassInfo

View File

@ -260,7 +260,9 @@ public:
bool isDesignable(const QObject *obj = nullptr) const;
bool isScriptable(const QObject *obj = nullptr) const;
bool isStored(const QObject *obj = nullptr) const;
bool isEditable(const QObject *obj = nullptr) const;
#if QT_DEPRECATED_SINCE(5, 15)
QT_DEPRECATED bool isEditable(const QObject *obj = nullptr) const;
#endif
bool isUser(const QObject *obj = nullptr) const;
bool isConstant() const;
bool isFinal() const;

View File

@ -936,6 +936,24 @@ struct ContainerCapabilitiesImpl<Container, decltype(std::declval<Container>().p
{ static_cast<Container *>(const_cast<void *>(container))->push_back(*static_cast<const typename Container::value_type *>(value)); }
};
namespace QtPrivate {
namespace ContainerCapabilitiesMetaProgrammingHelper {
template<typename... Ts>
using void_t = void;
}
}
template<typename Container>
struct ContainerCapabilitiesImpl<Container, QtPrivate::ContainerCapabilitiesMetaProgrammingHelper::void_t<decltype(std::declval<Container>().insert(std::declval<typename Container::value_type>())), decltype(std::declval<typename Container::value_type>() == std::declval<typename Container::value_type>())>>
{
enum {ContainerCapabilities = ContainerIsAppendable};
// The code below invokes undefined behavior if and only if the pointer passed into QSequentialIterableImpl
// pointed to a const object to begin with
static void appendImpl(const void *container, const void *value)
{ static_cast<Container *>(const_cast<void *>(container))->insert(*static_cast<const typename Container::value_type *>(value)); }
};
template<typename T, typename Category = typename std::iterator_traits<typename T::const_iterator>::iterator_category>
struct CapabilitiesImpl;

View File

@ -67,7 +67,7 @@ Q_CORE_EXPORT void QTestPrivate::qSleep(int ms)
Example:
\snippet code/src_corelib_kernel_qtestsupport_core.cpp 0
\snippet code/src_corelib_kernel_qtestsupport_core_snippet.cpp 0
The code above will wait for the object to become ready, for a
maximum of three seconds.

View File

@ -576,9 +576,7 @@ bool QLibraryPrivate::load()
Q_TRACE(QLibraryPrivate_load_entry, fileName);
mutex.lock();
bool ret = load_sys();
mutex.unlock();
if (qt_debug_component()) {
if (ret) {
qDebug() << "loaded library" << fileName;

View File

@ -123,6 +123,7 @@ QStringList QLibraryPrivate::prefixes_sys()
bool QLibraryPrivate::load_sys()
{
QMutexLocker locker(&mutex);
QString attempt;
QFileSystemEntry fsEntry(fileName);
@ -213,6 +214,7 @@ bool QLibraryPrivate::load_sys()
}
#endif
locker.unlock();
bool retry = true;
Handle hnd = nullptr;
for (int prefix = 0; retry && !hnd && prefix < prefixes.size(); prefix++) {
@ -235,15 +237,15 @@ bool QLibraryPrivate::load_sys()
hnd = dlopen(QFile::encodeName(attempt), dlFlags);
#ifdef Q_OS_ANDROID
if (!pHnd) {
if (!hnd) {
auto attemptFromBundle = attempt;
pHnd = dlopen(QFile::encodeName(attemptFromBundle.replace(QLatin1Char('/'), QLatin1Char('_'))), dlFlags);
hnd = dlopen(QFile::encodeName(attemptFromBundle.replace(QLatin1Char('/'), QLatin1Char('_'))), dlFlags);
}
if (pHnd) {
if (hnd) {
using JniOnLoadPtr = jint (*)(JavaVM *vm, void *reserved);
JniOnLoadPtr jniOnLoad = reinterpret_cast<JniOnLoadPtr>(dlsym(pHnd, "JNI_OnLoad"));
if (jniOnLoad && jniOnLoad(QtAndroidPrivate::javaVM(), nullptr) == JNI_ERR) {
dlclose(pHnd);
dlclose(hnd);
pHnd = nullptr;
}
}
@ -273,6 +275,8 @@ bool QLibraryPrivate::load_sys()
}
}
#endif
locker.relock();
if (!hnd) {
errorString = QLibrary::tr("Cannot load library %1: %2").arg(fileName, qdlerror());
}

View File

@ -78,6 +78,7 @@ bool QLibraryPrivate::load_sys()
// fileName
//
// NB If it's a plugin we do not ever try the ".dll" extension
QMutexLocker locker(&mutex);
QStringList attempts;
if (pluginState != IsAPlugin)
@ -95,6 +96,7 @@ bool QLibraryPrivate::load_sys()
attempts.prepend(QDir::rootPath() + fileName);
#endif
locker.unlock();
Handle hnd = nullptr;
for (const QString &attempt : qAsConst(attempts)) {
#ifndef Q_OS_WINRT
@ -115,6 +117,7 @@ bool QLibraryPrivate::load_sys()
#ifndef Q_OS_WINRT
SetErrorMode(oldmode);
#endif
locker.relock();
if (!hnd) {
errorString = QLibrary::tr("Cannot load library %1: %2").arg(
QDir::toNativeSeparators(fileName), qt_error_string());

View File

@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2018 Intel Corporation.
** Copyright (C) 2020 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@ -42,6 +42,7 @@
#define CBOR_NO_ENCODER_API
#include <private/qcborcommon_p.h>
#include <private/qbytearray_p.h>
#include <private/qnumeric_p.h>
#include <private/qutfcodec_p.h>
#include <qdebug.h>
@ -1055,6 +1056,10 @@ bool QCborStreamReader::next(int maxRecursion)
} else if (isString() || isByteArray()) {
auto r = _readByteArray_helper();
while (r.status == Ok) {
if (isString() && r.data.size() > MaxStringSize) {
d->handleError(CborErrorDataTooLarge);
break;
}
if (isString() && !QUtf8::isValidUtf8(r.data, r.data.size()).isValidUtf8) {
d->handleError(CborErrorInvalidUtf8TextString);
break;
@ -1337,15 +1342,23 @@ QCborStreamReader::StringResult<QString> QCborStreamReader::_readString_helper()
result.status = r.status;
if (r.status == Ok) {
QTextCodec::ConverterState cs;
result.data = QUtf8::convertToUnicode(r.data, r.data.size(), &cs);
if (cs.invalidChars == 0 && cs.remainingChars == 0)
return result;
// See QUtf8::convertToUnicode() a detailed explanation of why this
// conversion uses the same number of words or less.
CborError err = CborNoError;
if (r.data.size() > MaxStringSize) {
err = CborErrorDataTooLarge;
} else {
QTextCodec::ConverterState cs;
result.data = QUtf8::convertToUnicode(r.data, r.data.size(), &cs);
if (cs.invalidChars != 0 || cs.remainingChars != 0)
err = CborErrorInvalidUtf8TextString;
}
d->handleError(CborErrorInvalidUtf8TextString);
result.data.clear();
result.status = Error;
return result;
if (err) {
d->handleError(err);
result.data.clear();
result.status = Error;
}
}
return result;
}
@ -1373,6 +1386,10 @@ QCborStreamReader::StringResult<QByteArray> QCborStreamReader::_readByteArray_he
qsizetype len = _currentStringChunkSize();
if (len < 0)
return result;
if (len > MaxByteArraySize) {
d->handleError(CborErrorDataTooLarge);
return result;
}
result.data.resize(len);
auto r = readStringChunk(result.data.data(), len);

View File

@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2018 Intel Corporation.
** Copyright (C) 2020 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@ -53,6 +53,7 @@
#include <qendian.h>
#include <qlocale.h>
#include <private/qbytearray_p.h>
#include <private/qnumeric_p.h>
#include <private/qsimd_p.h>
@ -844,11 +845,6 @@ static QCborValue::Type convertToExtendedType(QCborContainerPrivate *d)
return QCborValue::Tag;
}
#if QT_CONFIG(cborstreamreader)
// in qcborstream.cpp
extern void qt_cbor_stream_set_error(QCborStreamReaderPrivate *d, QCborError error);
#endif
#if QT_CONFIG(cborstreamwriter)
static void writeDoubleToCbor(QCborStreamWriter &writer, double d, QCborValue::EncodingOptions opt)
{
@ -1462,23 +1458,59 @@ static Element decodeBasicValueFromCbor(QCborStreamReader &reader)
return e;
}
static inline QCborContainerPrivate *createContainerFromCbor(QCborStreamReader &reader)
static inline QCborContainerPrivate *createContainerFromCbor(QCborStreamReader &reader, int remainingRecursionDepth)
{
auto d = new QCborContainerPrivate;
d->ref.storeRelaxed(1);
d->decodeFromCbor(reader);
if (Q_UNLIKELY(remainingRecursionDepth == 0)) {
QCborContainerPrivate::setErrorInReader(reader, { QCborError::NestingTooDeep });
return nullptr;
}
QCborContainerPrivate *d = nullptr;
int mapShift = reader.isMap() ? 1 : 0;
if (reader.isLengthKnown()) {
quint64 len = reader.length();
// Clamp allocation to 1M elements (avoids crashing due to corrupt
// stream or loss of precision when converting from quint64 to
// QVector::size_type).
len = qMin(len, quint64(1024 * 1024 - 1));
if (len) {
d = new QCborContainerPrivate;
d->ref.storeRelaxed(1);
d->elements.reserve(qsizetype(len) << mapShift);
}
} else {
d = new QCborContainerPrivate;
d->ref.storeRelaxed(1);
}
reader.enterContainer();
if (reader.lastError() != QCborError::NoError)
return d;
while (reader.hasNext() && reader.lastError() == QCborError::NoError)
d->decodeValueFromCbor(reader, remainingRecursionDepth - 1);
if (reader.lastError() == QCborError::NoError)
reader.leaveContainer();
return d;
}
static QCborValue taggedValueFromCbor(QCborStreamReader &reader)
static QCborValue taggedValueFromCbor(QCborStreamReader &reader, int remainingRecursionDepth)
{
if (Q_UNLIKELY(remainingRecursionDepth == 0)) {
QCborContainerPrivate::setErrorInReader(reader, { QCborError::NestingTooDeep });
return QCborValue::Invalid;
}
auto d = new QCborContainerPrivate;
d->append(reader.toTag());
reader.next();
if (reader.lastError() == QCborError::NoError) {
// decode tagged value
d->decodeValueFromCbor(reader);
d->decodeValueFromCbor(reader, remainingRecursionDepth - 1);
}
QCborValue::Type type;
@ -1494,6 +1526,13 @@ static QCborValue taggedValueFromCbor(QCborStreamReader &reader)
return QCborContainerPrivate::makeValue(type, -1, d);
}
// in qcborstream.cpp
extern void qt_cbor_stream_set_error(QCborStreamReaderPrivate *d, QCborError error);
inline void QCborContainerPrivate::setErrorInReader(QCborStreamReader &reader, QCborError error)
{
qt_cbor_stream_set_error(reader.d.data(), error);
}
void QCborContainerPrivate::decodeStringFromCbor(QCborStreamReader &reader)
{
auto addByteData_local = [this](QByteArray::size_type len) -> qint64 {
@ -1515,6 +1554,8 @@ void QCborContainerPrivate::decodeStringFromCbor(QCborStreamReader &reader)
// and calculate the final size
if (add_overflow(offset, increment, &newSize))
return -1;
if (newSize > MaxByteArraySize)
return -1;
// since usedData <= data.size(), this can't overflow
usedData += increment;
@ -1538,7 +1579,7 @@ void QCborContainerPrivate::decodeStringFromCbor(QCborStreamReader &reader)
return; // error
if (len != rawlen) {
// truncation
qt_cbor_stream_set_error(reader.d.data(), { QCborError::DataTooLarge });
setErrorInReader(reader, { QCborError::DataTooLarge });
return;
}
@ -1548,7 +1589,7 @@ void QCborContainerPrivate::decodeStringFromCbor(QCborStreamReader &reader)
e.value = addByteData_local(len);
if (e.value < 0) {
// overflow
qt_cbor_stream_set_error(reader.d.data(), { QCborError::DataTooLarge });
setErrorInReader(reader, { QCborError::DataTooLarge });
return;
}
}
@ -1562,7 +1603,7 @@ void QCborContainerPrivate::decodeStringFromCbor(QCborStreamReader &reader)
auto utf8result = QUtf8::isValidUtf8(dataPtr() + data.size() - len, len);
if (!utf8result.isValidUtf8) {
r.status = QCborStreamReader::Error;
qt_cbor_stream_set_error(reader.d.data(), { QCborError::InvalidUtf8String });
setErrorInReader(reader, { QCborError::InvalidUtf8String });
break;
}
isAscii = isAscii && utf8result.isValidAscii;
@ -1586,14 +1627,7 @@ void QCborContainerPrivate::decodeStringFromCbor(QCborStreamReader &reader)
// error
r.status = QCborStreamReader::Error;
qt_cbor_stream_set_error(reader.d.data(), { QCborError::DataTooLarge });
}
if (r.status == QCborStreamReader::Error) {
// There can only be errors if there was data to be read.
Q_ASSERT(e.flags & Element::HasByteData);
data.truncate(e.value);
return;
setErrorInReader(reader, { QCborError::DataTooLarge });
}
// update size
@ -1607,14 +1641,30 @@ void QCborContainerPrivate::decodeStringFromCbor(QCborStreamReader &reader)
Q_ASSERT(e.type == QCborValue::String);
e.flags |= Element::StringIsAscii;
}
// check that this UTF-8 text string can be loaded onto a QString
if (e.type == QCborValue::String) {
if (Q_UNLIKELY(b->len > MaxStringSize)) {
setErrorInReader(reader, { QCborError::DataTooLarge });
r.status = QCborStreamReader::Error;
}
}
}
if (r.status == QCborStreamReader::Error) {
// There can only be errors if there was data to be read.
Q_ASSERT(e.flags & Element::HasByteData);
data.truncate(e.value);
return;
}
elements.append(e);
}
void QCborContainerPrivate::decodeValueFromCbor(QCborStreamReader &reader)
void QCborContainerPrivate::decodeValueFromCbor(QCborStreamReader &reader, int remainingRecursionDepth)
{
switch (reader.type()) {
QCborStreamReader::Type t = reader.type();
switch (t) {
case QCborStreamReader::UnsignedInteger:
case QCborStreamReader::NegativeInteger:
case QCborStreamReader::SimpleType:
@ -1631,37 +1681,17 @@ void QCborContainerPrivate::decodeValueFromCbor(QCborStreamReader &reader)
case QCborStreamReader::Array:
case QCborStreamReader::Map:
return append(makeValue(t == QCborStreamReader::Array ? QCborValue::Array : QCborValue::Map, -1,
createContainerFromCbor(reader, remainingRecursionDepth),
MoveContainer));
case QCborStreamReader::Tag:
return append(QCborValue::fromCbor(reader));
return append(taggedValueFromCbor(reader, remainingRecursionDepth));
case QCborStreamReader::Invalid:
return; // probably a decode error
}
}
void QCborContainerPrivate::decodeFromCbor(QCborStreamReader &reader)
{
int mapShift = reader.isMap() ? 1 : 0;
if (reader.isLengthKnown()) {
quint64 len = reader.length();
// Clamp allocation to 1M elements (avoids crashing due to corrupt
// stream or loss of precision when converting from quint64 to
// QVector::size_type).
len = qMin(len, quint64(1024 * 1024 - 1));
elements.reserve(qsizetype(len) << mapShift);
}
reader.enterContainer();
if (reader.lastError() != QCborError::NoError)
return;
while (reader.hasNext() && reader.lastError() == QCborError::NoError)
decodeValueFromCbor(reader);
if (reader.lastError() == QCborError::NoError)
reader.leaveContainer();
}
#endif // QT_CONFIG(cborstreamreader)
/*!
@ -2363,6 +2393,8 @@ QCborValueRef QCborValue::operator[](qint64 key)
}
#if QT_CONFIG(cborstreamreader)
enum { MaximumRecursionDepth = 1024 };
/*!
Decodes one item from the CBOR stream found in \a reader and returns the
equivalent representation. This function is recursive: if the item is a map
@ -2423,12 +2455,12 @@ QCborValue QCborValue::fromCbor(QCborStreamReader &reader)
case QCborStreamReader::Map:
result.n = -1;
result.t = reader.isArray() ? Array : Map;
result.container = createContainerFromCbor(reader);
result.container = createContainerFromCbor(reader, MaximumRecursionDepth);
break;
// tag
case QCborStreamReader::Tag:
result = taggedValueFromCbor(reader);
result = taggedValueFromCbor(reader, MaximumRecursionDepth);
break;
}

View File

@ -414,9 +414,9 @@ public:
elements.remove(idx);
}
void decodeValueFromCbor(QCborStreamReader &reader);
void decodeFromCbor(QCborStreamReader &reader);
void decodeValueFromCbor(QCborStreamReader &reader, int remainiingStackDepth);
void decodeStringFromCbor(QCborStreamReader &reader);
static inline void setErrorInReader(QCborStreamReader &reader, QCborError error);
};
QT_END_NAMESPACE

View File

@ -167,7 +167,11 @@ QJsonArray::QJsonArray(QCborContainerPrivate *array)
*/
void QJsonArray::initialize()
{
a = nullptr;
// Because we're being called with uninitialized state, we can't do:
// a = nullptr;
// QExplicitlyDataSharedPointer::operator= will read the current value
void *ptr = &a;
memset(ptr, 0, sizeof(a));
}
/*!
@ -177,7 +181,6 @@ QJsonArray::~QJsonArray() = default;
QJsonArray::QJsonArray(std::initializer_list<QJsonValue> args)
{
initialize();
for (const auto & arg : args)
append(arg);
}

View File

@ -150,7 +150,11 @@ QJsonObject::QJsonObject(QCborContainerPrivate *object)
void QJsonObject::initialize()
{
o = nullptr;
// Because we're being called with uninitialized state, we can't do:
// o = nullptr;
// QExplicitlyDataSharedPointer::operator= will read the current value
void *ptr = &o;
memset(ptr, 0, sizeof(o));
}
/*!
@ -160,7 +164,6 @@ QJsonObject::~QJsonObject() = default;
QJsonObject::QJsonObject(std::initializer_list<QPair<QString, QJsonValue> > args)
{
initialize();
for (const auto &arg : args)
insert(arg.first, arg.second);
}
@ -401,7 +404,9 @@ QJsonValue QJsonObject::operator [](const QString &key) const
#if QT_STRINGVIEW_LEVEL < 2
/*!
Returns a reference to the value for \a key.
Returns a reference to the value for \a key. If there is no value with key
\a key in the object, one is created with a QJsonValue::Null value and then
returned.
The return value is of type QJsonValueRef, a helper class for QJsonArray
and QJsonObject. When you get an object of type QJsonValueRef, you can

View File

@ -135,30 +135,30 @@ static const int QTEXTSTREAM_BUFFERSIZE = 16384;
\table
\header \li Manipulator \li Description
\row \li \c Qt::bin \li Same as setIntegerBase(2).
\row \li \c Qt::oct \li Same as setIntegerBase(8).
\row \li \c Qt::dec \li Same as setIntegerBase(10).
\row \li \c Qt::hex \li Same as setIntegerBase(16).
\row \li \c Qt::showbase \li Same as setNumberFlags(numberFlags() | ShowBase).
\row \li \c Qt::forcesign \li Same as setNumberFlags(numberFlags() | ForceSign).
\row \li \c Qt::forcepoint \li Same as setNumberFlags(numberFlags() | ForcePoint).
\row \li \c Qt::noshowbase \li Same as setNumberFlags(numberFlags() & ~ShowBase).
\row \li \c Qt::noforcesign \li Same as setNumberFlags(numberFlags() & ~ForceSign).
\row \li \c Qt::noforcepoint \li Same as setNumberFlags(numberFlags() & ~ForcePoint).
\row \li \c Qt::uppercasebase \li Same as setNumberFlags(numberFlags() | UppercaseBase).
\row \li \c Qt::uppercasedigits \li Same as setNumberFlags(numberFlags() | UppercaseDigits).
\row \li \c Qt::lowercasebase \li Same as setNumberFlags(numberFlags() & ~UppercaseBase).
\row \li \c Qt::lowercasedigits \li Same as setNumberFlags(numberFlags() & ~UppercaseDigits).
\row \li \c Qt::fixed \li Same as setRealNumberNotation(FixedNotation).
\row \li \c Qt::scientific \li Same as setRealNumberNotation(ScientificNotation).
\row \li \c Qt::left \li Same as setFieldAlignment(AlignLeft).
\row \li \c Qt::right \li Same as setFieldAlignment(AlignRight).
\row \li \c Qt::center \li Same as setFieldAlignment(AlignCenter).
\row \li \c Qt::endl \li Same as operator<<('\\n') and flush().
\row \li \c Qt::flush \li Same as flush().
\row \li \c Qt::reset \li Same as reset().
\row \li \c Qt::ws \li Same as skipWhiteSpace().
\row \li \c Qt::bom \li Same as setGenerateByteOrderMark(true).
\row \li Qt::bin \li Same as setIntegerBase(2).
\row \li Qt::oct \li Same as setIntegerBase(8).
\row \li Qt::dec \li Same as setIntegerBase(10).
\row \li Qt::hex \li Same as setIntegerBase(16).
\row \li Qt::showbase \li Same as setNumberFlags(numberFlags() | ShowBase).
\row \li Qt::forcesign \li Same as setNumberFlags(numberFlags() | ForceSign).
\row \li Qt::forcepoint \li Same as setNumberFlags(numberFlags() | ForcePoint).
\row \li Qt::noshowbase \li Same as setNumberFlags(numberFlags() & ~ShowBase).
\row \li Qt::noforcesign \li Same as setNumberFlags(numberFlags() & ~ForceSign).
\row \li Qt::noforcepoint \li Same as setNumberFlags(numberFlags() & ~ForcePoint).
\row \li Qt::uppercasebase \li Same as setNumberFlags(numberFlags() | UppercaseBase).
\row \li Qt::uppercasedigits \li Same as setNumberFlags(numberFlags() | UppercaseDigits).
\row \li Qt::lowercasebase \li Same as setNumberFlags(numberFlags() & ~UppercaseBase).
\row \li Qt::lowercasedigits \li Same as setNumberFlags(numberFlags() & ~UppercaseDigits).
\row \li Qt::fixed \li Same as setRealNumberNotation(FixedNotation).
\row \li Qt::scientific \li Same as setRealNumberNotation(ScientificNotation).
\row \li Qt::left \li Same as setFieldAlignment(AlignLeft).
\row \li Qt::right \li Same as setFieldAlignment(AlignRight).
\row \li Qt::center \li Same as setFieldAlignment(AlignCenter).
\row \li Qt::endl \li Same as operator<<('\\n') and flush().
\row \li Qt::flush \li Same as flush().
\row \li Qt::reset \li Same as reset().
\row \li Qt::ws \li Same as skipWhiteSpace().
\row \li Qt::bom \li Same as setGenerateByteOrderMark(true).
\endtable
In addition, Qt provides three global manipulators that take a
@ -2693,8 +2693,12 @@ QTextStream &QTextStream::operator<<(const void *ptr)
namespace Qt {
/*!
\fn QTextStream &QTextStreamFunctions::bin(QTextStream &stream)
\relates QTextStream
\obsolete Use Qt::bin() instead.
*/
/*!
Calls QTextStream::setIntegerBase(2) on \a stream and returns \a
stream.
@ -2707,8 +2711,12 @@ QTextStream &bin(QTextStream &stream)
}
/*!
\fn QTextStream &QTextStreamFunctions::oct(QTextStream &stream)
\relates QTextStream
\obsolete Use Qt::oct() instead.
*/
/*!
Calls QTextStream::setIntegerBase(8) on \a stream and returns \a
stream.
@ -2721,8 +2729,12 @@ QTextStream &oct(QTextStream &stream)
}
/*!
\fn QTextStream &QTextStreamFunctions::dec(QTextStream &stream)
\relates QTextStream
\obsolete Use Qt::dec() instead.
*/
/*!
Calls QTextStream::setIntegerBase(10) on \a stream and returns \a
stream.
@ -2735,8 +2747,12 @@ QTextStream &dec(QTextStream &stream)
}
/*!
\fn QTextStream &QTextStreamFunctions::hex(QTextStream &stream)
\relates QTextStream
\obsolete Use Qt::hex() instead.
*/
/*!
Calls QTextStream::setIntegerBase(16) on \a stream and returns \a
stream.
@ -2750,8 +2766,12 @@ QTextStream &hex(QTextStream &stream)
}
/*!
\fn QTextStream &QTextStreamFunctions::showbase(QTextStream &stream)
\relates QTextStream
\obsolete Use Qt::showbase() instead.
*/
/*!
Calls QTextStream::setNumberFlags(QTextStream::numberFlags() |
QTextStream::ShowBase) on \a stream and returns \a stream.
@ -2764,8 +2784,12 @@ QTextStream &showbase(QTextStream &stream)
}
/*!
\fn QTextStream &QTextStreamFunctions::forcesign(QTextStream &stream)
\relates QTextStream
\obsolete Use Qt::forcesign() instead.
*/
/*!
Calls QTextStream::setNumberFlags(QTextStream::numberFlags() |
QTextStream::ForceSign) on \a stream and returns \a stream.
@ -2778,8 +2802,12 @@ QTextStream &forcesign(QTextStream &stream)
}
/*!
\fn QTextStream &QTextStreamFunctions::forcepoint(QTextStream &stream)
\relates QTextStream
\obsolete Use Qt::forcepoint() instead.
*/
/*!
Calls QTextStream::setNumberFlags(QTextStream::numberFlags() |
QTextStream::ForcePoint) on \a stream and returns \a stream.
@ -2792,8 +2820,12 @@ QTextStream &forcepoint(QTextStream &stream)
}
/*!
\fn QTextStream &QTextStreamFunctions::noshowbase(QTextStream &stream)
\relates QTextStream
\obsolete Use Qt::noshowbase() instead.
*/
/*!
Calls QTextStream::setNumberFlags(QTextStream::numberFlags() &
~QTextStream::ShowBase) on \a stream and returns \a stream.
@ -2806,8 +2838,12 @@ QTextStream &noshowbase(QTextStream &stream)
}
/*!
\fn QTextStream &QTextStreamFunctions::noforcesign(QTextStream &stream)
\relates QTextStream
\obsolete Use Qt::noforcesign() instead.
*/
/*!
Calls QTextStream::setNumberFlags(QTextStream::numberFlags() &
~QTextStream::ForceSign) on \a stream and returns \a stream.
@ -2820,8 +2856,12 @@ QTextStream &noforcesign(QTextStream &stream)
}
/*!
\fn QTextStream &QTextStreamFunctions::noforcepoint(QTextStream &stream)
\relates QTextStream
\obsolete Use Qt::noforcepoint() instead.
*/
/*!
Calls QTextStream::setNumberFlags(QTextStream::numberFlags() &
~QTextStream::ForcePoint) on \a stream and returns \a stream.
@ -2834,8 +2874,12 @@ QTextStream &noforcepoint(QTextStream &stream)
}
/*!
\fn QTextStream &QTextStreamFunctions::uppercasebase(QTextStream &stream)
\relates QTextStream
\obsolete Use Qt::uppercasebase() instead.
*/
/*!
Calls QTextStream::setNumberFlags(QTextStream::numberFlags() |
QTextStream::UppercaseBase) on \a stream and returns \a stream.
@ -2848,8 +2892,12 @@ QTextStream &uppercasebase(QTextStream &stream)
}
/*!
\fn QTextStream &QTextStreamFunctions::uppercasedigits(QTextStream &stream)
\relates QTextStream
\obsolete Use Qt::uppercasedigits() instead.
*/
/*!
Calls QTextStream::setNumberFlags(QTextStream::numberFlags() |
QTextStream::UppercaseDigits) on \a stream and returns \a stream.
@ -2862,8 +2910,12 @@ QTextStream &uppercasedigits(QTextStream &stream)
}
/*!
\fn QTextStream &QTextStreamFunctions::lowercasebase(QTextStream &stream)
\relates QTextStream
\obsolete Use Qt::lowercasebase() instead.
*/
/*!
Calls QTextStream::setNumberFlags(QTextStream::numberFlags() &
~QTextStream::UppercaseBase) on \a stream and returns \a stream.
@ -2876,8 +2928,12 @@ QTextStream &lowercasebase(QTextStream &stream)
}
/*!
\fn QTextStream &QTextStreamFunctions::lowercasedigits(QTextStream &stream)
\relates QTextStream
\obsolete Use Qt::lowercasedigits() instead.
*/
/*!
Calls QTextStream::setNumberFlags(QTextStream::numberFlags() &
~QTextStream::UppercaseDigits) on \a stream and returns \a stream.
@ -2890,8 +2946,12 @@ QTextStream &lowercasedigits(QTextStream &stream)
}
/*!
\fn QTextStream &QTextStreamFunctions::fixed(QTextStream &stream)
\relates QTextStream
\obsolete Use Qt::fixed() instead.
*/
/*!
Calls QTextStream::setRealNumberNotation(QTextStream::FixedNotation)
on \a stream and returns \a stream.
@ -2904,8 +2964,12 @@ QTextStream &fixed(QTextStream &stream)
}
/*!
\fn QTextStream &QTextStreamFunctions::scientific(QTextStream &stream)
\relates QTextStream
\obsolete Use Qt::scientific() instead.
*/
/*!
Calls QTextStream::setRealNumberNotation(QTextStream::ScientificNotation)
on \a stream and returns \a stream.
@ -2918,8 +2982,12 @@ QTextStream &scientific(QTextStream &stream)
}
/*!
\fn QTextStream &QTextStreamFunctions::left(QTextStream &stream)
\relates QTextStream
\obsolete Use Qt::left() instead.
*/
/*!
Calls QTextStream::setFieldAlignment(QTextStream::AlignLeft)
on \a stream and returns \a stream.
@ -2932,8 +3000,12 @@ QTextStream &left(QTextStream &stream)
}
/*!
\fn QTextStream &QTextStreamFunctions::right(QTextStream &stream)
\relates QTextStream
\obsolete Use Qt::right() instead.
*/
/*!
Calls QTextStream::setFieldAlignment(QTextStream::AlignRight)
on \a stream and returns \a stream.
@ -2946,8 +3018,12 @@ QTextStream &right(QTextStream &stream)
}
/*!
\fn QTextStream &QTextStreamFunctions::center(QTextStream &stream)
\relates QTextStream
\obsolete Use Qt::center() instead.
*/
/*!
Calls QTextStream::setFieldAlignment(QTextStream::AlignCenter)
on \a stream and returns \a stream.
@ -2960,8 +3036,12 @@ QTextStream &center(QTextStream &stream)
}
/*!
\fn QTextStream &QTextStreamFunctions::endl(QTextStream &stream)
\relates QTextStream
\obsolete Use Qt::endl() instead.
*/
/*!
Writes '\\n' to the \a stream and flushes the stream.
Equivalent to
@ -2979,8 +3059,12 @@ QTextStream &endl(QTextStream &stream)
}
/*!
\fn QTextStream &QTextStreamFunctions::flush(QTextStream &stream)
\relates QTextStream
\obsolete Use Qt::flush() instead.
*/
/*!
Calls QTextStream::flush() on \a stream and returns \a stream.
\sa endl(), reset(), {QTextStream manipulators}
@ -2992,8 +3076,12 @@ QTextStream &flush(QTextStream &stream)
}
/*!
\fn QTextStream &QTextStreamFunctions::reset(QTextStream &stream)
\relates QTextStream
\obsolete Use Qt::reset() instead.
*/
/*!
Calls QTextStream::reset() on \a stream and returns \a stream.
\sa flush(), {QTextStream manipulators}
@ -3005,8 +3093,12 @@ QTextStream &reset(QTextStream &stream)
}
/*!
\fn QTextStream &QTextStreamFunctions::ws(QTextStream &stream)
\relates QTextStream
\obsolete Use Qt::ws() instead.
*/
/*!
Calls \l {QTextStream::}{skipWhiteSpace()} on \a stream and returns \a stream.
\sa {QTextStream manipulators}
@ -3044,8 +3136,12 @@ QTextStream &ws(QTextStream &stream)
namespace Qt {
/*!
\fn QTextStream &QTextStreamFunctions::bom(QTextStream &stream)
\relates QTextStream
\obsolete Use Qt::bom() instead.
*/
/*!
Toggles insertion of the Byte Order Mark on \a stream when QTextStream is
used with a UTF codec.

View File

@ -268,7 +268,7 @@ Q_CORE_EXPORT QTextStream &ws(QTextStream &s);
} // namespace Qt
#if QT_DEPRECATED_SINCE(5, 15) && !defined(Q_QDOC)
#if QT_DEPRECATED_SINCE(5, 15)
// This namespace only exists for 'using namespace' declarations.
namespace QTextStreamFunctions {
Q_CORE_EXPORT QT_DEPRECATED_X("Use Qt::bin") QTextStream &bin(QTextStream &s);
@ -303,7 +303,7 @@ QT_WARNING_DISABLE_CLANG("-Wheader-hygiene")
// conflicting definitions compiler errors.
using namespace QTextStreamFunctions;
QT_WARNING_POP
#endif // QT_DEPRECATED_SINCE(5, 15) && !defined(Q_QDOC)
#endif // QT_DEPRECATED_SINCE(5, 15)
inline QTextStreamManipulator qSetFieldWidth(int width)
{

View File

@ -56,10 +56,9 @@
QT_BEGIN_NAMESPACE
enum {
// Define as enum to force inlining. Don't expose MaxAllocSize in a public header.
MaxByteArraySize = MaxAllocSize - sizeof(std::remove_pointer<QByteArray::DataPointer>::type)
};
// -1 because of the terminating NUL
constexpr qsizetype MaxByteArraySize = MaxAllocSize - sizeof(std::remove_pointer<QByteArray::DataPointer>::type) - 1;
constexpr qsizetype MaxStringSize = (MaxAllocSize - sizeof(std::remove_pointer<QByteArray::DataPointer>::type)) / 2 - 1;
QT_END_NAMESPACE

View File

@ -57,7 +57,7 @@
#include <QVector>
#if QT_CONFIG(icu)
#include <unicode/ucol.h>
#elif defined(Q_OS_OSX)
#elif defined(Q_OS_MACOS)
#include <CoreServices/CoreServices.h>
#elif defined(Q_OS_WIN)
#include <qt_windows.h>
@ -70,7 +70,7 @@ typedef UCollator *CollatorType;
typedef QByteArray CollatorKeyType;
const CollatorType NoCollator = nullptr;
#elif defined(Q_OS_OSX)
#elif defined(Q_OS_MACOS)
typedef CollatorRef CollatorType;
typedef QVector<UCCollationValue> CollatorKeyType;
const CollatorType NoCollator = 0;

View File

@ -73,8 +73,8 @@ class Q_CORE_EXPORT QLocale
friend class QTextStreamPrivate;
public:
// GENERATED PART STARTS HERE
// see qlocale_data_p.h for more info on generated data
// GENERATED PART STARTS HERE
enum Language {
AnyLanguage = 0,
C = 1,

File diff suppressed because it is too large Load Diff

View File

@ -191,26 +191,26 @@ template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<2>::isLockFree()
template<> struct QAtomicOpsSupport<8> { enum { IsSupported = 1 }; };
# define Q_ATOMIC_INT64_IS_SUPPORTED
# if ATOMIC_LLONG_LOCK_FREE == 2
# define Q_ATOMIC_INT16_REFERENCE_COUNTING_IS_ALWAYS_NATIVE
# define Q_ATOMIC_INT16_TEST_AND_SET_IS_ALWAYS_NATIVE
# define Q_ATOMIC_INT16_FETCH_AND_STORE_IS_ALWAYS_NATIVE
# define Q_ATOMIC_INT16_FETCH_AND_ADD_IS_ALWAYS_NATIVE
# define Q_ATOMIC_INT64_REFERENCE_COUNTING_IS_ALWAYS_NATIVE
# define Q_ATOMIC_INT64_TEST_AND_SET_IS_ALWAYS_NATIVE
# define Q_ATOMIC_INT64_FETCH_AND_STORE_IS_ALWAYS_NATIVE
# define Q_ATOMIC_INT64_FETCH_AND_ADD_IS_ALWAYS_NATIVE
template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<8>::isLockFree()
{ return true; }
# elif ATOMIC_LLONG_LOCK_FREE == 1
# define Q_ATOMIC_INT16_REFERENCE_COUNTING_IS_SOMETIMES_NATIVE
# define Q_ATOMIC_INT16_TEST_AND_SET_IS_SOMETIMES_NATIVE
# define Q_ATOMIC_INT16_FETCH_AND_STORE_IS_SOMETIMES_NATIVE
# define Q_ATOMIC_INT16_FETCH_AND_ADD_IS_SOMETIMES_NATIVE
# define Q_ATOMIC_INT64_REFERENCE_COUNTING_IS_SOMETIMES_NATIVE
# define Q_ATOMIC_INT64_TEST_AND_SET_IS_SOMETIMES_NATIVE
# define Q_ATOMIC_INT64_FETCH_AND_STORE_IS_SOMETIMES_NATIVE
# define Q_ATOMIC_INT64_FETCH_AND_ADD_IS_SOMETIMES_NATIVE
template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<8>::isLockFree()
{ return false; }
# else
# define Q_ATOMIC_INT16_REFERENCE_COUNTING_IS_NEVER_NATIVE
# define Q_ATOMIC_INT16_TEST_AND_SET_IS_NEVER_NATIVE
# define Q_ATOMIC_INT16_FETCH_AND_STORE_IS_NEVER_NATIVE
# define Q_ATOMIC_INT16_FETCH_AND_ADD_IS_NEVER_NATIVE
# define Q_ATOMIC_INT64_REFERENCE_COUNTING_IS_NEVER_NATIVE
# define Q_ATOMIC_INT64_TEST_AND_SET_IS_NEVER_NATIVE
# define Q_ATOMIC_INT64_FETCH_AND_STORE_IS_NEVER_NATIVE
# define Q_ATOMIC_INT64_FETCH_AND_ADD_IS_NEVER_NATIVE
template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<8>::isLockFree()
{ return false; }

View File

@ -67,7 +67,9 @@ QThreadData::QThreadData(int initialRefCount)
QThreadData::~QThreadData()
{
#if QT_CONFIG(thread)
Q_ASSERT(_ref.loadRelaxed() == 0);
#endif
// In the odd case that Qt is running on a secondary thread, the main
// thread instance will have been dereffed asunder because of the deref in

View File

@ -375,10 +375,11 @@ static int fromOffsetString(QStringView offsetString, bool *valid) noexcept
\reentrant
\brief The QDate class provides date functions.
A QDate object represents a particular date. This can be expressed as a
calendar date, i.e. year, month, and day numbers, in the proleptic Gregorian
calendar.
A QDate object represents a particular day, regardless of calendar,
locale or other settings used when creating it or supplied by the system.
It can report the year, month and day of the month that represent the
day with respect to the proleptic Gregorian calendar or any calendar supplied
as a QCalendar object.
A QDate object is typically created by giving the year, month, and day
numbers explicitly. Note that QDate interprets year numbers less than 100 as
@ -1676,9 +1677,8 @@ qint64 QDate::daysTo(QDate d) const
/*!
\fn bool QDate::operator==(QDate d) const
Returns \c true if this date is equal to \a d; otherwise returns
false.
Returns \c true if this date and \a d represent the same day, otherwise
\c false.
*/
/*!
@ -1686,6 +1686,8 @@ qint64 QDate::daysTo(QDate d) const
Returns \c true if this date is different from \a d; otherwise
returns \c false.
\sa operator==()
*/
/*!

View File

@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE
// GENERATED PART STARTS HERE
/*
This part of the file was generated on 2020-01-30 from the
This part of the file was generated on 2020-04-07 from the
Common Locale Data Repository v36
http://www.unicode.org/cldr/
@ -70,7 +70,7 @@ QT_BEGIN_NAMESPACE
*/
static const QCalendarLocale locale_data[] = {
// lang script terr sLng long sSrt shrt sNrw naro Sizes...
// lang script terr sLong long sShrt short sNarw narow Sizes...
{ 1, 0, 0, 0, 0, 106, 106, 184, 184,106,106, 78, 78, 26, 26 },// C/AnyScript/AnyCountry
{ 3, 7, 69, 0, 0, 106, 106, 184, 184,106,106, 78, 78, 26, 26 },// Oromo/Latin/Ethiopia
{ 3, 7, 111, 0, 0, 106, 106, 184, 184,106,106, 78, 78, 26, 26 },// Oromo/Latin/Kenya

View File

@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE
// GENERATED PART STARTS HERE
/*
This part of the file was generated on 2020-01-30 from the
This part of the file was generated on 2020-04-07 from the
Common Locale Data Repository v36
http://www.unicode.org/cldr/
@ -70,7 +70,7 @@ QT_BEGIN_NAMESPACE
*/
static const QCalendarLocale locale_data[] = {
// lang script terr sLng long sSrt shrt sNrw naro Sizes...
// lang script terr sLong long sShrt short sNarw narow Sizes...
{ 1, 0, 0, 0, 0, 83, 83, 130, 153, 83, 83, 47, 47, 23, 26 },// C/AnyScript/AnyCountry
{ 3, 7, 69, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Oromo/Latin/Ethiopia
{ 3, 7, 111, 0, 0, 0, 0, 153, 153, 83, 83, 83, 83, 26, 26 },// Oromo/Latin/Kenya

View File

@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE
// GENERATED PART STARTS HERE
/*
This part of the file was generated on 2020-01-30 from the
This part of the file was generated on 2020-04-07 from the
Common Locale Data Repository v36
http://www.unicode.org/cldr/
@ -70,7 +70,7 @@ QT_BEGIN_NAMESPACE
*/
static const QCalendarLocale locale_data[] = {
// lang script terr sLng long sSrt shrt sNrw naro Sizes...
// lang script terr sLong long sShrt short sNarw narow Sizes...
{ 1, 0, 0, 0, 0, 85, 85, 132, 155, 85, 85, 47, 47, 23, 26 },// C/AnyScript/AnyCountry
{ 3, 7, 69, 181, 181, 291, 291, 132, 132,110,110, 47, 47, 23, 23 },// Oromo/Latin/Ethiopia
{ 3, 7, 111, 181, 181, 291, 291, 338, 132,110,110, 47, 47, 23, 23 },// Oromo/Latin/Kenya

View File

@ -102,7 +102,7 @@ void QAndroidTimeZonePrivate::init(const QByteArray &ianaId)
for (int style = 1; m_id.isEmpty() && style-- > 0;) {
for (int dst = 1; m_id.isEmpty() && dst-- > 0;) {
m_id = match(androidTimeZone.callObjectMethod(
"getDisplayName", "(ZI;)Ljava/lang/String;", bool(dst), style));
"getDisplayName", "(ZI)Ljava/lang/String;", bool(dst), style));
}
}
}

View File

@ -115,8 +115,8 @@ struct QUtcData {
// GENERATED PART STARTS HERE
/*
This part of the file was generated on 2019-10-24 from the
Common Locale Data Repository v36 supplemental/windowsZones.xml file $Revision$
This part of the file was generated on 2020-02-28 from the
Common Locale Data Repository v36 file supplemental/windowsZones.xml
http://www.unicode.org/cldr/

View File

@ -290,6 +290,16 @@ Q_DECL_CONSTEXPR inline bool operator==(const QTzTransitionRule &lhs, const QTzT
Q_DECL_CONSTEXPR inline bool operator!=(const QTzTransitionRule &lhs, const QTzTransitionRule &rhs) noexcept
{ return !operator==(lhs, rhs); }
// These are stored separately from QTzTimeZonePrivate so that they can be
// cached, avoiding the need to re-parse them from disk constantly.
struct QTzTimeZoneCacheEntry
{
QVector<QTzTransitionTime> m_tranTimes;
QVector<QTzTransitionRule> m_tranRules;
QList<QByteArray> m_abbreviations;
QByteArray m_posixRule;
};
class Q_AUTOTEST_EXPORT QTzTimeZonePrivate final : public QTimeZonePrivate
{
QTzTimeZonePrivate(const QTzTimeZonePrivate &) = default;
@ -337,13 +347,11 @@ private:
QVector<QTimeZonePrivate::Data> getPosixTransitions(qint64 msNear) const;
Data dataForTzTransition(QTzTransitionTime tran) const;
QVector<QTzTransitionTime> m_tranTimes;
QVector<QTzTransitionRule> m_tranRules;
QList<QByteArray> m_abbreviations;
#if QT_CONFIG(icu)
mutable QSharedDataPointer<QTimeZonePrivate> m_icu;
#endif
QByteArray m_posixRule;
QTzTimeZoneCacheEntry cached_data;
QVector<QTzTransitionTime> tranCache() const { return cached_data.m_tranTimes; }
};
#endif // Q_OS_UNIX

View File

@ -1,5 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2019 Crimson AS <info@crimson.no>
** Copyright (C) 2013 John Layt <jlayt@kde.org>
** Contact: https://www.qt.io/licensing/
**
@ -42,6 +43,7 @@
#include "private/qlocale_tools_p.h"
#include <QtCore/QFile>
#include <QtCore/QMutex>
#include <QtCore/QHash>
#include <QtCore/QDataStream>
#include <QtCore/QDateTime>
@ -637,7 +639,7 @@ QTzTimeZonePrivate::QTzTimeZonePrivate()
// Create a named time zone
QTzTimeZonePrivate::QTzTimeZonePrivate(const QByteArray &ianaId)
{
init(ianaId);
init(ianaId.isEmpty() ? systemTimeZoneId() : ianaId);
}
QTzTimeZonePrivate::~QTzTimeZonePrivate()
@ -649,14 +651,26 @@ QTzTimeZonePrivate *QTzTimeZonePrivate::clone() const
return new QTzTimeZonePrivate(*this);
}
void QTzTimeZonePrivate::init(const QByteArray &ianaId)
class QTzTimeZoneCache
{
public:
QTzTimeZoneCacheEntry fetchEntry(const QByteArray &ianaId);
private:
QTzTimeZoneCacheEntry findEntry(const QByteArray &ianaId);
QHash<QByteArray, QTzTimeZoneCacheEntry> m_cache;
QMutex m_mutex;
};
QTzTimeZoneCacheEntry QTzTimeZoneCache::findEntry(const QByteArray &ianaId)
{
QTzTimeZoneCacheEntry ret;
QFile tzif;
if (ianaId.isEmpty()) {
// Open system tz
tzif.setFileName(QStringLiteral("/etc/localtime"));
if (!tzif.open(QIODevice::ReadOnly))
return;
return ret;
} else {
// Open named tz, try modern path first, if fails try legacy path
tzif.setFileName(QLatin1String("/usr/share/zoneinfo/") + QString::fromLocal8Bit(ianaId));
@ -669,9 +683,9 @@ void QTzTimeZonePrivate::init(const QByteArray &ianaId)
if (PosixZone::parse(begin, zoneInfo.constEnd()).hasValidOffset()
&& (begin == zoneInfo.constEnd()
|| PosixZone::parse(begin, zoneInfo.constEnd()).hasValidOffset())) {
m_id = m_posixRule = ianaId;
ret.m_posixRule = ianaId;
}
return;
return ret;
}
}
}
@ -682,59 +696,59 @@ void QTzTimeZonePrivate::init(const QByteArray &ianaId)
bool ok = false;
QTzHeader hdr = parseTzHeader(ds, &ok);
if (!ok || ds.status() != QDataStream::Ok)
return;
return ret;
QVector<QTzTransition> tranList = parseTzTransitions(ds, hdr.tzh_timecnt, false);
if (ds.status() != QDataStream::Ok)
return;
return ret;
QVector<QTzType> typeList = parseTzTypes(ds, hdr.tzh_typecnt);
if (ds.status() != QDataStream::Ok)
return;
return ret;
QMap<int, QByteArray> abbrevMap = parseTzAbbreviations(ds, hdr.tzh_charcnt, typeList);
if (ds.status() != QDataStream::Ok)
return;
return ret;
parseTzLeapSeconds(ds, hdr.tzh_leapcnt, false);
if (ds.status() != QDataStream::Ok)
return;
return ret;
typeList = parseTzIndicators(ds, typeList, hdr.tzh_ttisstdcnt, hdr.tzh_ttisgmtcnt);
if (ds.status() != QDataStream::Ok)
return;
return ret;
// If version 2 then parse the second block of data
if (hdr.tzh_version == '2' || hdr.tzh_version == '3') {
ok = false;
QTzHeader hdr2 = parseTzHeader(ds, &ok);
if (!ok || ds.status() != QDataStream::Ok)
return;
return ret;
tranList = parseTzTransitions(ds, hdr2.tzh_timecnt, true);
if (ds.status() != QDataStream::Ok)
return;
return ret;
typeList = parseTzTypes(ds, hdr2.tzh_typecnt);
if (ds.status() != QDataStream::Ok)
return;
return ret;
abbrevMap = parseTzAbbreviations(ds, hdr2.tzh_charcnt, typeList);
if (ds.status() != QDataStream::Ok)
return;
return ret;
parseTzLeapSeconds(ds, hdr2.tzh_leapcnt, true);
if (ds.status() != QDataStream::Ok)
return;
return ret;
typeList = parseTzIndicators(ds, typeList, hdr2.tzh_ttisstdcnt, hdr2.tzh_ttisgmtcnt);
if (ds.status() != QDataStream::Ok)
return;
m_posixRule = parseTzPosixRule(ds);
return ret;
ret.m_posixRule = parseTzPosixRule(ds);
if (ds.status() != QDataStream::Ok)
return;
return ret;
}
// Translate the TZ file into internal format
// Translate the array index based tz_abbrind into list index
const int size = abbrevMap.size();
m_abbreviations.clear();
m_abbreviations.reserve(size);
ret.m_abbreviations.clear();
ret.m_abbreviations.reserve(size);
QVector<int> abbrindList;
abbrindList.reserve(size);
for (auto it = abbrevMap.cbegin(), end = abbrevMap.cend(); it != end; ++it) {
m_abbreviations.append(it.value());
ret.m_abbreviations.append(it.value());
abbrindList.append(it.key());
}
for (int i = 0; i < typeList.size(); ++i)
@ -752,7 +766,7 @@ void QTzTimeZonePrivate::init(const QByteArray &ianaId)
// Now for each transition time calculate and store our rule:
const int tranCount = tranList.count();;
m_tranTimes.reserve(tranCount);
ret.m_tranTimes.reserve(tranCount);
// The DST offset when in effect: usually stable, usually an hour:
int lastDstOff = 3600;
for (int i = 0; i < tranCount; i++) {
@ -806,24 +820,48 @@ void QTzTimeZonePrivate::init(const QByteArray &ianaId)
rule.abbreviationIndex = tz_type.tz_abbrind;
// If the rule already exist then use that, otherwise add it
int ruleIndex = m_tranRules.indexOf(rule);
int ruleIndex = ret.m_tranRules.indexOf(rule);
if (ruleIndex == -1) {
m_tranRules.append(rule);
tran.ruleIndex = m_tranRules.size() - 1;
ret.m_tranRules.append(rule);
tran.ruleIndex = ret.m_tranRules.size() - 1;
} else {
tran.ruleIndex = ruleIndex;
}
tran.atMSecsSinceEpoch = tz_tran.tz_time * 1000;
m_tranTimes.append(tran);
ret.m_tranTimes.append(tran);
}
if (m_tranTimes.isEmpty() && m_posixRule.isEmpty())
return ret;
}
QTzTimeZoneCacheEntry QTzTimeZoneCache::fetchEntry(const QByteArray &ianaId)
{
QMutexLocker locker(&m_mutex);
// search the cache...
const auto& it = m_cache.find(ianaId);
if (it != m_cache.constEnd())
return *it;
// ... or build a new entry from scratch
QTzTimeZoneCacheEntry ret = findEntry(ianaId);
m_cache[ianaId] = ret;
return ret;
}
void QTzTimeZonePrivate::init(const QByteArray &ianaId)
{
// System ID defaults to UTC, so is never empty; and our callers default to
// the system ID if what they're given is empty.
Q_ASSERT(!ianaId.isEmpty());
static QTzTimeZoneCache tzCache;
const auto &entry = tzCache.fetchEntry(ianaId);
if (entry.m_tranTimes.isEmpty() && entry.m_posixRule.isEmpty())
return; // Invalid after all !
if (ianaId.isEmpty())
m_id = systemTimeZoneId();
else
m_id = ianaId;
cached_data = std::move(entry);
m_id = ianaId;
}
QLocale::Country QTzTimeZonePrivate::country() const
@ -903,12 +941,12 @@ QString QTzTimeZonePrivate::displayName(QTimeZone::TimeType timeType,
}
// Otherwise is strange sequence, so work backwards through trans looking for first match, if any
auto it = std::partition_point(m_tranTimes.cbegin(), m_tranTimes.cend(),
auto it = std::partition_point(tranCache().cbegin(), tranCache().cend(),
[currentMSecs](const QTzTransitionTime &at) {
return at.atMSecsSinceEpoch <= currentMSecs;
});
while (it != m_tranTimes.cbegin()) {
while (it != tranCache().cbegin()) {
--it;
tran = dataForTzTransition(*it);
int offset = tran.daylightTimeOffset;
@ -944,7 +982,7 @@ int QTzTimeZonePrivate::daylightTimeOffset(qint64 atMSecsSinceEpoch) const
bool QTzTimeZonePrivate::hasDaylightTime() const
{
// TODO Perhaps cache as frequently accessed?
for (const QTzTransitionRule &rule : m_tranRules) {
for (const QTzTransitionRule &rule : cached_data.m_tranRules) {
if (rule.dstOffset != 0)
return true;
}
@ -960,11 +998,11 @@ QTimeZonePrivate::Data QTzTimeZonePrivate::dataForTzTransition(QTzTransitionTime
{
QTimeZonePrivate::Data data;
data.atMSecsSinceEpoch = tran.atMSecsSinceEpoch;
QTzTransitionRule rule = m_tranRules.at(tran.ruleIndex);
QTzTransitionRule rule = cached_data.m_tranRules.at(tran.ruleIndex);
data.standardTimeOffset = rule.stdOffset;
data.daylightTimeOffset = rule.dstOffset;
data.offsetFromUtc = rule.stdOffset + rule.dstOffset;
data.abbreviation = QString::fromUtf8(m_abbreviations.at(rule.abbreviationIndex));
data.abbreviation = QString::fromUtf8(cached_data.m_abbreviations.at(rule.abbreviationIndex));
return data;
}
@ -972,37 +1010,37 @@ QVector<QTimeZonePrivate::Data> QTzTimeZonePrivate::getPosixTransitions(qint64 m
{
const int year = QDateTime::fromMSecsSinceEpoch(msNear, Qt::UTC).date().year();
// The Data::atMSecsSinceEpoch of the single entry if zone is constant:
qint64 atTime = m_tranTimes.isEmpty() ? msNear : m_tranTimes.last().atMSecsSinceEpoch;
return calculatePosixTransitions(m_posixRule, year - 1, year + 1, atTime);
qint64 atTime = tranCache().isEmpty() ? msNear : tranCache().last().atMSecsSinceEpoch;
return calculatePosixTransitions(cached_data.m_posixRule, year - 1, year + 1, atTime);
}
QTimeZonePrivate::Data QTzTimeZonePrivate::data(qint64 forMSecsSinceEpoch) const
{
// If the required time is after the last transition (or there were none)
// and we have a POSIX rule, then use it:
if (!m_posixRule.isEmpty()
&& (m_tranTimes.isEmpty() || m_tranTimes.last().atMSecsSinceEpoch < forMSecsSinceEpoch)) {
if (!cached_data.m_posixRule.isEmpty()
&& (tranCache().isEmpty() || tranCache().last().atMSecsSinceEpoch < forMSecsSinceEpoch)) {
QVector<QTimeZonePrivate::Data> posixTrans = getPosixTransitions(forMSecsSinceEpoch);
auto it = std::partition_point(posixTrans.cbegin(), posixTrans.cend(),
[forMSecsSinceEpoch] (const QTimeZonePrivate::Data &at) {
return at.atMSecsSinceEpoch <= forMSecsSinceEpoch;
});
// Use most recent, if any in the past; or the first if we have no other rules:
if (it > posixTrans.cbegin() || (m_tranTimes.isEmpty() && it < posixTrans.cend())) {
if (it > posixTrans.cbegin() || (tranCache().isEmpty() && it < posixTrans.cend())) {
QTimeZonePrivate::Data data = *(it > posixTrans.cbegin() ? it - 1 : it);
data.atMSecsSinceEpoch = forMSecsSinceEpoch;
return data;
}
}
if (m_tranTimes.isEmpty()) // Only possible if !isValid()
if (tranCache().isEmpty()) // Only possible if !isValid()
return invalidData();
// Otherwise, use the rule for the most recent or first transition:
auto last = std::partition_point(m_tranTimes.cbegin(), m_tranTimes.cend(),
auto last = std::partition_point(tranCache().cbegin(), tranCache().cend(),
[forMSecsSinceEpoch] (const QTzTransitionTime &at) {
return at.atMSecsSinceEpoch <= forMSecsSinceEpoch;
});
if (last > m_tranTimes.cbegin())
if (last > tranCache().cbegin())
--last;
Data data = dataForTzTransition(*last);
data.atMSecsSinceEpoch = forMSecsSinceEpoch;
@ -1018,8 +1056,8 @@ QTimeZonePrivate::Data QTzTimeZonePrivate::nextTransition(qint64 afterMSecsSince
{
// If the required time is after the last transition (or there were none)
// and we have a POSIX rule, then use it:
if (!m_posixRule.isEmpty()
&& (m_tranTimes.isEmpty() || m_tranTimes.last().atMSecsSinceEpoch < afterMSecsSinceEpoch)) {
if (!cached_data.m_posixRule.isEmpty()
&& (tranCache().isEmpty() || tranCache().last().atMSecsSinceEpoch < afterMSecsSinceEpoch)) {
QVector<QTimeZonePrivate::Data> posixTrans = getPosixTransitions(afterMSecsSinceEpoch);
auto it = std::partition_point(posixTrans.cbegin(), posixTrans.cend(),
[afterMSecsSinceEpoch] (const QTimeZonePrivate::Data &at) {
@ -1030,19 +1068,19 @@ QTimeZonePrivate::Data QTzTimeZonePrivate::nextTransition(qint64 afterMSecsSince
}
// Otherwise, if we can find a valid tran, use its rule:
auto last = std::partition_point(m_tranTimes.cbegin(), m_tranTimes.cend(),
auto last = std::partition_point(tranCache().cbegin(), tranCache().cend(),
[afterMSecsSinceEpoch] (const QTzTransitionTime &at) {
return at.atMSecsSinceEpoch <= afterMSecsSinceEpoch;
});
return last != m_tranTimes.cend() ? dataForTzTransition(*last) : invalidData();
return last != tranCache().cend() ? dataForTzTransition(*last) : invalidData();
}
QTimeZonePrivate::Data QTzTimeZonePrivate::previousTransition(qint64 beforeMSecsSinceEpoch) const
{
// If the required time is after the last transition (or there were none)
// and we have a POSIX rule, then use it:
if (!m_posixRule.isEmpty()
&& (m_tranTimes.isEmpty() || m_tranTimes.last().atMSecsSinceEpoch < beforeMSecsSinceEpoch)) {
if (!cached_data.m_posixRule.isEmpty()
&& (tranCache().isEmpty() || tranCache().last().atMSecsSinceEpoch < beforeMSecsSinceEpoch)) {
QVector<QTimeZonePrivate::Data> posixTrans = getPosixTransitions(beforeMSecsSinceEpoch);
auto it = std::partition_point(posixTrans.cbegin(), posixTrans.cend(),
[beforeMSecsSinceEpoch] (const QTimeZonePrivate::Data &at) {
@ -1051,15 +1089,15 @@ QTimeZonePrivate::Data QTzTimeZonePrivate::previousTransition(qint64 beforeMSecs
if (it > posixTrans.cbegin())
return *--it;
// It fell between the last transition (if any) and the first of the POSIX rule:
return m_tranTimes.isEmpty() ? invalidData() : dataForTzTransition(m_tranTimes.last());
return tranCache().isEmpty() ? invalidData() : dataForTzTransition(tranCache().last());
}
// Otherwise if we can find a valid tran then use its rule
auto last = std::partition_point(m_tranTimes.cbegin(), m_tranTimes.cend(),
auto last = std::partition_point(tranCache().cbegin(), tranCache().cend(),
[beforeMSecsSinceEpoch] (const QTzTransitionTime &at) {
return at.atMSecsSinceEpoch < beforeMSecsSinceEpoch;
});
return last > m_tranTimes.cbegin() ? dataForTzTransition(*--last) : invalidData();
return last > tranCache().cbegin() ? dataForTzTransition(*--last) : invalidData();
}
static long getSymloopMax()
@ -1088,15 +1126,15 @@ QByteArray QTzTimeZonePrivate::systemTimeZoneId() const
{
// Check TZ env var first, if not populated try find it
QByteArray ianaId = qgetenv("TZ");
if (!ianaId.isEmpty() && ianaId.at(0) == ':')
ianaId = ianaId.mid(1);
// The TZ value can be ":/etc/localtime" which libc considers
// to be a "default timezone", in which case it will be read
// by one of the blocks below, so unset it here so it is not
// considered as a valid/found ianaId
if (ianaId == "/etc/localtime")
if (ianaId == ":/etc/localtime")
ianaId.clear();
else if (ianaId.startsWith(':'))
ianaId = ianaId.mid(1);
// On most distros /etc/localtime is a symlink to a real file so extract name from the path
if (ianaId.isEmpty()) {
@ -1115,36 +1153,6 @@ QByteArray QTzTimeZonePrivate::systemTimeZoneId() const
}
}
// On Debian Etch up to Jessie, /etc/localtime is a regular file while the actual name is in /etc/timezone
if (ianaId.isEmpty()) {
QFile tzif(QStringLiteral("/etc/timezone"));
if (tzif.open(QIODevice::ReadOnly)) {
// TODO QTextStream inefficient, replace later
QTextStream ts(&tzif);
if (!ts.atEnd())
ianaId = ts.readLine().toUtf8();
}
}
// On some Red Hat distros /etc/localtime is real file with name held in /etc/sysconfig/clock
// in a line like ZONE="Europe/Oslo" or TIMEZONE="Europe/Oslo"
if (ianaId.isEmpty()) {
QFile tzif(QStringLiteral("/etc/sysconfig/clock"));
if (tzif.open(QIODevice::ReadOnly)) {
// TODO QTextStream inefficient, replace later
QTextStream ts(&tzif);
QString line;
while (ianaId.isEmpty() && !ts.atEnd() && ts.status() == QTextStream::Ok) {
line = ts.readLine();
if (line.startsWith(QLatin1String("ZONE="))) {
ianaId = line.midRef(6, line.size() - 7).toUtf8();
} else if (line.startsWith(QLatin1String("TIMEZONE="))) {
ianaId = line.midRef(10, line.size() - 11).toUtf8();
}
}
}
}
// Some systems (e.g. uClibc) have a default value for $TZ in /etc/TZ:
if (ianaId.isEmpty()) {
QFile zone(QStringLiteral("/etc/TZ"));

View File

@ -1483,7 +1483,7 @@ uint qHash(long double key, uint seed) noexcept
/*! \fn template <class Key, class T> QList<Key> QHash<Key, T>::uniqueKeys() const
\since 4.2
\obsolete
\obsolete Use QMultiHash for storing multiple values with the same key.
Returns a list containing all the keys in the map. Keys that occur multiple
times in the map (because items were inserted with insertMulti(), or
@ -1529,8 +1529,8 @@ uint qHash(long double key, uint seed) noexcept
*/
/*! \fn template <class Key, class T> QList<T> QHash<Key, T>::values(const Key &key) const
\obsolete
\overload
\obsolete Use QMultiHash for storing multiple values with the same key.
Returns a list of all the values associated with the \a key,
from the most recently inserted to the least recently inserted.
@ -2095,6 +2095,7 @@ uint qHash(long double key, uint seed) noexcept
/*!
\fn template <class Key, class T> QHash<Key, T>::iterator &QHash<Key, T>::iterator::operator--()
\obsolete This operator is deprecated in order to align with std::unordered_map functionality.
The prefix -- operator (\c{--i}) makes the preceding item
current and returns an iterator pointing to the new current item.
@ -2107,6 +2108,7 @@ uint qHash(long double key, uint seed) noexcept
/*!
\fn template <class Key, class T> QHash<Key, T>::iterator QHash<Key, T>::iterator::operator--(int)
\obsolete This operator is deprecated in order to align with std::unordered_map functionality.
\overload
@ -2116,6 +2118,7 @@ uint qHash(long double key, uint seed) noexcept
*/
/*! \fn template <class Key, class T> QHash<Key, T>::iterator QHash<Key, T>::iterator::operator+(int j) const
\obsolete This operator is deprecated in order to align with std::unordered_map functionality.
Returns an iterator to the item at \a j positions forward from
this iterator. (If \a j is negative, the iterator goes backward.)
@ -2127,6 +2130,7 @@ uint qHash(long double key, uint seed) noexcept
*/
/*! \fn template <class Key, class T> QHash<Key, T>::iterator QHash<Key, T>::iterator::operator-(int j) const
\obsolete This operator is deprecated in order to align with std::unordered_map functionality.
Returns an iterator to the item at \a j positions backward from
this iterator. (If \a j is negative, the iterator goes forward.)
@ -2137,6 +2141,7 @@ uint qHash(long double key, uint seed) noexcept
*/
/*! \fn template <class Key, class T> QHash<Key, T>::iterator &QHash<Key, T>::iterator::operator+=(int j)
\obsolete This operator is deprecated in order to align with std::unordered_map functionality.
Advances the iterator by \a j items. (If \a j is negative, the
iterator goes backward.)
@ -2145,6 +2150,7 @@ uint qHash(long double key, uint seed) noexcept
*/
/*! \fn template <class Key, class T> QHash<Key, T>::iterator &QHash<Key, T>::iterator::operator-=(int j)
\obsolete This operator is deprecated in order to align with std::unordered_map functionality.
Makes the iterator go back by \a j items. (If \a j is negative,
the iterator goes forward.)
@ -2288,6 +2294,7 @@ uint qHash(long double key, uint seed) noexcept
*/
/*! \fn template <class Key, class T> QHash<Key, T>::const_iterator &QHash<Key, T>::const_iterator::operator--()
\obsolete This operator is deprecated in order to align with std::unordered_map functionality.
The prefix -- operator (\c{--i}) makes the preceding item
current and returns an iterator pointing to the new current item.
@ -2299,6 +2306,7 @@ uint qHash(long double key, uint seed) noexcept
*/
/*! \fn template <class Key, class T> QHash<Key, T>::const_iterator QHash<Key, T>::const_iterator::operator--(int)
\obsolete This operator is deprecated in order to align with std::unordered_map functionality.
\overload
@ -2308,6 +2316,7 @@ uint qHash(long double key, uint seed) noexcept
*/
/*! \fn template <class Key, class T> QHash<Key, T>::const_iterator QHash<Key, T>::const_iterator::operator+(int j) const
\obsolete This operator is deprecated in order to align with std::unordered_map functionality.
Returns an iterator to the item at \a j positions forward from
this iterator. (If \a j is negative, the iterator goes backward.)
@ -2318,6 +2327,7 @@ uint qHash(long double key, uint seed) noexcept
*/
/*! \fn template <class Key, class T> QHash<Key, T>::const_iterator QHash<Key, T>::const_iterator::operator-(int j) const
\obsolete This operator is deprecated in order to align with std::unordered_map functionality.
Returns an iterator to the item at \a j positions backward from
this iterator. (If \a j is negative, the iterator goes forward.)
@ -2328,6 +2338,7 @@ uint qHash(long double key, uint seed) noexcept
*/
/*! \fn template <class Key, class T> QHash<Key, T>::const_iterator &QHash<Key, T>::const_iterator::operator+=(int j)
\obsolete This operator is deprecated in order to align with std::unordered_map functionality.
Advances the iterator by \a j items. (If \a j is negative, the
iterator goes backward.)
@ -2338,6 +2349,7 @@ uint qHash(long double key, uint seed) noexcept
*/
/*! \fn template <class Key, class T> QHash<Key, T>::const_iterator &QHash<Key, T>::const_iterator::operator-=(int j)
\obsolete This operator is deprecated in order to align with std::unordered_map functionality.
Makes the iterator go back by \a j items. (If \a j is negative,
the iterator goes forward.)
@ -2432,6 +2444,7 @@ uint qHash(long double key, uint seed) noexcept
*/
/*! \fn template <class Key, class T> QHash<Key, T>::key_iterator &QHash<Key, T>::key_iterator::operator--()
\obsolete This operator is deprecated in order to align with std::unordered_map functionality.
The prefix -- operator (\c{--i}) makes the preceding item
current and returns an iterator pointing to the new current item.
@ -2443,6 +2456,7 @@ uint qHash(long double key, uint seed) noexcept
*/
/*! \fn template <class Key, class T> QHash<Key, T>::key_iterator QHash<Key, T>::key_iterator::operator--(int)
\obsolete This operator is deprecated in order to align with std::unordered_map functionality.
\overload

View File

@ -637,12 +637,9 @@
\sa hasNext(), next(), peekPrevious()
*/
/*! \fn template <class T> bool QListIterator<T>::hasPrevious() const
\fn template <class T> bool QVectorIterator<T>::hasPrevious() const
\fn template <class T> bool QSetIterator<T>::hasPrevious() const
\fn template <class T> bool QMutableListIterator<T>::hasPrevious() const
\fn template <class T> bool QMutableVectorIterator<T>::hasPrevious() const
/*!
\fn template <class T> bool QMutableSetIterator<T>::hasPrevious() const
\obsolete Deprecated in order to align with std::unordered_set functionality.
Returns \c true if there is at least one item behind the iterator,
i.e. the iterator is \e not at the front of the container;
@ -651,10 +648,35 @@
\sa hasNext(), previous()
*/
/*! \fn template <class T> bool QListIterator<T>::hasPrevious() const
\fn template <class T> bool QVectorIterator<T>::hasPrevious() const
\fn template <class T> bool QSetIterator<T>::hasPrevious() const
\fn template <class T> bool QMutableListIterator<T>::hasPrevious() const
\fn template <class T> bool QMutableVectorIterator<T>::hasPrevious() const
Returns \c true if there is at least one item behind the iterator,
i.e. the iterator is \e not at the front of the container;
otherwise returns \c false.
\sa hasNext(), previous()
*/
/*!
\fn template <class T> const T &QMutableSetIterator<T>::previous()
\obsolete Deprecated in order to align with std::unordered_set functionality.
Returns the previous item and moves the iterator back by one
position.
Calling this function on an iterator located at the front of the
container leads to undefined results.
\sa hasPrevious(), peekPrevious(), next()
*/
/*! \fn template <class T> const T &QListIterator<T>::previous()
\fn template <class T> const T &QVectorIterator<T>::previous()
\fn template <class T> const T &QSetIterator<T>::previous()
\fn template <class T> const T &QMutableSetIterator<T>::previous()
Returns the previous item and moves the iterator back by one
position.
@ -677,10 +699,21 @@
\sa hasPrevious(), peekPrevious(), next()
*/
/*!
\fn template <class T> const T &QMutableSetIterator<T>::peekPrevious() const
\obsolete Deprecated in order to align with std::unordered_set functionality.
Returns the previous item without moving the iterator.
Calling this function on an iterator located at the front of the
container leads to undefined results.
\sa hasPrevious(), previous(), peekNext()
*/
/*! \fn template <class T> const T &QListIterator<T>::peekPrevious() const
\fn template <class T> const T &QVectorIterator<T>::peekPrevious() const
\fn template <class T> const T &QSetIterator<T>::peekPrevious() const
\fn template <class T> const T &QMutableSetIterator<T>::peekPrevious() const
Returns the previous item without moving the iterator.
@ -701,12 +734,25 @@
\sa hasPrevious(), previous(), peekNext()
*/
/*!
\fn template <class T> bool QMutableSetIterator<T>::findNext(const T &value)
\obsolete Deprecated in order to align with std::unordered_set functionality.
Searches for \a value starting from the current iterator position
forward. Returns \c true if \a value is found; otherwise returns \c false.
After the call, if \a value was found, the iterator is positioned
just after the matching item; otherwise, the iterator is
positioned at the back of the container.
\sa findPrevious()
*/
/*! \fn template <class T> bool QListIterator<T>::findNext(const T &value)
\fn template <class T> bool QVectorIterator<T>::findNext(const T &value)
\fn template <class T> bool QSetIterator<T>::findNext(const T &value)
\fn template <class T> bool QMutableListIterator<T>::findNext(const T &value)
\fn template <class T> bool QMutableVectorIterator<T>::findNext(const T &value)
\fn template <class T> bool QMutableSetIterator<T>::findNext(const T &value)
Searches for \a value starting from the current iterator position
forward. Returns \c true if \a value is found; otherwise returns \c false.

View File

@ -374,7 +374,7 @@ QDataStream &operator>>(QDataStream &stream, QLine &line)
*/
/*!
\enum QLineF::IntersectType
\enum QLineF::IntersectionType
Describes the intersection between two lines.

View File

@ -740,7 +740,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
/*! \fn template <class Key, class T> QList<Key> QMap<Key, T>::uniqueKeys() const
\since 4.2
\obsolete
\obsolete Use QMultiMap for storing multiple values with the same key.
Returns a list containing all the keys in the map in ascending
order. Keys that occur multiple times in the map (because items
@ -802,9 +802,8 @@ void QMapDataBase::freeData(QMapDataBase *d)
*/
/*! \fn template <class Key, class T> QList<T> QMap<Key, T>::values(const Key &key) const
\obsolete
\overload
\obsolete Use QMultiMap for maps storing multiple values with the same key.
Returns a list containing all the values associated with key
\a key, from the most recently inserted to the least recently
@ -1162,7 +1161,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
*/
/*! \fn template <class Key, class T> QMap<Key, T>::iterator QMap<Key, T>::insertMulti(const Key &key, const T &value)
\obsolete
\obsolete Use QMultiMap for storing multiple values with the same key.
Inserts a new item with the key \a key and a value of \a value.
@ -1177,7 +1176,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
/*! \fn template <class Key, class T> QMap<Key, T>::iterator QMap<Key, T>::insertMulti(const_iterator pos, const Key &key, const T &value)
\overload
\since 5.1
\obsolete
\obsolete Use QMultiMap for storing multiple values with the same key.
Inserts a new item with the key \a key and value \a value and with hint \a pos
suggesting where to do the insert.
@ -1196,7 +1195,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
/*! \fn template <class Key, class T> QMap<Key, T> &QMap<Key, T>::unite(const QMap<Key, T> &other)
\obsolete
\obsolete Use QMultiMap for storing multiple values with the same key.
Inserts all the items in the \a other map into this map. If a
key is common to both maps, the resulting map will contain the

View File

@ -96,6 +96,7 @@ private:
template <typename F> QScopeGuard(F(&)()) -> QScopeGuard<F(*)()>;
#endif
//! [qScopeGuard]
template <typename F>
#if __has_cpp_attribute(nodiscard)
Q_REQUIRED_RESULT

View File

@ -69,7 +69,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
\fn template <typename F> const QScopeGuard<F> qScopeGuard(F f)
\fn [qScopeGuard] template <typename F> QScopeGuard<typename std::decay<F>::type> qScopeGuard(F &&f)
\inmodule QtCore
\relates QScopeGuard
\brief The qScopeGuard function can be used to call a function at the end

View File

@ -399,6 +399,7 @@
*/
/*! \fn template <class T> QSet<T>::reverse_iterator QSet<T>::rbegin()
\obsolete Deprecated in order to align with std::unordered_set functionality.
\since 5.6
Returns a \l{STL-style iterators}{STL-style} reverse iterator pointing to the first
@ -408,11 +409,13 @@
*/
/*! \fn template <class T> QSet<T>::const_reverse_iterator QSet<T>::rbegin() const
\obsolete Deprecated in order to align with std::unordered_set functionality.
\since 5.6
\overload
*/
/*! \fn template <class T> QSet<T>::const_reverse_iterator QSet<T>::crbegin() const
\obsolete Deprecated in order to align with std::unordered_set functionality.
\since 5.6
Returns a const \l{STL-style iterators}{STL-style} reverse iterator pointing to the first
@ -422,6 +425,7 @@
*/
/*! \fn template <class T> QSet<T>::reverse_iterator QSet<T>::rend()
\obsolete Deprecated in order to align with std::unordered_set functionality.
\since 5.6
Returns a \l{STL-style iterators}{STL-style} reverse iterator pointing to one past
@ -431,11 +435,13 @@
*/
/*! \fn template <class T> QSet<T>::const_reverse_iterator QSet<T>::rend() const
\obsolete Deprecated in order to align with std::unordered_set functionality.
\since 5.6
\overload
*/
/*! \fn template <class T> QSet<T>::const_reverse_iterator QSet<T>::crend() const
\obsolete Deprecated in order to align with std::unordered_set functionality.
\since 5.6
Returns a const \l{STL-style iterators}{STL-style} reverse iterator pointing to one
@ -507,6 +513,7 @@
/*! \typedef QSet::reverse_iterator
\since 5.6
\obsolete Deprecated in order to align with std::unordered_set functionality.
The QSet::reverse_iterator typedef provides an STL-style non-const
reverse iterator for QSet.
@ -523,6 +530,7 @@
/*! \typedef QSet::const_reverse_iterator
\since 5.6
\obsolete Deprecated in order to align with std::unordered_set functionality.
The QSet::const_reverse_iterator typedef provides an STL-style const
reverse iterator for QSet.
@ -921,8 +929,20 @@
/*!
\fn template <class T> QSet<T>::iterator &QSet<T>::iterator::operator--()
\obsolete This operator is deprecated in order to align with std::unordered_set functionality.
The prefix -- operator (\c{--it}) makes the preceding item
current and returns an iterator to the new current item.
Calling this function on QSet::begin() leads to undefined
results.
\sa operator++()
*/
/*!
\fn template <class T> QSet<T>::const_iterator &QSet<T>::const_iterator::operator--()
\obsolete
\obsolete This operator is deprecated in order to align with std::unordered_set functionality.
The prefix -- operator (\c{--it}) makes the preceding item
current and returns an iterator to the new current item.
@ -935,8 +955,17 @@
/*!
\fn template <class T> QSet<T>::iterator QSet<T>::iterator::operator--(int)
\obsolete This operator is deprecated in order to align with std::unordered_set functionality.
\overload
The postfix -- operator (\c{it--}) makes the preceding item
current and returns an iterator to the previously current item.
*/
/*!
\fn template <class T> QSet<T>::const_iterator QSet<T>::const_iterator::operator--(int)
\obsolete
\obsolete This operator is deprecated in order to align with std::unordered_set functionality.
\overload
@ -946,8 +975,19 @@
/*!
\fn template <class T> QSet<T>::iterator QSet<T>::iterator::operator+(int j) const
\obsolete This operator is deprecated in order to align with std::unordered_set functionality.
Returns an iterator to the item at \a j positions forward from
this iterator. (If \a j is negative, the iterator goes backward.)
This operation can be slow for large \a j values.
\sa operator-()
*/
/*!
\fn template <class T> QSet<T>::const_iterator QSet<T>::const_iterator::operator+(int j) const
\obsolete
\obsolete This operator is deprecated in order to align with std::unordered_set functionality.
Returns an iterator to the item at \a j positions forward from
this iterator. (If \a j is negative, the iterator goes backward.)
@ -959,8 +999,19 @@
/*!
\fn template <class T> QSet<T>::iterator QSet<T>::iterator::operator-(int j) const
\obsolete This operator is deprecated in order to align with std::unordered_set functionality.
Returns an iterator to the item at \a j positions backward from
this iterator. (If \a j is negative, the iterator goes forward.)
This operation can be slow for large \a j values.
\sa operator+()
*/
/*!
\fn template <class T> QSet<T>::const_iterator QSet<T>::const_iterator::operator-(int j) const
\obsolete
\obsolete This operator is deprecated in order to align with std::unordered_set functionality.
Returns an iterator to the item at \a j positions backward from
this iterator. (If \a j is negative, the iterator goes forward.)
@ -972,8 +1023,20 @@
/*!
\fn template <class T> QSet<T>::iterator &QSet<T>::iterator::operator+=(int j)
\obsolete This operator is deprecated in order to align with std::unordered_set functionality.
Advances the iterator by \a j items. (If \a j is negative, the
iterator goes backward.)
This operation can be slow for large \a j values.
\sa operator-=(), operator+()
*/
/*!
\fn template <class T> QSet<T>::const_iterator &QSet<T>::const_iterator::operator+=(int j)
\obsolete
\obsolete This operator is deprecated in order to align with std::unordered_set functionality.
Advances the iterator by \a j items. (If \a j is negative, the
iterator goes backward.)
@ -985,8 +1048,19 @@
/*!
\fn template <class T> QSet<T>::iterator &QSet<T>::iterator::operator-=(int j)
\obsolete This operator is deprecated in order to align with std::unordered_set functionality.
Makes the iterator go back by \a j items. (If \a j is negative,
the iterator goes forward.)
This operation can be slow for large \a j values.
\sa operator+=(), operator-()
*/
/*!
\fn template <class T> QSet<T>::const_iterator &QSet<T>::const_iterator::operator-=(int j)
\obsolete
\obsolete This operator is deprecated in order to align with std::unordered_set functionality.
Makes the iterator go back by \a j items. (If \a j is negative,
the iterator goes forward.)

View File

@ -74,6 +74,13 @@ QT_BEGIN_NAMESPACE
\sa QDBusMessage, QDBusInterface
*/
/*!
\fn template<typename T> QDBusReply<T>::QDBusReply(const QDBusReply &other)
\since 5.15
Constructs a copy of \a other.
*/
/*!
\fn template<typename T> QDBusReply<T>::QDBusReply(const QDBusMessage &reply)
Automatically construct a QDBusReply object from the reply message \a reply, extracting the

Some files were not shown because too many files have changed in this diff Show More