summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.qmake.conf2
-rw-r--r--config.tests/common/pch/header.h1
-rw-r--r--config.tests/common/pch/pch.pro4
-rw-r--r--config.tests/common/pch/source.cpp44
-rw-r--r--config.tests/corewlan/corewlan.pro1
-rw-r--r--config.tests/corewlan/corewlantest.mm47
-rw-r--r--config.tests/gnu-libiconv/gnu-libiconv.cpp54
-rw-r--r--config.tests/gnu-libiconv/gnu-libiconv.pro1
-rw-r--r--config.tests/iconv/iconv.cpp54
-rw-r--r--config.tests/iconv/iconv.pro2
-rw-r--r--config.tests/openssl/openssl.cpp54
-rw-r--r--config.tests/openssl/openssl.pro1
-rw-r--r--config.tests/qpa/vulkan/vulkan.cpp58
-rw-r--r--config.tests/qpa/vulkan/vulkan.pro1
-rw-r--r--config.tests/sun-libiconv/sun-libiconv.pro1
-rw-r--r--config.tests/unix/cxx11_random/cxx11_random.cpp35
-rw-r--r--config.tests/unix/cxx11_random/cxx11_random.pro1
-rw-r--r--config.tests/unix/futimens/futimens.cpp47
-rw-r--r--config.tests/unix/futimens/futimens.pro6
-rw-r--r--config.tests/unix/futimes/futimes.cpp47
-rw-r--r--config.tests/unix/futimes/futimes.pro1
-rw-r--r--config.tests/unix/getauxval/getauxval.cpp34
-rw-r--r--config.tests/unix/getauxval/getauxval.pro1
-rw-r--r--config.tests/unix/getentropy/getentropy.cpp35
-rw-r--r--config.tests/unix/getentropy/getentropy.pro1
-rw-r--r--config.tests/unix/opengles32/opengles32.cpp47
-rw-r--r--config.tests/unix/opengles32/opengles32.pro7
-rw-r--r--config.tests/unix/openssl11/openssl.cpp48
-rw-r--r--config.tests/unix/openssl11/openssl.pro2
-rw-r--r--config.tests/x11/xrender/xrender.cpp52
-rw-r--r--config.tests/x11/xrender/xrender.pro2
-rw-r--r--config.tests/xlocalescanprint/qglobal.h43
-rw-r--r--config.tests/xlocalescanprint/xlocalescanprint.cpp62
-rw-r--r--config.tests/xlocalescanprint/xlocalescanprint.pro1
-rw-r--r--config_help.txt5
-rw-r--r--configure.json22
-rw-r--r--dist/changes-5.12.01
-rw-r--r--examples/corelib/corelib.pro3
-rw-r--r--examples/corelib/threads/semaphores/semaphores.cpp6
-rw-r--r--mkspecs/common/msvc-based-version.conf32
-rw-r--r--mkspecs/common/msvc-version.conf10
-rw-r--r--mkspecs/features/data/dumpvcvars.bat44
-rw-r--r--mkspecs/features/egl.prf1
-rw-r--r--mkspecs/features/mac/asset_catalogs.prf2
-rw-r--r--mkspecs/features/mac/default_post.prf4
-rw-r--r--mkspecs/features/moc.prf2
-rw-r--r--mkspecs/features/qmake_use.prf6
-rw-r--r--mkspecs/features/qt.prf22
-rw-r--r--mkspecs/features/qt_common.prf24
-rw-r--r--mkspecs/features/qt_configure.prf182
-rw-r--r--mkspecs/features/qt_docs.prf2
-rw-r--r--mkspecs/features/qt_helper_lib.prf3
-rw-r--r--mkspecs/features/qt_module_headers.prf8
-rw-r--r--mkspecs/features/resources.prf9
-rw-r--r--mkspecs/features/static_runtime.prf4
-rw-r--r--mkspecs/features/toolchain.prf360
-rw-r--r--mkspecs/win32-clang-msvc/qmake.conf8
-rw-r--r--mkspecs/winrt-arm-msvc2015/qmake.conf1
-rw-r--r--mkspecs/winrt-arm-msvc2017/qmake.conf1
-rw-r--r--mkspecs/winrt-x64-msvc2015/qmake.conf1
-rw-r--r--mkspecs/winrt-x64-msvc2017/qmake.conf1
-rw-r--r--mkspecs/winrt-x86-msvc2015/qmake.conf1
-rw-r--r--mkspecs/winrt-x86-msvc2017/qmake.conf1
-rw-r--r--qmake/Makefile.unix6
-rw-r--r--qmake/Makefile.unix.win322
-rw-r--r--qmake/doc/src/qmake-manual.qdoc13
-rw-r--r--qmake/generators/makefile.cpp58
-rw-r--r--qmake/generators/makefile.h1
-rw-r--r--qmake/generators/unix/unixmake.cpp14
-rw-r--r--qmake/generators/unix/unixmake2.cpp2
-rw-r--r--qmake/generators/win32/msvc_nmake.cpp216
-rw-r--r--qmake/generators/win32/winmakefile.cpp2
-rw-r--r--qmake/library/qmakebuiltins.cpp40
-rw-r--r--qmake/library/registry.cpp (renamed from qmake/generators/win32/registry.cpp)0
-rw-r--r--qmake/library/registry_p.h (renamed from qmake/generators/win32/registry_p.h)4
-rw-r--r--qmake/qmake_pch.h2
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/HLSLCompiler.cpp25
-rw-r--r--src/3rdparty/xcb/README2
-rw-r--r--src/3rdparty/xcb/include/xcb/xcb_renderutil.h10
-rw-r--r--src/3rdparty/xcb/xcb-util-renderutil/util.c30
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtNative.java131
-rw-r--r--src/android/templates/build.gradle2
-rw-r--r--src/angle/patches/0012-ANGLE-Dynamically-load-D3D-compiler-from-a-list.patch59
-rw-r--r--src/angle/src/common/common.pri16
-rw-r--r--src/angle/src/common/gles_common.pri6
-rw-r--r--src/angle/src/libEGL/libEGL.pro5
-rw-r--r--src/corelib/codecs/codecs.pri3
-rw-r--r--src/corelib/codecs/codecs.qdoc6
-rw-r--r--src/corelib/codecs/qwindowscodec.cpp2
-rw-r--r--src/corelib/configure.json143
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_animation_qparallelanimationgroup.cpp51
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_animation_qpropertyanimation.cpp51
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_animation_qsequentialanimationgroup.cpp51
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_animation_qvariantanimation.cpp51
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp12
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_global_qlogging.cpp51
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_global_qnumeric.cpp51
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_global_qoperatingsystemversion.cpp51
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_global_qrandom.cpp49
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_io_qdebug.cpp49
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_io_qfileselector.cpp49
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_io_qloggingcategory.cpp51
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_io_qstorageinfo.cpp49
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_io_qurlquery.cpp51
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_kernel_qdeadlinetimer.cpp49
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_serialization_qcborstream.cpp49
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_serialization_qcborvalue.cpp49
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_serialization_qdatastream.cpp51
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_serialization_qjsondocument.cpp51
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_tools_qbytearraymatcher.cpp51
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_tools_qcontiguouscache.cpp51
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_tools_qshareddata.cpp51
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_tools_qsharedpointer.cpp49
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_tools_qstringview.cpp51
-rw-r--r--src/corelib/doc/snippets/code/src_gui_itemviews_qidentityproxymodel.cpp2
-rw-r--r--src/corelib/doc/snippets/hellotrmain.cpp2
-rw-r--r--src/corelib/doc/snippets/qbytearraylist/main.cpp51
-rw-r--r--src/corelib/doc/snippets/qelapsedtimer/main.cpp2
-rw-r--r--src/corelib/doc/snippets/qloggingcategory/main.cpp2
-rw-r--r--src/corelib/doc/snippets/resource-system/mainwindow.cpp2
-rw-r--r--src/corelib/doc/snippets/timers/analogclock.cpp2
-rw-r--r--src/corelib/doc/src/external-resources.qdoc8
-rw-r--r--src/corelib/global/archdetect.cpp2
-rw-r--r--src/corelib/global/qendian.h4
-rw-r--r--src/corelib/global/qfloat16.h2
-rw-r--r--src/corelib/global/qnumeric_p.h16
-rw-r--r--src/corelib/io/qdebug.h2
-rw-r--r--src/corelib/io/qdir.cpp3
-rw-r--r--src/corelib/io/qfileinfo.cpp2
-rw-r--r--src/corelib/itemmodels/qabstractproxymodel.cpp2
-rw-r--r--src/corelib/itemmodels/qabstractproxymodel.h2
-rw-r--r--src/corelib/itemmodels/qabstractproxymodel_p.h2
-rw-r--r--src/corelib/itemmodels/qidentityproxymodel.cpp2
-rw-r--r--src/corelib/itemmodels/qidentityproxymodel.h2
-rw-r--r--src/corelib/itemmodels/qitemselectionmodel.cpp2
-rw-r--r--src/corelib/itemmodels/qitemselectionmodel.h2
-rw-r--r--src/corelib/itemmodels/qitemselectionmodel_p.h2
-rw-r--r--src/corelib/itemmodels/qsortfilterproxymodel.cpp2
-rw-r--r--src/corelib/itemmodels/qsortfilterproxymodel.h2
-rw-r--r--src/corelib/itemmodels/qstringlistmodel.cpp7
-rw-r--r--src/corelib/itemmodels/qstringlistmodel.h2
-rw-r--r--src/corelib/kernel/qcore_mac_objc.mm95
-rw-r--r--src/corelib/kernel/qmetaobject.cpp7
-rw-r--r--src/corelib/kernel/qmetatype.cpp6
-rw-r--r--src/corelib/kernel/qppsattribute.cpp74
-rw-r--r--src/corelib/kernel/qppsattribute_p.h75
-rw-r--r--src/corelib/kernel/qppsattributeprivate_p.h74
-rw-r--r--src/corelib/kernel/qppsobject.cpp74
-rw-r--r--src/corelib/kernel/qppsobject_p.h74
-rw-r--r--src/corelib/kernel/qppsobjectprivate_p.h74
-rw-r--r--src/corelib/kernel/qtestsupport_core.cpp2
-rw-r--r--src/corelib/kernel/qtestsupport_core.h2
-rw-r--r--src/corelib/tools/qchar.cpp2
-rw-r--r--src/corelib/tools/qcollator.cpp8
-rw-r--r--src/corelib/tools/qcollator_icu.cpp4
-rw-r--r--src/corelib/tools/qcollator_macx.cpp20
-rw-r--r--src/corelib/tools/qcollator_p.h1
-rw-r--r--src/corelib/tools/qcollator_posix.cpp41
-rw-r--r--src/corelib/tools/qcollator_win.cpp7
-rw-r--r--src/corelib/tools/qregularexpression.cpp15
-rw-r--r--src/corelib/tools/qstring.cpp206
-rw-r--r--src/corelib/tools/qstring_mips_dsp_asm.S2
-rw-r--r--src/corelib/tools/qstringbuilder.cpp2
-rw-r--r--src/gui/configure.json520
-rw-r--r--src/gui/configure.pri46
-rw-r--r--src/gui/doc/snippets/code/src_gui_vulkan_qvulkaninstance.cpp2
-rw-r--r--src/gui/image/qpixmap_win.cpp7
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp8
-rw-r--r--src/gui/painting/qrgba64_p.h8
-rw-r--r--src/gui/painting/qtextureglyphcache.cpp2
-rw-r--r--src/gui/text/qharfbuzzng.cpp2
-rw-r--r--src/gui/text/qtextengine.cpp10
-rw-r--r--src/gui/text/qtextlayout.cpp4
-rw-r--r--src/network/access/qnetworkreplywasmimpl.cpp39
-rw-r--r--src/network/access/qnetworkreplywasmimpl_p.h4
-rw-r--r--src/network/configure.json62
-rw-r--r--src/network/socket/qabstractsocket.cpp2
-rw-r--r--src/network/ssl/qdtls.cpp1
-rw-r--r--src/opengl/qgl.cpp2
-rw-r--r--src/platformsupport/eglconvenience/qt_egl_p.h4
-rw-r--r--src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp6
-rw-r--r--src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm16
-rw-r--r--src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm2
-rw-r--r--src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp5
-rw-r--r--src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h1
-rw-r--r--src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp114
-rw-r--r--src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h10
-rw-r--r--src/platformsupport/fontdatabases/windows/windows.pri9
-rw-r--r--src/platformsupport/fontdatabases/winrt/winrt.pri4
-rw-r--r--src/plugins/platforms/android/androidjniclipboard.cpp68
-rw-r--r--src/plugins/platforms/android/androidjniclipboard.h5
-rw-r--r--src/plugins/platforms/android/qandroidplatformclipboard.cpp11
-rw-r--r--src/plugins/platforms/android/qandroidplatformclipboard.h5
-rw-r--r--src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm23
-rw-r--r--src/plugins/platforms/cocoa/qcocoatheme.mm20
-rw-r--r--src/plugins/platforms/direct2d/direct2d.pro3
-rw-r--r--src/plugins/platforms/offscreen/qoffscreenintegration.cpp5
-rw-r--r--src/plugins/platforms/platforms.pro8
-rw-r--r--src/plugins/platforms/qnx/qqnxintegration.cpp114
-rw-r--r--src/plugins/platforms/qnx/qqnxintegration.h2
-rw-r--r--src/plugins/platforms/wasm/qwasmeventtranslator.cpp27
-rw-r--r--src/plugins/platforms/wasm/qwasmeventtranslator.h1
-rw-r--r--src/plugins/platforms/windows/windows.pri2
-rw-r--r--src/plugins/platforms/winrt/qwinrtintegration.cpp132
-rw-r--r--src/plugins/platforms/winrt/qwinrtintegration.h16
-rw-r--r--src/plugins/platforms/winrt/winrt.pro3
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/gl_integrations.pro4
-rw-r--r--src/plugins/platforms/xcb/qxcbbackingstore.cpp18
-rw-r--r--src/plugins/platforms/xcb/qxcbbackingstore.h3
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp3
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection_basic.cpp10
-rw-r--r--src/plugins/platforms/xcb/qxcbcursor.cpp4
-rw-r--r--src/plugins/platforms/xcb/qxcbimage.cpp17
-rw-r--r--src/plugins/platforms/xcb/xcb_qpa_lib.pro8
-rw-r--r--src/plugins/sqldrivers/configure.json33
-rw-r--r--src/plugins/sqldrivers/configure.pri4
-rw-r--r--src/plugins/sqldrivers/psql/qsql_psql.cpp4
-rw-r--r--src/plugins/sqldrivers/psql/qsql_psql_p.h1
-rw-r--r--src/plugins/styles/windowsvista/qwindowsvistastyle.cpp10
-rw-r--r--src/printsupport/configure.json2
-rw-r--r--src/printsupport/dialogs/qpagesetupdialog_win.cpp2
-rw-r--r--src/testlib/doc/snippets/code/src_corelib_kernel_qtestsupport_core.cpp51
-rw-r--r--src/tools/moc/moc.cpp2
-rw-r--r--src/tools/uic/cpp/cppwriteinitialization.cpp19
-rw-r--r--src/widgets/dialogs/qdialog.cpp57
-rw-r--r--src/widgets/dialogs/qdialog_p.h5
-rw-r--r--src/widgets/dialogs/qfiledialog.cpp4
-rw-r--r--src/widgets/dialogs/qfilesystemmodel.cpp3
-rw-r--r--src/widgets/dialogs/qmessagebox.cpp42
-rw-r--r--src/widgets/itemviews/qtableview.cpp103
-rw-r--r--src/widgets/itemviews/qtableview_p.h20
-rw-r--r--src/widgets/kernel/qapplication.cpp6
-rw-r--r--src/widgets/kernel/qtooltip.cpp9
-rw-r--r--src/widgets/kernel/qwidget.cpp21
-rw-r--r--src/widgets/kernel/qwidget_p.h2
-rw-r--r--src/widgets/styles/qcommonstyle.cpp3
-rw-r--r--src/widgets/styles/qfusionstyle.cpp1
-rw-r--r--src/widgets/styles/qstyle.cpp2
-rw-r--r--src/widgets/widgets/qabstractslider.cpp9
-rw-r--r--src/widgets/widgets/qdatetimeedit.cpp2
-rw-r--r--src/widgets/widgets/qmenu.cpp20
-rw-r--r--src/widgets/widgets/qmenu_p.h1
-rw-r--r--tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp20
-rw-r--r--tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp11
-rw-r--r--tests/auto/corelib/kernel/qtimer/BLACKLIST2
-rw-r--r--tests/auto/corelib/tools/qcollator/tst_qcollator.cpp18
-rw-r--r--tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp76
-rw-r--r--tests/auto/gui/image/qimage/tst_qimage.cpp14
-rw-r--r--tests/auto/gui/painting/qpainter/tst_qpainter.cpp16
-rw-r--r--tests/auto/gui/text/qfontmetrics/testfont.qrc1
-rw-r--r--tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp27
-rw-r--r--tests/auto/tools/moc/cxx11-enums.h9
-rw-r--r--tests/auto/tools/moc/tst_moc.cpp3
-rw-r--r--tests/auto/tools/qmakelib/qmakelib.pro2
-rw-r--r--tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp302
-rw-r--r--tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp40
-rw-r--r--tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp1129
-rw-r--r--tests/manual/textrendering/nativetext/main.cpp36
258 files changed, 4708 insertions, 3366 deletions
diff --git a/.qmake.conf b/.qmake.conf
index 5df08093cd..518aa07f06 100644
--- a/.qmake.conf
+++ b/.qmake.conf
@@ -4,4 +4,4 @@ CONFIG += warning_clean
QT_SOURCE_TREE = $$PWD
QT_BUILD_TREE = $$shadowed($$PWD)
-MODULE_VERSION = 5.12.0
+MODULE_VERSION = 5.12.1
diff --git a/config.tests/common/pch/header.h b/config.tests/common/pch/header.h
deleted file mode 100644
index ebc22c4fb0..0000000000
--- a/config.tests/common/pch/header.h
+++ /dev/null
@@ -1 +0,0 @@
-#define HEADER_H
diff --git a/config.tests/common/pch/pch.pro b/config.tests/common/pch/pch.pro
deleted file mode 100644
index f6384b71e1..0000000000
--- a/config.tests/common/pch/pch.pro
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG += precompile_header
-PRECOMPILED_DIR = .pch
-PRECOMPILED_HEADER = header.h
-SOURCES = source.cpp
diff --git a/config.tests/common/pch/source.cpp b/config.tests/common/pch/source.cpp
deleted file mode 100644
index 855672ffa8..0000000000
--- a/config.tests/common/pch/source.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the configuration of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef HEADER_H
-#error no go
-#endif
-
-int main() { return 0; }
diff --git a/config.tests/corewlan/corewlan.pro b/config.tests/corewlan/corewlan.pro
deleted file mode 100644
index c19f0be4fd..0000000000
--- a/config.tests/corewlan/corewlan.pro
+++ /dev/null
@@ -1 +0,0 @@
-OBJECTIVE_SOURCES = corewlantest.mm
diff --git a/config.tests/corewlan/corewlantest.mm b/config.tests/corewlan/corewlantest.mm
deleted file mode 100644
index 73b4d0d145..0000000000
--- a/config.tests/corewlan/corewlantest.mm
+++ /dev/null
@@ -1,47 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the config.tests of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <CoreWLAN/CoreWLAN.h>
-#include <CoreWLAN/CWInterface.h>
-
-int main()
-{
- [CWInterface interfaceWithName:@"en2"];
- return 0;
-}
diff --git a/config.tests/gnu-libiconv/gnu-libiconv.cpp b/config.tests/gnu-libiconv/gnu-libiconv.cpp
deleted file mode 100644
index fe4b87b923..0000000000
--- a/config.tests/gnu-libiconv/gnu-libiconv.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the config.tests of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <iconv.h>
-
-int main(int, char **)
-{
- iconv_t x = iconv_open("", "");
-
- const char *inp;
- char *outp;
- size_t inbytes, outbytes;
- iconv(x, &inp, &inbytes, &outp, &outbytes);
-
- iconv_close(x);
-
- return 0;
-}
diff --git a/config.tests/gnu-libiconv/gnu-libiconv.pro b/config.tests/gnu-libiconv/gnu-libiconv.pro
deleted file mode 100644
index e4e020cffb..0000000000
--- a/config.tests/gnu-libiconv/gnu-libiconv.pro
+++ /dev/null
@@ -1 +0,0 @@
-SOURCES = gnu-libiconv.cpp
diff --git a/config.tests/iconv/iconv.cpp b/config.tests/iconv/iconv.cpp
deleted file mode 100644
index be4236436f..0000000000
--- a/config.tests/iconv/iconv.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the config.tests of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <iconv.h>
-
-int main(int, char **)
-{
- iconv_t x = iconv_open("", "");
-
- char *inp;
- char *outp;
- size_t inbytes, outbytes;
- iconv(x, &inp, &inbytes, &outp, &outbytes);
-
- iconv_close(x);
-
- return 0;
-}
diff --git a/config.tests/iconv/iconv.pro b/config.tests/iconv/iconv.pro
deleted file mode 100644
index 70af0d2eb2..0000000000
--- a/config.tests/iconv/iconv.pro
+++ /dev/null
@@ -1,2 +0,0 @@
-SOURCES = iconv.cpp
-mac|mingw|openbsd|qnx|haiku:LIBS += -liconv
diff --git a/config.tests/openssl/openssl.cpp b/config.tests/openssl/openssl.cpp
deleted file mode 100644
index 9188fb008f..0000000000
--- a/config.tests/openssl/openssl.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the config.tests of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <openssl/opensslv.h>
-
-#if !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER-0 < 0x10000000L
-# error "OpenSSL >= 1.0.0 is required"
-#endif
-
-#include <openssl/ssl.h>
-
-#if OPENSSL_VERSION_NUMBER-0 >= 0x10002000L && !defined(OPENSSL_NO_EC) && !defined(SSL_CTRL_SET_CURVES)
-# error "OpenSSL was reported as >= 1.0.2 but is missing required features, possibly it's libressl which is unsupported"
-#endif
-
-int main()
-{
-}
diff --git a/config.tests/openssl/openssl.pro b/config.tests/openssl/openssl.pro
deleted file mode 100644
index f0ee5e2b0c..0000000000
--- a/config.tests/openssl/openssl.pro
+++ /dev/null
@@ -1 +0,0 @@
-SOURCES = openssl.cpp
diff --git a/config.tests/qpa/vulkan/vulkan.cpp b/config.tests/qpa/vulkan/vulkan.cpp
deleted file mode 100644
index 22f5edf9f2..0000000000
--- a/config.tests/qpa/vulkan/vulkan.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the config.tests of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-// This is a header-only test. Qt does not rely on linking to a Vulkan library directly.
-
-#include <vulkan/vulkan.h>
-
-// The pData parameter has changed from uint32_t* to void* at some point.
-// Ensure the headers have the updated one to prevent compile errors later on.
-PFN_vkCmdUpdateBuffer cmdUpdBuf;
-void testUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize dataSize, const void* pData)
-{
- cmdUpdBuf(commandBuffer, dstBuffer, dstOffset, dataSize, pData);
-}
-
-int main(int, char **)
-{
- VkInstanceCreateInfo info;
- testUpdateBuffer(0, 0, 0, 0, 0);
-
- return 0;
-}
diff --git a/config.tests/qpa/vulkan/vulkan.pro b/config.tests/qpa/vulkan/vulkan.pro
deleted file mode 100644
index 5f05bc49aa..0000000000
--- a/config.tests/qpa/vulkan/vulkan.pro
+++ /dev/null
@@ -1 +0,0 @@
-SOURCES = vulkan.cpp
diff --git a/config.tests/sun-libiconv/sun-libiconv.pro b/config.tests/sun-libiconv/sun-libiconv.pro
deleted file mode 100644
index d0881b732a..0000000000
--- a/config.tests/sun-libiconv/sun-libiconv.pro
+++ /dev/null
@@ -1 +0,0 @@
-SOURCES = ../gnu-libiconv/gnu-libiconv.cpp
diff --git a/config.tests/unix/cxx11_random/cxx11_random.cpp b/config.tests/unix/cxx11_random/cxx11_random.cpp
deleted file mode 100644
index d6872667fd..0000000000
--- a/config.tests/unix/cxx11_random/cxx11_random.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 Intel Corporation.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <random>
-
-int main()
-{
- std::mt19937 mt(0);
- return 0;
-}
diff --git a/config.tests/unix/cxx11_random/cxx11_random.pro b/config.tests/unix/cxx11_random/cxx11_random.pro
deleted file mode 100644
index 0cd5fff9d9..0000000000
--- a/config.tests/unix/cxx11_random/cxx11_random.pro
+++ /dev/null
@@ -1 +0,0 @@
-SOURCES = cxx11_random.cpp
diff --git a/config.tests/unix/futimens/futimens.cpp b/config.tests/unix/futimens/futimens.cpp
deleted file mode 100644
index 1b66386ca1..0000000000
--- a/config.tests/unix/futimens/futimens.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 Raphael Gozzo <raphael.rg91@gmail.com>
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the config.tests of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <sys/stat.h>
-
-int main(int, char **)
-{
- futimens(-1,0);
- return 0;
-}
-
diff --git a/config.tests/unix/futimens/futimens.pro b/config.tests/unix/futimens/futimens.pro
deleted file mode 100644
index 83a122252a..0000000000
--- a/config.tests/unix/futimens/futimens.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-SOURCES += futimens.cpp
-
-# 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
diff --git a/config.tests/unix/futimes/futimes.cpp b/config.tests/unix/futimes/futimes.cpp
deleted file mode 100644
index 553b39068e..0000000000
--- a/config.tests/unix/futimes/futimes.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 Raphael Gozzo <raphael.rg91@gmail.com>
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the config.tests of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <sys/time.h>
-
-int main(int, char **)
-{
- futimes(-1,0);
- return 0;
-}
-
diff --git a/config.tests/unix/futimes/futimes.pro b/config.tests/unix/futimes/futimes.pro
deleted file mode 100644
index 8e7f2c0f62..0000000000
--- a/config.tests/unix/futimes/futimes.pro
+++ /dev/null
@@ -1 +0,0 @@
-SOURCES += futimes.cpp
diff --git a/config.tests/unix/getauxval/getauxval.cpp b/config.tests/unix/getauxval/getauxval.cpp
deleted file mode 100644
index 62f71e95d2..0000000000
--- a/config.tests/unix/getauxval/getauxval.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 Intel Corporation.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <sys/auxv.h>
-
-int main()
-{
- return getauxval(AT_NULL);
-}
diff --git a/config.tests/unix/getauxval/getauxval.pro b/config.tests/unix/getauxval/getauxval.pro
deleted file mode 100644
index ea46cb0bae..0000000000
--- a/config.tests/unix/getauxval/getauxval.pro
+++ /dev/null
@@ -1 +0,0 @@
-SOURCES = getauxval.cpp
diff --git a/config.tests/unix/getentropy/getentropy.cpp b/config.tests/unix/getentropy/getentropy.cpp
deleted file mode 100644
index 6cb4dc3a95..0000000000
--- a/config.tests/unix/getentropy/getentropy.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 Intel Corporation.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <unistd.h>
-
-int main()
-{
- char buf[32];
- return getentropy(buf, sizeof(buf));
-}
diff --git a/config.tests/unix/getentropy/getentropy.pro b/config.tests/unix/getentropy/getentropy.pro
deleted file mode 100644
index bdd626b513..0000000000
--- a/config.tests/unix/getentropy/getentropy.pro
+++ /dev/null
@@ -1 +0,0 @@
-SOURCES = getentropy.cpp
diff --git a/config.tests/unix/opengles32/opengles32.cpp b/config.tests/unix/opengles32/opengles32.cpp
deleted file mode 100644
index 0505510464..0000000000
--- a/config.tests/unix/opengles32/opengles32.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the config.tests of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <GLES3/gl32.h>
-
-int main(int, char **)
-{
- glFramebufferTexture(GL_TEXTURE_2D, GL_DEPTH_STENCIL_ATTACHMENT, 1, 0);
-
- return 0;
-}
diff --git a/config.tests/unix/opengles32/opengles32.pro b/config.tests/unix/opengles32/opengles32.pro
deleted file mode 100644
index c95ba83364..0000000000
--- a/config.tests/unix/opengles32/opengles32.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-# The library is expected to be the same as in ES 2.0 (libGLESv2).
-# The difference is the header and the presence of the functions in
-# the library.
-
-SOURCES = opengles32.cpp
-
-CONFIG -= qt
diff --git a/config.tests/unix/openssl11/openssl.cpp b/config.tests/unix/openssl11/openssl.cpp
deleted file mode 100644
index c20cc59deb..0000000000
--- a/config.tests/unix/openssl11/openssl.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the config.tests of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <openssl/opensslv.h>
-
-#if !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER-0 < 0x10100000L
-# error "OpenSSL >= 1.1 is required"
-#endif
-
-int main()
-{
-}
diff --git a/config.tests/unix/openssl11/openssl.pro b/config.tests/unix/openssl11/openssl.pro
deleted file mode 100644
index a023aee4aa..0000000000
--- a/config.tests/unix/openssl11/openssl.pro
+++ /dev/null
@@ -1,2 +0,0 @@
-SOURCES = openssl.cpp
-CONFIG -= x11 qt
diff --git a/config.tests/x11/xrender/xrender.cpp b/config.tests/x11/xrender/xrender.cpp
deleted file mode 100644
index 35203cc02c..0000000000
--- a/config.tests/x11/xrender/xrender.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the config.tests of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <X11/Xlib.h>
-#include <X11/extensions/Xrender.h>
-
-#if RENDER_MAJOR == 0 && RENDER_MINOR < 5
-# error "Required Xrender version 0.6 not found."
-#else
-int main(int, char **)
-{
- XRenderPictFormat *format;
- format = 0;
- return 0;
-}
-#endif
diff --git a/config.tests/x11/xrender/xrender.pro b/config.tests/x11/xrender/xrender.pro
deleted file mode 100644
index 6244ae6b47..0000000000
--- a/config.tests/x11/xrender/xrender.pro
+++ /dev/null
@@ -1,2 +0,0 @@
-SOURCES = xrender.cpp
-CONFIG -= qt
diff --git a/config.tests/xlocalescanprint/qglobal.h b/config.tests/xlocalescanprint/qglobal.h
deleted file mode 100644
index 98de822847..0000000000
--- a/config.tests/xlocalescanprint/qglobal.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the config.tests of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGLOBAL_H
-#define QGLOBAL_H
-
-#endif
diff --git a/config.tests/xlocalescanprint/xlocalescanprint.cpp b/config.tests/xlocalescanprint/xlocalescanprint.cpp
deleted file mode 100644
index 2f1f28f74e..0000000000
--- a/config.tests/xlocalescanprint/xlocalescanprint.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the config.tests of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#define QT_BEGIN_NAMESPACE
-#define QT_END_NAMESPACE
-
-#ifdef _MSVC_VER
-#define Q_CC_MSVC _MSVC_VER
-#endif
-
-#define QT_NO_DOUBLECONVERSION
-
-#include "../../../src/corelib/tools/qdoublescanprint_p.h"
-
-int main(int argc, char **argv)
-{
-#ifdef _MSVC_VER
- _locale_t invalidLocale = NULL;
-#else
- locale_t invalidLocale = NULL;
-#endif
- double a = 3.4;
- qDoubleSnprintf(argv[0], 1, invalidLocale, "invalid format", a);
- qDoubleSscanf(argv[0], invalidLocale, "invalid format", &a, &argc);
- return 0;
-}
diff --git a/config.tests/xlocalescanprint/xlocalescanprint.pro b/config.tests/xlocalescanprint/xlocalescanprint.pro
deleted file mode 100644
index 3748d2a728..0000000000
--- a/config.tests/xlocalescanprint/xlocalescanprint.pro
+++ /dev/null
@@ -1 +0,0 @@
-SOURCES = xlocalescanprint.cpp
diff --git a/config_help.txt b/config_help.txt
index 5369163055..fb37cbaed9 100644
--- a/config_help.txt
+++ b/config_help.txt
@@ -17,7 +17,8 @@ quoting and double quotes for the outer quoting.
Top-level installation directories:
-prefix <dir> ...... The deployment directory, as seen on the target device.
- [/usr/local/Qt-$QT_VERSION, $PWD if -developer-build]
+ [/usr/local/Qt-$QT_VERSION; qtbase build directory if
+ -developer-build]
-extprefix <dir> ... The installation directory, as seen on the host machine.
[SYSROOT/PREFIX]
-hostprefix [dir] .. The installation directory for build tools running on
@@ -292,7 +293,7 @@ Gui, printing, widget options:
-kms ............... Enable backends for KMS [auto] (Linux only)
-linuxfb ........... Enable Linux Framebuffer support [auto] (Linux only)
-mirclient ......... Enable Mir client support [no] (Linux only)
- -xcb ............... Select used xcb-* libraries [system/qt/no]
+ -xcb ............... Enable X11 support. Select used xcb-* libraries [system/qt/no]
(-qt-xcb still uses system version of libxcb itself)
Input backends:
diff --git a/configure.json b/configure.json
index 69e058e0c2..9fce6d039e 100644
--- a/configure.json
+++ b/configure.json
@@ -152,13 +152,13 @@
"zlib": {
"label": "zlib",
"test": {
- "include": "zlib.h",
"main": [
"z_streamp stream = 0;",
"(void) zlibVersion();",
"(void) compress2(0, 0, 0, 0, 1); // compress2 was added in zlib version 1.0.8"
]
},
+ "headers": "zlib.h",
"sources": [
{ "libs": "-lzdll", "condition": "config.msvc" },
{ "libs": "-lzlib", "condition": "config.msvc" },
@@ -169,9 +169,9 @@
"dbus": {
"label": "D-Bus >= 1.2",
"test": {
- "include": "dbus/dbus.h",
"main": "(void) dbus_bus_get_private(DBUS_BUS_SYSTEM, (DBusError *)NULL);"
},
+ "headers": "dbus/dbus.h",
"sources": [
{ "type": "pkgConfig", "args": "dbus-1 >= 1.2" },
{
@@ -196,9 +196,9 @@
"libudev": {
"label": "udev",
"test": {
- "include": "libudev.h",
"main": "udev_unref(udev_new());"
},
+ "headers": "libudev.h",
"sources": [
{ "type": "pkgConfig", "args": "libudev" },
"-ludev"
@@ -324,7 +324,21 @@
"precompile_header": {
"label": "precompiled header support",
"type": "compile",
- "test": "common/pch"
+ "test": {
+ "files": {
+ "header.h": "#define HEADER_H"
+ },
+ "tail": [
+ "#ifndef HEADER_H",
+ "#error no go",
+ "#endif"
+ ],
+ "qmake": [
+ "CONFIG += precompile_header",
+ "PRECOMPILED_DIR = .pch",
+ "PRECOMPILED_HEADER = header.h"
+ ]
+ }
},
"use_gold_linker": {
"label": "gold linker",
diff --git a/dist/changes-5.12.0 b/dist/changes-5.12.0
index b5e664fc5a..15b12b60ab 100644
--- a/dist/changes-5.12.0
+++ b/dist/changes-5.12.0
@@ -48,6 +48,7 @@ information about a particular change.
- The minimal required version of libxcb is now 1.9. Bundled xcb sources
were updated to libxcb 1.9.1 built with xcb-proto 1.8.
- [QTBUG-67654] Updated CLDR to version 33.1
+ - [QTBUG-71144] Updated CLDR to version 34
- [QTBUG-66561][QTBUG-70008] double-conversion got updated to upstream
version 3.1.1.
- libjpeg-turbo was updated to version 2.0.0
diff --git a/examples/corelib/corelib.pro b/examples/corelib/corelib.pro
index 014e8af608..8caf2c16df 100644
--- a/examples/corelib/corelib.pro
+++ b/examples/corelib/corelib.pro
@@ -5,5 +5,6 @@ SUBDIRS = \
ipc \
mimetypes \
serialization \
- threads \
tools
+
+qtConfig(thread): SUBDIRS += threads
diff --git a/examples/corelib/threads/semaphores/semaphores.cpp b/examples/corelib/threads/semaphores/semaphores.cpp
index 145624bb0b..a245b9906b 100644
--- a/examples/corelib/threads/semaphores/semaphores.cpp
+++ b/examples/corelib/threads/semaphores/semaphores.cpp
@@ -94,12 +94,6 @@ public:
}
fprintf(stderr, "\n");
}
-
-signals:
- void stringConsumed(const QString &text);
-
-protected:
- bool finish;
};
//! [4]
diff --git a/mkspecs/common/msvc-based-version.conf b/mkspecs/common/msvc-based-version.conf
new file mode 100644
index 0000000000..38aecbaf59
--- /dev/null
+++ b/mkspecs/common/msvc-based-version.conf
@@ -0,0 +1,32 @@
+#
+# qmake configuration for Compilers based on the Microsoft Visual Studio
+# C/C++ Compilers like win32-clang-msvc
+
+#
+# Version-specific changes
+#
+
+isEmpty(QMAKE_MSC_VER): error("msvc-based-version.conf loaded but QMAKE_MSC_VER isn't set")
+
+MSVC_VER = 14.0
+COMPAT_MKSPEC = win32-msvc2015
+
+# -utf-8 compiler option for Visual Studio 2015 Update 2
+greaterThan(QMAKE_MSC_FULL_VER, 190023918):!intel_icl {
+ isEmpty(QT_CLANG_MAJOR_VERSION)|!lessThan(QT_CLANG_MAJOR_VERSION, 4) {
+ QMAKE_CFLAGS_UTF8_SOURCE = -utf-8
+ }
+}
+
+greaterThan(QMAKE_MSC_VER, 1909) {
+ # Visual Studio 2017 (15.0) / Visual C++ 19.10 and up
+ MSVC_VER = 15.0
+ COMPAT_MKSPEC = win32-msvc2017
+}
+
+greaterThan(QMAKE_MSC_VER, 1910) {
+ # No compat spec past MSVC 2017
+ COMPAT_MKSPEC =
+}
+
+!isEmpty(COMPAT_MKSPEC):!$$COMPAT_MKSPEC: CONFIG += $$COMPAT_MKSPEC
diff --git a/mkspecs/common/msvc-version.conf b/mkspecs/common/msvc-version.conf
index 3fb55c9d81..de8ba56b7b 100644
--- a/mkspecs/common/msvc-version.conf
+++ b/mkspecs/common/msvc-version.conf
@@ -1,7 +1,6 @@
#
# qmake configuration for Microsoft Visual Studio C/C++ Compiler
-# This file is used by win32-msvc, win32-clang-msvc, and all
-# winrt-XXX-msvcXXX specs
+# This file is used by win32-msvc and all winrt-XXX-msvcXXX specs
#
#
@@ -70,11 +69,8 @@ greaterThan(QMAKE_MSC_VER, 1899) {
QMAKE_CXXFLAGS += -Zc:strictStrings -Zc:throwingNew
QMAKE_CXXFLAGS_WARN_ON += -w44456 -w44457 -w44458 -wd4577 -wd4467
- greaterThan(QMAKE_MSC_FULL_VER, 190023918):!intel_icl {
- isEmpty(QT_CLANG_MAJOR_VERSION)|!lessThan(QT_CLANG_MAJOR_VERSION, 4) {
- QMAKE_CFLAGS_UTF8_SOURCE = -utf-8
- }
- }
+ # -utf-8 compiler option for Visual Studio 2015 Update 2
+ greaterThan(QMAKE_MSC_FULL_VER, 190023918): QMAKE_CFLAGS_UTF8_SOURCE = -utf-8
}
greaterThan(QMAKE_MSC_VER, 1909) {
diff --git a/mkspecs/features/data/dumpvcvars.bat b/mkspecs/features/data/dumpvcvars.bat
new file mode 100644
index 0000000000..4721da2e39
--- /dev/null
+++ b/mkspecs/features/data/dumpvcvars.bat
@@ -0,0 +1,44 @@
+:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+::
+:: Copyright (C) 2018 The Qt Company Ltd.
+:: Contact: https://www.qt.io/licensing/
+::
+:: This file is part of the tools applications of the Qt Toolkit.
+::
+:: $QT_BEGIN_LICENSE:GPL-EXCEPT$
+:: Commercial License Usage
+:: Licensees holding valid commercial Qt licenses may use this file in
+:: accordance with the commercial license agreement provided with the
+:: Software or, alternatively, in accordance with the terms contained in
+:: a written agreement between you and The Qt Company. For licensing terms
+:: and conditions see https://www.qt.io/terms-conditions. For further
+:: information use the contact form at https://www.qt.io/contact-us.
+::
+:: GNU General Public License Usage
+:: Alternatively, this file may be used under the terms of the GNU
+:: General Public License version 3 as published by the Free Software
+:: Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+:: included in the packaging of this file. Please review the following
+:: information to ensure the GNU General Public License requirements will
+:: be met: https://www.gnu.org/licenses/gpl-3.0.html.
+::
+:: $QT_END_LICENSE$
+::
+:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+
+@echo off
+
+REM We clear INCLUDE and LIB, because we want to obtain pristine values.
+REM PATH cannot be cleared, because then the script does not even run,
+REM and it would be counterproductive anyway (see toolchain.prf).
+set INCLUDE=
+set LIB=
+
+call %* || exit 1
+REM VS2015 does not set errorlevel in case of failure.
+if "%INCLUDE%" == "" exit 1
+
+echo =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
+echo %INCLUDE%
+echo %LIB%
+echo %PATH%
diff --git a/mkspecs/features/egl.prf b/mkspecs/features/egl.prf
index 9fa0c9e219..4577785576 100644
--- a/mkspecs/features/egl.prf
+++ b/mkspecs/features/egl.prf
@@ -2,6 +2,7 @@ INCLUDEPATH += $$QMAKE_INCDIR_EGL
LIBS_PRIVATE += $$QMAKE_LIBS_EGL
QMAKE_CFLAGS += $$QMAKE_CFLAGS_EGL
QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_EGL
+DEFINES += $$QMAKE_DEFINES_EGL
LIBS += $$QMAKE_LFLAGS_EGL
for(p, QMAKE_LIBDIR_EGL) {
LIBS_PRIVATE += -L$$p
diff --git a/mkspecs/features/mac/asset_catalogs.prf b/mkspecs/features/mac/asset_catalogs.prf
index 123a0e0fcd..58211c13a2 100644
--- a/mkspecs/features/mac/asset_catalogs.prf
+++ b/mkspecs/features/mac/asset_catalogs.prf
@@ -110,7 +110,7 @@
# Backwards compatibility
for (bundle_data, QMAKE_BUNDLE_DATA) {
for (bundle_file, $${bundle_data}.files) {
- !contains(bundle_file, .*\.xcassets$): next()
+ !contains(bundle_file, .*\\.xcassets$): next()
warning("*.xcassets in QMAKE_BUNDLE_DATA is deprecated. Use QMAKE_ASSET_CATALOGS instead.")
!exists($$absolute_path($$bundle_file/AppIcon.appiconset, $$_PRO_FILE_PWD_)): next()
diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf
index c01e99fe8e..8e2c5e603a 100644
--- a/mkspecs/features/mac/default_post.prf
+++ b/mkspecs/features/mac/default_post.prf
@@ -1,7 +1,7 @@
load(default_post)
contains(TEMPLATE, .*app) {
- !macx-xcode {
+ !macx-xcode:if(isEmpty(BUILDS)|build_pass) {
# Detect changes to the platform SDK
QMAKE_EXTRA_VARIABLES += QMAKE_MAC_SDK QMAKE_MAC_SDK_VERSION QMAKE_XCODE_DEVELOPER_PATH
QMAKE_EXTRA_INCLUDES += $$shell_quote($$PWD/sdk.mk)
@@ -21,7 +21,7 @@ contains(TEMPLATE, .*app) {
!isEmpty($$list($$(QT_MAC_SDK_NO_VERSION_CHECK))): \
CONFIG += sdk_no_version_check
- QMAKE_MAC_SDK_MAJOR_MINOR_VERSION = $$replace(QMAKE_MAC_SDK_VERSION, "(\d+)(\.\d+)(\.\d+)?", \1\2)
+ QMAKE_MAC_SDK_MAJOR_MINOR_VERSION = $$replace(QMAKE_MAC_SDK_VERSION, "(\\d+)(\\.\\d+)(\\.\\d+)?", \\1\\2)
!sdk_no_version_check:!versionAtMost(QMAKE_MAC_SDK_MAJOR_MINOR_VERSION, $$QT_MAC_SDK_VERSION_MAX) {
warning("Qt has only been tested with version $$QT_MAC_SDK_VERSION_MAX"\
diff --git a/mkspecs/features/moc.prf b/mkspecs/features/moc.prf
index 5c7745e5bb..d075183028 100644
--- a/mkspecs/features/moc.prf
+++ b/mkspecs/features/moc.prf
@@ -38,7 +38,7 @@ if(gcc|intel_icl|msvc):!rim_qcc:!uikit:!no_moc_predefs:if(!macos|count(QMAKE_APP
} else: error("Oops, I messed up")
moc_predefs.output = $$MOC_DIR/moc_predefs.h
moc_predefs.input = MOC_PREDEF_FILE
- silent: moc_predefs.commands = @echo generating $$moc_predefs.output$$escape_expand(\n\t)@$$moc_predefs.commands
+ silent: moc_predefs.commands = @echo generating $$moc_predefs.output$$escape_expand(\\n\\t)@$$moc_predefs.commands
QMAKE_EXTRA_COMPILERS += moc_predefs
MOC_PREDEF_FILE = $$[QT_HOST_DATA/src]/mkspecs/features/data/dummy.cpp
}
diff --git a/mkspecs/features/qmake_use.prf b/mkspecs/features/qmake_use.prf
index 8159e471a2..64faa4f215 100644
--- a/mkspecs/features/qmake_use.prf
+++ b/mkspecs/features/qmake_use.prf
@@ -5,14 +5,14 @@ for(ever) {
for (use, QMAKE_USE$${suffix}) {
use = $$split(use, /)
name = $$take_first(use)
- nu = $$upper($$name)
+ nu = $$upper($$replace(name, -, _))
!contains(use, linkonly): CC_USES += $$nu
!contains(use, nolink): LD_USES += $$nu
}
CC_USES = $$resolve_depends(CC_USES, QMAKE_DEPENDS_, _CC)
for (nu, CC_USES) {
!defined(QMAKE_LIBS_$$nu, var): \
- error("Library '$$lower($$nu)' is not defined.")
+ error("Library '$$lower($$replace(nu, _, -))' is not defined.")
DEFINES += $$eval(QMAKE_DEFINES_$${nu})
INCLUDEPATH += $$eval(QMAKE_INCDIR_$${nu})
@@ -20,7 +20,7 @@ for(ever) {
LD_USES = $$resolve_depends(LD_USES, QMAKE_DEPENDS_, _LD)
for (nu, LD_USES) {
!defined(QMAKE_LIBS_$$nu, var): \
- error("Library '$$lower($$nu)' is not defined.")
+ error("Library '$$lower($$replace(nu, _, -))' is not defined.")
debug: \
LIBS$${suffix} += $$eval(QMAKE_LIBS_$${nu}_DEBUG) $$eval(QMAKE_LIBS_$$nu)
diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf
index d16b3cf1be..5da82fdb5b 100644
--- a/mkspecs/features/qt.prf
+++ b/mkspecs/features/qt.prf
@@ -198,28 +198,6 @@ for(ever) {
MODULE_LIBS_ADD = $$MODULE_LIBS
MODULE_LIBS_ADD -= $$QMAKE_DEFAULT_LIBDIRS
- !contains(MODULE_CONFIG, v2) {
- # Backwards compatibility with pre-5.6 module .pri files
-
- contains(MODULE_CONFIG, lib_bundle) {
- MODULE_FRAMEWORKS = $$MODULE_LIBS
- inc = $$MODULE_LIBS/$${MODULE_NAME}.framework/Headers
- MODULE_INCLUDES = $$inc
- contains(MODULE_CONFIG, internal_module): \
- MODULE_INCLUDES += \
- $$inc/$$eval(QT.$${QTLIB}.VERSION) \
- $$inc/$$eval(QT.$${QTLIB}.VERSION)/$$MODULE_NAME
- } else {
- # Re-insert the major version in the library name (cf qt5LibraryTarget above)
- MODULE_NAME ~= s,^Qt,Qt$$QT_MAJOR_VERSION,
- }
-
- # Only link to this module if a libs directory is set, else this is just a module
- # to give access to sources or include files, and not for linking.
- !isEmpty(MODULE_LIBS):!contains(MODULE_CONFIG, no_link): \
- MODULE_MODULE = $${MODULE_NAME}$${QT_LIBINFIX}
- }
-
# Frameworks shouldn't need include paths, but much code does not use
# module-qualified #includes, so by default we add paths which point
# directly into the frameworks. Private modules have somewhat convoluted
diff --git a/mkspecs/features/qt_common.prf b/mkspecs/features/qt_common.prf
index 4ad9946ae0..6cb2e78c1c 100644
--- a/mkspecs/features/qt_common.prf
+++ b/mkspecs/features/qt_common.prf
@@ -89,6 +89,14 @@ clang {
greaterThan(QT_GCC_MAJOR_VERSION, 5): QMAKE_CXXFLAGS_WARN_ON += -Wshift-overflow=2 -Wduplicated-cond
# GCC 7 has a lot of false positives relating to this, so disable completely
greaterThan(QT_GCC_MAJOR_VERSION, 6): QMAKE_CXXFLAGS_WARN_ON += -Wno-stringop-overflow
+ # GCC 9 has a lot of false positives relating to this, so disable completely
+ greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-deprecated-copy
+ # GCC 9 introduced this
+ greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-redundant-move
+ # GCC 9 introduced this
+ greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-format-overflow
+ # GCC 9 introduced this
+ greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-init-list-lifetime
}
warnings_are_errors:warning_clean {
@@ -104,16 +112,17 @@ warnings_are_errors:warning_clean {
QMAKE_CXXFLAGS_WARN_ON += -Werror -Wno-error=\\$${LITERAL_HASH}warnings -Wno-error=deprecated-declarations $$WERROR
}
} else:intel_icc:linux {
- # Intel CC 13.0 - 17.0, on Linux only
+ # Intel CC 13.0 - 18.0, on Linux only
ver = $${QT_ICC_MAJOR_VERSION}.$${QT_ICC_MINOR_VERSION}
- linux:contains(ver, "(1[3456]\\.|17\\.0)") {
+ linux:contains(ver, "(1[345678]\\.|19\\.0)") {
# 177: function "entity" was declared but never referenced
# (too aggressive; ICC reports even for functions created due to template instantiation)
# 1224: #warning directive
# 1478: function "entity" (declared at line N) was declared deprecated
+ # 1786: function "entity" (declared at line N of "file") was declared deprecated ("message")
# 1881: argument must be a constant null pointer value
# (NULL in C++ is usually a literal 0)
- QMAKE_CXXFLAGS_WARN_ON += -Werror -ww177,1224,1478,1881 $$WERROR
+ QMAKE_CXXFLAGS_WARN_ON += -Werror -ww177,1224,1478,1786,1881 $$WERROR
}
} else:gcc:!clang:!intel_icc:!rim_qcc {
# GCC 4.6-4.9, 5.x, ...
@@ -127,7 +136,14 @@ warnings_are_errors:warning_clean {
# GCC 7 includes -Wimplicit-fallthrough in -Wextra, but Qt is not yet free of implicit fallthroughs.
greaterThan(QT_GCC_MAJOR_VERSION, 6): QMAKE_CXXFLAGS_WARN_ON += -Wno-error=implicit-fallthrough
-
+ # GCC 9 has a lot of false positives relating to this, so disable completely
+ greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-deprecated-copy
+ # GCC 9 introduced this
+ greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-redundant-move
+ # GCC 9 introduced this
+ greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-format-overflow
+ # GCC 9 introduced this
+ greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-init-list-lifetime
# Work-around for bug https://code.google.com/p/android/issues/detail?id=58135
android: QMAKE_CXXFLAGS_WARN_ON += -Wno-error=literal-suffix
}
diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf
index d8f5af5404..87190bc52a 100644
--- a/mkspecs/features/qt_configure.prf
+++ b/mkspecs/features/qt_configure.prf
@@ -1,3 +1,13 @@
+#
+# W A R N I N G
+# -------------
+#
+# This file is not part of the Qt API. It exists purely as an
+# implementation detail. It may change from version to version
+# without notice, or even be removed.
+#
+# We mean it.
+#
QT_CONFIGURE_REPORT =
QT_CONFIGURE_NOTES =
@@ -378,6 +388,7 @@ defineReplace(qtConfFindInPathList) {
defineReplace(qtConfFindInPath) {
ensurePathEnv()
+ equals(QMAKE_HOST.os, Windows):!contains(1, .*\\.exe): 1 = $${1}.exe
return($$qtConfFindInPathList($$1, $$2 $$QMAKE_PATH_ENV))
}
@@ -428,12 +439,12 @@ defineTest(qtConfSetupLibraries) {
lpfx = $${currentConfig}.libraries.$${l}
# 'export' may be omitted, in which case it falls back to the library's name
!defined($${lpfx}.export, var) {
- $${lpfx}.export = $$l
+ $${lpfx}.export = $$replace(l, -, _)
export($${lpfx}.export)
}
# 'export' may also be empty, but we need a derived identifier
alias = $$eval($${lpfx}.export)
- isEmpty(alias): alias = $$l
+ isEmpty(alias): alias = $$replace(l, -, _)
$${lpfx}.alias = $$alias
export($${lpfx}.alias)
# make it easy to refer to the library by its export name.
@@ -581,7 +592,43 @@ defineTest(qtConfResolvePathLibs) {
return($$ret)
}
-# includes-var, includes
+defineReplace(qtConfGetTestSourceList) {
+ result =
+ !isEmpty($${1}.test.inherit) {
+ base = $$section(1, ., 0, -2)
+ for (i, $${1}.test.inherit): \
+ result += $$qtConfGetTestSourceList($${base}.$$i)
+ }
+ return($$result $$1)
+}
+
+defineReplace(qtConfGetTestIncludes) {
+ defined($${1}._KEYS_, var) {
+ 1st = $$first($${1}._KEYS_)
+ equals(1st, 0) {
+ # array; recurse for every element
+ ret =
+ for (k, $${1}._KEYS_): \
+ ret += $$qtConfGetTestIncludes($${1}.$$k)
+ return($$ret)
+ }
+ # object; try condition and recurse
+ !defined($${1}.headers, var):!defined($${1}.headers._KEYS_, var): \ # just plain broken without it
+ error("headers object '$$1' has no nested headers entry")
+ cond = $$eval($${1}.condition)
+ isEmpty(cond): \ # would be pointless otherwise
+ error("headers object '$$1' has no condition")
+ !$$qtConfEvaluate($$cond) {
+ qtLog("header entry '$$1' failed condition '$$cond'.")
+ return()
+ }
+ qtLog("header entry '$$1' passed condition.")
+ return($$qtConfGetTestIncludes($${1}.headers))
+ }
+ return($$eval($$1)) # plain string - or nothing (can happen for top-level call only)
+}
+
+# includes-var, in-paths, test-object-var
defineTest(qtConfResolvePathIncs) {
ret = true
for (incdir, 2) {
@@ -593,6 +640,24 @@ defineTest(qtConfResolvePathIncs) {
2 -= $$QMAKE_DEFAULT_INCDIRS
$$1 = $$2
export($$1)
+ wasm {
+ # FIXME: emcc downloads pre-built libraries and adds their include
+ # path to the clang call dynamically. it would be possible to parse
+ # the emcc -s USE_xyz=1 --cflags output to populate xzy_INCDIR and
+ # thus make the code below work.
+ return($$ret)
+ }
+ tests = $$qtConfGetTestSourceList($$3)
+ hdrs =
+ for (test, tests): \
+ hdrs += $$qtConfGetTestIncludes($${test}.headers)
+ for (hdr, hdrs) {
+ h = $$qtConfFindInPathList($$hdr, $$2 $$EXTRA_INCLUDEPATH $$QMAKE_DEFAULT_INCDIRS)
+ isEmpty(h) {
+ qtLog("$$hdr not found in [$$val_escape(2)] and global paths.")
+ ret = false
+ }
+ }
return($$ret)
}
@@ -655,13 +720,17 @@ defineTest(qtConfLibrary_inline) {
}
libdir = $$eval(config.input.$${input}.libdir)
- !isEmpty(libdir): \
- $${1}.libs = -L$$libdir $$eval($${1}.libs)
+ !isEmpty(libdir) {
+ libs =
+ for (ld, libdir): \
+ libs += -L$$ld
+ $${1}.libs = $$libs $$eval($${1}.libs)
+ }
!qtConfResolveAllLibs($$1): \
return(false)
- !qtConfResolvePathIncs($${1}.includedir, $$includes): \
+ !qtConfResolvePathIncs($${1}.includedir, $$includes, $$2): \
return(false)
return(true)
@@ -677,7 +746,7 @@ defineTest(qtConfLibrary_makeSpec) {
!qtConfResolvePathLibs($${1}.libs, $$eval(QMAKE_LIBDIR_$$spec), $$eval(QMAKE_LIBS_$$spec)): \
return(false)
- !qtConfResolvePathIncs($${1}.includedir, $$eval(QMAKE_INCDIR_$$spec)): \
+ !qtConfResolvePathIncs($${1}.includedir, $$eval(QMAKE_INCDIR_$$spec), $$2): \
return(false)
# note that the object is re-exported, because we resolve the libraries.
@@ -740,7 +809,7 @@ defineTest(qtConfLibrary_pkgConfig) {
}
!isEmpty(ignored): \
qtLog("Note: Dropped compiler flags '$$ignored'.")
- !qtConfResolvePathIncs($${1}.includedir, $$includes): \
+ !qtConfResolvePathIncs($${1}.includedir, $$includes, $$2): \
return(false)
$${1}.defines = $$defines
@@ -748,7 +817,7 @@ defineTest(qtConfLibrary_pkgConfig) {
largs = $$qtConfAllLibraryArgs($$eval($${2}.dependencies))
for (la, largs): \
eval("$$la")
- USES = $$eval($$list($$upper($$QMAKE_USE)))
+ USES = $$eval($$list($$upper($$replace(QMAKE_USE, -, _))))
# _CC == _LD for configure's library sources, so pick first arbitrarily.
DEPS = $$resolve_depends(USES, QMAKE_DEPENDS_, _CC)
for (DEP, DEPS) {
@@ -781,7 +850,7 @@ defineTest(qtConfTest_getPkgConfigVariable) {
}
defineReplace(qtConfLibraryArgs) {
- NAME = $$upper($$eval($${1}.library))
+ NAME = $$upper($$replace($${1}.library, -, _))
qmake_args = "QMAKE_LIBS_$${NAME} = $$val_escape($${1}.libs)"
for (b, $${1}.builds._KEYS_): \
qmake_args += "QMAKE_LIBS_$${NAME}_$$upper($$b) = $$val_escape($${1}.builds.$${b})"
@@ -797,8 +866,8 @@ defineReplace(qtConfLibraryArgs) {
for (use, depends): \
dep_uses += $$section(use, :, 1, 1)
qmake_args += \
- "QMAKE_DEPENDS_$${NAME}_CC = $$upper($$dep_uses)" \
- "QMAKE_DEPENDS_$${NAME}_LD = $$upper($$dep_uses)"
+ "QMAKE_DEPENDS_$${NAME}_CC = $$upper($$replace(dep_uses, -, _))" \
+ "QMAKE_DEPENDS_$${NAME}_LD = $$upper($$replace(dep_uses, -, _))"
}
return($$qmake_args)
}
@@ -861,7 +930,7 @@ defineTest(qtConfExportLibrary) {
!isEmpty(use_cfg): \
depends += $$upper($$eval($${use_cfg}.libraries.$${use_lib}.export))
else: \
- depends += $$upper($$use_lib)
+ depends += $$upper($$replace(use_lib, -, _))
}
# we use suffixes instead of infixes, because $$resolve_depends() demands it.
qtConfOutputVar(assign, $$output, QMAKE_DEPENDS_$${NAME}_CC, $$depends)
@@ -930,7 +999,7 @@ defineTest(qtConfHandleLibrary) {
export($${lpfx}.source)
# if the library defines a test, use it to verify the source.
- !isEmpty($${lpfx}.test)|!isEmpty($${lpfx}.test._KEYS_) {
+ defined($${lpfx}.test, var)|defined($${lpfx}.test._KEYS_, var) {
$${lpfx}.resolved_uses = $$currentConfig:$$1
$${lpfx}.host = $$eval($${spfx}.host)
!qtConfTest_compile($$lpfx) {
@@ -1036,7 +1105,7 @@ defineTest(qtConfTestPrepare_compile) {
}
}
isEmpty(libConfig) {
- nu = $$upper($$u)
+ nu = $$upper($$replace(u, -, _))
!defined(QMAKE_LIBS_$$nu, var): \
error("Test $$1 tries to use undeclared library '$$u'")
# using an external library by exported name.
@@ -1055,8 +1124,12 @@ defineTest(qtConfTestPrepare_compile) {
defineTest(qtConfPrepareCompileTestSource) {
test_dir = $$2
- test_lang = $$eval($${1}.lang)
- isEmpty(test_lang): test_lang = "c++"
+ tests = $$qtConfGetTestSourceList($$1)
+
+ test_lang = "c++"
+ for (test, tests): \
+ test_lang += $$eval($${test}.test.lang)
+ test_lang = $$last(test_lang) # Last non-empty, that is.
equals(test_lang, "c++"): suffix = "cpp"
else: equals(test_lang, "c"): suffix = "c"
@@ -1067,33 +1140,48 @@ defineTest(qtConfPrepareCompileTestSource) {
# Create source code
contents = "/* Generated by configure */"
# Custom code before includes
- for (ent, $$qtConfScalarOrList($${1}.head)): \
- contents += $$ent
+ for (test, tests): \
+ for (ent, $$qtConfScalarOrList($${test}.test.head)): \
+ contents += $$ent
# Includes
- for (ent, $$qtConfScalarOrList($${1}.include)): \
- contents += "$${LITERAL_HASH}include <$$ent>"
+ for (test, tests) {
+ hdrs = $$qtConfGetTestIncludes($${test}.test.include)
+ isEmpty(hdrs): \
+ hdrs = $$qtConfGetTestIncludes($${test}.headers)
+ for (ent, hdrs): \
+ contents += "$${LITERAL_HASH}include <$$ent>"
+ }
# Custom code after includes
- for (ent, $$qtConfScalarOrList($${1}.tail)): \
- contents += $$ent
+ for (test, tests): \
+ for (ent, $$qtConfScalarOrList($${test}.test.tail)): \
+ contents += $$ent
# And finally the custom code inside main()
contents += \
"int main(int argc, char **argv)" \
"{" \
" (void)argc; (void)argv;" \
" /* BEGIN TEST: */"
- for (ent, $$qtConfScalarOrList($${1}.main)): \
- contents += " $$ent"
+ for (test, tests): \
+ for (ent, $$qtConfScalarOrList($${test}.test.main)): \
+ contents += " $$ent"
contents += \
" /* END TEST */" \
" return 0;" \
"}"
write_file($$test_dir/main.$$suffix, contents)|error()
+ for (test, tests) {
+ for (file, $$qtConfScalarOrList($${test}.test.files._KEYS_)): \
+ write_file($$test_dir/$$file, $$qtConfScalarOrList($${test}.test.files.$${file}))|error()
+ }
+
# Create stub .pro file
contents = "SOURCES = main.$$suffix"
# Custom project code
- for (ent, $$qtConfScalarOrList($${1}.qmake)): \
- contents += $$ent
+ pwd = $$val_escape($${currentConfig}.dir)
+ for (test, tests): \
+ for (ent, $$qtConfScalarOrList($${test}.test.qmake)): \
+ contents += $$replace(ent, "@PWD@", $$pwd)
write_file($$test_dir/$$basename(test_dir).pro, contents)|error()
}
@@ -1106,7 +1194,7 @@ defineTest(qtConfTest_compile) {
isEmpty(test) {
test_dir = $$test_base_out_dir/$$section(1, ".", -1)
test_out_dir = $$test_dir
- qtConfPrepareCompileTestSource($${1}.test, $$test_dir)
+ qtConfPrepareCompileTestSource($$1, $$test_dir)
} else {
test_dir = $$QMAKE_CONFIG_TESTS_DIR/$$test
test_out_dir = $$test_base_out_dir/$$test
@@ -1196,9 +1284,9 @@ defineTest(qtConfTest_files) {
for(i, $${1}.files._KEYS_) {
f = $$eval($${1}.files.$${i})
qtLog("Searching for file $${f}.")
- contains(f, ".*\.h") {
+ contains(f, ".*\\.h") {
file = $$qtConfFindInPathList($$f, $$EXTRA_INCLUDEPATH $$QMAKE_DEFAULT_INCDIRS)
- } else: contains(f, ".*\.(lib|so|a)") {
+ } else: contains(f, ".*\\.(lib|so|a)") {
file = $$qtConfFindInPathList($$f, $$EXTRA_LIBDIR $$QMAKE_DEFAULT_LIBDIRS)
} else {
# assume we're looking for an executable
@@ -1399,7 +1487,7 @@ defineReplace(qtConfEvaluate) {
1 ~= s/$$escape_expand(\\n) */ /g
expr = $${1}
expr ~= s/&&/ && /g
- expr ~= s/\|\|/ || /g
+ expr ~= s/\\|\\|/ || /g
expr ~= s/!/ ! /g
expr ~= s/\\(/ ( /g
expr ~= s/\\)/ ) /g
@@ -1422,7 +1510,7 @@ defineReplace(qtConfEvaluateSingleExpression) {
} else: contains(e, "^'.*'$") {
# quoted literals
result = $$replace(e, "^'(.*)'$", "\\1")
- } else: contains(e, "^tests\..*") {
+ } else: contains(e, "^tests\\..*") {
!qt_conf_tests_allowed: \
error("Expression '$${1}' refers to a test, which is not allowed at this stage of configuring.")
test = $$section(e, ".", 1, 1)
@@ -1433,7 +1521,7 @@ defineReplace(qtConfEvaluateSingleExpression) {
error("Unknown test object $${test} in expression '$${1}'.")
qtRunSingleTest($$test)
result = $$eval($${currentConfig}.tests.$${test}.$${var})
- } else: contains(e, "^libs\..*") {
+ } else: contains(e, "^libs\\..*") {
!qt_conf_tests_allowed: \
error("Expression '$${1}' refers to a library, which is not allowed at this stage of configuring.")
lib = $$section(e, ".", 1, 1)
@@ -1446,7 +1534,7 @@ defineReplace(qtConfEvaluateSingleExpression) {
!defined($${currentConfig}.libraries.$${lib}.$${var}, var): \
var = sources.$$eval($${currentConfig}.libraries.$${lib}.source).$$var
result = $$eval($${currentConfig}.libraries.$${lib}.$${var})
- } else: contains(e, "^features\..*") {
+ } else: contains(e, "^features\\..*") {
feature = $$section(e, ".", 1, 1)
var = $$section(e, ".", 2, -1)
isEmpty(var): \
@@ -1470,33 +1558,33 @@ defineReplace(qtConfEvaluateSingleExpression) {
!qtConfCheckFeature($$feature): \
error("Expression '$$1' is accessing non-emitted feature $${feature}.")
result = $$eval($${currentConfig}.features.$${feature}.$${var})
- } else: contains(e, "^config\..*") {
- var = $$replace(e, "^config\.", "")
+ } else: contains(e, "^config\\..*") {
+ var = $$replace(e, "^config\\.", "")
result = false
contains(CONFIG, $$var): result = true
- } else: contains(e, "^module\..*") {
- var = $$replace(e, "^module\.", "")
+ } else: contains(e, "^module\\..*") {
+ var = $$replace(e, "^module\\.", "")
result = false
qtConfHaveModule($$var): result = true
- } else: contains(e, "^arch\..*") {
- var = $$replace(e, "^arch\.", "")
+ } else: contains(e, "^arch\\..*") {
+ var = $$replace(e, "^arch\\.", "")
result = false
isEmpty(QT_ARCH): \
qtConfCheckFeature(architecture)
contains(QT_ARCH, $$var): result = true
- } else: contains(e, "^subarch\..*") {
- var = $$replace(e, "^subarch\.", "")
+ } else: contains(e, "^subarch\\..*") {
+ var = $$replace(e, "^subarch\\.", "")
result = false
isEmpty(QT_ARCH): \
qtConfCheckFeature(architecture)
contains(QT_CPU_FEATURES.$$QT_ARCH, $$var): result = true
- } else: contains(e, "^input\..*") {
+ } else: contains(e, "^input\\..*") {
result = $$eval(config.$$e)
- } else: contains(e, "^var\..*") {
- var = $$replace(e, "^var\.", "")
+ } else: contains(e, "^var\\..*") {
+ var = $$replace(e, "^var\\.", "")
result = $$eval($$var)
- } else: contains(e, "^call\..*") {
- call = $$replace(e, "^call\.", "qtConfFunc_")
+ } else: contains(e, "^call\\..*") {
+ call = $$replace(e, "^call\\.", "qtConfFunc_")
!defined($$call, replace): \
error("Call $$call referenced in expression '$${1}' does not exist")
eval(result = \$\$"$$call"())
diff --git a/mkspecs/features/qt_docs.prf b/mkspecs/features/qt_docs.prf
index 3139c443c6..3b74cd4dd5 100644
--- a/mkspecs/features/qt_docs.prf
+++ b/mkspecs/features/qt_docs.prf
@@ -18,7 +18,7 @@ isEmpty(qtver.value): error("No version for documentation specified.")
qtmver.name = QT_VER
qtmver.value = $$replace(qtver.value, ^(\\d+\\.\\d+).*$, \\1)
qtvertag.name = QT_VERSION_TAG
-qtvertag.value = $$replace(qtver.value, \.,)
+qtvertag.value = $$replace(qtver.value, \\.,)
qtdocs.name = QT_INSTALL_DOCS
qtdocs.value = $$[QT_INSTALL_DOCS/src]
builddir.name = BUILDDIR
diff --git a/mkspecs/features/qt_helper_lib.prf b/mkspecs/features/qt_helper_lib.prf
index 05d3b941bd..2cb54fc547 100644
--- a/mkspecs/features/qt_helper_lib.prf
+++ b/mkspecs/features/qt_helper_lib.prf
@@ -31,6 +31,7 @@ THE_TARGET = $$qt5LibraryTarget($$TARGET)
!build_pass {
MODULE = $$replace(TARGET, ^qt, )
+ MODULE ~= s,-,_,
MODULE_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules/qt_ext_$${MODULE}.pri
ucmodule = $$upper($$MODULE)
@@ -46,7 +47,7 @@ THE_TARGET = $$qt5LibraryTarget($$TARGET)
for (use, QMAKE_USE) {
use = $$split(use, /)
name = $$take_first(use)
- nu = $$upper($$name)
+ nu = $$upper($$replace(name, -, _))
!contains(use, linkonly): CC_USES += $$nu
!contains(use, nolink): LD_USES += $$nu
}
diff --git a/mkspecs/features/qt_module_headers.prf b/mkspecs/features/qt_module_headers.prf
index 70d3520e5c..6b4b9143fa 100644
--- a/mkspecs/features/qt_module_headers.prf
+++ b/mkspecs/features/qt_module_headers.prf
@@ -239,6 +239,14 @@ headersclean:!internal_module {
gcc_ver = $${QT_GCC_MAJOR_VERSION}.$${QT_GCC_MINOR_VERSION}
versionAtLeast(gcc_ver, 4.5): hcleanFLAGS += -Wdouble-promotion
versionAtLeast(gcc_ver, 4.9): hcleanFLAGS += -Wfloat-conversion
+ # GCC 9 has a lot of false positives relating to this, so disable completely
+ greaterThan(QT_GCC_MAJOR_VERSION, 8): hcleanFLAGS += -Wno-deprecated-copy
+ # GCC 9 introduced this
+ greaterThan(QT_GCC_MAJOR_VERSION, 8): hcleanFLAGS += -Wno-redundant-move
+ # GCC 9 introduced this
+ greaterThan(QT_GCC_MAJOR_VERSION, 8): hcleanFLAGS += -Wno-format-overflow
+ # GCC 9 introduced this
+ greaterThan(QT_GCC_MAJOR_VERSION, 8): hcleanFLAGS += -Wno-init-list-lifetime
c++11 {
# only enabled for actual c++11 builds due to
diff --git a/mkspecs/features/resources.prf b/mkspecs/features/resources.prf
index a25846bd77..48e9f83885 100644
--- a/mkspecs/features/resources.prf
+++ b/mkspecs/features/resources.prf
@@ -73,17 +73,14 @@ for(resource, RESOURCES) {
}
!isEmpty(RESOURCES):contains(TEMPLATE, .*lib):plugin:static {
- pluginName = $$lower($$replace(_PRO_FILE_, .*/([^/.]+)\\.[^/.]+, \\1))
-
- resource_init_function = $${pluginName}_plugin_resource_init
+ resource_init_function = $$lower($$basename(TARGET))_plugin_resource_init
DEFINES += "QT_PLUGIN_RESOURCE_INIT_FUNCTION=$$resource_init_function"
-
- RESOURCE_INIT_CPP = $$OUT_PWD/$${pluginName}_plugin_resources.cpp
+ RESOURCE_INIT_CPP = $$OUT_PWD/$$lower($$basename(TARGET))_plugin_resources.cpp
GENERATED_SOURCES += $$RESOURCE_INIT_CPP
QMAKE_DISTCLEAN += $$RESOURCE_INIT_CPP
- !build_pass {
+ isEmpty(BUILDS)|build_pass {
RESOURCE_INIT_CONT = \
"// This file is autogenerated by qmake. It contains a function that" \
"// references all resources the plugin includes and the function is" \
diff --git a/mkspecs/features/static_runtime.prf b/mkspecs/features/static_runtime.prf
index 1af3236189..e20bfc4281 100644
--- a/mkspecs/features/static_runtime.prf
+++ b/mkspecs/features/static_runtime.prf
@@ -1,7 +1,7 @@
msvc {
# -MD becomes -MT, -MDd becomes -MTd
- QMAKE_CFLAGS ~= s,^-MD(d?)$,-MT\1,g
- QMAKE_CXXFLAGS ~= s,^-MD(d?)$,-MT\1,g
+ QMAKE_CFLAGS ~= s,^-MD(d?)$,-MT\\1,g
+ QMAKE_CXXFLAGS ~= s,^-MD(d?)$,-MT\\1,g
} else: mingw {
QMAKE_LFLAGS += -static
}
diff --git a/mkspecs/features/toolchain.prf b/mkspecs/features/toolchain.prf
index 55295f271f..2a7cbabc54 100644
--- a/mkspecs/features/toolchain.prf
+++ b/mkspecs/features/toolchain.prf
@@ -1,28 +1,22 @@
-
-defineReplace(qtMakeExpand) {
- out = "$$1"
- for(ever) {
- m = $$replace(out, ".*\\$\\(EXPORT_([^)]+)\\).*", \\1)
- equals(m, $$out): \
- return($$out)
- out = $$replace(out, "\\$\\(EXPORT_$$m\\)", $$eval($$m))
- }
+defineTest(qtToolchainError) {
+ msg = \
+ $$1 \
+ "===================" \
+ $$2 \
+ "===================" \
+ $$3
+ error($$join(msg, $$escape_expand(\\n)))
}
-defineTest(qtCompilerErrror) {
+defineTest(qtCompilerError) {
!cross_compile: \
what =
else: host_build: \
what = " host"
else: \
what = " target"
- msg = \
- "Cannot run$$what compiler '$$1'. Output:" \
- "===================" \
- $$2 \
- "===================" \
- "Maybe you forgot to setup the environment?"
- error($$join(msg, $$escape_expand(\\n)))
+ qtToolchainError("Cannot run$$what compiler '$$1'. Output:", $$2, \
+ "Maybe you forgot to setup the environment?")
}
cross_compile:host_build: \
@@ -30,6 +24,142 @@ cross_compile:host_build: \
else: \
target_prefix = QMAKE_CXX
+#
+# Determine and cache the compiler version
+#
+
+defineReplace(qtVariablesFromMSVC) {
+ ret = $$system("$$1 -nologo -E $$2 $$system_quote($$PWD/data/macros.cpp) 2>NUL", lines, ec)
+ !equals(ec, 0): qtCompilerError($$1, $$ret)
+ return($$ret)
+}
+
+defineReplace(qtVariablesFromGCC) {
+ ret = $$system("$$1 -E $$system_quote($$PWD/data/macros.cpp) \
+ 2>$$QMAKE_SYSTEM_NULL_DEVICE", lines, ec)
+ !equals(ec, 0): qtCompilerError($$1, $$ret)
+ return($$ret)
+}
+
+isEmpty($${target_prefix}.COMPILER_MACROS) {
+ msvc {
+ clang_cl {
+ # We need to obtain the cl.exe version first
+ vars = $$qtVariablesFromMSVC(cl)
+ for (v, vars) {
+ isEmpty(v)|contains(v, $${LITERAL_HASH}.*): next()
+ eval($$v)
+ }
+ isEmpty(QMAKE_MSC_FULL_VER): error("Could not determine the Visual Studio version")
+
+ QMAKE_CFLAGS_MSVC_COMPAT = $$replace(QMAKE_MSC_FULL_VER, "(..)(..)(.*)", \
+ "-fms-compatibility-version=\\1.\\2.\\3")
+ cache($${target_prefix}.QMAKE_CFLAGS_MSVC_COMPAT, set stash, QMAKE_CFLAGS_MSVC_COMPAT)
+ $${target_prefix}.COMPILER_MACROS += QMAKE_CFLAGS_MSVC_COMPAT
+ vars = $$qtVariablesFromMSVC($$QMAKE_CXX, $$QMAKE_CFLAGS_MSVC_COMPAT)
+ } else {
+ vars = $$qtVariablesFromMSVC($$QMAKE_CXX)
+ }
+ } else: gcc|ghs {
+ vars = $$qtVariablesFromGCC($$QMAKE_CXX)
+ }
+ for (v, vars) {
+ !contains(v, "[A-Z_]+ = .*"): next()
+ # Set both <varname> for the outer scope ...
+ eval($$v)
+ v ~= s/ .*//
+ isEmpty($$v): error("Compiler produced empty value for $${v}.")
+ # ... and save QMAKE_(HOST_)?CXX.<varname> in the cache.
+ cache($${target_prefix}.$$v, set stash, $$v)
+ $${target_prefix}.COMPILER_MACROS += $$v
+ }
+ cache($${target_prefix}.COMPILER_MACROS, set stash)
+} else {
+ # load from the cache
+ for (i, $${target_prefix}.COMPILER_MACROS): \
+ $$i = $$eval($${target_prefix}.$$i)
+}
+
+# Populate QMAKE_COMPILER_DEFINES and some compatibility variables.
+# The $$format_number() calls strip leading zeros to avoid misinterpretation as octal.
+QMAKE_COMPILER_DEFINES += __cplusplus=$$QT_COMPILER_STDCXX
+!isEmpty(QMAKE_MSC_VER): \
+ QMAKE_COMPILER_DEFINES += _MSC_VER=$$QMAKE_MSC_VER _MSC_FULL_VER=$$QMAKE_MSC_FULL_VER
+!isEmpty(QMAKE_ICC_VER): \
+ QMAKE_COMPILER_DEFINES += __INTEL_COMPILER=$$QMAKE_ICC_VER __INTEL_COMPILER_UPDATE=$$QMAKE_ICC_UPDATE_VER
+!isEmpty(QMAKE_APPLE_CC): \
+ QMAKE_COMPILER_DEFINES += __APPLE_CC__=$$QMAKE_APPLE_CC
+!isEmpty(QMAKE_APPLE_CLANG_MAJOR_VERSION): \
+ QMAKE_COMPILER_DEFINES += __clang__ \
+ __clang_major__=$$QMAKE_APPLE_CLANG_MAJOR_VERSION \
+ __clang_minor__=$$QMAKE_APPLE_CLANG_MINOR_VERSION \
+ __clang_patchlevel__=$$QMAKE_APPLE_CLANG_PATCH_VERSION
+!isEmpty(QMAKE_CLANG_MAJOR_VERSION): \
+ QMAKE_COMPILER_DEFINES += __clang__ \
+ __clang_major__=$$QMAKE_CLANG_MAJOR_VERSION \
+ __clang_minor__=$$QMAKE_CLANG_MINOR_VERSION \
+ __clang_patchlevel__=$$QMAKE_CLANG_PATCH_VERSION
+!isEmpty(QMAKE_GCC_MAJOR_VERSION): \
+ QMAKE_COMPILER_DEFINES += \
+ __GNUC__=$$QMAKE_GCC_MAJOR_VERSION \
+ __GNUC_MINOR__=$$QMAKE_GCC_MINOR_VERSION \
+ __GNUC_PATCHLEVEL__=$$QMAKE_GCC_PATCH_VERSION
+!isEmpty(QMAKE_GHS_VERSION): \
+ QMAKE_COMPILER_DEFINES += __ghs__ __GHS_VERSION_NUMBER=$$QMAKE_GHS_VERSION
+
+QMAKE_CFLAGS += $$QMAKE_CFLAGS_MSVC_COMPAT
+QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_MSVC_COMPAT
+
+clang_cl|intel_icl {
+ include(../common/msvc-based-version.conf)
+} else: msvc {
+ include(../common/msvc-version.conf)
+}
+
+#
+# Determine and cache the default search paths
+#
+
+defineReplace(qtMakeExpand) {
+ out = "$$1"
+ for(ever) {
+ m = $$replace(out, ".*\\$\\(EXPORT_([^)]+)\\).*", \\1)
+ equals(m, $$out): \
+ return($$out)
+ out = $$replace(out, "\\$\\(EXPORT_$$m\\)", $$eval($$m))
+ }
+}
+
+defineReplace(qtSplitPathList) {
+ paths = $$split(1, $$QMAKE_DIRLIST_SEP)
+ ret =
+ for (p, paths): \
+ ret += $$clean_path($$p)
+ return($$ret)
+}
+
+defineReplace(qtNmakePathList) {
+ paths =
+ for (p, 1): \
+ paths += $$shell_path($$p)
+ paths ~= s,$${LITERAL_HASH},^$${LITERAL_HASH},g
+ paths ~= s,\\$,\$\$,g
+ return($$join(paths, $$QMAKE_DIRLIST_SEP))
+}
+
+msvc {
+ arch = $$lower($$VCPROJ_ARCH)
+ equals(arch, x64): \ # may be "win32" or undefined
+ arch = amd64
+ else: !equals(arch, arm):!equals(arch, arm64): \ # may be "win32" or undefined
+ arch = x86
+ # Consider only WinRT and ARM64 desktop builds to be cross-builds -
+ # the host is assumed to be Intel and capable of running the target
+ # executables (so building for x64 on x86 will break).
+ winrt|equals(arch, arm64): \
+ CONFIG += msvc_cross
+}
+
isEmpty($${target_prefix}.INCDIRS) {
#
# Get default include and library paths from compiler
@@ -69,7 +199,7 @@ isEmpty($${target_prefix}.INCDIRS) {
cxx_flags += -E -v
output = $$system("$$cmd_prefix $$QMAKE_CXX $$qtMakeExpand($$cxx_flags) -xc++ - 2>&1 $$cmd_suffix", lines, ec)
- !equals(ec, 0): qtCompilerErrror($$QMAKE_CXX, $$output)
+ !equals(ec, 0): qtCompilerError($$QMAKE_CXX, $$output)
rim_qcc {
for (line, output) {
@@ -129,7 +259,7 @@ isEmpty($${target_prefix}.INCDIRS) {
# What's more, -print-search-dirs can't be used on clang on Apple because it
# won't print all the library paths (only the clang-internal ones).
output = $$system("$$cmd_prefix $$QMAKE_LINK $$QMAKE_LFLAGS -print-search-dirs", lines, ec)
- !equals(ec, 0): qtCompilerErrror($$QMAKE_LINK, $$output)
+ !equals(ec, 0): qtCompilerError($$QMAKE_LINK, $$output)
for (line, output) {
contains(line, "^libraries: .*") {
@@ -149,7 +279,7 @@ isEmpty($${target_prefix}.INCDIRS) {
} else: ghs {
cmd = $$QMAKE_CXX $$QMAKE_CXXFLAGS -$${LITERAL_HASH} -o /tmp/fake_output /tmp/fake_input.cpp
output = $$system("$$cmd", blob, ec)
- !equals(ec, 0): qtCompilerErrror($$QMAKE_CXX, $$output)
+ !equals(ec, 0): qtCompilerError($$QMAKE_CXX, $$output)
output ~= s/\\\\\\n {8}//g
output = $$split(output, $$escape_expand(\\n))
for (line, output) {
@@ -169,113 +299,121 @@ isEmpty($${target_prefix}.INCDIRS) {
}
}
}
+ } else: msvc_cross {
+ # Use a batch file, because %VAR% in the system() call expands to
+ # the pre-script-call value, and !VAR! cannot be enabled outside
+ # a batch file without invoking another shell instance.
+ cmd = $$system_quote($$system_path($$PWD/data/dumpvcvars.bat))
+
+ hostArch = $$QMAKE_HOST.arch
+ equals(hostArch, x86_64): \
+ hostArch = amd64
+ !equals(arch, $$hostArch): \
+ arch = $${hostArch}_$$arch
+
+ isEmpty(MSVC_VER): \
+ error("Mkspec does not specify MSVC_VER. Cannot continue.")
+ versionAtLeast(MSVC_VER, 15.0) {
+ dir = $$(VSINSTALLDIR)
+ isEmpty(dir): \
+ dir = $$read_registry(HKLM, \
+ "Software\\Microsoft\\VisualStudio\\SxS\\VS7\\$$MSVC_VER", 32)
+ isEmpty(dir): \
+ error("Failed to find the Visual Studio installation directory.")
+ cmd += $$system_quote($$dir\\VC\\Auxiliary\\Build\\vcvarsall.bat) $$arch
+ } else {
+ dir = $$(VCINSTALLDIR)
+ isEmpty(dir): \
+ dir = $$read_registry(HKLM, \
+ "Software\\Microsoft\\VisualStudio\\$$MSVC_VER\\Setup\\VC\\ProductDir", 32)
+ isEmpty(dir): \
+ error("Failed to find the Visual C installation directory.")
+ cmd += $$system_quote($$dir\\vcvarsall.bat) $$arch
+ }
+ winrt: cmd += store
+
+ isEmpty(WINSDK_VER): \
+ error("Mkspec does not specify WINSDK_VER. Cannot continue.")
+ # We prefer the environment variable, because that may work around
+ # a broken registry entry after uninstalling a newer SDK.
+ # However, we do that only if the major+minor SDK version matches
+ # the one requested by the mkspec, as we might be building for a
+ # newer target than the host.
+ winsdk_ver = $$(WindowsSDKVersion)
+ !isEmpty(winsdk_ver) {
+ winsdk_ver ~= s,\\\\$,, # Work around SDK breakage.
+ !equals(WINSDK_VER, $$replace(winsdk_ver, ^(\\d+\\.\\d+).*$, \\1)): \
+ winsdk_ver =
+ }
+ !isEmpty(winsdk_ver) {
+ cmd += $$winsdk_ver
+ } else {
+ winsdk_ver = $$read_registry(HKLM, \
+ "Software\\Microsoft\\Microsoft SDKs\\Windows\\v$$WINSDK_VER\\ProductVersion", 32)
+ isEmpty(winsdk_ver): \
+ error("Windows SDK $$WINSDK_VER requested by mkspec is not installed. Cannot continue.")
+ cmd += $${winsdk_ver}.0
+ }
+
+ output = $$system("$$cmd 2>&1", lines, ec)
+ !equals(ec, 0): \
+ qtToolchainError("SDK setup script failed. Output:", $$output, \
+ "Command was: $$cmd")
+ lines = $$output
+ for(ever) {
+ isEmpty(lines): \
+ break()
+ line = $$take_first(lines)
+ equals(line, "=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+="): \
+ break()
+ }
+ !count(lines, 3): \
+ qtToolchainError("SDK setup script returned unexpected output:", $$output, \
+ "Command was: $$cmd")
+
+ # These contain only paths for the target.
+ QMAKE_DEFAULT_INCDIRS = $$qtSplitPathList($$member(lines, 0))
+ QMAKE_DEFAULT_LIBDIRS = $$qtSplitPathList($$member(lines, 1))
+ # PATH is inherently for the host, and paths that are not shadowed
+ # by vcvarsall.bat are assumed to contain only tools that work for
+ # both host and target builds.
+ QMAKE_DEFAULT_PATH = $$qtSplitPathList($$member(lines, 2))
+ # We de-duplicate, because the script just prepends to the paths for
+ # the host, some of which are identical to the ones for the target.
+ QMAKE_DEFAULT_PATH = $$unique(QMAKE_DEFAULT_PATH)
} else: msvc {
- # This doesn't differentiate between host and target,
- # but neither do the compilers.
LIB = $$getenv("LIB")
QMAKE_DEFAULT_LIBDIRS = $$split(LIB, $$QMAKE_DIRLIST_SEP)
INCLUDE = $$getenv("INCLUDE")
QMAKE_DEFAULT_INCDIRS = $$split(INCLUDE, $$QMAKE_DIRLIST_SEP)
}
- unix {
+ unix:if(!cross_compile|host_build) {
isEmpty(QMAKE_DEFAULT_INCDIRS): QMAKE_DEFAULT_INCDIRS = /usr/include /usr/local/include
isEmpty(QMAKE_DEFAULT_LIBDIRS): QMAKE_DEFAULT_LIBDIRS = /lib /usr/lib
}
- cache($${target_prefix}.INCDIRS, set stash, QMAKE_DEFAULT_INCDIRS)
- cache($${target_prefix}.LIBDIRS, set stash, QMAKE_DEFAULT_LIBDIRS)
+ # cache() complains about undefined variables and doesn't persist empty ones.
+ !isEmpty(QMAKE_DEFAULT_INCDIRS): \
+ cache($${target_prefix}.INCDIRS, set stash, QMAKE_DEFAULT_INCDIRS)
+ !isEmpty(QMAKE_DEFAULT_LIBDIRS): \
+ cache($${target_prefix}.LIBDIRS, set stash, QMAKE_DEFAULT_LIBDIRS)
+ !isEmpty(QMAKE_DEFAULT_PATH): \
+ cache($${target_prefix}.PATH, set stash, QMAKE_DEFAULT_PATH)
} else {
QMAKE_DEFAULT_INCDIRS = $$eval($${target_prefix}.INCDIRS)
QMAKE_DEFAULT_LIBDIRS = $$eval($${target_prefix}.LIBDIRS)
+ QMAKE_DEFAULT_PATH = $$eval($${target_prefix}.PATH)
}
-#
-# Determine and cache the compiler version
-#
-
-defineReplace(qtVariablesFromMSVC) {
- ret = $$system("$$1 -nologo -E $$2 $$system_quote($$PWD/data/macros.cpp) 2>NUL", lines, ec)
- !equals(ec, 0): qtCompilerErrror($$1, $$ret)
- return($$ret)
-}
-
-defineReplace(qtVariablesFromGCC) {
- ret = $$system("$$1 -E $$system_quote($$PWD/data/macros.cpp) \
- 2>$$QMAKE_SYSTEM_NULL_DEVICE", lines, ec)
- !equals(ec, 0): qtCompilerErrror($$1, $$ret)
- return($$ret)
-}
-
-isEmpty($${target_prefix}.COMPILER_MACROS) {
- msvc {
- clang_cl {
- # We need to obtain the cl.exe version first
- vars = $$qtVariablesFromMSVC(cl)
- for (v, vars) {
- isEmpty(v)|contains(v, $${LITERAL_HASH}.*): next()
- eval($$v)
- }
- isEmpty(QMAKE_MSC_FULL_VER): error("Could not determine the Visual Studio version")
-
- QMAKE_CFLAGS_MSVC_COMPAT = $$replace(QMAKE_MSC_FULL_VER, "(..)(..)(.*)", \
- "-fms-compatibility-version=\\1.\\2.\\3")
- cache($${target_prefix}.QMAKE_CFLAGS_MSVC_COMPAT, set stash, QMAKE_CFLAGS_MSVC_COMPAT)
- $${target_prefix}.COMPILER_MACROS += QMAKE_CFLAGS_MSVC_COMPAT
- vars = $$qtVariablesFromMSVC($$QMAKE_CXX, $$QMAKE_CFLAGS_MSVC_COMPAT)
- } else {
- vars = $$qtVariablesFromMSVC($$QMAKE_CXX)
- }
- } else: gcc|ghs {
- vars = $$qtVariablesFromGCC($$QMAKE_CXX)
- }
- for (v, vars) {
- !contains(v, "[A-Z_]+ = .*"): next()
- # Set both <varname> for the outer scope ...
- eval($$v)
- v ~= s/ .*//
- isEmpty($$v): error("Compiler produced empty value for $${v}.")
- # ... and save QMAKE_(HOST_)?CXX.<varname> in the cache.
- cache($${target_prefix}.$$v, set stash, $$v)
- $${target_prefix}.COMPILER_MACROS += $$v
- }
- cache($${target_prefix}.COMPILER_MACROS, set stash)
-} else {
- # load from the cache
- for (i, $${target_prefix}.COMPILER_MACROS): \
- $$i = $$eval($${target_prefix}.$$i)
+msvc_cross {
+ qmake_inc_exp.name = INCLUDE
+ qmake_inc_exp.value = $$qtNmakePathList($$QMAKE_DEFAULT_INCDIRS)
+ qmake_lib_exp.name = LIB
+ qmake_lib_exp.value = $$qtNmakePathList($$QMAKE_DEFAULT_LIBDIRS)
+ qmake_path_exp.name = PATH
+ qmake_path_exp.value = $$qtNmakePathList($$QMAKE_DEFAULT_PATH)
+ QMAKE_EXPORTED_VARIABLES += qmake_inc_exp qmake_lib_exp qmake_path_exp
}
unset(target_prefix)
-
-# Populate QMAKE_COMPILER_DEFINES and some compatibility variables.
-# The $$format_number() calls strip leading zeros to avoid misinterpretation as octal.
-QMAKE_COMPILER_DEFINES += __cplusplus=$$QT_COMPILER_STDCXX
-!isEmpty(QMAKE_MSC_VER): \
- QMAKE_COMPILER_DEFINES += _MSC_VER=$$QMAKE_MSC_VER _MSC_FULL_VER=$$QMAKE_MSC_FULL_VER
-!isEmpty(QMAKE_ICC_VER): \
- QMAKE_COMPILER_DEFINES += __INTEL_COMPILER=$$QMAKE_ICC_VER __INTEL_COMPILER_UPDATE=$$QMAKE_ICC_UPDATE_VER
-!isEmpty(QMAKE_APPLE_CC): \
- QMAKE_COMPILER_DEFINES += __APPLE_CC__=$$QMAKE_APPLE_CC
-!isEmpty(QMAKE_APPLE_CLANG_MAJOR_VERSION): \
- QMAKE_COMPILER_DEFINES += __clang__ \
- __clang_major__=$$QMAKE_APPLE_CLANG_MAJOR_VERSION \
- __clang_minor__=$$QMAKE_APPLE_CLANG_MINOR_VERSION \
- __clang_patchlevel__=$$QMAKE_APPLE_CLANG_PATCH_VERSION
-!isEmpty(QMAKE_CLANG_MAJOR_VERSION): \
- QMAKE_COMPILER_DEFINES += __clang__ \
- __clang_major__=$$QMAKE_CLANG_MAJOR_VERSION \
- __clang_minor__=$$QMAKE_CLANG_MINOR_VERSION \
- __clang_patchlevel__=$$QMAKE_CLANG_PATCH_VERSION
-!isEmpty(QMAKE_GCC_MAJOR_VERSION): \
- QMAKE_COMPILER_DEFINES += \
- __GNUC__=$$QMAKE_GCC_MAJOR_VERSION \
- __GNUC_MINOR__=$$QMAKE_GCC_MINOR_VERSION \
- __GNUC_PATCHLEVEL__=$$QMAKE_GCC_PATCH_VERSION
-!isEmpty(QMAKE_GHS_VERSION): \
- QMAKE_COMPILER_DEFINES += __ghs__ __GHS_VERSION_NUMBER=$$QMAKE_GHS_VERSION
-
-QMAKE_CFLAGS += $$QMAKE_CFLAGS_MSVC_COMPAT
-QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_MSVC_COMPAT
-
-msvc:!intel_icl:!clang_cl: include(../common/msvc-version.conf)
diff --git a/mkspecs/win32-clang-msvc/qmake.conf b/mkspecs/win32-clang-msvc/qmake.conf
index ba9704e069..027f93ca6e 100644
--- a/mkspecs/win32-clang-msvc/qmake.conf
+++ b/mkspecs/win32-clang-msvc/qmake.conf
@@ -15,6 +15,14 @@ QMAKE_CFLAGS += -Wno-microsoft-enum-value
QMAKE_CXXFLAGS += -Wno-microsoft-enum-value
+QMAKE_LINK = lld-link
+QMAKE_LIB = llvm-lib /NOLOGO
+
+QMAKE_CFLAGS_LTCG = -flto
+QMAKE_CXXFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG
+# Leave QMAKE_LFLAGS_LTCG empty because lld-link doesn't need any additional parameters
+QMAKE_LFLAGS_LTCG =
+
# Precompiled headers are not supported yet by clang
CONFIG -= precompile_header
diff --git a/mkspecs/winrt-arm-msvc2015/qmake.conf b/mkspecs/winrt-arm-msvc2015/qmake.conf
index 8bca6f4af8..bc113d4954 100644
--- a/mkspecs/winrt-arm-msvc2015/qmake.conf
+++ b/mkspecs/winrt-arm-msvc2015/qmake.conf
@@ -15,6 +15,5 @@ QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib One
VCPROJ_ARCH = ARM
WINSDK_VER = 10.0
-WINTARGET_VER = winv10.0
WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
WINRT_MANIFEST.architecture = arm
diff --git a/mkspecs/winrt-arm-msvc2017/qmake.conf b/mkspecs/winrt-arm-msvc2017/qmake.conf
index bf571d620c..1160d5766d 100644
--- a/mkspecs/winrt-arm-msvc2017/qmake.conf
+++ b/mkspecs/winrt-arm-msvc2017/qmake.conf
@@ -15,6 +15,5 @@ QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib One
VCPROJ_ARCH = ARM
WINSDK_VER = 10.0
-WINTARGET_VER = winv10.0
WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
WINRT_MANIFEST.architecture = arm
diff --git a/mkspecs/winrt-x64-msvc2015/qmake.conf b/mkspecs/winrt-x64-msvc2015/qmake.conf
index d503399e3c..d1d1eb6513 100644
--- a/mkspecs/winrt-x64-msvc2015/qmake.conf
+++ b/mkspecs/winrt-x64-msvc2015/qmake.conf
@@ -15,6 +15,5 @@ QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib One
VCPROJ_ARCH = x64
WINSDK_VER = 10.0
-WINTARGET_VER = winv10.0
WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
WINRT_MANIFEST.architecture = x64
diff --git a/mkspecs/winrt-x64-msvc2017/qmake.conf b/mkspecs/winrt-x64-msvc2017/qmake.conf
index cb2209fa23..dce896bd47 100644
--- a/mkspecs/winrt-x64-msvc2017/qmake.conf
+++ b/mkspecs/winrt-x64-msvc2017/qmake.conf
@@ -15,6 +15,5 @@ QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib One
VCPROJ_ARCH = x64
WINSDK_VER = 10.0
-WINTARGET_VER = winv10.0
WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
WINRT_MANIFEST.architecture = x64
diff --git a/mkspecs/winrt-x86-msvc2015/qmake.conf b/mkspecs/winrt-x86-msvc2015/qmake.conf
index 37ce0e5525..06f059b600 100644
--- a/mkspecs/winrt-x86-msvc2015/qmake.conf
+++ b/mkspecs/winrt-x86-msvc2015/qmake.conf
@@ -14,6 +14,5 @@ QMAKE_LFLAGS += /SAFESEH /MACHINE:X86 /NODEFAULTLIB:kernel32.lib
QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib OneCore.lib
VCPROJ_ARCH = Win32
WINSDK_VER = 10.0
-WINTARGET_VER = winv10.0
WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
WINRT_MANIFEST.architecture = x86
diff --git a/mkspecs/winrt-x86-msvc2017/qmake.conf b/mkspecs/winrt-x86-msvc2017/qmake.conf
index 3c9506bbad..94fb68f6c0 100644
--- a/mkspecs/winrt-x86-msvc2017/qmake.conf
+++ b/mkspecs/winrt-x86-msvc2017/qmake.conf
@@ -14,6 +14,5 @@ QMAKE_LFLAGS += /SAFESEH /MACHINE:X86 /NODEFAULTLIB:kernel32.lib
QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib OneCore.lib
VCPROJ_ARCH = Win32
WINSDK_VER = 10.0
-WINTARGET_VER = winv10.0
WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
WINRT_MANIFEST.architecture = x86
diff --git a/qmake/Makefile.unix b/qmake/Makefile.unix
index 9e0b51ba55..0f69b6b487 100644
--- a/qmake/Makefile.unix
+++ b/qmake/Makefile.unix
@@ -192,6 +192,9 @@ qmakeevaluator.o: $(QMKLIBSRC)/qmakeevaluator.cpp
qmakebuiltins.o: $(QMKLIBSRC)/qmakebuiltins.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
+registry.o: $(QMKLIBSRC)/registry.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) $<
+
project.o: $(QMKSRC)/project.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
@@ -225,9 +228,6 @@ unixmake.o: $(QMKSRC)/generators/unix/unixmake.cpp
unixmake2.o: $(QMKSRC)/generators/unix/unixmake2.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
-registry.o: $(QMKSRC)/generators/win32/registry.cpp
- $(CXX) -c -o $@ $(CXXFLAGS) $<
-
winmakefile.o: $(QMKSRC)/generators/win32/winmakefile.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
diff --git a/qmake/Makefile.unix.win32 b/qmake/Makefile.unix.win32
index 48efd6f030..faf09ac11e 100644
--- a/qmake/Makefile.unix.win32
+++ b/qmake/Makefile.unix.win32
@@ -18,4 +18,4 @@ QTSRCS = \
$(SOURCE_PATH)/src/corelib/io/qsettings_win.cpp \
$(SOURCE_PATH)/src/corelib/tools/qlocale_win.cpp \
$(SOURCE_PATH)/src/corelib/plugin/qsystemlibrary.cpp \
- $(SOURCE_PATH)/qmake/generators/win32/registry.cpp
+ $(SOURCE_PATH)/qmake/library/registry.cpp
diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc
index 1a779a94b4..fb8bad32a2 100644
--- a/qmake/doc/src/qmake-manual.qdoc
+++ b/qmake/doc/src/qmake-manual.qdoc
@@ -3258,6 +3258,17 @@
Returns the \c string with every special regular expression character
escaped with a backslash. This function is a wrapper around QRegExp::escape.
+ \section2 read_registry(tree, key[, flag])
+
+ Returns the value of registry key \c key inside the tree \c tree.
+
+ Only the trees \c HKEY_CURRENT_USER (\c HKCU) and \c HKEY_LOCAL_MACHINE
+ (\c HKLM) are supported.
+
+ The \c flag may be \c WOW64_32KEY (\c 32) or \c WOW64_64KEY (\c 64).
+
+ \note This function is available only on Windows hosts.
+
\section2 relative_path(filePath[, base])
Returns the path to \c filePath relative to \c base.
@@ -3406,7 +3417,7 @@
\snippet code/doc_src_qmake-manual.pro 72
Like \l {qmake-cat}{$$cat()}, the \a mode argument takes \c blob, \c lines,
- \c true, and \false as value. However, the legacy word splitting rules
+ \c true, and \c false as value. However, the legacy word splitting rules
(i.e. empty or \c true, and \c false) differ subtly.
If you pass \c stsvar, the command's exit status will be stored in that
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 7247d1f8df..99455e7cb5 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -1289,6 +1289,7 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild)
}
}
bool is_target = (wild == fileFixify(var("TARGET"), FileFixifyAbsolute));
+ const bool noStrip = installConfigValues.contains("nostrip");
if(is_target || exists(wild)) { //real file or target
QFileInfo fi(fileInfo(wild));
QString dst_file = filePrefixRoot(root, dst_dir);
@@ -1302,7 +1303,7 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild)
cmd = QLatin1String("-$(QINSTALL)");
cmd += " " + escapeFilePath(wild) + " " + escapeFilePath(dst_file);
inst << cmd;
- if (!project->isActiveConfig("debug_info") && !project->isActiveConfig("nostrip") &&
+ if (!noStrip && !project->isActiveConfig("debug_info") && !project->isActiveConfig("nostrip") &&
!fi.isDir() && fi.isExecutable() && !project->isEmpty("QMAKE_STRIP"))
inst << QString("-") + var("QMAKE_STRIP") + " " +
escapeFilePath(filePrefixRoot(root, fileFixify(dst_dir + filestr, FileFixifyAbsolute, false)));
@@ -1337,7 +1338,7 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild)
QString cmd = QLatin1String("-$(QINSTALL) ") +
escapeFilePath(dirstr + file) + " " + escapeFilePath(dst_file);
inst << cmd;
- if (!project->isActiveConfig("debug_info") && !project->isActiveConfig("nostrip") &&
+ if (!noStrip && !project->isActiveConfig("debug_info") && !project->isActiveConfig("nostrip") &&
!fi.isDir() && fi.isExecutable() && !project->isEmpty("QMAKE_STRIP"))
inst << QString("-") + var("QMAKE_STRIP") + " " +
escapeFilePath(filePrefixRoot(root, fileFixify(dst_dir + file, FileFixifyAbsolute, false)));
@@ -1875,12 +1876,14 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
if (config.indexOf("combine") != -1) {
// compilers with a combined input only have one output
QString input = project->first(ProKey(*it + ".output")).toQString();
- t << ' ' << escapeDependencyPath(Option::fixPathToTargetOS(
- replaceExtraCompilerVariables(tmp_out, input, QString(), NoShell)));
+ t << ' ' << escapeDependencyPath(fileFixify(
+ replaceExtraCompilerVariables(tmp_out, input, QString(), NoShell),
+ FileFixifyFromOutdir));
} else {
for (ProStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) {
- t << ' ' << escapeDependencyPath(Option::fixPathToTargetOS(
- replaceExtraCompilerVariables(tmp_out, (*input).toQString(), QString(), NoShell)));
+ t << ' ' << escapeDependencyPath(fileFixify(
+ replaceExtraCompilerVariables(tmp_out, (*input).toQString(), QString(), NoShell),
+ FileFixifyFromOutdir));
}
}
t << endl;
@@ -1916,8 +1919,9 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
QString tinp = (*input).toQString();
QString out = replaceExtraCompilerVariables(tmp_out, tinp, QString(), NoShell);
for (const QString &rc : qAsConst(raw_clean)) {
- dels << ' ' + escapeFilePath(Option::fixPathToTargetOS(
- replaceExtraCompilerVariables(rc, tinp, out, NoShell), false));
+ dels << ' ' + escapeFilePath(fileFixify(
+ replaceExtraCompilerVariables(rc, tinp, out, NoShell),
+ FileFixifyFromOutdir));
}
}
if(project->isActiveConfig("no_delete_multiple_files")) {
@@ -2033,7 +2037,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
QString out = replaceExtraCompilerVariables(tmp_out, QString(), QString(), NoShell);
QString cmd = replaceExtraCompilerVariables(tmp_cmd, inputs, QStringList() << out, TargetShell);
- t << escapeDependencyPath(Option::fixPathToTargetOS(out)) << ":";
+ t << escapeDependencyPath(fileFixify(out, FileFixifyFromOutdir)) << ":";
// compiler.CONFIG+=explicit_dependencies means that ONLY compiler.depends gets to cause Makefile dependencies
if (config.indexOf("explicit_dependencies") != -1) {
t << " " << valList(escapeDependencyPaths(fileFixify(tmp_dep, FileFixifyFromOutdir)));
@@ -2045,14 +2049,16 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
}
for (ProStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) {
QString inpf = (*input).toQString();
- QString in = Option::fixPathToTargetOS(inpf, false);
- QStringList deps = findDependencies(inpf);
- deps << in;
- QString out = Option::fixPathToTargetOS(replaceExtraCompilerVariables(tmp_out, inpf, QString(), NoShell));
+ QStringList deps;
+ deps << fileFixify(inpf, FileFixifyFromOutdir);
+ deps += findDependencies(inpf);
+ QString out = fileFixify(replaceExtraCompilerVariables(tmp_out, inpf, QString(), NoShell),
+ FileFixifyFromOutdir);
if(!tmp_dep.isEmpty()) {
QStringList pre_deps = fileFixify(tmp_dep, FileFixifyFromOutdir);
for(int i = 0; i < pre_deps.size(); ++i)
- deps << replaceExtraCompilerVariables(pre_deps.at(i), inpf, out, NoShell);
+ deps << fileFixify(replaceExtraCompilerVariables(pre_deps.at(i), inpf, out, NoShell),
+ FileFixifyFromOutdir);
}
QString cmd = replaceExtraCompilerVariables(tmp_cmd, inpf, out, TargetShell);
// NOTE: The var -> QMAKE_COMP_var replace feature is unsupported, do not use!
@@ -2112,7 +2118,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
//use the depend system to find includes of these included files
QStringList inc_deps;
for(int i = 0; i < deps.size(); ++i) {
- const QString dep = deps.at(i);
+ const QString dep = fileFixify(deps.at(i), FileFixifyFromOutdir | FileFixifyAbsolute);
if(QFile::exists(dep)) {
SourceFileType type = TYPE_UNKNOWN;
if(type == TYPE_UNKNOWN) {
@@ -2149,11 +2155,10 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
}
}
}
- deps += inc_deps;
+ deps += fileFixify(inc_deps, FileFixifyFromOutdir);
}
for(int i = 0; i < deps.size(); ) {
QString &dep = deps[i];
- dep = Option::fixPathToTargetOS(dep, false);
if(out == dep)
deps.removeAt(i);
else
@@ -2207,6 +2212,25 @@ MakefileGenerator::writeExtraVariables(QTextStream &t)
}
}
+// This is a more powerful alternative to the above function.
+// It's meant to be internal, as one can make quite a mess with it.
+void
+MakefileGenerator::writeExportedVariables(QTextStream &t)
+{
+ const auto &vars = project->values("QMAKE_EXPORTED_VARIABLES");
+ if (vars.isEmpty())
+ return;
+ for (const auto &exp : vars) {
+ const ProString &name = project->first(ProKey(exp + ".name"));
+ const ProString &value = project->first(ProKey(exp + ".value"));
+ if (!value.isEmpty())
+ t << name << " = " << value << endl;
+ else
+ t << name << " =\n";
+ }
+ t << endl;
+}
+
bool
MakefileGenerator::writeDummyMakefile(QTextStream &t)
{
diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h
index b5c150e1cb..0c30e74a1d 100644
--- a/qmake/generators/makefile.h
+++ b/qmake/generators/makefile.h
@@ -79,6 +79,7 @@ protected:
void writeHeader(QTextStream &t);
void writeSubDirs(QTextStream &t);
void writeMakeQmake(QTextStream &t, bool noDummyQmakeAll = false);
+ void writeExportedVariables(QTextStream &t);
void writeExtraVariables(QTextStream &t);
void writeExtraTargets(QTextStream &t);
void writeExtraCompilerTargets(QTextStream &t);
diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp
index 50ec8db79e..4cbe06d9dc 100644
--- a/qmake/generators/unix/unixmake.cpp
+++ b/qmake/generators/unix/unixmake.cpp
@@ -399,6 +399,8 @@ UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
libdirs.append(QMakeLocalFileName(dlib.toQString()));
frameworkdirs.append(QMakeLocalFileName("/System/Library/Frameworks"));
frameworkdirs.append(QMakeLocalFileName("/Library/Frameworks"));
+ ProStringList extens;
+ extens << project->first("QMAKE_EXTENSION_SHLIB") << "a";
static const char * const lflags[] = { "LIBS", "LIBS_PRIVATE",
"QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", nullptr };
for (int i = 0; lflags[i]; i++) {
@@ -417,8 +419,6 @@ UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
libdirs.insert(libidx++, f);
} else if(opt.startsWith("-l")) {
QString lib = opt.mid(2);
- ProStringList extens;
- extens << project->first("QMAKE_EXTENSION_SHLIB") << "a";
for (QList<QMakeLocalFileName>::Iterator dep_it = libdirs.begin();
dep_it != libdirs.end(); ++dep_it) {
QString libBase = (*dep_it).local() + '/'
@@ -521,8 +521,18 @@ UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
lflags[arch].append(opt);
}
} else if(!opt.isNull()) {
+ for (const ProString &ext : extens) {
+ if (opt.size() > ext.size() && opt.endsWith(ext)
+ && opt.at(opt.size() - ext.size() - 1) == '.') {
+ // Make sure we keep the dependency order of libraries
+ lflags[arch].removeAll(opt);
+ lflags[arch].append(opt);
+ goto found2;
+ }
+ }
if(!lflags[arch].contains(opt))
lflags[arch].append(opt);
+ found2: ;
}
}
diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp
index d3abedb50b..4b33713a75 100644
--- a/qmake/generators/unix/unixmake2.cpp
+++ b/qmake/generators/unix/unixmake2.cpp
@@ -180,6 +180,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
ProStringList &bundledFiles = project->values("QMAKE_BUNDLED_FILES");
+ writeExportedVariables(t);
+
t << "####### Compiler, tools and options\n\n";
t << "CC = " << var("QMAKE_CC") << endl;
t << "CXX = " << var("QMAKE_CXX") << endl;
diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp
index 306ae57871..aa3d389b67 100644
--- a/qmake/generators/win32/msvc_nmake.cpp
+++ b/qmake/generators/win32/msvc_nmake.cpp
@@ -34,23 +34,10 @@
#include <qdiriterator.h>
#include <qset.h>
-#include <registry_p.h>
-
#include <time.h>
QT_BEGIN_NAMESPACE
-static QString nmakePathList(const QStringList &list)
-{
- QStringList pathList;
- pathList.reserve(list.size());
- for (const QString &path : list)
- pathList.append(QDir::cleanPath(path));
-
- return QDir::toNativeSeparators(pathList.join(QLatin1Char(';')))
- .replace('#', QLatin1String("^#")).replace('$', QLatin1String("$$"));
-}
-
NmakeMakefileGenerator::NmakeMakefileGenerator() : usePCH(false), usePCHC(false)
{
@@ -70,202 +57,6 @@ NmakeMakefileGenerator::writeMakefile(QTextStream &t)
if(Option::mkfile::do_stub_makefile)
return MakefileGenerator::writeStubMakefile(t);
#endif
- if (!project->isHostBuild()) {
- const QString msvcVer = project->first("MSVC_VER").toQString();
- if (msvcVer.isEmpty()) {
- fprintf(stderr, "Mkspec does not specify MSVC_VER. Cannot continue.\n");
- return false;
- }
-
- bool winrtBuild = false;
- bool crossPlatformDesktopBuild = false;
- QString arch = project->first("VCPROJ_ARCH").toQString().toLower();
- if (project->isActiveConfig(QStringLiteral("winrt"))) {
- winrtBuild = true;
-
- // Only add explicit support for arm64 cross-platform desktop builds.
- } else if ((arch == QLatin1String("arm64")) && (msvcVer == QStringLiteral("15.0"))) {
- crossPlatformDesktopBuild = true;
- }
-
- if (winrtBuild || crossPlatformDesktopBuild) {
- QString compiler;
- QString compilerArch;
- const ProStringList hostArch = project->values("QMAKE_TARGET.arch");
- if (msvcVer == QStringLiteral("15.0")) {
- if (hostArch.contains("x86_64"))
- compiler = QStringLiteral("HostX64/");
- else
- compiler = QStringLiteral("HostX86/");
- if (arch == QLatin1String("arm")) {
- compiler += QStringLiteral("arm");
- compilerArch = QStringLiteral("arm");
- } else if (arch == QLatin1String("x64")) {
- compiler += QStringLiteral("x64");
- compilerArch = QStringLiteral("amd64");
- } else if (arch == QLatin1String("arm64")) {
- compiler += QStringLiteral("arm64");
- compilerArch = QStringLiteral("arm64");
- } else {
- arch = QStringLiteral("x86");
- compiler += QStringLiteral("x86");
- }
- } else {
- if (arch == QLatin1String("arm")) {
- compiler = QStringLiteral("x86_arm");
- compilerArch = QStringLiteral("arm");
- } else if (arch == QLatin1String("x64")) {
- const ProStringList hostArch = project->values("QMAKE_TARGET.arch");
- if (hostArch.contains("x86_64"))
- compiler = QStringLiteral("amd64");
- else
- compiler = QStringLiteral("x86_amd64");
- compilerArch = QStringLiteral("amd64");
- } else {
- arch = QStringLiteral("x86");
- }
- }
-
- const QString winsdkVer = project->first("WINSDK_VER").toQString();
- if (winsdkVer.isEmpty()) {
- fprintf(stderr, "Mkspec does not specify WINSDK_VER. Cannot continue.\n");
- return false;
- }
- const QString targetVer = project->first("WINTARGET_VER").toQString();
- if (targetVer.isEmpty() && winrtBuild) {
- fprintf(stderr, "Mkspec does not specify WINTARGET_VER. Cannot continue.\n");
- return false;
- }
-
-#ifdef Q_OS_WIN
- QString regKey;
- if (msvcVer == QStringLiteral("15.0"))
- regKey = QStringLiteral("Software\\Microsoft\\VisualStudio\\SxS\\VS7\\") + msvcVer;
- else
- regKey = QStringLiteral("Software\\Microsoft\\VisualStudio\\") + msvcVer + ("\\Setup\\VC\\ProductDir");
- const QString vcInstallDir = qt_readRegistryKey(HKEY_LOCAL_MACHINE, regKey, KEY_WOW64_32KEY);
- if (vcInstallDir.isEmpty()) {
- fprintf(stderr, "Failed to find the Visual Studio installation directory.\n");
- return false;
- }
-
- const QString windowsPath = "Software\\Microsoft\\Microsoft SDKs\\Windows\\v";
-
- regKey = windowsPath + winsdkVer + QStringLiteral("\\InstallationFolder");
- const QString kitDir = qt_readRegistryKey(HKEY_LOCAL_MACHINE, regKey, KEY_WOW64_32KEY);
- if (kitDir.isEmpty()) {
- fprintf(stderr, "Failed to find the Windows Kit installation directory.\n");
- return false;
- }
-#else
- const QString vcInstallDir = "/fake/vc_install_dir";
- const QString kitDir = "/fake/sdk_install_dir";
-#endif // Q_OS_WIN
- QStringList incDirs;
- QStringList libDirs;
- QStringList binDirs;
- if (msvcVer == QStringLiteral("15.0")) {
- const QString toolsInstallDir = qgetenv("VCToolsInstallDir");
- if (toolsInstallDir.isEmpty()) {
- fprintf(stderr, "Failed to access tools installation dir.\n");
- return false;
- }
-
- binDirs << toolsInstallDir + QStringLiteral("bin/") + compiler;
- if (arch == QStringLiteral("x64"))
- binDirs << toolsInstallDir + QStringLiteral("bin/HostX86/X86");
- binDirs << kitDir + QStringLiteral("bin/x86");
- binDirs << vcInstallDir + QStringLiteral("Common7/Tools");
- binDirs << vcInstallDir + QStringLiteral("Common7/ide");
- binDirs << vcInstallDir + QStringLiteral("MSBuild/15.0/bin");
-
- incDirs << toolsInstallDir + QStringLiteral("include");
- incDirs << vcInstallDir + QStringLiteral("VC/Auxiliary/VS/include");
-
- const QString crtVersion = qgetenv("UCRTVersion");
- if (crtVersion.isEmpty()) {
- fprintf(stderr, "Failed to access CRT version.\n");
- return false;
- }
- const QString crtInclude = kitDir + QStringLiteral("Include/") + crtVersion;
- const QString crtLib = kitDir + QStringLiteral("Lib/") + crtVersion;
- incDirs << crtInclude + QStringLiteral("/ucrt");
- incDirs << crtInclude + QStringLiteral("/um");
- incDirs << crtInclude + QStringLiteral("/shared");
- incDirs << crtInclude + QStringLiteral("/winrt");
-
- if (winrtBuild) {
- // Only use mobile-specific headers and link against store-specific libs for
- // winrt builds.
- incDirs << kitDir + QStringLiteral("Extension SDKs/WindowsMobile/")
- + crtVersion + QStringLiteral("/Include/WinRT");
-
- libDirs << toolsInstallDir + QStringLiteral("lib/") + arch + QStringLiteral("/store");
- } else {
- // Desktop projects may require the atl headers and libs.
- incDirs << toolsInstallDir + QStringLiteral("atlmfc/include");
- libDirs << toolsInstallDir + QStringLiteral("atlmfc/lib/") + compilerArch;
- libDirs << toolsInstallDir + QStringLiteral("lib/") + arch;
- }
-
- libDirs << vcInstallDir + QStringLiteral("VC/Auxiliary/VS/lib/") + arch;
-
- libDirs << crtLib + QStringLiteral("/ucrt/") + arch;
- libDirs << crtLib + QStringLiteral("/um/") + arch;
- } else if (msvcVer == QStringLiteral("14.0")) {
- binDirs << vcInstallDir + QStringLiteral("bin/") + compiler;
- binDirs << vcInstallDir + QStringLiteral("bin/"); // Maybe remove for x86 again?
- binDirs << kitDir + QStringLiteral("bin/") + (arch == QStringLiteral("arm") ? QStringLiteral("x86") : arch);
- binDirs << vcInstallDir + QStringLiteral("../Common7/Tools/bin");
- binDirs << vcInstallDir + QStringLiteral("../Common7/Tools");
- binDirs << vcInstallDir + QStringLiteral("../Common7/ide");
- binDirs << kitDir + QStringLiteral("Windows Performance Toolkit/");
-
- incDirs << vcInstallDir + QStringLiteral("include");
- incDirs << vcInstallDir + QStringLiteral("atlmfc/include");
-
- const QString crtVersion = qgetenv("UCRTVersion");
- if (crtVersion.isEmpty()) {
- fprintf(stderr, "Failed to access CRT version.\n");
- return false;
- }
- const QString crtInclude = kitDir + QStringLiteral("Include/") + crtVersion;
- const QString crtLib = kitDir + QStringLiteral("Lib/") + crtVersion;
- incDirs << crtInclude + QStringLiteral("/ucrt");
- incDirs << crtInclude + QStringLiteral("/um");
- incDirs << crtInclude + QStringLiteral("/shared");
- incDirs << crtInclude + QStringLiteral("/winrt");
-
- incDirs << kitDir + QStringLiteral("Extension SDKs/WindowsMobile/")
- + crtVersion + QStringLiteral("/Include/WinRT");
-
- libDirs << vcInstallDir + QStringLiteral("lib/store/") + compilerArch;
- libDirs << vcInstallDir + QStringLiteral("atlmfc/lib") + compilerArch;
-
- libDirs << crtLib + QStringLiteral("/ucrt/") + arch;
- libDirs << crtLib + QStringLiteral("/um/") + arch;
- } else {
- incDirs << vcInstallDir + QStringLiteral("/include");
- libDirs << vcInstallDir + QStringLiteral("/lib/store/") + compilerArch
- << vcInstallDir + QStringLiteral("/lib/") + compilerArch;
- binDirs << vcInstallDir + QStringLiteral("/bin/") + compiler
- << vcInstallDir + QStringLiteral("/../Common7/IDE");
- libDirs << kitDir + QStringLiteral("/Lib/") + targetVer + ("/um/") + arch;
- incDirs << kitDir + QStringLiteral("/include/um")
- << kitDir + QStringLiteral("/include/shared")
- << kitDir + QStringLiteral("/include/winrt");
- }
-
- binDirs << vcInstallDir + QStringLiteral("/bin");
-
- // Inherit PATH
- binDirs << QString::fromLocal8Bit(qgetenv("PATH")).split(QLatin1Char(';'));
-
- t << "\nINCLUDE = " << nmakePathList(incDirs);
- t << "\nLIB = " << nmakePathList(libDirs);
- t << "\nPATH = " << nmakePathList(binDirs) << '\n';
- }
- }
writeNmakeParts(t);
return MakefileGenerator::writeMakefile(t);
}
@@ -553,12 +344,13 @@ void NmakeMakefileGenerator::writeImplicitRulesPart(QTextStream &t)
QDirIterator dit(sourceDir, sourceFilesFilter, QDir::Files | QDir::NoDotAndDotDot);
while (dit.hasNext()) {
dit.next();
- QString &duplicate = fileNames[dit.fileName()];
+ const QFileInfo fi = dit.fileInfo();
+ QString &duplicate = fileNames[fi.completeBaseName()];
if (duplicate.isNull()) {
- duplicate = dit.filePath();
+ duplicate = fi.filePath();
} else {
warn_msg(WarnLogic, "%s conflicts with %s", qPrintable(duplicate),
- qPrintable(dit.filePath()));
+ qPrintable(fi.filePath()));
duplicatesFound = true;
}
}
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
index e0d03ccc1c..91215c94b1 100644
--- a/qmake/generators/win32/winmakefile.cpp
+++ b/qmake/generators/win32/winmakefile.cpp
@@ -520,6 +520,8 @@ void Win32MakefileGenerator::writeIncPart(QTextStream &t)
void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
{
+ writeExportedVariables(t);
+
t << "####### Compiler, tools and options\n\n";
t << "CC = " << var("QMAKE_CC") << endl;
t << "CXX = " << var("QMAKE_CXX") << endl;
diff --git a/qmake/library/qmakebuiltins.cpp b/qmake/library/qmakebuiltins.cpp
index f81bec158b..dd7766c8e0 100644
--- a/qmake/library/qmakebuiltins.cpp
+++ b/qmake/library/qmakebuiltins.cpp
@@ -52,6 +52,9 @@
# include <qthreadpool.h>
#endif
#include <qversionnumber.h>
+#ifdef Q_OS_WIN
+# include <registry_p.h>
+#endif
#include <algorithm>
@@ -93,7 +96,7 @@ enum ExpandFunc {
E_UPPER, E_LOWER, E_TITLE, E_FILES, E_PROMPT, E_RE_ESCAPE, E_VAL_ESCAPE,
E_REPLACE, E_SORT_DEPENDS, E_RESOLVE_DEPENDS, E_ENUMERATE_VARS,
E_SHADOWED, E_ABSOLUTE_PATH, E_RELATIVE_PATH, E_CLEAN_PATH,
- E_SYSTEM_PATH, E_SHELL_PATH, E_SYSTEM_QUOTE, E_SHELL_QUOTE, E_GETENV
+ E_SYSTEM_PATH, E_SHELL_PATH, E_SYSTEM_QUOTE, E_SHELL_QUOTE, E_GETENV, E_READ_REGISTRY
};
enum TestFunc {
@@ -190,6 +193,7 @@ void QMakeEvaluator::initFunctionStatics()
{ "system_quote", E_SYSTEM_QUOTE, -1, 1, "arg" },
{ "shell_quote", E_SHELL_QUOTE, -1, 1, "arg" },
{ "getenv", E_GETENV, 1, 1, "arg" },
+ { "read_registry", E_READ_REGISTRY, 2, 3, "tree, key, [wow64]" },
};
statics.expands.reserve((int)(sizeof(expandInits)/sizeof(expandInits[0])));
for (unsigned i = 0; i < sizeof(expandInits)/sizeof(expandInits[0]); ++i)
@@ -1214,6 +1218,40 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinExpand(
ret << ProString(m_option->getEnv(u1.str()));
break;
}
+#ifdef Q_OS_WIN
+ case E_READ_REGISTRY: {
+ HKEY tree;
+ const auto par = args.at(0);
+ if (!par.compare(QLatin1String("HKCU"), Qt::CaseInsensitive)
+ || !par.compare(QLatin1String("HKEY_CURRENT_USER"), Qt::CaseInsensitive)) {
+ tree = HKEY_CURRENT_USER;
+ } else if (!par.compare(QLatin1String("HKLM"), Qt::CaseInsensitive)
+ || !par.compare(QLatin1String("HKEY_LOCAL_MACHINE"), Qt::CaseInsensitive)) {
+ tree = HKEY_LOCAL_MACHINE;
+ } else {
+ evalError(fL1S("read_registry(): invalid or unsupported registry tree %1.")
+ .arg(par.toQStringView()));
+ goto allfail;
+ }
+ int flags = 0;
+ if (args.count() > 2) {
+ const auto opt = args.at(2);
+ if (opt == "32"
+ || !opt.compare(QLatin1String("wow64_32key"), Qt::CaseInsensitive)) {
+ flags = KEY_WOW64_32KEY;
+ } else if (opt == "64"
+ || !opt.compare(QLatin1String("wow64_64key"), Qt::CaseInsensitive)) {
+ flags = KEY_WOW64_64KEY;
+ } else {
+ evalError(fL1S("read_registry(): invalid option %1.")
+ .arg(opt.toQStringView()));
+ goto allfail;
+ }
+ }
+ ret << ProString(qt_readRegistryKey(tree, args.at(1).toQString(m_tmp1), flags));
+ break;
+ }
+#endif
default:
evalError(fL1S("Function '%1' is not implemented.").arg(func.toQStringView()));
break;
diff --git a/qmake/generators/win32/registry.cpp b/qmake/library/registry.cpp
index 3391ab9512..3391ab9512 100644
--- a/qmake/generators/win32/registry.cpp
+++ b/qmake/library/registry.cpp
diff --git a/qmake/generators/win32/registry_p.h b/qmake/library/registry_p.h
index 3526dffd45..f9e8bba016 100644
--- a/qmake/generators/win32/registry_p.h
+++ b/qmake/library/registry_p.h
@@ -40,8 +40,6 @@
// We mean it.
//
-QT_BEGIN_NAMESPACE
-
#include <QtCore/qglobal.h>
#ifdef Q_OS_WIN32
@@ -52,6 +50,8 @@ QT_BEGIN_NAMESPACE
#include <QtCore/qstring.h>
+QT_BEGIN_NAMESPACE
+
/**
* Read a value from the Windows registry.
*
diff --git a/qmake/qmake_pch.h b/qmake/qmake_pch.h
index c0f62b263d..c97c872311 100644
--- a/qmake/qmake_pch.h
+++ b/qmake/qmake_pch.h
@@ -54,10 +54,10 @@
#include <stdlib.h>
#include <qregexp.h>
-QT_BEGIN_NAMESPACE
//#include <qdir.h>
//#include "option.h"
+QT_BEGIN_NAMESPACE
QT_END_NAMESPACE
#endif
diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/HLSLCompiler.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/HLSLCompiler.cpp
index b38765070b..5d47308d67 100644
--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/HLSLCompiler.cpp
+++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/HLSLCompiler.cpp
@@ -14,6 +14,10 @@
#include "libANGLE/histogram_macros.h"
#include "third_party/trace_event/trace_event.h"
+#ifndef QT_D3DCOMPILER_DLL
+#define QT_D3DCOMPILER_DLL D3DCOMPILER_DLL
+#endif
+
#if ANGLE_APPEND_ASSEMBLY_TO_SHADER_DEBUG_INFO == ANGLE_ENABLED
namespace
{
@@ -130,6 +134,27 @@ gl::Error HLSLCompiler::ensureInitialized()
}
#endif // ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES
+ // Load the compiler DLL specified by the environment, or default to QT_D3DCOMPILER_DLL
+ const wchar_t *defaultCompiler = _wgetenv(L"QT_D3DCOMPILER_DLL");
+ if (!defaultCompiler)
+ defaultCompiler = QT_D3DCOMPILER_DLL;
+
+ const wchar_t *compilerDlls[] = {
+ defaultCompiler,
+ L"d3dcompiler_47.dll",
+ L"d3dcompiler_46.dll",
+ L"d3dcompiler_43.dll",
+ 0
+ };
+
+ // Load the first available known compiler DLL
+ for (int i = 0; compilerDlls[i]; ++i)
+ {
+ mD3DCompilerModule = LoadLibrary(compilerDlls[i]);
+ if (mD3DCompilerModule)
+ break;
+ }
+
if (!mD3DCompilerModule)
{
// Load the version of the D3DCompiler DLL associated with the Direct3D version ANGLE was built with.
diff --git a/src/3rdparty/xcb/README b/src/3rdparty/xcb/README
index 9e8ea30b51..2f1ee24079 100644
--- a/src/3rdparty/xcb/README
+++ b/src/3rdparty/xcb/README
@@ -8,7 +8,7 @@ Contains the header and sources files from selected xcb libraries:
Pointer Barriers API and SendExtensionEvent API)
libxcb-util-image-0.3.9
libxcb-util-keysyms-0.3.9
- libxcb-util-renderutil-0.3.8
+ libxcb-util-renderutil-0.3.9
libxcb-util-wm-0.3.9
The 'include' directory was obtained by compiling and installing all of the modules.
diff --git a/src/3rdparty/xcb/include/xcb/xcb_renderutil.h b/src/3rdparty/xcb/include/xcb/xcb_renderutil.h
index 6eb5923236..77c5b7f054 100644
--- a/src/3rdparty/xcb/include/xcb/xcb_renderutil.h
+++ b/src/3rdparty/xcb/include/xcb/xcb_renderutil.h
@@ -27,6 +27,10 @@
#define XCB_RENDERUTIL
#include <xcb/render.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef enum xcb_pict_format_t {
XCB_PICT_FORMAT_ID = (1 << 0),
XCB_PICT_FORMAT_TYPE = (1 << 1),
@@ -58,7 +62,7 @@ xcb_render_util_find_visual_format (const xcb_render_query_pict_formats_reply_t
xcb_render_pictforminfo_t *
xcb_render_util_find_format (const xcb_render_query_pict_formats_reply_t *formats,
unsigned long mask,
- const xcb_render_pictforminfo_t *template,
+ const xcb_render_pictforminfo_t *ptemplate,
int count);
xcb_render_pictforminfo_t *
@@ -139,4 +143,8 @@ void
xcb_render_util_composite_text_free (
xcb_render_util_composite_text_stream_t *stream );
+#ifdef __cplusplus
+}
+#endif
+
#endif /* XCB_RENDERUTIL */
diff --git a/src/3rdparty/xcb/xcb-util-renderutil/util.c b/src/3rdparty/xcb/xcb-util-renderutil/util.c
index 2d8840d204..7666c433dd 100644
--- a/src/3rdparty/xcb/xcb-util-renderutil/util.c
+++ b/src/3rdparty/xcb/xcb-util-renderutil/util.c
@@ -19,6 +19,10 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "xcb_renderutil.h"
xcb_render_pictvisual_t *
@@ -41,7 +45,7 @@ xcb_render_util_find_visual_format (const xcb_render_query_pict_formats_reply_t
xcb_render_pictforminfo_t *
xcb_render_util_find_format (const xcb_render_query_pict_formats_reply_t *formats,
unsigned long mask,
- const xcb_render_pictforminfo_t *template,
+ const xcb_render_pictforminfo_t *ptemplate,
int count)
{
xcb_render_pictforminfo_iterator_t i;
@@ -50,40 +54,40 @@ xcb_render_util_find_format (const xcb_render_query_pict_formats_reply_t *format
for (i = xcb_render_query_pict_formats_formats_iterator(formats); i.rem; xcb_render_pictforminfo_next(&i))
{
if (mask & XCB_PICT_FORMAT_ID)
- if (template->id != i.data->id)
+ if (ptemplate->id != i.data->id)
continue;
if (mask & XCB_PICT_FORMAT_TYPE)
- if (template->type != i.data->type)
+ if (ptemplate->type != i.data->type)
continue;
if (mask & XCB_PICT_FORMAT_DEPTH)
- if (template->depth != i.data->depth)
+ if (ptemplate->depth != i.data->depth)
continue;
if (mask & XCB_PICT_FORMAT_RED)
- if (template->direct.red_shift != i.data->direct.red_shift)
+ if (ptemplate->direct.red_shift != i.data->direct.red_shift)
continue;
if (mask & XCB_PICT_FORMAT_RED_MASK)
- if (template->direct.red_mask != i.data->direct.red_mask)
+ if (ptemplate->direct.red_mask != i.data->direct.red_mask)
continue;
if (mask & XCB_PICT_FORMAT_GREEN)
- if (template->direct.green_shift != i.data->direct.green_shift)
+ if (ptemplate->direct.green_shift != i.data->direct.green_shift)
continue;
if (mask & XCB_PICT_FORMAT_GREEN_MASK)
- if (template->direct.green_mask != i.data->direct.green_mask)
+ if (ptemplate->direct.green_mask != i.data->direct.green_mask)
continue;
if (mask & XCB_PICT_FORMAT_BLUE)
- if (template->direct.blue_shift != i.data->direct.blue_shift)
+ if (ptemplate->direct.blue_shift != i.data->direct.blue_shift)
continue;
if (mask & XCB_PICT_FORMAT_BLUE_MASK)
- if (template->direct.blue_mask != i.data->direct.blue_mask)
+ if (ptemplate->direct.blue_mask != i.data->direct.blue_mask)
continue;
if (mask & XCB_PICT_FORMAT_ALPHA)
- if (template->direct.alpha_shift != i.data->direct.alpha_shift)
+ if (ptemplate->direct.alpha_shift != i.data->direct.alpha_shift)
continue;
if (mask & XCB_PICT_FORMAT_ALPHA_MASK)
- if (template->direct.alpha_mask != i.data->direct.alpha_mask)
+ if (ptemplate->direct.alpha_mask != i.data->direct.alpha_mask)
continue;
if (mask & XCB_PICT_FORMAT_COLORMAP)
- if (template->colormap != i.data->colormap)
+ if (ptemplate->colormap != i.data->colormap)
continue;
if (count-- == 0)
return i.data;
diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
index adc67e93fb..5562c010aa 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
@@ -47,6 +47,7 @@ import java.util.concurrent.Semaphore;
import android.app.Activity;
import android.app.Service;
import android.content.Context;
+import android.content.ContentResolver;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ActivityInfo;
@@ -57,6 +58,7 @@ import android.os.IBinder;
import android.os.Looper;
import android.content.ClipboardManager;
import android.content.ClipboardManager.OnPrimaryClipChangedListener;
+import android.content.ClipData;
import android.util.Log;
import android.view.ContextMenu;
import android.view.KeyEvent;
@@ -98,7 +100,9 @@ public class QtNative
private static ClipboardManager m_clipboardManager = null;
private static Method m_checkSelfPermissionMethod = null;
private static Boolean m_tabletEventSupported = null;
+ private static boolean m_usePrimaryClip = false;
public static QtThread m_qtThread = new QtThread();
+ private static Method m_addItemMethod = null;
private static final Runnable runPendingCppRunnablesRunnable = new Runnable() {
@Override
public void run() {
@@ -697,26 +701,133 @@ public class QtNative
}
}
+ private static void clearClipData()
+ {
+ m_usePrimaryClip = false;
+ }
private static void setClipboardText(String text)
{
- if (m_clipboardManager != null)
- m_clipboardManager.setText(text);
+ if (m_clipboardManager != null) {
+ ClipData clipData = ClipData.newPlainText("text/plain", text);
+ updatePrimaryClip(clipData);
+ }
}
public static boolean hasClipboardText()
{
- if (m_clipboardManager != null)
- return m_clipboardManager.hasText();
- else
- return false;
+ if (m_clipboardManager != null && m_clipboardManager.hasPrimaryClip()) {
+ ClipData primaryClip = m_clipboardManager.getPrimaryClip();
+ for (int i = 0; i < primaryClip.getItemCount(); ++i)
+ if (primaryClip.getItemAt(i).getText() != null)
+ return true;
+ }
+ return false;
}
private static String getClipboardText()
{
- if (m_clipboardManager != null)
- return m_clipboardManager.getText().toString();
- else
- return "";
+ if (m_clipboardManager != null && m_clipboardManager.hasPrimaryClip()) {
+ ClipData primaryClip = m_clipboardManager.getPrimaryClip();
+ for (int i = 0; i < primaryClip.getItemCount(); ++i)
+ if (primaryClip.getItemAt(i).getText() != null)
+ return primaryClip.getItemAt(i).getText().toString();
+ }
+ return "";
+ }
+
+ private static void updatePrimaryClip(ClipData clipData)
+ {
+ if (m_usePrimaryClip) {
+ ClipData clip = m_clipboardManager.getPrimaryClip();
+ if (Build.VERSION.SDK_INT >= 26) {
+ if (m_addItemMethod == null) {
+ Class[] cArg = new Class[2];
+ cArg[0] = ContentResolver.class;
+ cArg[1] = ClipData.Item.class;
+ try {
+ m_addItemMethod = m_clipboardManager.getClass().getMethod("addItem", cArg);
+ } catch (Exception e) {
+ }
+ }
+ }
+ if (m_addItemMethod != null) {
+ try {
+ m_addItemMethod.invoke(m_activity.getContentResolver(), clipData.getItemAt(0));
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ } else {
+ clip.addItem(clipData.getItemAt(0));
+ }
+ m_clipboardManager.setPrimaryClip(clip);
+ } else {
+ m_clipboardManager.setPrimaryClip(clipData);
+ m_usePrimaryClip = true;
+ }
+ }
+
+ private static void setClipboardHtml(String text, String html)
+ {
+ if (m_clipboardManager != null) {
+ ClipData clipData = ClipData.newHtmlText("text/html", text, html);
+ updatePrimaryClip(clipData);
+ }
+ }
+
+ public static boolean hasClipboardHtml()
+ {
+ if (m_clipboardManager != null && m_clipboardManager.hasPrimaryClip()) {
+ ClipData primaryClip = m_clipboardManager.getPrimaryClip();
+ for (int i = 0; i < primaryClip.getItemCount(); ++i)
+ if (primaryClip.getItemAt(i).getHtmlText() != null)
+ return true;
+ }
+ return false;
+ }
+
+ private static String getClipboardHtml()
+ {
+ if (m_clipboardManager != null && m_clipboardManager.hasPrimaryClip()) {
+ ClipData primaryClip = m_clipboardManager.getPrimaryClip();
+ for (int i = 0; i < primaryClip.getItemCount(); ++i)
+ if (primaryClip.getItemAt(i).getHtmlText() != null)
+ return primaryClip.getItemAt(i).getHtmlText().toString();
+ }
+ return "";
+ }
+
+ private static void setClipboardUri(String uriString)
+ {
+ if (m_clipboardManager != null) {
+ ClipData clipData = ClipData.newUri(m_activity.getContentResolver(), "text/uri-list",
+ Uri.parse(uriString));
+ updatePrimaryClip(clipData);
+ }
+ }
+
+ public static boolean hasClipboardUri()
+ {
+ if (m_clipboardManager != null && m_clipboardManager.hasPrimaryClip()) {
+ ClipData primaryClip = m_clipboardManager.getPrimaryClip();
+ for (int i = 0; i < primaryClip.getItemCount(); ++i)
+ if (primaryClip.getItemAt(i).getUri() != null)
+ return true;
+ }
+ return false;
+ }
+
+ private static String[] getClipboardUris()
+ {
+ ArrayList<String> uris = new ArrayList<String>();
+ if (m_clipboardManager != null && m_clipboardManager.hasPrimaryClip()) {
+ ClipData primaryClip = m_clipboardManager.getPrimaryClip();
+ for (int i = 0; i < primaryClip.getItemCount(); ++i)
+ if (primaryClip.getItemAt(i).getUri() != null)
+ uris.add(primaryClip.getItemAt(i).getUri().toString());
+ }
+ String[] strings = new String[uris.size()];
+ strings = uris.toArray(strings);
+ return strings;
}
private static void openContextMenu(final int x, final int y, final int w, final int h)
diff --git a/src/android/templates/build.gradle b/src/android/templates/build.gradle
index fcd8ae345d..989d0792cf 100644
--- a/src/android/templates/build.gradle
+++ b/src/android/templates/build.gradle
@@ -17,7 +17,7 @@ repositories {
apply plugin: 'com.android.application'
dependencies {
- implementation fileTree(dir: 'libs', include: ['*.jar'])
+ implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
}
android {
diff --git a/src/angle/patches/0012-ANGLE-Dynamically-load-D3D-compiler-from-a-list.patch b/src/angle/patches/0012-ANGLE-Dynamically-load-D3D-compiler-from-a-list.patch
new file mode 100644
index 0000000000..7009dec1ba
--- /dev/null
+++ b/src/angle/patches/0012-ANGLE-Dynamically-load-D3D-compiler-from-a-list.patch
@@ -0,0 +1,59 @@
+From dff9676c60c51fa7af0749e1cb54305f112183e3 Mon Sep 17 00:00:00 2001
+From: Oliver Wolff <oliver.wolff@qt.io>
+Date: Mon, 10 Dec 2018 08:33:14 +0100
+Subject: [PATCH] ANGLE: Dynamically load D3D compiler from a list
+
+If the default compiler cannot be found, load it from a list of DLL names,
+including a non-versioned proxy DLL provided by Qt. On Desktop Windows,
+the default compiler can also be specified by an environment variable,
+QT_D3DCOMPILER_DLL.
+---
+ src/3rdparty/angle/src/libANGLE/renderer/d3d/HLSLCompiler.cpp | 25 +++++++++++++++++++++++++
+ 1 file changed, 25 insertions(+)
+
+diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/HLSLCompiler.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/HLSLCompiler.cpp
+index b38765070..5d47308d6 100644
+--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/HLSLCompiler.cpp
++++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/HLSLCompiler.cpp
+@@ -14,6 +14,10 @@
+ #include "libANGLE/histogram_macros.h"
+ #include "third_party/trace_event/trace_event.h"
+
++#ifndef QT_D3DCOMPILER_DLL
++#define QT_D3DCOMPILER_DLL D3DCOMPILER_DLL
++#endif
++
+ #if ANGLE_APPEND_ASSEMBLY_TO_SHADER_DEBUG_INFO == ANGLE_ENABLED
+ namespace
+ {
+@@ -130,6 +134,27 @@ gl::Error HLSLCompiler::ensureInitialized()
+ }
+ #endif // ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES
+
++ // Load the compiler DLL specified by the environment, or default to QT_D3DCOMPILER_DLL
++ const wchar_t *defaultCompiler = _wgetenv(L"QT_D3DCOMPILER_DLL");
++ if (!defaultCompiler)
++ defaultCompiler = QT_D3DCOMPILER_DLL;
++
++ const wchar_t *compilerDlls[] = {
++ defaultCompiler,
++ L"d3dcompiler_47.dll",
++ L"d3dcompiler_46.dll",
++ L"d3dcompiler_43.dll",
++ 0
++ };
++
++ // Load the first available known compiler DLL
++ for (int i = 0; compilerDlls[i]; ++i)
++ {
++ mD3DCompilerModule = LoadLibrary(compilerDlls[i]);
++ if (mD3DCompilerModule)
++ break;
++ }
++
+ if (!mD3DCompilerModule)
+ {
+ // Load the version of the D3DCompiler DLL associated with the Direct3D version ANGLE was built with.
+--
+2.15.0.windows.1
+
diff --git a/src/angle/src/common/common.pri b/src/angle/src/common/common.pri
index b64dbd3e36..df29269786 100644
--- a/src/angle/src/common/common.pri
+++ b/src/angle/src/common/common.pri
@@ -22,21 +22,7 @@ lib_replace.replace = \$\$\$\$[QT_INSTALL_LIBS]
lib_replace.CONFIG = path
QMAKE_PRL_INSTALL_REPLACE += lib_replace
-# DirectX is included in the Windows 8 Kit, but everything else requires the DX SDK.
-winrt|msvc {
- FXC = fxc.exe
-} else {
- DX_DIR = $$(DXSDK_DIR)
- isEmpty(DX_DIR) {
- error("Cannot determine DirectX SDK location. Please set DXSDK_DIR environment variable.")
- }
-
- equals(QMAKE_TARGET.arch, x86_64) {
- FXC = \"$${DX_DIR}Utilities\\bin\\x64\\fxc.exe\"
- } else {
- FXC = \"$${DX_DIR}Utilities\\bin\\x86\\fxc.exe\"
- }
-}
+FXC = $$shell_quote($$shell_path($$QMAKE_FXC_LOCATION))
win32 {
VERSION = $$MODULE_VERSION
diff --git a/src/angle/src/common/gles_common.pri b/src/angle/src/common/gles_common.pri
index fdd0e45971..70b65dd4cc 100644
--- a/src/angle/src/common/gles_common.pri
+++ b/src/angle/src/common/gles_common.pri
@@ -8,11 +8,11 @@ INCLUDEPATH += \
# Remember to adapt src/gui/configure.* if the Direct X version changes.
!winrt: \
- LIBS_PRIVATE += -ld3d9
+ QMAKE_USE_PRIVATE += d3d9
winrt: \
- LIBS_PRIVATE += -ld3dcompiler -ldxgi -ld3d11
+ QMAKE_USE_PRIVATE += d3dcompiler d3d11 dxgi
-LIBS_PRIVATE += -ldxguid
+QMAKE_USE_PRIVATE += dxguid
STATICLIBS = translator preprocessor
for(libname, STATICLIBS) {
diff --git a/src/angle/src/libEGL/libEGL.pro b/src/angle/src/libEGL/libEGL.pro
index 889f39890e..912ff7825e 100644
--- a/src/angle/src/libEGL/libEGL.pro
+++ b/src/angle/src/libEGL/libEGL.pro
@@ -1,9 +1,10 @@
include(../common/common.pri)
DEF_FILE_TARGET = $${TARGET}
TARGET = $$qtLibraryTarget($${LIBEGL_NAME})
-winrt: LIBS_PRIVATE += -ld3d11
+winrt: QMAKE_USE_PRIVATE += d3d11
+QMAKE_USE_PRIVATE += dxguid
-LIBS_PRIVATE += -ldxguid -L$$QT_BUILD_TREE/lib -l$$qtLibraryTarget($${LIBGLESV2_NAME})
+LIBS_PRIVATE += -L$$QT_BUILD_TREE/lib -l$$qtLibraryTarget($${LIBGLESV2_NAME})
DEFINES += GL_APICALL= GL_GLEXT_PROTOTYPES= EGLAPI= LIBEGL_IMPLEMENTATION
diff --git a/src/corelib/codecs/codecs.pri b/src/corelib/codecs/codecs.pri
index f1bbde1d69..5d500ce521 100644
--- a/src/corelib/codecs/codecs.pri
+++ b/src/corelib/codecs/codecs.pri
@@ -56,8 +56,7 @@ qtConfig(textcodec) {
qtConfig(iconv) {
HEADERS += codecs/qiconvcodec_p.h
SOURCES += codecs/qiconvcodec.cpp
- qtConfig(gnu-libiconv): \
- QMAKE_USE_PRIVATE += iconv
+ QMAKE_USE_PRIVATE += iconv
}
win32 {
diff --git a/src/corelib/codecs/codecs.qdoc b/src/corelib/codecs/codecs.qdoc
index 9364b7a989..ec9b8185e2 100644
--- a/src/corelib/codecs/codecs.qdoc
+++ b/src/corelib/codecs/codecs.qdoc
@@ -276,13 +276,11 @@
TSCII, formally the Tamil Standard Code Information Interchange
specification, is a commonly used charset for Tamils. The
- official page for the standard is at
- \l{http://www.tamil.net/tscii/}
+ official page for the standard is \l{Information Technology in Tamil}
- This codec uses the mapping table found at
- \l{http://www.geocities.com/Athens/5180/tsciiset.html}.
Tamil uses composed Unicode which might cause some
problems if you are using Unicode fonts instead of TSCII fonts.
+ A Tamil codepage layout can be found on \l {Tamil Script Code}.
Most of the code was written by Hans Petter Bieker and is
included in Qt with the author's permission and the grateful
diff --git a/src/corelib/codecs/qwindowscodec.cpp b/src/corelib/codecs/qwindowscodec.cpp
index 37e1183fb6..710935a65a 100644
--- a/src/corelib/codecs/qwindowscodec.cpp
+++ b/src/corelib/codecs/qwindowscodec.cpp
@@ -183,7 +183,7 @@ QString QWindowsLocalCodec::convertToUnicodeCharByChar(const char *chars, int le
#else
QString s;
size_t size = mbstowcs(NULL, mb, length);
- if (size < 0) {
+ if (size == size_t(-1)) {
Q_ASSERT("Error in CE TextCodec");
return QString();
}
diff --git a/src/corelib/configure.json b/src/corelib/configure.json
index 183eb3a13e..a22a7459bd 100644
--- a/src/corelib/configure.json
+++ b/src/corelib/configure.json
@@ -24,9 +24,9 @@
"doubleconversion": {
"label": "DoubleConversion",
"test": {
- "include": "double-conversion/double-conversion.h",
"main": "(void) double_conversion::StringToDoubleConverter::NO_FLAGS;"
},
+ "headers": "double-conversion/double-conversion.h",
"sources": [
"-ldouble-conversion"
]
@@ -35,7 +35,6 @@
"label": "GLib",
"test": {
"head": "typedef struct _GMainContext GMainContext;",
- "include": "glib.h",
"main": [
"g_thread_init(NULL);",
"(void) g_main_context_default();",
@@ -43,22 +42,60 @@
"g_source_add_poll(NULL, NULL);"
]
},
+ "headers": "glib.h",
"sources": [
{ "type": "pkgConfig", "args": "glib-2.0 gthread-2.0" }
]
},
+ "posix_iconv": {
+ "label": "POSIX iconv",
+ "export": "iconv",
+ "test": {
+ "main": [
+ "iconv_t x = iconv_open(\"\", \"\");",
+ "char *inp, *outp;",
+ "size_t inbytes, outbytes;",
+ "iconv(x, &inp, &inbytes, &outp, &outbytes);",
+ "iconv_close(x);"
+ ]
+ },
+ "headers": "iconv.h",
+ "sources": [
+ { "libs": "-liconv", "condition": "config.openbsd || config.haiku" },
+ { "libs": "", "condition": "!(config.openbsd || config.haiku)" }
+ ]
+ },
"gnu_iconv": {
"label": "GNU libiconv",
"export": "iconv",
- "test": "gnu-libiconv",
+ "test": {
+ "main": [
+ "iconv_t x = iconv_open(\"\", \"\");",
+ "const char *inp;",
+ "char *outp;",
+ "size_t inbytes, outbytes;",
+ "iconv(x, &inp, &inbytes, &outp, &outbytes);",
+ "iconv_close(x);"
+ ]
+ },
+ "headers": "iconv.h",
"sources": [
"-liconv"
]
},
+ "sun_iconv": {
+ "label": "SUN libiconv",
+ "export": "iconv",
+ "test": {
+ "inherit": "gnu_iconv"
+ },
+ "sources": [
+ ""
+ ]
+ },
"icu": {
"label": "ICU",
"test": {
- "include": [ "unicode/utypes.h", "unicode/ucol.h", "unicode/ustring.h" ],
"main": [
"UErrorCode status = U_ZERO_ERROR;",
"UCollator *collator = ucol_open(\"ru_RU\", &status);",
@@ -66,6 +103,7 @@
" ucol_close(collator);"
]
},
+ "headers": [ "unicode/utypes.h", "unicode/ucol.h", "unicode/ustring.h" ],
"sources": [
{
"builds": {
@@ -84,9 +122,9 @@
"journald": {
"label": "journald",
"test": {
- "include": [ "systemd/sd-journal.h", "syslog.h" ],
"main": "sd_journal_send(\"PRIORITY=%i\", LOG_INFO, NULL);"
},
+ "headers": [ "systemd/sd-journal.h", "syslog.h" ],
"sources": [
{ "type": "pkgConfig", "args": "libsystemd" },
{ "type": "pkgConfig", "args": "libsystemd-journal" }
@@ -95,7 +133,6 @@
"libatomic": {
"label": "64 bit atomics",
"test": {
- "include": [ "atomic", "cstdint" ],
"tail": [
"void test(volatile std::atomic<std::int64_t> &a)",
"{",
@@ -114,6 +151,7 @@
],
"qmake": "CONFIG += c++11"
},
+ "headers": [ "atomic", "cstdint" ],
"sources": [
"",
"-latomic"
@@ -122,13 +160,13 @@
"libdl": {
"label": "dlopen()",
"test": {
- "include": "dlfcn.h",
"main": [
"dlclose(dlopen(0, 0));",
"dlsym(RTLD_DEFAULT, 0);",
"dlerror();"
]
},
+ "headers": "dlfcn.h",
"sources": [
"",
"-ldl"
@@ -137,9 +175,9 @@
"librt": {
"label": "clock_gettime()",
"test": {
- "include": [ "unistd.h", "time.h" ],
"main": "timespec ts; clock_gettime(CLOCK_REALTIME, &ts);"
},
+ "headers": [ "unistd.h", "time.h" ],
"sources": [
"",
"-lrt"
@@ -148,9 +186,9 @@
"lttng-ust": {
"label": "lttng-ust",
"test": {
- "include": "lttng/ust-events.h",
"main": "lttng_session_destroy(nullptr);"
},
+ "headers": "lttng/ust-events.h",
"sources": [
{ "type": "pkgConfig", "args": "lttng-ust" },
"-llttng-ust"
@@ -161,13 +199,13 @@
"label": "PCRE2",
"test": {
"head": "#define PCRE2_CODE_UNIT_WIDTH 16",
- "include": "pcre2.h",
"tail": [
"#if (PCRE2_MAJOR < 10) || ((PCRE2_MAJOR == 10) && (PCRE2_MINOR < 20))",
"# error This PCRE version is not supported",
"#endif"
]
},
+ "headers": "pcre2.h",
"sources": [
{ "type": "pkgConfig", "args": "libpcre2-16" },
"-lpcre2-16"
@@ -176,12 +214,12 @@
"pps": {
"label": "PPS",
"test": {
- "include": "sys/pps.h",
"main": [
"pps_decoder_t decoder;",
"pps_decoder_initialize(&decoder, NULL);"
]
},
+ "headers": "sys/pps.h",
"sources": [
"-lpps"
]
@@ -189,10 +227,10 @@
"slog2": {
"label": "slog2",
"test": {
- "include": "sys/slog2.h",
"main": "slog2_set_default_buffer((slog2_buffer_t)-1);"
},
"export": "",
+ "headers": "sys/slog2.h",
"sources": [
"-lslog2"
]
@@ -277,7 +315,10 @@
"cxx11_random": {
"label": "C++11 <random>",
"type": "compile",
- "test": "unix/cxx11_random"
+ "test": {
+ "include": "random",
+ "main": "std::mt19937 mt(0);"
+ }
},
"eventfd": {
"label": "eventfd",
@@ -295,32 +336,43 @@
"futimens": {
"label": "futimens()",
"type": "compile",
- "test": "unix/futimens"
+ "test": {
+ "include": "sys/stat.h",
+ "main": "futimens(-1, 0);",
+ "qmake": [
+ "# 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"
+ ]
+ }
},
"futimes": {
"label": "futimes()",
"type": "compile",
- "test": "unix/futimes"
+ "test": {
+ "include": "sys/time.h",
+ "main": "futimes(-1, 0);"
+ }
},
"getauxval": {
"label": "getauxval()",
"type": "compile",
- "test": "unix/getauxval"
+ "test": {
+ "include": "sys/auxv.h",
+ "main": "(void) getauxval(AT_NULL);"
+ }
},
"getentropy": {
"label": "getentropy()",
"type": "compile",
- "test": "unix/getentropy"
- },
- "posix-iconv": {
- "label": "POSIX iconv",
- "type": "compile",
- "test": "iconv"
- },
- "sun-iconv": {
- "label": "SUN libiconv",
- "type": "compile",
- "test": "sun-libiconv"
+ "test": {
+ "include": "unistd.h",
+ "main": [
+ "char buf[32];",
+ "(void) getentropy(buf, sizeof(buf));"
+ ]
+ }
},
"inotify": {
"label": "inotify",
@@ -443,7 +495,38 @@
"xlocalescanprint": {
"label": "xlocale.h (or equivalents)",
"type": "compile",
- "test": "xlocalescanprint"
+ "test": {
+ "files": {
+ "qglobal.h": [
+ "#ifndef QGLOBAL_H",
+ "#define QGLOBAL_H",
+ "#endif"
+ ]
+ },
+ "tail": [
+ "#define QT_BEGIN_NAMESPACE",
+ "#define QT_END_NAMESPACE",
+ "",
+ "#ifdef _MSVC_VER",
+ "#define Q_CC_MSVC _MSVC_VER",
+ "#endif",
+ "",
+ "#define QT_NO_DOUBLECONVERSION",
+ "",
+ "#include QDSP_P_H"
+ ],
+ "main": [
+ "#ifdef _MSVC_VER",
+ "_locale_t invalidLocale = NULL;",
+ "#else",
+ "locale_t invalidLocale = NULL;",
+ "#endif",
+ "double a = 3.4;",
+ "qDoubleSnprintf(argv[0], 1, invalidLocale, \"invalid format\", a);",
+ "qDoubleSscanf(argv[0], invalidLocale, \"invalid format\", &a, &argc);"
+ ],
+ "qmake": "DEFINES += QDSP_P_H=$$shell_quote(\\\"@PWD@/tools/qdoublescanprint_p.h\\\")"
+ }
}
},
@@ -521,14 +604,14 @@
"label": "POSIX iconv",
"enable": "input.iconv == 'posix'",
"disable": "input.iconv == 'sun' || input.iconv == 'gnu' || input.iconv == 'no'",
- "condition": "!config.win32 && !config.qnx && !config.android && !config.darwin && tests.posix-iconv",
+ "condition": "!config.win32 && !config.qnx && !config.android && !config.darwin && libs.posix_iconv",
"output": [ "privateFeature" ]
},
"sun-libiconv": {
"label": "SUN iconv",
"enable": "input.iconv == 'sun'",
"disable": "input.iconv == 'posix' || input.iconv == 'gnu' || input.iconv == 'no'",
- "condition": "!config.win32 && !config.qnx && !config.android && !config.darwin && !features.posix-libiconv && tests.sun-iconv"
+ "condition": "!config.win32 && !config.qnx && !config.android && !config.darwin && !features.posix-libiconv && libs.sun_iconv"
},
"gnu-libiconv": {
"label": "GNU iconv",
diff --git a/src/corelib/doc/snippets/code/src_corelib_animation_qparallelanimationgroup.cpp b/src/corelib/doc/snippets/code/src_corelib_animation_qparallelanimationgroup.cpp
index 3fc53bc58b..472c5d41c4 100644
--- a/src/corelib/doc/snippets/code/src_corelib_animation_qparallelanimationgroup.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_animation_qparallelanimationgroup.cpp
@@ -3,9 +3,9 @@
** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtCore module of the Qt Toolkit.
+** This file is part of the documentation of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
@@ -14,24 +14,35 @@
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "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 The Qt Company Ltd 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
+** OWNER 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."
**
** $QT_END_LICENSE$
**
diff --git a/src/corelib/doc/snippets/code/src_corelib_animation_qpropertyanimation.cpp b/src/corelib/doc/snippets/code/src_corelib_animation_qpropertyanimation.cpp
index a6dbd909d7..7bd8121b90 100644
--- a/src/corelib/doc/snippets/code/src_corelib_animation_qpropertyanimation.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_animation_qpropertyanimation.cpp
@@ -3,9 +3,9 @@
** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtCore module of the Qt Toolkit.
+** This file is part of the documentation of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
@@ -14,24 +14,35 @@
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "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 The Qt Company Ltd 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
+** OWNER 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."
**
** $QT_END_LICENSE$
**
diff --git a/src/corelib/doc/snippets/code/src_corelib_animation_qsequentialanimationgroup.cpp b/src/corelib/doc/snippets/code/src_corelib_animation_qsequentialanimationgroup.cpp
index 1f1363f127..0eff184926 100644
--- a/src/corelib/doc/snippets/code/src_corelib_animation_qsequentialanimationgroup.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_animation_qsequentialanimationgroup.cpp
@@ -3,9 +3,9 @@
** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtCore module of the Qt Toolkit.
+** This file is part of the documentation of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
@@ -14,24 +14,35 @@
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "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 The Qt Company Ltd 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
+** OWNER 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."
**
** $QT_END_LICENSE$
**
diff --git a/src/corelib/doc/snippets/code/src_corelib_animation_qvariantanimation.cpp b/src/corelib/doc/snippets/code/src_corelib_animation_qvariantanimation.cpp
index b462ff2d6a..0808dcc145 100644
--- a/src/corelib/doc/snippets/code/src_corelib_animation_qvariantanimation.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_animation_qvariantanimation.cpp
@@ -3,9 +3,9 @@
** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtCore module of the Qt Toolkit.
+** This file is part of the documentation of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
@@ -14,24 +14,35 @@
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "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 The Qt Company Ltd 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
+** OWNER 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."
**
** $QT_END_LICENSE$
**
diff --git a/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp b/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp
index 0248640369..03904659f5 100644
--- a/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp
@@ -279,21 +279,23 @@ const TInputType &myMin(const TInputType &value1, const TInputType &value2)
void myMessageOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg)
{
QByteArray localMsg = msg.toLocal8Bit();
+ const char *file = context.file ? context.file : "";
+ const char *function = context.function ? context.function : "";
switch (type) {
case QtDebugMsg:
- fprintf(stderr, "Debug: %s (%s:%u, %s)\n", localMsg.constData(), context.file, context.line, context.function);
+ fprintf(stderr, "Debug: %s (%s:%u, %s)\n", localMsg.constData(), file, context.line, function);
break;
case QtInfoMsg:
- fprintf(stderr, "Info: %s (%s:%u, %s)\n", localMsg.constData(), context.file, context.line, context.function);
+ fprintf(stderr, "Info: %s (%s:%u, %s)\n", localMsg.constData(), file, context.line, function);
break;
case QtWarningMsg:
- fprintf(stderr, "Warning: %s (%s:%u, %s)\n", localMsg.constData(), context.file, context.line, context.function);
+ fprintf(stderr, "Warning: %s (%s:%u, %s)\n", localMsg.constData(), file, context.line, function);
break;
case QtCriticalMsg:
- fprintf(stderr, "Critical: %s (%s:%u, %s)\n", localMsg.constData(), context.file, context.line, context.function);
+ fprintf(stderr, "Critical: %s (%s:%u, %s)\n", localMsg.constData(), file, context.line, function);
break;
case QtFatalMsg:
- fprintf(stderr, "Fatal: %s (%s:%u, %s)\n", localMsg.constData(), context.file, context.line, context.function);
+ fprintf(stderr, "Fatal: %s (%s:%u, %s)\n", localMsg.constData(), file, context.line, function);
break;
}
}
diff --git a/src/corelib/doc/snippets/code/src_corelib_global_qlogging.cpp b/src/corelib/doc/snippets/code/src_corelib_global_qlogging.cpp
index 7b0b357cff..7589050bc2 100644
--- a/src/corelib/doc/snippets/code/src_corelib_global_qlogging.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_global_qlogging.cpp
@@ -3,9 +3,9 @@
** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtCore module of the Qt Toolkit.
+** This file is part of the documentation of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
@@ -14,24 +14,35 @@
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "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 The Qt Company Ltd 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
+** OWNER 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."
**
** $QT_END_LICENSE$
**
diff --git a/src/corelib/doc/snippets/code/src_corelib_global_qnumeric.cpp b/src/corelib/doc/snippets/code/src_corelib_global_qnumeric.cpp
index 5d64070b1b..d281089041 100644
--- a/src/corelib/doc/snippets/code/src_corelib_global_qnumeric.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_global_qnumeric.cpp
@@ -3,9 +3,9 @@
** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtCore module of the Qt Toolkit.
+** This file is part of the documentation of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
@@ -14,24 +14,35 @@
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "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 The Qt Company Ltd 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
+** OWNER 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."
**
** $QT_END_LICENSE$
**
diff --git a/src/corelib/doc/snippets/code/src_corelib_global_qoperatingsystemversion.cpp b/src/corelib/doc/snippets/code/src_corelib_global_qoperatingsystemversion.cpp
index d9e927c55a..c712dfa432 100644
--- a/src/corelib/doc/snippets/code/src_corelib_global_qoperatingsystemversion.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_global_qoperatingsystemversion.cpp
@@ -3,9 +3,9 @@
** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtCore module of the Qt Toolkit.
+** This file is part of the documentation of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
@@ -14,24 +14,35 @@
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "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 The Qt Company Ltd 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
+** OWNER 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."
**
** $QT_END_LICENSE$
**
diff --git a/src/corelib/doc/snippets/code/src_corelib_global_qrandom.cpp b/src/corelib/doc/snippets/code/src_corelib_global_qrandom.cpp
index b03e656b64..6e47a7a3d9 100644
--- a/src/corelib/doc/snippets/code/src_corelib_global_qrandom.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_global_qrandom.cpp
@@ -4,9 +4,9 @@
** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtCore module of the Qt Toolkit.
+** This file is part of the documentation of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
@@ -15,24 +15,35 @@
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
+** "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 The Qt Company Ltd 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
+** OWNER 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."
**
** $QT_END_LICENSE$
**
diff --git a/src/corelib/doc/snippets/code/src_corelib_io_qdebug.cpp b/src/corelib/doc/snippets/code/src_corelib_io_qdebug.cpp
index 4bbdc509ca..14e72e99dd 100644
--- a/src/corelib/doc/snippets/code/src_corelib_io_qdebug.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_io_qdebug.cpp
@@ -3,9 +3,9 @@
** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtCore module of the Qt Toolkit.
+** This file is part of the documentation of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
@@ -14,24 +14,35 @@
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
+** "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 The Qt Company Ltd 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
+** OWNER 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."
**
** $QT_END_LICENSE$
**
diff --git a/src/corelib/doc/snippets/code/src_corelib_io_qfileselector.cpp b/src/corelib/doc/snippets/code/src_corelib_io_qfileselector.cpp
index 91c94eb762..0d1aa691cf 100644
--- a/src/corelib/doc/snippets/code/src_corelib_io_qfileselector.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_io_qfileselector.cpp
@@ -3,9 +3,9 @@
** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtWidgets module of the Qt Toolkit.
+** This file is part of the documentation of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
@@ -14,24 +14,35 @@
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
+** "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 The Qt Company Ltd 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
+** OWNER 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."
**
** $QT_END_LICENSE$
**
diff --git a/src/corelib/doc/snippets/code/src_corelib_io_qloggingcategory.cpp b/src/corelib/doc/snippets/code/src_corelib_io_qloggingcategory.cpp
index 20ae52a251..cab48f1e27 100644
--- a/src/corelib/doc/snippets/code/src_corelib_io_qloggingcategory.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_io_qloggingcategory.cpp
@@ -3,9 +3,9 @@
** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtCore module of the Qt Toolkit.
+** This file is part of the documentation of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
@@ -14,24 +14,35 @@
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "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 The Qt Company Ltd 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
+** OWNER 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."
**
** $QT_END_LICENSE$
**
diff --git a/src/corelib/doc/snippets/code/src_corelib_io_qstorageinfo.cpp b/src/corelib/doc/snippets/code/src_corelib_io_qstorageinfo.cpp
index e0594433ff..c7a1b34f7a 100644
--- a/src/corelib/doc/snippets/code/src_corelib_io_qstorageinfo.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_io_qstorageinfo.cpp
@@ -3,9 +3,9 @@
** Copyright (C) 2014 Ivan Komissarov
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtCore module of the Qt Toolkit.
+** This file is part of the documentation of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
@@ -14,24 +14,35 @@
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
+** "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 The Qt Company Ltd 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
+** OWNER 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."
**
** $QT_END_LICENSE$
**
diff --git a/src/corelib/doc/snippets/code/src_corelib_io_qurlquery.cpp b/src/corelib/doc/snippets/code/src_corelib_io_qurlquery.cpp
index da87bfd143..22f1d3260f 100644
--- a/src/corelib/doc/snippets/code/src_corelib_io_qurlquery.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_io_qurlquery.cpp
@@ -3,9 +3,9 @@
** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtWidgets module of the Qt Toolkit.
+** This file is part of the documentation of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
@@ -14,24 +14,35 @@
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "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 The Qt Company Ltd 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
+** OWNER 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."
**
** $QT_END_LICENSE$
**
diff --git a/src/corelib/doc/snippets/code/src_corelib_kernel_qdeadlinetimer.cpp b/src/corelib/doc/snippets/code/src_corelib_kernel_qdeadlinetimer.cpp
index eb291d7b18..35c06f842e 100644
--- a/src/corelib/doc/snippets/code/src_corelib_kernel_qdeadlinetimer.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_kernel_qdeadlinetimer.cpp
@@ -3,9 +3,9 @@
** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtWidgets module of the Qt Toolkit.
+** This file is part of the documentation of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
@@ -14,24 +14,35 @@
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
+** "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 The Qt Company Ltd 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
+** OWNER 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."
**
** $QT_END_LICENSE$
**
diff --git a/src/corelib/doc/snippets/code/src_corelib_serialization_qcborstream.cpp b/src/corelib/doc/snippets/code/src_corelib_serialization_qcborstream.cpp
index dbe38aa4b5..6ddb5a9365 100644
--- a/src/corelib/doc/snippets/code/src_corelib_serialization_qcborstream.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_serialization_qcborstream.cpp
@@ -3,9 +3,9 @@
** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtWidgets module of the Qt Toolkit.
+** This file is part of the documentation of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
@@ -14,24 +14,35 @@
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
+** "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 The Qt Company Ltd 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
+** OWNER 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."
**
** $QT_END_LICENSE$
**
diff --git a/src/corelib/doc/snippets/code/src_corelib_serialization_qcborvalue.cpp b/src/corelib/doc/snippets/code/src_corelib_serialization_qcborvalue.cpp
index 63f813cf69..5406536cfe 100644
--- a/src/corelib/doc/snippets/code/src_corelib_serialization_qcborvalue.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_serialization_qcborvalue.cpp
@@ -3,9 +3,9 @@
** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtWidgets module of the Qt Toolkit.
+** This file is part of the documentation of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
@@ -14,24 +14,35 @@
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
+** "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 The Qt Company Ltd 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
+** OWNER 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."
**
** $QT_END_LICENSE$
**
diff --git a/src/corelib/doc/snippets/code/src_corelib_serialization_qdatastream.cpp b/src/corelib/doc/snippets/code/src_corelib_serialization_qdatastream.cpp
index 5caaa16727..cfcc2f8f94 100644
--- a/src/corelib/doc/snippets/code/src_corelib_serialization_qdatastream.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_serialization_qdatastream.cpp
@@ -3,9 +3,9 @@
** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtCore module of the Qt Toolkit.
+** This file is part of the documentation of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
@@ -14,24 +14,35 @@
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "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 The Qt Company Ltd 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
+** OWNER 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."
**
** $QT_END_LICENSE$
**
diff --git a/src/corelib/doc/snippets/code/src_corelib_serialization_qjsondocument.cpp b/src/corelib/doc/snippets/code/src_corelib_serialization_qjsondocument.cpp
index c4913b1740..1fe328c0a0 100644
--- a/src/corelib/doc/snippets/code/src_corelib_serialization_qjsondocument.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_serialization_qjsondocument.cpp
@@ -3,9 +3,9 @@
** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtCore module of the Qt Toolkit.
+** This file is part of the documentation of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
@@ -14,24 +14,35 @@
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "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 The Qt Company Ltd 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
+** OWNER 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."
**
** $QT_END_LICENSE$
**
diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qbytearraymatcher.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qbytearraymatcher.cpp
index 63fc1f91e7..9cf94f0494 100644
--- a/src/corelib/doc/snippets/code/src_corelib_tools_qbytearraymatcher.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_tools_qbytearraymatcher.cpp
@@ -3,9 +3,9 @@
** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtCore module of the Qt Toolkit.
+** This file is part of the documentation of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
@@ -14,24 +14,35 @@
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "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 The Qt Company Ltd 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
+** OWNER 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."
**
** $QT_END_LICENSE$
**
diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qcontiguouscache.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qcontiguouscache.cpp
index 6bc9604243..84780374e9 100644
--- a/src/corelib/doc/snippets/code/src_corelib_tools_qcontiguouscache.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_tools_qcontiguouscache.cpp
@@ -3,9 +3,9 @@
** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtCore module of the Qt Toolkit.
+** This file is part of the documentation of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
@@ -14,24 +14,35 @@
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "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 The Qt Company Ltd 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
+** OWNER 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."
**
** $QT_END_LICENSE$
**
diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qshareddata.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qshareddata.cpp
index 45e8b0a965..88c8ae4151 100644
--- a/src/corelib/doc/snippets/code/src_corelib_tools_qshareddata.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_tools_qshareddata.cpp
@@ -3,9 +3,9 @@
** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtCore module of the Qt Toolkit.
+** This file is part of the documentation of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
@@ -14,24 +14,35 @@
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "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 The Qt Company Ltd 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
+** OWNER 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."
**
** $QT_END_LICENSE$
**
diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qsharedpointer.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qsharedpointer.cpp
index 69061ce298..e2979fa7b4 100644
--- a/src/corelib/doc/snippets/code/src_corelib_tools_qsharedpointer.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_tools_qsharedpointer.cpp
@@ -3,9 +3,9 @@
** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtCore module of the Qt Toolkit.
+** This file is part of the documentation of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
@@ -14,24 +14,35 @@
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
+** "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 The Qt Company Ltd 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
+** OWNER 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."
**
** $QT_END_LICENSE$
**
diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qstringview.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qstringview.cpp
index 5dc153372c..fc426e1977 100644
--- a/src/corelib/doc/snippets/code/src_corelib_tools_qstringview.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_tools_qstringview.cpp
@@ -3,9 +3,9 @@
** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtWidgets module of the Qt Toolkit.
+** This file is part of the documentation of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
@@ -14,24 +14,35 @@
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "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 The Qt Company Ltd 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
+** OWNER 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."
**
** $QT_END_LICENSE$
**
diff --git a/src/corelib/doc/snippets/code/src_gui_itemviews_qidentityproxymodel.cpp b/src/corelib/doc/snippets/code/src_gui_itemviews_qidentityproxymodel.cpp
index d89e28836f..c1af521c03 100644
--- a/src/corelib/doc/snippets/code/src_gui_itemviews_qidentityproxymodel.cpp
+++ b/src/corelib/doc/snippets/code/src_gui_itemviews_qidentityproxymodel.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2016 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
diff --git a/src/corelib/doc/snippets/hellotrmain.cpp b/src/corelib/doc/snippets/hellotrmain.cpp
index 7e09c58f4f..2fab919a47 100644
--- a/src/corelib/doc/snippets/hellotrmain.cpp
+++ b/src/corelib/doc/snippets/hellotrmain.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the examples of the Qt Toolkit.
+** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
diff --git a/src/corelib/doc/snippets/qbytearraylist/main.cpp b/src/corelib/doc/snippets/qbytearraylist/main.cpp
index 8a861eca4a..fd52ef945b 100644
--- a/src/corelib/doc/snippets/qbytearraylist/main.cpp
+++ b/src/corelib/doc/snippets/qbytearraylist/main.cpp
@@ -3,9 +3,9 @@
** Copyright (C) 2014 by Southwest Research Institute (R)
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtCore module of the Qt Toolkit.
+** This file is part of the documentation of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
@@ -14,24 +14,35 @@
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "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 The Qt Company Ltd 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
+** OWNER 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."
**
** $QT_END_LICENSE$
**
diff --git a/src/corelib/doc/snippets/qelapsedtimer/main.cpp b/src/corelib/doc/snippets/qelapsedtimer/main.cpp
index add6ad0169..408c4eab07 100644
--- a/src/corelib/doc/snippets/qelapsedtimer/main.cpp
+++ b/src/corelib/doc/snippets/qelapsedtimer/main.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtNetwork module of the Qt Toolkit.
+** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
diff --git a/src/corelib/doc/snippets/qloggingcategory/main.cpp b/src/corelib/doc/snippets/qloggingcategory/main.cpp
index 73df3c2d2f..f5c47b2ae8 100644
--- a/src/corelib/doc/snippets/qloggingcategory/main.cpp
+++ b/src/corelib/doc/snippets/qloggingcategory/main.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the examples of the Qt Toolkit.
+** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
diff --git a/src/corelib/doc/snippets/resource-system/mainwindow.cpp b/src/corelib/doc/snippets/resource-system/mainwindow.cpp
index 6fcf52e588..bbeeec64ac 100644
--- a/src/corelib/doc/snippets/resource-system/mainwindow.cpp
+++ b/src/corelib/doc/snippets/resource-system/mainwindow.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the examples of the Qt Toolkit.
+** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
diff --git a/src/corelib/doc/snippets/timers/analogclock.cpp b/src/corelib/doc/snippets/timers/analogclock.cpp
index 0dc2fbc708..4e1957a450 100644
--- a/src/corelib/doc/snippets/timers/analogclock.cpp
+++ b/src/corelib/doc/snippets/timers/analogclock.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the examples of the Qt Toolkit.
+** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
diff --git a/src/corelib/doc/src/external-resources.qdoc b/src/corelib/doc/src/external-resources.qdoc
index f7c9dbb365..f16a21d521 100644
--- a/src/corelib/doc/src/external-resources.qdoc
+++ b/src/corelib/doc/src/external-resources.qdoc
@@ -32,13 +32,13 @@
*/
/*!
- \externalpage http://www.geocities.com/Athens/5180/tsciiset.html
- \title http://www.geocities.com/Athens/5180/tsciiset.html
+ \externalpage https://en.wikipedia.org/wiki/Tamil_Script_Code_for_Information_Interchange
+ \title Tamil Script Code
*/
/*!
- \externalpage http://www.tamil.net/tscii/
- \title http://www.tamil.net/tscii/
+ \externalpage http://home.infitt.org
+ \title Information Technology in Tamil
*/
/*!
diff --git a/src/corelib/global/archdetect.cpp b/src/corelib/global/archdetect.cpp
index 422df3ff90..66a5e074f6 100644
--- a/src/corelib/global/archdetect.cpp
+++ b/src/corelib/global/archdetect.cpp
@@ -4,7 +4,7 @@
** Copyright (C) 2016 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the FOO module of the Qt Toolkit.
+** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
diff --git a/src/corelib/global/qendian.h b/src/corelib/global/qendian.h
index f2e5833468..615f523888 100644
--- a/src/corelib/global/qendian.h
+++ b/src/corelib/global/qendian.h
@@ -204,9 +204,9 @@ template <typename T> inline Q_DECL_CONSTEXPR T qToBigEndian(T source)
template <typename T> inline Q_DECL_CONSTEXPR T qFromBigEndian(T source)
{ return source; }
template <typename T> inline Q_DECL_CONSTEXPR T qToLittleEndian(T source)
-{ return qbswap<T>(source); }
+{ return qbswap(source); }
template <typename T> inline Q_DECL_CONSTEXPR T qFromLittleEndian(T source)
-{ return qbswap<T>(source); }
+{ return qbswap(source); }
template <typename T> inline void qToBigEndian(T src, void *dest)
{ qToUnaligned<T>(src, dest); }
template <typename T> inline void qToLittleEndian(T src, void *dest)
diff --git a/src/corelib/global/qfloat16.h b/src/corelib/global/qfloat16.h
index a8befd7adb..3e50ad8467 100644
--- a/src/corelib/global/qfloat16.h
+++ b/src/corelib/global/qfloat16.h
@@ -123,6 +123,7 @@ Q_REQUIRED_RESULT inline bool qIsNull(qfloat16 f) Q_DECL_NOTHROW
inline int qIntCast(qfloat16 f) Q_DECL_NOTHROW
{ return int(static_cast<float>(f)); }
+#ifndef Q_QDOC
QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wc99-extensions")
QT_WARNING_DISABLE_GCC("-Wold-style-cast")
@@ -162,6 +163,7 @@ inline qfloat16::operator float() const Q_DECL_NOTHROW
return f;
#endif
}
+#endif
inline qfloat16 operator-(qfloat16 a) Q_DECL_NOTHROW
{
diff --git a/src/corelib/global/qnumeric_p.h b/src/corelib/global/qnumeric_p.h
index dd59f97f8b..4a225b2599 100644
--- a/src/corelib/global/qnumeric_p.h
+++ b/src/corelib/global/qnumeric_p.h
@@ -231,7 +231,7 @@ QT_WARNING_POP
// size_t. Implementations for 8- and 16-bit types will work but may not be as
// efficient. Implementations for 64-bit may be missing on 32-bit platforms.
-#if (defined(Q_CC_GNU) && (Q_CC_GNU >= 500) || (defined(Q_CC_INTEL) && !defined(Q_OS_WIN))) || QT_HAS_BUILTIN(__builtin_add_overflowx)
+#if (defined(Q_CC_GNU) && (Q_CC_GNU >= 500) || (defined(Q_CC_INTEL) && !defined(Q_OS_WIN))) || QT_HAS_BUILTIN(__builtin_add_overflow)
// GCC 5, ICC 18, and Clang 3.8 have builtins to detect overflows
template <typename T> inline
@@ -373,10 +373,18 @@ template <> inline bool add_overflow(unsigned v1, unsigned v2, unsigned *r)
// 32-bit mul_overflow is fine with the generic code above
-# if defined(Q_PROCESSOR_X86_64)
template <> inline bool add_overflow(quint64 v1, quint64 v2, quint64 *r)
-{ return _addcarry_u64(0, v1, v2, reinterpret_cast<unsigned __int64 *>(r)); }
-# endif // x86-64
+{
+# if defined(Q_PROCESSOR_X86_64)
+ return _addcarry_u64(0, v1, v2, reinterpret_cast<unsigned __int64 *>(r));
+# else
+ uint low, high;
+ uchar carry = _addcarry_u32(0, unsigned(v1), unsigned(v2), &low);
+ carry = _addcarry_u32(carry, v1 >> 32, v2 >> 32, &high);
+ *r = (quint64(high) << 32) | low;
+ return carry;
+# endif // !x86-64
+}
# endif // MSVC X86
#endif // !GCC
}
diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h
index ae1869f89e..9d1ce51da5 100644
--- a/src/corelib/io/qdebug.h
+++ b/src/corelib/io/qdebug.h
@@ -96,7 +96,7 @@ class Q_CORE_EXPORT QDebug
void setVerbosity(int v)
{
if (context.version > 1) {
- flags &= ~(VerbosityMask << VerbosityShift);
+ flags &= ~(uint(VerbosityMask) << VerbosityShift);
flags |= (v & VerbosityMask) << VerbosityShift;
}
}
diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp
index 405718aba8..4b63a38963 100644
--- a/src/corelib/io/qdir.cpp
+++ b/src/corelib/io/qdir.cpp
@@ -2127,10 +2127,9 @@ QString QDir::rootPath()
bool QDir::match(const QStringList &filters, const QString &fileName)
{
for (QStringList::ConstIterator sit = filters.constBegin(); sit != filters.constEnd(); ++sit) {
- QString wildcard = QRegularExpression::wildcardToRegularExpression(*sit);
// Insensitive exact match
// (see Notes for QRegExp Users in QRegularExpression's documentation)
- QRegularExpression rx(QRegularExpression::anchoredPattern(wildcard),
+ QRegularExpression rx(QRegularExpression::wildcardToRegularExpression(*sit),
QRegularExpression::CaseInsensitiveOption);
if (rx.match(fileName).hasMatch())
return true;
diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp
index 26078a6c71..185e061d8f 100644
--- a/src/corelib/io/qfileinfo.cpp
+++ b/src/corelib/io/qfileinfo.cpp
@@ -703,6 +703,8 @@ bool QFileInfo::exists() const
*/
bool QFileInfo::exists(const QString &file)
{
+ if (file.isEmpty())
+ return false;
QFileSystemEntry entry(file);
QFileSystemMetaData data;
QAbstractFileEngine *engine =
diff --git a/src/corelib/itemmodels/qabstractproxymodel.cpp b/src/corelib/itemmodels/qabstractproxymodel.cpp
index b7c49a53e4..62b3ee85b9 100644
--- a/src/corelib/itemmodels/qabstractproxymodel.cpp
+++ b/src/corelib/itemmodels/qabstractproxymodel.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
diff --git a/src/corelib/itemmodels/qabstractproxymodel.h b/src/corelib/itemmodels/qabstractproxymodel.h
index c4e5d67908..08ecf9d15f 100644
--- a/src/corelib/itemmodels/qabstractproxymodel.h
+++ b/src/corelib/itemmodels/qabstractproxymodel.h
@@ -3,7 +3,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
diff --git a/src/corelib/itemmodels/qabstractproxymodel_p.h b/src/corelib/itemmodels/qabstractproxymodel_p.h
index 3a9f33baba..f7bd5cc691 100644
--- a/src/corelib/itemmodels/qabstractproxymodel_p.h
+++ b/src/corelib/itemmodels/qabstractproxymodel_p.h
@@ -3,7 +3,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
diff --git a/src/corelib/itemmodels/qidentityproxymodel.cpp b/src/corelib/itemmodels/qidentityproxymodel.cpp
index c1e23dbd0c..f869601d3f 100644
--- a/src/corelib/itemmodels/qidentityproxymodel.cpp
+++ b/src/corelib/itemmodels/qidentityproxymodel.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2011 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
diff --git a/src/corelib/itemmodels/qidentityproxymodel.h b/src/corelib/itemmodels/qidentityproxymodel.h
index 3e6f5e4c48..89ac89cdba 100644
--- a/src/corelib/itemmodels/qidentityproxymodel.h
+++ b/src/corelib/itemmodels/qidentityproxymodel.h
@@ -3,7 +3,7 @@
** Copyright (C) 2011 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
diff --git a/src/corelib/itemmodels/qitemselectionmodel.cpp b/src/corelib/itemmodels/qitemselectionmodel.cpp
index edb9bb9098..1bacb63b17 100644
--- a/src/corelib/itemmodels/qitemselectionmodel.cpp
+++ b/src/corelib/itemmodels/qitemselectionmodel.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
diff --git a/src/corelib/itemmodels/qitemselectionmodel.h b/src/corelib/itemmodels/qitemselectionmodel.h
index 63e5f0ca9c..1c924053a5 100644
--- a/src/corelib/itemmodels/qitemselectionmodel.h
+++ b/src/corelib/itemmodels/qitemselectionmodel.h
@@ -3,7 +3,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
diff --git a/src/corelib/itemmodels/qitemselectionmodel_p.h b/src/corelib/itemmodels/qitemselectionmodel_p.h
index 187d4a2c1d..e12a0c2928 100644
--- a/src/corelib/itemmodels/qitemselectionmodel_p.h
+++ b/src/corelib/itemmodels/qitemselectionmodel_p.h
@@ -3,7 +3,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.cpp b/src/corelib/itemmodels/qsortfilterproxymodel.cpp
index 21fbf83382..87960b0863 100644
--- a/src/corelib/itemmodels/qsortfilterproxymodel.cpp
+++ b/src/corelib/itemmodels/qsortfilterproxymodel.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.h b/src/corelib/itemmodels/qsortfilterproxymodel.h
index 0be8b88672..303226668f 100644
--- a/src/corelib/itemmodels/qsortfilterproxymodel.h
+++ b/src/corelib/itemmodels/qsortfilterproxymodel.h
@@ -3,7 +3,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
diff --git a/src/corelib/itemmodels/qstringlistmodel.cpp b/src/corelib/itemmodels/qstringlistmodel.cpp
index 567e6fa35e..f92a0d6676 100644
--- a/src/corelib/itemmodels/qstringlistmodel.cpp
+++ b/src/corelib/itemmodels/qstringlistmodel.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -184,7 +184,10 @@ bool QStringListModel::setData(const QModelIndex &index, const QVariant &value,
{
if (index.row() >= 0 && index.row() < lst.size()
&& (role == Qt::EditRole || role == Qt::DisplayRole)) {
- lst.replace(index.row(), value.toString());
+ const QString valueString = value.toString();
+ if (lst.at(index.row()) == valueString)
+ return true;
+ lst.replace(index.row(), valueString);
QVector<int> roles;
roles.reserve(2);
roles.append(Qt::DisplayRole);
diff --git a/src/corelib/itemmodels/qstringlistmodel.h b/src/corelib/itemmodels/qstringlistmodel.h
index a40c13ae40..53376285c6 100644
--- a/src/corelib/itemmodels/qstringlistmodel.h
+++ b/src/corelib/itemmodels/qstringlistmodel.h
@@ -3,7 +3,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
diff --git a/src/corelib/kernel/qcore_mac_objc.mm b/src/corelib/kernel/qcore_mac_objc.mm
index 4ca9c2e996..bc23e821fd 100644
--- a/src/corelib/kernel/qcore_mac_objc.mm
+++ b/src/corelib/kernel/qcore_mac_objc.mm
@@ -1,52 +1,47 @@
/****************************************************************************
- **
- ** Copyright (C) 2016 The Qt Company Ltd.
- ** Copyright (C) 2014 Petroules Corporation.
- ** Contact: https://www.qt.io/licensing/
- **
- ** This file is part of the QtCore module of the Qt Toolkit.
- **
- ** $QT_BEGIN_LICENSE:LGPL$
- ** Commercial License Usage
- ** Licensees holding valid commercial Qt licenses may use this file in
- ** accordance with the commercial license agreement provided with the
- ** Software or, alternatively, in accordance with the terms contained in
- ** a written agreement between you and The Qt Company. For licensing terms
- ** and conditions see https://www.qt.io/terms-conditions. For further
- ** information use the contact form at https://www.qt.io/contact-us.
- **
- ** GNU Lesser General Public License Usage
- ** Alternatively, this file may be used under the terms of the GNU Lesser
- ** General Public License version 3 as published by the Free Software
- ** Foundation and appearing in the file LICENSE.LGPL3 included in the
- ** packaging of this file. Please review the following information to
- ** ensure the GNU Lesser General Public License version 3 requirements
- ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
- **
- ** GNU General Public License Usage
- ** Alternatively, this file may be used under the terms of the GNU
- ** General Public License version 2.0 or (at your option) the GNU General
- ** Public license version 3 or any later version approved by the KDE Free
- ** Qt Foundation. The licenses are as published by the Free Software
- ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
- ** included in the packaging of this file. Please review the following
- ** information to ensure the GNU General Public License requirements will
- ** be met: https://www.gnu.org/licenses/gpl-2.0.html and
- ** https://www.gnu.org/licenses/gpl-3.0.html.
- **
- ** $QT_END_LICENSE$
- **
- ****************************************************************************/
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2014 Petroules Corporation.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
#include <private/qcore_mac_p.h>
#ifdef Q_OS_MACOS
-# include <AppKit/AppKit.h>
-# if !QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_14)
-@interface NSApplication (MojaveForwardDeclarations)
-@property (strong) NSAppearance *effectiveAppearance NS_AVAILABLE_MAC(10_14);
-@end
-# endif
+#include <AppKit/AppKit.h>
#endif
#if defined(QT_PLATFORM_UIKIT)
@@ -174,10 +169,14 @@ QDebug operator<<(QDebug debug, const QMacAutoReleasePool *pool)
#ifdef Q_OS_MACOS
bool qt_mac_applicationIsInDarkMode()
{
- if (__builtin_available(macOS 10.14, *))
- return [NSApp.effectiveAppearance.name hasSuffix:@"DarkAqua"];
- else
- return false;
+#if QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_14)
+ if (__builtin_available(macOS 10.14, *)) {
+ auto appearance = [NSApp.effectiveAppearance bestMatchFromAppearancesWithNames:
+ @[ NSAppearanceNameAqua, NSAppearanceNameDarkAqua ]];
+ return [appearance isEqualToString:NSAppearanceNameDarkAqua];
+ }
+#endif
+ return false;
}
#endif
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp
index c642cd07f2..5de2717078 100644
--- a/src/corelib/kernel/qmetaobject.cpp
+++ b/src/corelib/kernel/qmetaobject.cpp
@@ -1381,6 +1381,8 @@ static inline QByteArray findMethodCandidates(const QMetaObject *metaObject, con
}
/*!
+ \threadsafe
+
Invokes the \a member (a signal or a slot name) on the object \a
obj. Returns \c true if the member could be invoked. Returns \c false
if there is no such member or the parameters did not match.
@@ -1570,6 +1572,7 @@ bool QMetaObject::invokeMethodImpl(QObject *object, QtPrivate::QSlotObjectBase *
QGenericArgument val7 = QGenericArgument(),
QGenericArgument val8 = QGenericArgument(),
QGenericArgument val9 = QGenericArgument());
+ \threadsafe
\overload invokeMethod()
This overload always invokes the member using the connection type Qt::AutoConnection.
@@ -1588,6 +1591,7 @@ bool QMetaObject::invokeMethodImpl(QObject *object, QtPrivate::QSlotObjectBase *
QGenericArgument val8 = QGenericArgument(),
QGenericArgument val9 = QGenericArgument())
+ \threadsafe
\overload invokeMethod()
This overload can be used if the return value of the member is of no interest.
@@ -1606,6 +1610,7 @@ bool QMetaObject::invokeMethodImpl(QObject *object, QtPrivate::QSlotObjectBase *
QGenericArgument val8 = QGenericArgument(),
QGenericArgument val9 = QGenericArgument())
+ \threadsafe
\overload invokeMethod()
This overload invokes the member using the connection type Qt::AutoConnection and
@@ -1617,6 +1622,7 @@ bool QMetaObject::invokeMethodImpl(QObject *object, QtPrivate::QSlotObjectBase *
\since 5.10
+ \threadsafe
\overload
Invokes the \a function in the event loop of \a context. \a function can be a functor
@@ -1630,6 +1636,7 @@ bool QMetaObject::invokeMethodImpl(QObject *object, QtPrivate::QSlotObjectBase *
\since 5.10
+ \threadsafe
\overload
Invokes the \a function in the event loop of \a context using the connection type Qt::AutoConnection.
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp
index eb67544f21..632b86959d 100644
--- a/src/corelib/kernel/qmetatype.cpp
+++ b/src/corelib/kernel/qmetatype.cpp
@@ -2566,6 +2566,8 @@ void *QMetaType::createExtended(const void *copy) const
*/
void QMetaType::destroyExtended(void *data) const
{
+ if (m_typeId == QMetaType::UnknownType)
+ return;
if (Q_UNLIKELY(m_typedDestructor && !m_destructor))
m_typedDestructor(m_typeId, data);
else
@@ -2582,6 +2584,8 @@ void QMetaType::destroyExtended(void *data) const
*/
void *QMetaType::constructExtended(void *where, const void *copy) const
{
+ if (m_typeId == QMetaType::UnknownType)
+ return nullptr;
if (m_typedConstructor && !m_constructor)
return m_typedConstructor(m_typeId, where, copy);
return nullptr;
@@ -2596,6 +2600,8 @@ void *QMetaType::constructExtended(void *where, const void *copy) const
*/
void QMetaType::destructExtended(void *data) const
{
+ if (m_typeId == QMetaType::UnknownType)
+ return;
if (m_typedDestructor && !m_destructor)
m_typedDestructor(m_typeId, data);
}
diff --git a/src/corelib/kernel/qppsattribute.cpp b/src/corelib/kernel/qppsattribute.cpp
index ffd5c53a6d..6be462edb5 100644
--- a/src/corelib/kernel/qppsattribute.cpp
+++ b/src/corelib/kernel/qppsattribute.cpp
@@ -1,41 +1,41 @@
/****************************************************************************
- **
- ** Copyright (C) 2013 BlackBerry Limited. All rights reserved.
- ** Contact: https://www.qt.io/licensing/
- **
- ** This file is part of the QtCore module of the Qt Toolkit.
- **
- ** $QT_BEGIN_LICENSE:LGPL$
- ** Commercial License Usage
- ** Licensees holding valid commercial Qt licenses may use this file in
- ** accordance with the commercial license agreement provided with the
- ** Software or, alternatively, in accordance with the terms contained in
- ** a written agreement between you and The Qt Company. For licensing terms
- ** and conditions see https://www.qt.io/terms-conditions. For further
- ** information use the contact form at https://www.qt.io/contact-us.
- **
- ** GNU Lesser General Public License Usage
- ** Alternatively, this file may be used under the terms of the GNU Lesser
- ** General Public License version 3 as published by the Free Software
- ** Foundation and appearing in the file LICENSE.LGPL3 included in the
- ** packaging of this file. Please review the following information to
- ** ensure the GNU Lesser General Public License version 3 requirements
- ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
- **
- ** GNU General Public License Usage
- ** Alternatively, this file may be used under the terms of the GNU
- ** General Public License version 2.0 or (at your option) the GNU General
- ** Public license version 3 or any later version approved by the KDE Free
- ** Qt Foundation. The licenses are as published by the Free Software
- ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
- ** included in the packaging of this file. Please review the following
- ** information to ensure the GNU General Public License requirements will
- ** be met: https://www.gnu.org/licenses/gpl-2.0.html and
- ** https://www.gnu.org/licenses/gpl-3.0.html.
- **
- ** $QT_END_LICENSE$
- **
- ****************************************************************************/
+**
+** Copyright (C) 2013 BlackBerry Limited. All rights reserved.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
#include "qppsattribute_p.h"
#include "qppsattributeprivate_p.h"
diff --git a/src/corelib/kernel/qppsattribute_p.h b/src/corelib/kernel/qppsattribute_p.h
index 035756e002..b59dcd5851 100644
--- a/src/corelib/kernel/qppsattribute_p.h
+++ b/src/corelib/kernel/qppsattribute_p.h
@@ -1,41 +1,42 @@
/****************************************************************************
- **
- ** Copyright (C) 2013 BlackBerry Limited. All rights reserved.
- ** Contact: https://www.qt.io/licensing/
- **
- ** This file is part of the QtCore module of the Qt Toolkit.
- **
- ** $QT_BEGIN_LICENSE:LGPL$
- ** Commercial License Usage
- ** Licensees holding valid commercial Qt licenses may use this file in
- ** accordance with the commercial license agreement provided with the
- ** Software or, alternatively, in accordance with the terms contained in
- ** a written agreement between you and The Qt Company. For licensing terms
- ** and conditions see https://www.qt.io/terms-conditions. For further
- ** information use the contact form at https://www.qt.io/contact-us.
- **
- ** GNU Lesser General Public License Usage
- ** Alternatively, this file may be used under the terms of the GNU Lesser
- ** General Public License version 3 as published by the Free Software
- ** Foundation and appearing in the file LICENSE.LGPL3 included in the
- ** packaging of this file. Please review the following information to
- ** ensure the GNU Lesser General Public License version 3 requirements
- ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
- **
- ** GNU General Public License Usage
- ** Alternatively, this file may be used under the terms of the GNU
- ** General Public License version 2.0 or (at your option) the GNU General
- ** Public license version 3 or any later version approved by the KDE Free
- ** Qt Foundation. The licenses are as published by the Free Software
- ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
- ** included in the packaging of this file. Please review the following
- ** information to ensure the GNU General Public License requirements will
- ** be met: https://www.gnu.org/licenses/gpl-2.0.html and
- ** https://www.gnu.org/licenses/gpl-3.0.html.
- **
- ** $QT_END_LICENSE$
- **
- ****************************************************************************/
+**
+** Copyright (C) 2013 BlackBerry Limited. All rights reserved.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef QPPSATTRIBUTE_P_H
#define QPPSATTRIBUTE_P_H
diff --git a/src/corelib/kernel/qppsattributeprivate_p.h b/src/corelib/kernel/qppsattributeprivate_p.h
index 6166447ef2..78b7b3c4c2 100644
--- a/src/corelib/kernel/qppsattributeprivate_p.h
+++ b/src/corelib/kernel/qppsattributeprivate_p.h
@@ -1,41 +1,41 @@
/****************************************************************************
- **
- ** Copyright (C) 2013 BlackBerry Limited. All rights reserved.
- ** Contact: https://www.qt.io/licensing/
- **
- ** This file is part of the QtCore module of the Qt Toolkit.
- **
- ** $QT_BEGIN_LICENSE:LGPL$
- ** Commercial License Usage
- ** Licensees holding valid commercial Qt licenses may use this file in
- ** accordance with the commercial license agreement provided with the
- ** Software or, alternatively, in accordance with the terms contained in
- ** a written agreement between you and The Qt Company. For licensing terms
- ** and conditions see https://www.qt.io/terms-conditions. For further
- ** information use the contact form at https://www.qt.io/contact-us.
- **
- ** GNU Lesser General Public License Usage
- ** Alternatively, this file may be used under the terms of the GNU Lesser
- ** General Public License version 3 as published by the Free Software
- ** Foundation and appearing in the file LICENSE.LGPL3 included in the
- ** packaging of this file. Please review the following information to
- ** ensure the GNU Lesser General Public License version 3 requirements
- ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
- **
- ** GNU General Public License Usage
- ** Alternatively, this file may be used under the terms of the GNU
- ** General Public License version 2.0 or (at your option) the GNU General
- ** Public license version 3 or any later version approved by the KDE Free
- ** Qt Foundation. The licenses are as published by the Free Software
- ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
- ** included in the packaging of this file. Please review the following
- ** information to ensure the GNU General Public License requirements will
- ** be met: https://www.gnu.org/licenses/gpl-2.0.html and
- ** https://www.gnu.org/licenses/gpl-3.0.html.
- **
- ** $QT_END_LICENSE$
- **
- ****************************************************************************/
+**
+** Copyright (C) 2013 BlackBerry Limited. All rights reserved.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
#ifndef QPPSATTRIBUTEPRIVATE_P_H
#define QPPSATTRIBUTEPRIVATE_P_H
diff --git a/src/corelib/kernel/qppsobject.cpp b/src/corelib/kernel/qppsobject.cpp
index d58715d12b..f4001d3833 100644
--- a/src/corelib/kernel/qppsobject.cpp
+++ b/src/corelib/kernel/qppsobject.cpp
@@ -1,41 +1,41 @@
/****************************************************************************
- **
- ** Copyright (C) 2013 BlackBerry Limited. All rights reserved.
- ** Contact: https://www.qt.io/licensing/
- **
- ** This file is part of the QtCore module of the Qt Toolkit.
- **
- ** $QT_BEGIN_LICENSE:LGPL$
- ** Commercial License Usage
- ** Licensees holding valid commercial Qt licenses may use this file in
- ** accordance with the commercial license agreement provided with the
- ** Software or, alternatively, in accordance with the terms contained in
- ** a written agreement between you and The Qt Company. For licensing terms
- ** and conditions see https://www.qt.io/terms-conditions. For further
- ** information use the contact form at https://www.qt.io/contact-us.
- **
- ** GNU Lesser General Public License Usage
- ** Alternatively, this file may be used under the terms of the GNU Lesser
- ** General Public License version 3 as published by the Free Software
- ** Foundation and appearing in the file LICENSE.LGPL3 included in the
- ** packaging of this file. Please review the following information to
- ** ensure the GNU Lesser General Public License version 3 requirements
- ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
- **
- ** GNU General Public License Usage
- ** Alternatively, this file may be used under the terms of the GNU
- ** General Public License version 2.0 or (at your option) the GNU General
- ** Public license version 3 or any later version approved by the KDE Free
- ** Qt Foundation. The licenses are as published by the Free Software
- ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
- ** included in the packaging of this file. Please review the following
- ** information to ensure the GNU General Public License requirements will
- ** be met: https://www.gnu.org/licenses/gpl-2.0.html and
- ** https://www.gnu.org/licenses/gpl-3.0.html.
- **
- ** $QT_END_LICENSE$
- **
- ****************************************************************************/
+**
+** Copyright (C) 2013 BlackBerry Limited. All rights reserved.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
#include "qppsobject_p.h"
diff --git a/src/corelib/kernel/qppsobject_p.h b/src/corelib/kernel/qppsobject_p.h
index c7b99c8e42..abcf00fa05 100644
--- a/src/corelib/kernel/qppsobject_p.h
+++ b/src/corelib/kernel/qppsobject_p.h
@@ -1,41 +1,41 @@
/****************************************************************************
- **
- ** Copyright (C) 2013 BlackBerry Limited. All rights reserved.
- ** Contact: https://www.qt.io/licensing/
- **
- ** This file is part of the QtCore module of the Qt Toolkit.
- **
- ** $QT_BEGIN_LICENSE:LGPL$
- ** Commercial License Usage
- ** Licensees holding valid commercial Qt licenses may use this file in
- ** accordance with the commercial license agreement provided with the
- ** Software or, alternatively, in accordance with the terms contained in
- ** a written agreement between you and The Qt Company. For licensing terms
- ** and conditions see https://www.qt.io/terms-conditions. For further
- ** information use the contact form at https://www.qt.io/contact-us.
- **
- ** GNU Lesser General Public License Usage
- ** Alternatively, this file may be used under the terms of the GNU Lesser
- ** General Public License version 3 as published by the Free Software
- ** Foundation and appearing in the file LICENSE.LGPL3 included in the
- ** packaging of this file. Please review the following information to
- ** ensure the GNU Lesser General Public License version 3 requirements
- ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
- **
- ** GNU General Public License Usage
- ** Alternatively, this file may be used under the terms of the GNU
- ** General Public License version 2.0 or (at your option) the GNU General
- ** Public license version 3 or any later version approved by the KDE Free
- ** Qt Foundation. The licenses are as published by the Free Software
- ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
- ** included in the packaging of this file. Please review the following
- ** information to ensure the GNU General Public License requirements will
- ** be met: https://www.gnu.org/licenses/gpl-2.0.html and
- ** https://www.gnu.org/licenses/gpl-3.0.html.
- **
- ** $QT_END_LICENSE$
- **
- ****************************************************************************/
+**
+** Copyright (C) 2013 BlackBerry Limited. All rights reserved.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
#ifndef QPPSOBJECT_P_H
#define QPPSOBJECT_P_H
diff --git a/src/corelib/kernel/qppsobjectprivate_p.h b/src/corelib/kernel/qppsobjectprivate_p.h
index dae44e3609..d6b4640832 100644
--- a/src/corelib/kernel/qppsobjectprivate_p.h
+++ b/src/corelib/kernel/qppsobjectprivate_p.h
@@ -1,41 +1,41 @@
/****************************************************************************
- **
- ** Copyright (C) 2013 BlackBerry Limited. All rights reserved.
- ** Contact: https://www.qt.io/licensing/
- **
- ** This file is part of the QtCore module of the Qt Toolkit.
- **
- ** $QT_BEGIN_LICENSE:LGPL$
- ** Commercial License Usage
- ** Licensees holding valid commercial Qt licenses may use this file in
- ** accordance with the commercial license agreement provided with the
- ** Software or, alternatively, in accordance with the terms contained in
- ** a written agreement between you and The Qt Company. For licensing terms
- ** and conditions see https://www.qt.io/terms-conditions. For further
- ** information use the contact form at https://www.qt.io/contact-us.
- **
- ** GNU Lesser General Public License Usage
- ** Alternatively, this file may be used under the terms of the GNU Lesser
- ** General Public License version 3 as published by the Free Software
- ** Foundation and appearing in the file LICENSE.LGPL3 included in the
- ** packaging of this file. Please review the following information to
- ** ensure the GNU Lesser General Public License version 3 requirements
- ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
- **
- ** GNU General Public License Usage
- ** Alternatively, this file may be used under the terms of the GNU
- ** General Public License version 2.0 or (at your option) the GNU General
- ** Public license version 3 or any later version approved by the KDE Free
- ** Qt Foundation. The licenses are as published by the Free Software
- ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
- ** included in the packaging of this file. Please review the following
- ** information to ensure the GNU General Public License requirements will
- ** be met: https://www.gnu.org/licenses/gpl-2.0.html and
- ** https://www.gnu.org/licenses/gpl-3.0.html.
- **
- ** $QT_END_LICENSE$
- **
- ****************************************************************************/
+**
+** Copyright (C) 2013 BlackBerry Limited. All rights reserved.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
#ifndef QPPSOBJECTPRIVATE_P_H_
#define QPPSOBJECTPRIVATE_P_H_
diff --git a/src/corelib/kernel/qtestsupport_core.cpp b/src/corelib/kernel/qtestsupport_core.cpp
index aba2a136a1..c54b933f94 100644
--- a/src/corelib/kernel/qtestsupport_core.cpp
+++ b/src/corelib/kernel/qtestsupport_core.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtTest module of the Qt Toolkit.
+** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
diff --git a/src/corelib/kernel/qtestsupport_core.h b/src/corelib/kernel/qtestsupport_core.h
index 7fc0054580..c8b664b6d3 100644
--- a/src/corelib/kernel/qtestsupport_core.h
+++ b/src/corelib/kernel/qtestsupport_core.h
@@ -3,7 +3,7 @@
** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtTest module of the Qt Toolkit.
+** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
diff --git a/src/corelib/tools/qchar.cpp b/src/corelib/tools/qchar.cpp
index 94de69f075..47c853084b 100644
--- a/src/corelib/tools/qchar.cpp
+++ b/src/corelib/tools/qchar.cpp
@@ -652,7 +652,7 @@ QT_BEGIN_NAMESPACE
Constructs a QChar corresponding to ASCII/Latin-1 character \a ch.
\note This constructor is not available when \c QT_NO_CAST_FROM_ASCII
- or QT_RESTRICTED_CAST_FROM_ASCII is defined.
+ or \c QT_RESTRICTED_CAST_FROM_ASCII is defined.
\sa QT_NO_CAST_FROM_ASCII, QT_RESTRICTED_CAST_FROM_ASCII
*/
diff --git a/src/corelib/tools/qcollator.cpp b/src/corelib/tools/qcollator.cpp
index 1cf223aae6..76dcf35833 100644
--- a/src/corelib/tools/qcollator.cpp
+++ b/src/corelib/tools/qcollator.cpp
@@ -79,7 +79,6 @@ QT_BEGIN_NAMESPACE
QCollator::QCollator(const QLocale &locale)
: d(new QCollatorPrivate(locale))
{
- d->init();
}
/*!
@@ -223,11 +222,6 @@ Qt::CaseSensitivity QCollator::caseSensitivity() const
By default this mode is off.
- \note On Windows, this functionality makes use of the \l{ICU} library. If Qt was
- compiled without ICU support, it falls back to code using native Windows API,
- which only works from Windows 7 onwards. On older versions of Windows, it will not work
- and a warning will be emitted at runtime.
-
\sa numericMode()
*/
void QCollator::setNumericMode(bool on)
@@ -323,6 +317,8 @@ bool QCollator::ignorePunctuation() const
methods directly. But if the string is compared repeatedly (e.g. when sorting
a whole list of strings), it's usually faster to create the sort keys for each
string and then sort using the keys.
+
+ \note Not supported with the C (a.k.a. POSIX) locale on Darwin.
*/
/*!
diff --git a/src/corelib/tools/qcollator_icu.cpp b/src/corelib/tools/qcollator_icu.cpp
index fd621983d3..ab45b9a1a1 100644
--- a/src/corelib/tools/qcollator_icu.cpp
+++ b/src/corelib/tools/qcollator_icu.cpp
@@ -55,6 +55,8 @@ QT_BEGIN_NAMESPACE
void QCollatorPrivate::init()
{
cleanup();
+ if (isC())
+ return;
UErrorCode status = U_ZERO_ERROR;
QByteArray name = QLocalePrivate::get(locale)->bcp47Name('_');
@@ -140,6 +142,8 @@ QCollatorSortKey QCollator::sortKey(const QString &string) const
{
if (d->dirty)
d->init();
+ if (d->isC())
+ return QCollatorSortKey(new QCollatorSortKeyPrivate(string.toUtf8()));
if (d->collator) {
QByteArray result(16 + string.size() + (string.size() >> 2), Qt::Uninitialized);
diff --git a/src/corelib/tools/qcollator_macx.cpp b/src/corelib/tools/qcollator_macx.cpp
index 9aa59a81dc..42e67e0c12 100644
--- a/src/corelib/tools/qcollator_macx.cpp
+++ b/src/corelib/tools/qcollator_macx.cpp
@@ -55,6 +55,15 @@ QT_BEGIN_NAMESPACE
void QCollatorPrivate::init()
{
cleanup();
+ /*
+ LocaleRefFromLocaleString() will accept "POSIX" as the locale name, but
+ the locale it produces (named "pos") doesn't implement the [A-Z] < [a-z]
+ behavior we expect of the C locale. We can use QStringView to get round
+ that for collation, but this leaves no way to do a sort key.
+ */
+ if (isC())
+ return;
+
LocaleRef localeRef;
int rc = LocaleRefFromLocaleString(QLocalePrivate::get(locale)->bcp47Name().constData(), &localeRef);
if (rc != 0)
@@ -92,6 +101,8 @@ int QCollator::compare(const QChar *s1, int len1, const QChar *s2, int len2) con
{
if (d->dirty)
d->init();
+ if (!d->collator)
+ return QStringView(s1, len1).compare(QStringView(s2, len2), caseSensitivity());
SInt32 result;
Boolean equivalent;
@@ -104,6 +115,7 @@ int QCollator::compare(const QChar *s1, int len1, const QChar *s2, int len2) con
return 0;
return result < 0 ? -1 : 1;
}
+
int QCollator::compare(const QString &str1, const QString &str2) const
{
return compare(str1.constData(), str1.size(), str2.constData(), str2.size());
@@ -118,6 +130,11 @@ QCollatorSortKey QCollator::sortKey(const QString &string) const
{
if (d->dirty)
d->init();
+ if (!d->collator) {
+ // What should (or even *can*) we do here ? (See init()'s comment.)
+ qWarning("QCollator doesn't support sort keys for the C locale on Darwin");
+ return QCollatorSortKey(nullptr);
+ }
//Documentation recommends having it 5 times as big as the input
QVector<UCCollationValue> ret(string.size() * 5);
@@ -136,6 +153,9 @@ QCollatorSortKey QCollator::sortKey(const QString &string) const
int QCollatorSortKey::compare(const QCollatorSortKey &key) const
{
+ if (!d.data())
+ return 0;
+
SInt32 order;
UCCompareCollationKeys(d->m_key.data(), d->m_key.size(),
key.d->m_key.data(), key.d->m_key.size(),
diff --git a/src/corelib/tools/qcollator_p.h b/src/corelib/tools/qcollator_p.h
index e89c08447c..361c3fb987 100644
--- a/src/corelib/tools/qcollator_p.h
+++ b/src/corelib/tools/qcollator_p.h
@@ -110,6 +110,7 @@ public:
QCollatorPrivate(const QLocale &locale) : locale(locale) {}
~QCollatorPrivate() { cleanup(); }
+ bool isC() { return locale.language() == QLocale::C; }
void clear() {
cleanup();
diff --git a/src/corelib/tools/qcollator_posix.cpp b/src/corelib/tools/qcollator_posix.cpp
index 42413a4a82..81f97a02e1 100644
--- a/src/corelib/tools/qcollator_posix.cpp
+++ b/src/corelib/tools/qcollator_posix.cpp
@@ -48,10 +48,12 @@ QT_BEGIN_NAMESPACE
void QCollatorPrivate::init()
{
- if (locale != QLocale())
- qWarning("Only default locale supported with the posix collation implementation");
- if (caseSensitivity != Qt::CaseSensitive)
- qWarning("Case insensitive sorting unsupported in the posix collation implementation");
+ if (!isC()) {
+ if (locale != QLocale())
+ qWarning("Only C and default locale supported with the posix collation implementation");
+ if (caseSensitivity != Qt::CaseSensitive)
+ qWarning("Case insensitive sorting unsupported in the posix collation implementation");
+ }
if (numericMode)
qWarning("Numeric mode unsupported in the posix collation implementation");
if (ignorePunctuation)
@@ -73,14 +75,16 @@ static void stringToWCharArray(QVarLengthArray<wchar_t> &ret, const QString &str
int QCollator::compare(const QChar *s1, int len1, const QChar *s2, int len2) const
{
- QVarLengthArray<wchar_t> array1, array2;
- stringToWCharArray(array1, QString(s1, len1));
- stringToWCharArray(array2, QString(s2, len2));
- return std::wcscoll(array1.constData(), array2.constData());
+ return compare(QString::fromRawData(s1, len1), QString::fromRawData(s2, len2));
}
int QCollator::compare(const QString &s1, const QString &s2) const
{
+ if (d->isC())
+ return s1.compare(s2, caseSensitivity());
+ if (d->dirty)
+ d->init();
+
QVarLengthArray<wchar_t> array1, array2;
stringToWCharArray(array1, s1);
stringToWCharArray(array2, s2);
@@ -89,10 +93,7 @@ int QCollator::compare(const QString &s1, const QString &s2) const
int QCollator::compare(const QStringRef &s1, const QStringRef &s2) const
{
- if (d->dirty)
- d->init();
-
- return compare(s1.constData(), s1.size(), s2.constData(), s2.size());
+ return compare(s1.toString(), s2.toString());
}
QCollatorSortKey QCollator::sortKey(const QString &string) const
@@ -102,14 +103,18 @@ QCollatorSortKey QCollator::sortKey(const QString &string) const
QVarLengthArray<wchar_t> original;
stringToWCharArray(original, string);
- QVector<wchar_t> result(string.size());
- size_t size = std::wcsxfrm(result.data(), original.constData(), string.size());
- if (size > uint(result.size())) {
+ QVector<wchar_t> result(original.size());
+ if (d->isC()) {
+ std::copy(original.cbegin(), original.cend(), result.begin());
+ } else {
+ size_t size = std::wcsxfrm(result.data(), original.constData(), string.size());
+ if (size > uint(result.size())) {
+ result.resize(size+1);
+ size = std::wcsxfrm(result.data(), original.constData(), string.size());
+ }
result.resize(size+1);
- size = std::wcsxfrm(result.data(), original.constData(), string.size());
+ result[size] = 0;
}
- result.resize(size+1);
- result[size] = 0;
return QCollatorSortKey(new QCollatorSortKeyPrivate(std::move(result)));
}
diff --git a/src/corelib/tools/qcollator_win.cpp b/src/corelib/tools/qcollator_win.cpp
index 5a838c1b50..35142bb8b8 100644
--- a/src/corelib/tools/qcollator_win.cpp
+++ b/src/corelib/tools/qcollator_win.cpp
@@ -60,6 +60,8 @@ extern LCID qt_inIsoNametoLCID(const char *name);
void QCollatorPrivate::init()
{
collator = 0;
+ if (isC())
+ return;
#ifndef USE_COMPARESTRINGEX
localeID = qt_inIsoNametoLCID(QLocalePrivate::get(locale)->bcp47Name().constData());
@@ -86,6 +88,9 @@ void QCollatorPrivate::cleanup()
int QCollator::compare(const QChar *s1, int len1, const QChar *s2, int len2) const
{
+ if (d->isC())
+ return QString::compare_helper(s1, len1, s2, len2, d->caseSensitivity);
+
if (d->dirty)
d->init();
@@ -119,6 +124,8 @@ QCollatorSortKey QCollator::sortKey(const QString &string) const
{
if (d->dirty)
d->init();
+ if (d->isC())
+ return QCollatorSortKey(new QCollatorSortKeyPrivate(string));
#ifndef USE_COMPARESTRINGEX
int size = LCMapStringW(d->localeID, LCMAP_SORTKEY | d->collator,
diff --git a/src/corelib/tools/qregularexpression.cpp b/src/corelib/tools/qregularexpression.cpp
index 908e7ff0d6..bdaa2d3243 100644
--- a/src/corelib/tools/qregularexpression.cpp
+++ b/src/corelib/tools/qregularexpression.cpp
@@ -1992,7 +1992,7 @@ QString QRegularExpression::wildcardToRegularExpression(const QString &pattern)
}
}
- return rx;
+ return anchoredPattern(rx);
}
/*!
@@ -2138,6 +2138,9 @@ int QRegularExpressionMatch::lastCapturedIndex() const
If the \a nth capturing group did not capture a string, or if there is no
such capturing group, returns a null QString.
+ \note The implicit capturing group number 0 captures the substring matched
+ by the entire pattern.
+
\sa capturedRef(), capturedView(), lastCapturedIndex(), capturedStart(), capturedEnd(),
capturedLength(), QString::isNull()
*/
@@ -2160,6 +2163,9 @@ QString QRegularExpressionMatch::captured(int nth) const
If the \a nth capturing group did not capture a string, or if there is no
such capturing group, returns a null QStringRef.
+ \note The implicit capturing group number 0 captures the substring matched
+ by the entire pattern.
+
\sa captured(), capturedView(), lastCapturedIndex(), capturedStart(), capturedEnd(),
capturedLength(), QStringRef::isNull()
*/
@@ -2184,6 +2190,9 @@ QStringRef QRegularExpressionMatch::capturedRef(int nth) const
If the \a nth capturing group did not capture a string, or if there is no
such capturing group, returns a null QStringView.
+ \note The implicit capturing group number 0 captures the substring matched
+ by the entire pattern.
+
\sa captured(), capturedRef(), lastCapturedIndex(), capturedStart(), capturedEnd(),
capturedLength(), QStringView::isNull()
*/
@@ -2296,7 +2305,9 @@ QStringView QRegularExpressionMatch::capturedView(QStringView name) const
/*!
Returns a list of all strings captured by capturing groups, in the order
- the groups themselves appear in the pattern string.
+ the groups themselves appear in the pattern string. The list includes the
+ implicit capturing group number 0, capturing the substring matched by the
+ entire pattern.
*/
QStringList QRegularExpressionMatch::capturedTexts() const
{
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index d20c46774d..63d44eb39c 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -265,16 +265,46 @@ const ushort *QtPrivate::qustrchr(QStringView str, ushort c) noexcept
const ushort *e = reinterpret_cast<const ushort *>(str.end());
#ifdef __SSE2__
+ bool loops = true;
+ // Using the PMOVMSKB instruction, we get two bits for each character
+ // we compare.
+# if defined(__AVX2__) && !defined(__OPTIMIZE_SIZE__)
+ // we're going to read n[0..15] (32 bytes)
+ __m256i mch256 = _mm256_set1_epi32(c | (c << 16));
+ for (const ushort *next = n + 16; next <= e; n = next, next += 16) {
+ __m256i data = _mm256_loadu_si256(reinterpret_cast<const __m256i *>(n));
+ __m256i result = _mm256_cmpeq_epi16(data, mch256);
+ uint mask = uint(_mm256_movemask_epi8(result));
+ if (mask) {
+ uint idx = qCountTrailingZeroBits(mask);
+ return n + idx / 2;
+ }
+ }
+ loops = false;
+ __m128i mch = _mm256_castsi256_si128(mch256);
+# else
__m128i mch = _mm_set1_epi32(c | (c << 16));
+# endif
+
+ auto hasMatch = [mch, &n](__m128i data, ushort validityMask) {
+ __m128i result = _mm_cmpeq_epi16(data, mch);
+ uint mask = uint(_mm_movemask_epi8(result));
+ if ((mask & validityMask) == 0)
+ return false;
+ uint idx = qCountTrailingZeroBits(mask);
+ n += idx / 2;
+ return true;
+ };
// we're going to read n[0..7] (16 bytes)
for (const ushort *next = n + 8; next <= e; n = next, next += 8) {
__m128i data = _mm_loadu_si128(reinterpret_cast<const __m128i *>(n));
- __m128i result = _mm_cmpeq_epi16(data, mch);
- uint mask = _mm_movemask_epi8(result);
- if (ushort(mask)) {
- // found a match
- return n + (qCountTrailingZeroBits(mask) >> 1);
+ if (hasMatch(data, 0xffff))
+ return n;
+
+ if (!loops) {
+ n += 8;
+ break;
}
}
@@ -282,12 +312,8 @@ const ushort *QtPrivate::qustrchr(QStringView str, ushort c) noexcept
// we're going to read n[0..3] (8 bytes)
if (e - n > 3) {
__m128i data = _mm_loadl_epi64(reinterpret_cast<const __m128i *>(n));
- __m128i result = _mm_cmpeq_epi16(data, mch);
- uint mask = _mm_movemask_epi8(result);
- if (uchar(mask)) {
- // found a match
- return n + (qCountTrailingZeroBits(mask) >> 1);
- }
+ if (hasMatch(data, 0xff))
+ return n;
n += 4;
}
@@ -874,6 +900,19 @@ static int ucstrncmp(const QChar *a, const QChar *b, size_t l)
const QChar *end = a + l;
qptrdiff offset = 0;
+ // Using the PMOVMSKB instruction, we get two bits for each character
+ // we compare.
+ int retval;
+ auto isDifferent = [a, b, &offset, &retval](__m128i a_data, __m128i b_data) {
+ __m128i result = _mm_cmpeq_epi16(a_data, b_data);
+ uint mask = ~uint(_mm_movemask_epi8(result));
+ if (ushort(mask) == 0)
+ return false;
+ uint idx = qCountTrailingZeroBits(mask);
+ retval = a[offset + idx / 2].unicode() - b[offset + idx / 2].unicode();
+ return true;
+ };
+
// we're going to read a[0..15] and b[0..15] (32 bytes)
for ( ; a + offset + 16 <= end; offset += 16) {
#ifdef __AVX2__
@@ -902,13 +941,8 @@ static int ucstrncmp(const QChar *a, const QChar *b, size_t l)
if (a + offset + 8 <= end) {
__m128i a_data = _mm_loadu_si128(reinterpret_cast<const __m128i *>(a + offset));
__m128i b_data = _mm_loadu_si128(reinterpret_cast<const __m128i *>(b + offset));
- __m128i result = _mm_cmpeq_epi16(a_data, b_data);
- uint mask = ~_mm_movemask_epi8(result);
- if (ushort(mask)) {
- // found a different character
- uint idx = qCountTrailingZeroBits(mask);
- return a[offset + idx / 2].unicode() - b[offset + idx / 2].unicode();
- }
+ if (isDifferent(a_data, b_data))
+ return retval;
offset += 8;
}
@@ -917,13 +951,8 @@ static int ucstrncmp(const QChar *a, const QChar *b, size_t l)
if (a + offset + 4 <= end) {
__m128i a_data = _mm_loadl_epi64(reinterpret_cast<const __m128i *>(a + offset));
__m128i b_data = _mm_loadl_epi64(reinterpret_cast<const __m128i *>(b + offset));
- __m128i result = _mm_cmpeq_epi16(a_data, b_data);
- uint mask = ~_mm_movemask_epi8(result);
- if (uchar(mask)) {
- // found a different character
- uint idx = qCountTrailingZeroBits(mask);
- return a[offset + idx / 2].unicode() - b[offset + idx / 2].unicode();
- }
+ if (isDifferent(a_data, b_data))
+ return retval;
offset += 4;
}
@@ -1018,6 +1047,19 @@ static int ucstrncmp(const QChar *a, const uchar *c, size_t l)
__m128i nullmask = _mm_setzero_si128();
qptrdiff offset = 0;
+ // Using the PMOVMSKB instruction, we get two bits for each character
+ // we compare.
+ int retval;
+ auto isDifferent = [uc, c, &offset, &retval](__m128i a_data, __m128i b_data) {
+ __m128i result = _mm_cmpeq_epi16(a_data, b_data);
+ uint mask = ~uint(_mm_movemask_epi8(result));
+ if (ushort(mask) == 0)
+ return false;
+ uint idx = qCountTrailingZeroBits(mask);
+ retval = uc[offset + idx / 2] - c[offset + idx / 2];
+ return true;
+ };
+
// we're going to read uc[offset..offset+15] (32 bytes)
// and c[offset..offset+15] (16 bytes)
for ( ; uc + offset + 15 < e; offset += 16) {
@@ -1061,13 +1103,8 @@ static int ucstrncmp(const QChar *a, const uchar *c, size_t l)
__m128i secondHalf = mm_load8_zero_extend(c + offset);
__m128i ucdata = _mm_loadu_si128((const __m128i*)(uc + offset));
- __m128i result = _mm_cmpeq_epi16(secondHalf, ucdata);
- uint mask = ~_mm_movemask_epi8(result);
- if (ushort(mask)) {
- // found a different character
- uint idx = qCountTrailingZeroBits(mask);
- return uc[offset + idx / 2] - c[offset + idx / 2];
- }
+ if (isDifferent(ucdata, secondHalf))
+ return retval;
// still matched
offset += 8;
@@ -1080,13 +1117,8 @@ static int ucstrncmp(const QChar *a, const uchar *c, size_t l)
__m128i secondHalf = _mm_unpacklo_epi8(chunk, nullmask);
__m128i ucdata = _mm_loadl_epi64(reinterpret_cast<const __m128i *>(uc + offset));
- __m128i result = _mm_cmpeq_epi8(secondHalf, ucdata);
- uint mask = ~_mm_movemask_epi8(result);
- if (uchar(mask)) {
- // found a different character
- uint idx = qCountTrailingZeroBits(mask);
- return uc[offset + idx / 2] - c[offset + idx / 2];
- }
+ if (isDifferent(ucdata, secondHalf))
+ return retval;
// still matched
offset += 4;
@@ -1318,7 +1350,7 @@ const QString::Null QString::null = { };
literals and 8-bit data to unicode QStrings, but allows the use of
the \c{QChar(char)} and \c{QString(const char (&ch)[N]} constructors,
and the \c{QString::operator=(const char (&ch)[N])} assignment operator
- giving most of the type-safety benefits of QT_NO_CAST_FROM_ASCII
+ giving most of the type-safety benefits of \c QT_NO_CAST_FROM_ASCII
but does not require user code to wrap character and string literals
with QLatin1Char, QLatin1String or similar.
@@ -1973,13 +2005,13 @@ const QString::Null QString::null = { };
can be useful if you want to ensure that all user-visible strings
go through QObject::tr(), for example.
- \note Defining QT_RESTRICTED_CAST_FROM_ASCII also disables
+ \note Defining \c QT_RESTRICTED_CAST_FROM_ASCII also disables
this constructor, but enables a \c{QString(const char (&ch)[N])}
constructor instead. Using non-literal input, or input with
embedded NUL characters, or non-7-bit characters is undefined
in this case.
- \sa fromLatin1(), fromLocal8Bit(), fromUtf8()
+ \sa fromLatin1(), fromLocal8Bit(), fromUtf8(), QT_NO_CAST_FROM_ASCII, QT_RESTRICTED_CAST_FROM_ASCII
*/
/*! \fn QString QString::fromStdString(const std::string &str)
@@ -2172,7 +2204,7 @@ QString::QString(QChar ch)
can be useful if you want to ensure that all user-visible strings
go through QObject::tr(), for example.
- \sa fromLatin1(), fromLocal8Bit(), fromUtf8()
+ \sa fromLatin1(), fromLocal8Bit(), fromUtf8(), QT_NO_CAST_FROM_ASCII
*/
/*! \fn QString::QString(const Null &)
@@ -2420,6 +2452,8 @@ QString &QString::operator=(QLatin1String other)
QT_NO_CAST_FROM_ASCII when you compile your applications. This
can be useful if you want to ensure that all user-visible strings
go through QObject::tr(), for example.
+
+ \sa QT_NO_CAST_FROM_ASCII
*/
/*! \fn QString &QString::operator=(const char *str)
@@ -2434,6 +2468,7 @@ QString &QString::operator=(QLatin1String other)
This can be useful if you want to ensure that all user-visible strings
go through QObject::tr(), for example.
+ \sa QT_NO_CAST_FROM_ASCII, QT_RESTRICTED_CAST_FROM_ASCII
*/
/*! \fn QString &QString::operator=(char ch)
@@ -2448,6 +2483,8 @@ QString &QString::operator=(QLatin1String other)
QT_NO_CAST_FROM_ASCII when you compile your applications. This
can be useful if you want to ensure that all user-visible strings
go through QObject::tr(), for example.
+
+ \sa QT_NO_CAST_FROM_ASCII
*/
/*!
@@ -2510,8 +2547,10 @@ QString &QString::operator=(QChar ch)
If the given \a position is greater than size(), the array is
first extended using resize().
- This function is not available when QT_NO_CAST_FROM_ASCII is
+ This function is not available when \c QT_NO_CAST_FROM_ASCII is
defined.
+
+ \sa QT_NO_CAST_FROM_ASCII
*/
@@ -2526,8 +2565,10 @@ QString &QString::operator=(QChar ch)
If the given \a position is greater than size(), the array is
first extended using resize().
- This function is not available when QT_NO_CAST_FROM_ASCII is
+ This function is not available when \c QT_NO_CAST_FROM_ASCII is
defined.
+
+ \sa QT_NO_CAST_FROM_ASCII
*/
@@ -2692,6 +2733,8 @@ QString &QString::append(QLatin1String str)
when you compile your applications. This can be useful if you want
to ensure that all user-visible strings go through QObject::tr(),
for example.
+
+ \sa QT_NO_CAST_FROM_ASCII
*/
/*! \fn QString &QString::append(const char *str)
@@ -2705,6 +2748,8 @@ QString &QString::append(QLatin1String str)
when you compile your applications. This can be useful if you want
to ensure that all user-visible strings go through QObject::tr(),
for example.
+
+ \sa QT_NO_CAST_FROM_ASCII
*/
/*!
@@ -2767,6 +2812,8 @@ QString &QString::append(QChar ch)
QT_NO_CAST_FROM_ASCII when you compile your applications. This
can be useful if you want to ensure that all user-visible strings
go through QObject::tr(), for example.
+
+ \sa QT_NO_CAST_FROM_ASCII
*/
/*! \fn QString &QString::prepend(const char *str)
@@ -2780,6 +2827,8 @@ QString &QString::append(QChar ch)
QT_NO_CAST_FROM_ASCII when you compile your applications. This
can be useful if you want to ensure that all user-visible strings
go through QObject::tr(), for example.
+
+ \sa QT_NO_CAST_FROM_ASCII
*/
/*! \fn QString &QString::prepend(QChar ch)
@@ -3378,6 +3427,8 @@ bool QString::operator==(QLatin1String other) const Q_DECL_NOTHROW
Returns \c true if this string is lexically equal to the parameter
string \a other. Otherwise returns \c false.
+
+ \sa QT_NO_CAST_FROM_ASCII
*/
/*! \fn bool QString::operator==(const char *other) const
@@ -3391,6 +3442,8 @@ bool QString::operator==(QLatin1String other) const Q_DECL_NOTHROW
QT_NO_CAST_FROM_ASCII when you compile your applications. This
can be useful if you want to ensure that all user-visible strings
go through QObject::tr(), for example.
+
+ \sa QT_NO_CAST_FROM_ASCII
*/
/*!
@@ -3431,6 +3484,8 @@ bool QString::operator<(QLatin1String other) const Q_DECL_NOTHROW
QT_NO_CAST_FROM_ASCII when you compile your applications. This
can be useful if you want to ensure that all user-visible strings
go through QObject::tr(), for example.
+
+ \sa QT_NO_CAST_FROM_ASCII
*/
/*! \fn bool QString::operator<(const char *other) const
@@ -3447,6 +3502,8 @@ bool QString::operator<(QLatin1String other) const Q_DECL_NOTHROW
QT_NO_CAST_FROM_ASCII when you compile your applications. This
can be useful if you want to ensure that all user-visible strings
go through QObject::tr(), for example.
+
+ \sa QT_NO_CAST_FROM_ASCII
*/
/*! \fn bool operator<=(const QString &s1, const QString &s2)
@@ -3482,6 +3539,8 @@ bool QString::operator<(QLatin1String other) const Q_DECL_NOTHROW
QT_NO_CAST_FROM_ASCII when you compile your applications. This
can be useful if you want to ensure that all user-visible strings
go through QObject::tr(), for example.
+
+ \sa QT_NO_CAST_FROM_ASCII
*/
/*! \fn bool QString::operator<=(const char *other) const
@@ -3495,6 +3554,8 @@ bool QString::operator<(QLatin1String other) const Q_DECL_NOTHROW
QT_NO_CAST_FROM_ASCII when you compile your applications. This
can be useful if you want to ensure that all user-visible strings
go through QObject::tr(), for example.
+
+ \sa QT_NO_CAST_FROM_ASCII
*/
/*! \fn bool operator>(const QString &s1, const QString &s2)
@@ -3532,6 +3593,8 @@ bool QString::operator>(QLatin1String other) const Q_DECL_NOTHROW
QT_NO_CAST_FROM_ASCII when you compile your applications. This
can be useful if you want to ensure that all user-visible strings
go through QObject::tr(), for example.
+
+ \sa QT_NO_CAST_FROM_ASCII
*/
/*! \fn bool QString::operator>(const char *other) const
@@ -3545,6 +3608,8 @@ bool QString::operator>(QLatin1String other) const Q_DECL_NOTHROW
when you compile your applications. This can be useful if you want
to ensure that all user-visible strings go through QObject::tr(),
for example.
+
+ \sa QT_NO_CAST_FROM_ASCII
*/
/*! \fn bool operator>=(const QString &s1, const QString &s2)
@@ -3579,6 +3644,8 @@ bool QString::operator>(QLatin1String other) const Q_DECL_NOTHROW
when you compile your applications. This can be useful if you want
to ensure that all user-visible strings go through QObject::tr(),
for example.
+
+ \sa QT_NO_CAST_FROM_ASCII
*/
/*! \fn bool QString::operator>=(const char *other) const
@@ -3592,6 +3659,8 @@ bool QString::operator>(QLatin1String other) const Q_DECL_NOTHROW
when you compile your applications. This can be useful if you want
to ensure that all user-visible strings go through QObject::tr(),
for example.
+
+ \sa QT_NO_CAST_FROM_ASCII
*/
/*! \fn bool operator!=(const QString &s1, const QString &s2)
@@ -3626,6 +3695,8 @@ bool QString::operator>(QLatin1String other) const Q_DECL_NOTHROW
when you compile your applications. This can be useful if you want
to ensure that all user-visible strings go through QObject::tr(),
for example.
+
+ \sa QT_NO_CAST_FROM_ASCII
*/
/*! \fn bool QString::operator!=(const char *other) const
@@ -3639,6 +3710,8 @@ bool QString::operator>(QLatin1String other) const Q_DECL_NOTHROW
QT_NO_CAST_FROM_ASCII when you compile your applications. This
can be useful if you want to ensure that all user-visible strings
go through QObject::tr(), for example.
+
+ \sa QT_NO_CAST_FROM_ASCII
*/
/*!
@@ -6032,6 +6105,8 @@ QString& QString::fill(QChar ch, int size)
QT_NO_CAST_FROM_ASCII when you compile your applications. This
can be useful if you want to ensure that all user-visible strings
go through QObject::tr(), for example.
+
+ \sa QT_NO_CAST_FROM_ASCII
*/
/*! \fn QString &QString::operator+=(const char *str)
@@ -6045,6 +6120,8 @@ QString& QString::fill(QChar ch, int size)
when you compile your applications. This can be useful if you want
to ensure that all user-visible strings go through QObject::tr(),
for example.
+
+ \sa QT_NO_CAST_FROM_ASCII
*/
/*! \fn QString &QString::operator+=(const QStringRef &str)
@@ -6066,6 +6143,8 @@ QString& QString::fill(QChar ch, int size)
when you compile your applications. This can be useful if you want
to ensure that all user-visible strings go through QObject::tr(),
for example.
+
+ \sa QT_NO_CAST_FROM_ASCII
*/
/*! \fn QString &QString::operator+=(QChar ch)
@@ -9243,7 +9322,7 @@ QString &QString::setRawData(const QChar *unicode, int size)
in the first place. In those cases, using QStringLiteral may be
the better option.
- \sa QString, QLatin1Char, {QStringLiteral()}{QStringLiteral}
+ \sa QString, QLatin1Char, {QStringLiteral()}{QStringLiteral}, QT_NO_CAST_FROM_ASCII
*/
/*!
@@ -9720,6 +9799,8 @@ QString &QString::setRawData(const QChar *unicode, int size)
QT_NO_CAST_FROM_ASCII when you compile your applications. This
can be useful if you want to ensure that all user-visible strings
go through QObject::tr(), for example.
+
+ \sa QT_NO_CAST_FROM_ASCII
*/
/*!
@@ -9734,6 +9815,8 @@ QString &QString::setRawData(const QChar *unicode, int size)
QT_NO_CAST_FROM_ASCII when you compile your applications. This
can be useful if you want to ensure that all user-visible strings
go through QObject::tr(), for example.
+
+ \sa QT_NO_CAST_FROM_ASCII
*/
/*! \fn bool QLatin1String::operator!=(const QString &other) const
@@ -9759,6 +9842,8 @@ QString &QString::setRawData(const QChar *unicode, int size)
QT_NO_CAST_FROM_ASCII when you compile your applications. This
can be useful if you want to ensure that all user-visible strings
go through QObject::tr(), for example.
+
+ \sa QT_NO_CAST_FROM_ASCII
*/
/*!
@@ -9773,6 +9858,8 @@ QString &QString::setRawData(const QChar *unicode, int size)
QT_NO_CAST_FROM_ASCII when you compile your applications. This
can be useful if you want to ensure that all user-visible strings
go through QObject::tr(), for example.
+
+ \sa QT_NO_CAST_FROM_ASCII
*/
/*!
@@ -9799,6 +9886,8 @@ QString &QString::setRawData(const QChar *unicode, int size)
when you compile your applications. This can be useful if you want
to ensure that all user-visible strings go through QObject::tr(),
for example.
+
+ \sa QT_NO_CAST_FROM_ASCII
*/
/*!
@@ -9813,6 +9902,8 @@ QString &QString::setRawData(const QChar *unicode, int size)
when you compile your applications. This can be useful if you want
to ensure that all user-visible strings go through QObject::tr(),
for example.
+
+ \sa QT_NO_CAST_FROM_ASCII
*/
/*!
@@ -9839,6 +9930,8 @@ QString &QString::setRawData(const QChar *unicode, int size)
QT_NO_CAST_FROM_ASCII when you compile your applications. This
can be useful if you want to ensure that all user-visible strings
go through QObject::tr(), for example.
+
+ \sa QT_NO_CAST_FROM_ASCII
*/
/*!
@@ -9853,6 +9946,8 @@ QString &QString::setRawData(const QChar *unicode, int size)
QT_NO_CAST_FROM_ASCII when you compile your applications. This
can be useful if you want to ensure that all user-visible strings
go through QObject::tr(), for example.
+
+ \sa QT_NO_CAST_FROM_ASCII
*/
/*!
@@ -9879,6 +9974,8 @@ QString &QString::setRawData(const QChar *unicode, int size)
QT_NO_CAST_FROM_ASCII when you compile your applications. This
can be useful if you want to ensure that all user-visible strings
go through QObject::tr(), for example.
+
+ \sa QT_NO_CAST_FROM_ASCII
*/
/*!
@@ -9893,6 +9990,8 @@ QString &QString::setRawData(const QChar *unicode, int size)
QT_NO_CAST_FROM_ASCII when you compile your applications. This
can be useful if you want to ensure that all user-visible strings
go through QObject::tr(), for example.
+
+ \sa QT_NO_CAST_FROM_ASCII
*/
/*! \fn bool QLatin1String::operator<=(const QString &other) const
@@ -9918,6 +10017,8 @@ QString &QString::setRawData(const QChar *unicode, int size)
QT_NO_CAST_FROM_ASCII when you compile your applications. This
can be useful if you want to ensure that all user-visible strings
go through QObject::tr(), for example.
+
+ \sa QT_NO_CAST_FROM_ASCII
*/
/*!
@@ -9932,6 +10033,8 @@ QString &QString::setRawData(const QChar *unicode, int size)
QT_NO_CAST_FROM_ASCII when you compile your applications. This
can be useful if you want to ensure that all user-visible strings
go through QObject::tr(), for example.
+
+ \sa QT_NO_CAST_FROM_ASCII
*/
@@ -10560,6 +10663,7 @@ bool operator<(const QStringRef &s1,const QStringRef &s2) Q_DECL_NOTHROW
Returns \c true if this string is lexically equal to the parameter
string \a s. Otherwise returns \c false.
+ \sa QT_NO_CAST_FROM_ASCII
*/
/*!
@@ -10577,6 +10681,8 @@ bool operator<(const QStringRef &s1,const QStringRef &s2) Q_DECL_NOTHROW
Returns \c true if this string is not lexically equal to the parameter
string \a s. Otherwise returns \c false.
+
+ \sa QT_NO_CAST_FROM_ASCII
*/
/*!
@@ -10594,6 +10700,8 @@ bool operator<(const QStringRef &s1,const QStringRef &s2) Q_DECL_NOTHROW
Returns \c true if this string is lexically smaller than the parameter
string \a s. Otherwise returns \c false.
+
+ \sa QT_NO_CAST_FROM_ASCII
*/
/*!
@@ -10611,6 +10719,8 @@ bool operator<(const QStringRef &s1,const QStringRef &s2) Q_DECL_NOTHROW
Returns \c true if this string is lexically smaller than or equal to the parameter
string \a s. Otherwise returns \c false.
+
+ \sa QT_NO_CAST_FROM_ASCII
*/
/*!
@@ -10629,6 +10739,8 @@ bool operator<(const QStringRef &s1,const QStringRef &s2) Q_DECL_NOTHROW
Returns \c true if this string is lexically greater than the parameter
string \a s. Otherwise returns \c false.
+
+ \sa QT_NO_CAST_FROM_ASCII
*/
/*!
@@ -10646,6 +10758,8 @@ bool operator<(const QStringRef &s1,const QStringRef &s2) Q_DECL_NOTHROW
Returns \c true if this string is lexically greater than or equal to the
parameter string \a s. Otherwise returns \c false.
+
+ \sa QT_NO_CAST_FROM_ASCII
*/
/*!
\typedef QString::Data
diff --git a/src/corelib/tools/qstring_mips_dsp_asm.S b/src/corelib/tools/qstring_mips_dsp_asm.S
index faf90e14be..202f322310 100644
--- a/src/corelib/tools/qstring_mips_dsp_asm.S
+++ b/src/corelib/tools/qstring_mips_dsp_asm.S
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Imagination Technologies Limited, www.imgtec.com
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
diff --git a/src/corelib/tools/qstringbuilder.cpp b/src/corelib/tools/qstringbuilder.cpp
index 081d7136a7..8afc83819b 100644
--- a/src/corelib/tools/qstringbuilder.cpp
+++ b/src/corelib/tools/qstringbuilder.cpp
@@ -80,7 +80,7 @@ QT_BEGIN_NAMESPACE
\endlist
The types in the last list point are only available when
- QT_NO_CAST_FROM_ASCII is not defined.
+ \c QT_NO_CAST_FROM_ASCII is not defined.
For building QByteArrays:
diff --git a/src/gui/configure.json b/src/gui/configure.json
index 7585e9c8d4..89934c8f1d 100644
--- a/src/gui/configure.json
+++ b/src/gui/configure.json
@@ -63,48 +63,127 @@
"-lbcm_host"
]
},
- "direct2d": {
- "label": "Direct 2D",
- "export": "",
+ "dxguid": {
+ "label": "DirectX GUID",
+ "sources": [
+ "-ldxguid"
+ ]
+ },
+ "dxgi": {
+ "label": "DirectX GI",
+ "headers": "dxgi.h",
+ "sources": [
+ "-ldxgi"
+ ]
+ },
+ "dxgi1_2": {
+ "label": "DirectX GI 1.2",
"test": {
- "include": [ "d3d11_1.h", "d2d1_1.h", "d2d1_1helper.h", "dxgi1_2.h", "wrl.h", "dwrite.h" ],
- "tail": "using Microsoft::WRL::ComPtr;",
"main": [
- "ComPtr<ID2D1Factory1> d2dFactory;",
- "D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, d2dFactory.ReleaseAndGetAddressOf());",
- "ComPtr<IDXGISurface1> surface;",
+ "// fails with mingw-w64 5.4.0 - declaration is missing from header",
+ "IDXGISurface1 *surface;",
"(void) surface;"
]
},
+ "headers": "dxgi1_2.h",
+ "sources": [
+ "-ldxgi"
+ ]
+ },
+ "d3d9": {
+ "label": "Direct3D 9",
+ "headers": "d3d9.h",
+ "sources": [
+ "-ld3d9"
+ ]
+ },
+ "d3d11": {
+ "label": "Direct3D 11",
+ "headers": "d3d11.h",
+ "sources": [
+ "-ld3d11"
+ ]
+ },
+ "d3d11_1": {
+ "label": "Direct3D 11.1",
+ "headers": "d3d11_1.h",
+ "sources": [
+ "-ld3d11"
+ ]
+ },
+ "d3dcompiler": {
+ "label": "Direct3D Shader Compiler Library",
+ "headers": "d3dcompiler.h",
"sources": [
- "-ld2d1 -ldwrite -ld3d11"
+ "-ld3dcompiler"
+ ]
+ },
+ "d2d1": {
+ "label": "Direct2D 1",
+ "headers": [ "d2d1.h", "d2d1helper.h" ],
+ "sources": [
+ "-ld2d1"
+ ]
+ },
+ "d2d1_1": {
+ "label": "Direct2D 1.1",
+ "test": {
+ "main": [
+ "ID2D1Factory1 *d2dFactory;",
+ "D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &d2dFactory);"
+ ]
+ },
+ "headers": [ "d2d1_1.h", "d2d1_1helper.h" ],
+ "sources": [
+ "-ld2d1"
]
},
"directfb": {
"label": "DirectFB",
"test": {
- "include": "directfb.h",
"tail": [
"#ifdef __typeof__",
"# error DirectFB headers are unclean and cannot compile",
"#endif"
]
},
+ "headers": "directfb.h",
"sources": [
{ "type": "pkgConfig", "args": "directfb" }
]
},
- "directwrite": {
+ "dwrite": {
"label": "DirectWrite",
- "export": "",
"test": {
- "include": [ "dwrite.h", "d2d1.h" ],
"main": [
"IDWriteFactory *factory = 0;",
"DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, __uuidof(IDWriteFactory),",
" (IUnknown **)(&factory));"
]
},
+ "headers": "dwrite.h",
+ "sources": [
+ "-ldwrite"
+ ]
+ },
+ "dwrite_1": {
+ "label": "DirectWrite 1",
+ "headers": "dwrite_1.h",
+ "sources": [
+ "-ldwrite"
+ ]
+ },
+ "dwrite_2": {
+ "label": "DirectWrite 2",
+ "test": {
+ "main": [
+ "IUnknown *factory = 0;",
+ "(void)(size_t(DWRITE_E_NOCOLOR) + sizeof(IDWriteFontFace2));",
+ "DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, __uuidof(IDWriteFactory2),",
+ " &factory);"
+ ]
+ },
+ "headers": "dwrite_2.h",
"sources": [
"-ldwrite"
]
@@ -117,15 +196,12 @@
"#include <stdint.h>",
"extern \"C\" {"
],
- "include": [
- "xf86drmMode.h",
- "xf86drm.h"
- ],
"tail": [
"}"
],
"main": "(void) drmModeGetCrtc(0, 0);"
},
+ "headers": [ "xf86drmMode.h", "xf86drm.h" ],
"sources": [
{ "type": "pkgConfig", "args": "libdrm" },
{ "libs": "-ldrm", "condition": "!config.integrity" },
@@ -135,12 +211,12 @@
"egl": {
"label": "EGL",
"test": {
- "include": "EGL/egl.h",
"main": [
"EGLint x = 0; EGLDisplay dpy = 0; EGLContext ctx = 0;",
"eglDestroyContext(dpy, ctx);"
]
},
+ "headers": "EGL/egl.h",
"sources": [
{ "type": "pkgConfig", "args": "egl" },
{ "type": "makeSpec", "spec": "EGL" }
@@ -149,7 +225,6 @@
"freetype": {
"label": "FreeType",
"test": {
- "include": "ft2build.h",
"tail": [
"#include FT_FREETYPE_H",
"#if ((FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100 + FREETYPE_PATCH) < 20200)",
@@ -160,6 +235,7 @@
"FT_Face face = 0;"
]
},
+ "headers": "ft2build.h",
"sources": [
{ "type": "pkgConfig", "args": "freetype2" },
{ "type": "freetype", "libs": "-lfreetype", "condition": "!config.wasm" },
@@ -172,7 +248,6 @@
"fontconfig": {
"label": "Fontconfig",
"test": {
- "include": "fontconfig/fontconfig.h",
"tail": [
"#ifndef FC_RGBA_UNKNOWN",
"# error This version of fontconfig is tool old, it is missing the FC_RGBA_UNKNOWN define",
@@ -182,6 +257,7 @@
"FcPattern *pattern = 0;"
]
},
+ "headers": "fontconfig/fontconfig.h",
"sources": [
{ "type": "pkgConfig", "args": "fontconfig" },
{ "type": "freetype", "libs": "-lfontconfig" }
@@ -196,12 +272,12 @@
"#include <stdint.h>",
"extern \"C\" {"
],
- "include": "gbm.h",
"tail": [
"}"
],
"main": "gbm_surface *surface = 0;"
},
+ "headers": "gbm.h",
"sources": [
{ "type": "pkgConfig", "args": "gbm" }
]
@@ -209,7 +285,6 @@
"harfbuzz": {
"label": "HarfBuzz",
"test": {
- "include": "harfbuzz/hb.h",
"tail": [
"#if !HB_VERSION_ATLEAST(1, 6, 0)",
"# error This version of harfbuzz is too old.",
@@ -224,6 +299,7 @@
"hb_buffer_destroy(buffer);"
]
},
+ "headers": "harfbuzz/hb.h",
"sources": [
"-lharfbuzz"
]
@@ -232,9 +308,9 @@
"label": "IMF",
"export": "",
"test": {
- "include": "imf/imf_client.h",
"main": "imf_client_init();"
},
+ "headers": "imf/imf_client.h",
"sources": [
"-linput_client"
]
@@ -242,9 +318,9 @@
"lgmon": {
"label": "lgmon",
"test": {
- "include": "lgmon.h",
"main": "lgmon_supported(getpid());"
},
+ "headers": "lgmon.h",
"sources": [
"-llgmon"
]
@@ -252,9 +328,9 @@
"libinput": {
"label": "libinput",
"test": {
- "include": "libinput.h",
"main": "libinput_udev_create_context(NULL, NULL, NULL);"
},
+ "headers": "libinput.h",
"sources": [
{ "type": "pkgConfig", "args": "libinput" }
]
@@ -266,7 +342,6 @@
"#include <stdlib.h>",
"#include <stdint.h>"
],
- "include": "device/hiddriver.h",
"main": [
"HIDDriver *driver;",
"uintptr_t devicecontext;",
@@ -274,6 +349,7 @@
"gh_hid_enum_devices(driver, &device_id, &devicecontext);"
]
},
+ "headers": "device/hiddriver.h",
"sources": [
{ "libs": "-lhiddev -lusbhid -lusb" }
]
@@ -286,7 +362,6 @@
"#include <stdio.h>",
"extern \"C\" {"
],
- "include": "jpeglib.h",
"tail": [
"}",
"",
@@ -294,6 +369,7 @@
],
"main": "jpeg_create_compress(cinfo);"
},
+ "headers": "jpeglib.h",
"sources": [
{ "libs": "-llibjpeg", "condition": "config.msvc" },
"-ljpeg"
@@ -302,9 +378,9 @@
"libpng": {
"label": "libpng",
"test": {
- "include": "png.h",
"main": "(void) png_create_read_struct(PNG_LIBPNG_VER_STRING,0,0,0);"
},
+ "headers": "png.h",
"sources": [
{ "type": "pkgConfig", "args": "libpng" },
{ "libs": "-llibpng16", "condition": "config.msvc" },
@@ -320,13 +396,13 @@
"mirclient": {
"label": "Mir client libraries",
"test": {
- "include": [ "mir_toolkit/mir_client_library.h", "ubuntu/application/lifecycle_delegate.h", "EGL/egl.h" ],
"tail": "static void surfaceCreateCallback(MirSurface*, void*) {}",
"main": [
"u_application_lifecycle_delegate_new();",
"mir_surface_create(0, surfaceCreateCallback, 0);"
]
},
+ "headers": [ "mir_toolkit/mir_client_library.h", "ubuntu/application/lifecycle_delegate.h", "EGL/egl.h" ],
"sources": [
{ "type": "pkgConfig", "args": "egl mirclient ubuntu-platform-api libcontent-hub >= 0.2.0" }
]
@@ -334,12 +410,12 @@
"mtdev": {
"label": "mtdev",
"test": {
- "include": "mtdev.h",
"main": [
"mtdev m;",
"mtdev_open(&m, 0);"
]
},
+ "headers": "mtdev.h",
"sources": [
{ "type": "pkgConfig", "args": "mtdev" }
]
@@ -352,7 +428,6 @@
"# include <OpenGL/gl.h>",
"#else",
"# define GL_GLEXT_PROTOTYPES",
- "# include <GL/gl.h>",
"#endif"
],
"main": [
@@ -363,6 +438,12 @@
"glEnd();"
]
},
+ "headers": [
+ {
+ "condition": "!config.darwin",
+ "headers": "GL/gl.h"
+ }
+ ],
"sources": [
{ "type": "pkgConfig", "args": "gl", "condition": "!config.darwin" },
{ "type": "makeSpec", "spec": "OPENGL" }
@@ -376,7 +457,6 @@
"# include <OpenGLES/ES2/gl.h>",
"#else",
"# define GL_GLEXT_PROTOTYPES",
- "# include <GLES2/gl2.h>",
"#endif"
],
"main": [
@@ -384,6 +464,12 @@
"glClear(GL_COLOR_BUFFER_BIT);"
]
},
+ "headers": [
+ {
+ "condition": "!config.darwin",
+ "headers": "GLES2/gl2.h"
+ }
+ ],
"sources": [
{ "type": "pkgConfig", "args": "glesv2", "condition": "!config.darwin" },
{ "type": "makeSpec", "spec": "OPENGL_ES2" }
@@ -392,9 +478,9 @@
"openvg": {
"label": "OpenVG",
"test": {
- "include": "VG/openvg.h",
"main": "VGint i = 2; vgFlush();"
},
+ "headers": "VG/openvg.h",
"sources": [
{ "type": "pkgConfig", "args": "vg" },
{ "type": "makeSpec", "spec": "OPENVG" }
@@ -403,9 +489,9 @@
"tslib": {
"label": "tslib",
"test": {
- "include": "tslib.h",
"main": "ts_open(\"foo\", 0);"
},
+ "headers": "tslib.h",
"sources": [
"-lts"
]
@@ -417,10 +503,6 @@
"#include <cstddef>",
"extern \"C\" {"
],
- "include": [
- "mediactl/mediactl.h",
- "mediactl/v4l2subdev.h"
- ],
"tail": [
"}"
],
@@ -431,6 +513,7 @@
"v4l2_subdev_set_format(nullptr, nullptr, 0, V4L2_SUBDEV_FORMAT_ACTIVE);"
]
},
+ "headers": [ "mediactl/mediactl.h", "mediactl/v4l2subdev.h" ],
"sources": [
{ "type": "pkgConfig", "args": "libv4l2 libmediactl" },
"-lmediactl -lv4l2 -lv4l2subdev"
@@ -438,7 +521,23 @@
},
"vulkan": {
"label": "Vulkan",
- "test": "qpa/vulkan",
+ "test": {
+ "comment": "Note: Qt does not rely on linking to a Vulkan library directly.",
+ "tail": [
+ "// The pData parameter has changed from uint32_t* to void* at some point.",
+ "// Ensure the headers have the updated one to prevent compile errors later on.",
+ "PFN_vkCmdUpdateBuffer cmdUpdBuf;",
+ "void testUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize dataSize, const void* pData)",
+ "{",
+ " cmdUpdBuf(commandBuffer, dstBuffer, dstOffset, dataSize, pData);",
+ "}"
+ ],
+ "main": [
+ "VkInstanceCreateInfo info;",
+ "testUpdateBuffer(0, 0, 0, 0, 0);"
+ ]
+ },
+ "headers": "vulkan/vulkan.h",
"sources": [
{ "type": "pkgConfig", "args": "vulkan" },
{ "type": "makeSpec", "spec": "VULKAN" }
@@ -447,9 +546,9 @@
"wayland_server": {
"label": "Wayland Server",
"test": {
- "include": "wayland-server.h",
"main": "wl_display_create();"
},
+ "headers": "wayland-server.h",
"sources": [
{ "type": "pkgConfig", "args": "wayland-server" }
]
@@ -457,12 +556,12 @@
"xlib": {
"label": "XLib",
"test": {
- "include": "X11/Xlib.h",
"main": [
"Display *d = XOpenDisplay(NULL);",
"XCloseDisplay(d);"
]
},
+ "headers": "X11/Xlib.h",
"sources": [
{ "type": "makeSpec", "spec": "X11" }
]
@@ -474,9 +573,8 @@
]
},
"xcb": {
- "label": "XCB >= 1.9 (core)",
+ "label": "XCB >= 1.9",
"test": {
- "include": "xcb/xcb.h",
"main": [
"int primaryScreen = 0;",
"(void)xcb_connect(\"\", &primaryScreen);",
@@ -484,42 +582,108 @@
"int xcbScreenError = XCB_CONN_CLOSED_INVALID_SCREEN;"
]
},
+ "headers": "xcb/xcb.h",
"sources": [
{ "type": "pkgConfig", "args": "xcb >= 1.9" },
"-lxcb"
]
},
- "xcb_syslibs": {
- "label": "XCB (extensions)",
- "test": {
- "include": [
- "xcb/xcb.h",
- "xcb/xfixes.h",
- "xcb/xcb_image.h",
- "xcb/xcb_keysyms.h",
- "xcb/xinerama.h",
- "xcb/sync.h",
- "xcb/randr.h",
- "xcb/shm.h",
- "xcb/xcb_icccm.h"
- ],
- "main": [
- "int primaryScreen = 0;",
- "(void) xcb_connect(\"\", &primaryScreen);"
- ]
- },
+ "xcb_icccm": {
+ "label": "XCB ICCCM >= 0.3.9",
+ "headers": "xcb/xcb_icccm.h",
"sources": [
- { "type": "pkgConfig",
- "args": "xcb xcb-shm xcb-sync xcb-xfixes xcb-xinerama xcb-randr xcb-image xcb-keysyms xcb-icccm xcb-shape" },
- "-lxcb -lxcb-shm -lxcb-sync -lxcb-xfixes -lxcb-xinerama -lxcb-randr -lxcb-image -lxcb-keysyms -lxcb-icccm -lxcb-shape"
- ]
+ { "type": "pkgConfig", "args": "xcb-icccm >= 0.3.9" },
+ "-lxcb-icccm"
+ ],
+ "use": "xcb"
+ },
+ "xcb_image": {
+ "label": "XCB Image >= 0.3.9",
+ "headers": "xcb/xcb_image.h",
+ "sources": [
+ { "type": "pkgConfig", "args": "xcb-image >= 0.3.9" },
+ "-lxcb-image"
+ ],
+ "use": "xcb_shm xcb"
+ },
+ "xcb_keysyms": {
+ "label": "XCB Keysyms >= 0.3.9",
+ "headers": "xcb/xcb_keysyms.h",
+ "sources": [
+ { "type": "pkgConfig", "args": "xcb-keysyms >= 0.3.9" },
+ "-lxcb-keysyms"
+ ],
+ "use": "xcb"
+ },
+ "xcb_renderutil": {
+ "label": "XCB Renderutil >= 0.3.9",
+ "headers": "xcb/xcb_renderutil.h",
+ "sources": [
+ { "type": "pkgConfig", "args": "xcb-renderutil >= 0.3.9" },
+ "-lxcb-render-util"
+ ],
+ "use": "xcb xcb_render"
+ },
+ "xcb_randr": {
+ "label": "XCB RandR",
+ "headers": "xcb/randr.h",
+ "sources": [
+ { "type": "pkgConfig", "args": "xcb-randr" },
+ "-lxcb-randr"
+ ],
+ "use": "xcb"
+ },
+ "xcb_shape": {
+ "label": "XCB Shape",
+ "headers": "xcb/shape.h",
+ "sources": [
+ { "type": "pkgConfig", "args": "xcb-shape" },
+ "-lxcb-shape"
+ ],
+ "use": "xcb"
+ },
+ "xcb_shm": {
+ "label": "XCB SHM",
+ "headers": "xcb/shm.h",
+ "sources": [
+ { "type": "pkgConfig", "args": "xcb-shm" },
+ "-lxcb-shm"
+ ],
+ "use": "xcb"
+ },
+ "xcb_sync": {
+ "label": "XCB Sync",
+ "headers": "xcb/sync.h",
+ "sources": [
+ { "type": "pkgConfig", "args": "xcb-sync" },
+ "-lxcb-sync"
+ ],
+ "use": "xcb"
+ },
+ "xcb_xfixes": {
+ "label": "XCB Xfixes",
+ "headers": "xcb/xfixes.h",
+ "sources": [
+ { "type": "pkgConfig", "args": "xcb-xfixes" },
+ "-lxcb-xfixes"
+ ],
+ "use": "xcb"
+ },
+ "xcb_xinerama": {
+ "label": "XCB Xinerama",
+ "headers": "xcb/xinerama.h",
+ "sources": [
+ { "type": "pkgConfig", "args": "xcb-xinerama" },
+ "-lxcb-xinerama"
+ ],
+ "use": "xcb"
},
"xcb_xlib": {
"label": "XCB Xlib",
"test": {
- "include": "X11/Xlib-xcb.h",
"main": "(void) XGetXCBConnection((Display *)0);"
},
+ "headers": "X11/Xlib-xcb.h",
"sources": [
{ "type": "pkgConfig", "args": "x11-xcb" },
"-lX11-xcb"
@@ -533,13 +697,13 @@
"// xkb.h is using a variable called 'explicit', which is a reserved keyword in C++",
"#define explicit dont_use_cxx_explicit"
],
- "include": "xcb/xkb.h",
"tail": "#undef explicit",
"main": [
"// This takes more arguments in xcb-xkb < 1.10.",
"xcb_xkb_get_kbd_by_name_unchecked(NULL, 0, 0, 0, 0);"
]
},
+ "headers": "xcb/xkb.h",
"sources": [
{ "type": "pkgConfig", "args": "xcb-xkb >= 1.10" },
"-lxcb-xkb"
@@ -548,42 +712,17 @@
},
"xcb_render": {
"label": "XCB XRender",
- "test": {
- "include": "xcb/render.h",
- "tail": [
- "// 'template' is used as a function argument name in xcb_renderutil.h",
- "#define template template_param",
- "// extern \"C\" is missing, too",
- "extern \"C\" {",
- "#include <xcb/xcb_renderutil.h>",
- "}",
- "#undef template"
- ],
- "main": [
- "int primaryScreen = 0;",
- "xcb_generic_error_t *error = 0;",
- "xcb_connection_t *connection = 0;",
- "xcb_render_query_pict_formats_cookie_t formatsCookie =",
- " xcb_render_query_pict_formats(connection);",
- "xcb_render_query_pict_formats_reply_t *formatsReply =",
- " xcb_render_query_pict_formats_reply(",
- " connection, formatsCookie, &error);",
- "xcb_render_util_find_standard_format(",
- " formatsReply, XCB_PICT_STANDARD_ARGB_32);"
- ]
- },
+ "headers": "xcb/render.h",
"sources": [
- { "type": "pkgConfig", "args": "xcb-renderutil xcb-render" },
- "-lxcb-render-util -lxcb-render"
+ { "type": "pkgConfig", "args": "xcb-render" },
+ "-lxcb-render"
],
"use": "xcb"
},
"xcb_glx": {
"label": "XCB GLX",
"test": {
- "include": "xcb/glx.h",
"main": [
- "int primaryScreen = 0;",
"xcb_connection_t *connection = 0;",
"xcb_generic_error_t *error = 0;",
"xcb_glx_query_version_cookie_t xglx_query_cookie = xcb_glx_query_version(",
@@ -591,6 +730,7 @@
"xcb_glx_query_version_reply(connection, xglx_query_cookie, &error);"
]
},
+ "headers": "xcb/glx.h",
"sources": [
{ "type": "pkgConfig", "args": "xcb-glx" },
"-lxcb-glx"
@@ -600,7 +740,6 @@
"xcb_xinput": {
"label": "XCB XInput",
"test": {
- "include": "xcb/xinput.h",
"main": [
"xcb_connection_t *connection = 0;",
"xcb_generic_error_t *error = 0;",
@@ -609,6 +748,7 @@
"xcb_input_xi_query_version_reply(connection, xinput_query_cookie, &error);"
]
},
+ "headers": "xcb/xinput.h",
"sources": [
{ "type": "pkgConfig", "args": "xcb-xinput >= 1.12" },
"-lxcb-xinput"
@@ -618,9 +758,9 @@
"xkbcommon": {
"label": "xkbcommon >= 0.5.0",
"test": {
- "include": [ "xkbcommon/xkbcommon.h" ],
"main": "xkb_context_new(XKB_CONTEXT_NO_FLAGS);"
},
+ "headers": [ "xkbcommon/xkbcommon.h" ],
"sources": [
{ "type": "pkgConfig", "args": "xkbcommon >= 0.5.0" }
]
@@ -628,16 +768,24 @@
"xkbcommon_x11": {
"label": "xkbcommon-x11",
"test": {
- "include": [ "xkbcommon/xkbcommon-x11.h" ],
"main": "xkb_x11_get_core_keyboard_device_id(nullptr);"
},
+ "headers": [ "xkbcommon/xkbcommon-x11.h" ],
"sources": [
{ "type": "pkgConfig", "args": "xkbcommon-x11" }
]
},
"xrender": {
"label": "XRender for native painting",
- "test": "x11/xrender",
+ "test": {
+ "tail": [
+ "#if RENDER_MAJOR == 0 && RENDER_MINOR < 5",
+ "# error Required Xrender version 0.6 not found.",
+ "#endif"
+ ],
+ "main": "XRenderPictFormat *format = 0;"
+ },
+ "headers": "X11/extensions/Xrender.h",
"sources": [
"-lXrender"
],
@@ -645,10 +793,6 @@
}
},
- "testTypeAliases": {
- "files": [ "directX" ]
- },
-
"tests": {
"angle_d3d11_qdtd": {
"label": "D3D11_QUERY_DATA_TIMESTAMP_DISJOINT",
@@ -661,28 +805,10 @@
]
}
},
- "directwrite2": {
- "label": "DirectWrite 2",
- "type": "compile",
- "test": {
- "include": [ "dwrite_2.h", "d2d1.h" ],
- "main": [
- "IUnknown *factory = 0;",
- "(void)(size_t(DWRITE_E_NOCOLOR) + sizeof(IDWriteFontFace2));",
- "DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, __uuidof(IDWriteFactory2),",
- " &factory);"
- ]
- },
- "use": "directwrite"
- },
- "directx": {
- "label": "DirectX SDK",
- "type": "directX",
- "files": [
- "d3dcompiler.h",
- "d3d11.lib",
- "fxc.exe"
- ]
+ "fxc": {
+ "label": "Direct3D Shader Compiler",
+ "type": "fxc",
+ "log": "value"
},
"drm_atomic": {
"label": "DRM Atomic API",
@@ -913,7 +1039,10 @@
"opengles32": {
"label": "OpenGL ES 3.2",
"type": "compile",
- "test": "unix/opengles32",
+ "test": {
+ "include": "GLES3/gl32.h",
+ "main": "glFramebufferTexture(GL_TEXTURE_2D, GL_DEPTH_STENCIL_ATTACHMENT, 1, 0);"
+ },
"use": "opengl_es2"
},
"qpa_default_platform": {
@@ -921,6 +1050,41 @@
"type": "qpaDefaultPlatform",
"log": "value"
},
+ "xcb_syslibs": {
+ "label": "XCB (extensions)",
+ "type": "compile",
+ "test": {
+ "include": [
+ "xcb/xcb.h",
+ "xcb/xcb_image.h",
+ "xcb/xcb_keysyms.h",
+ "xcb/randr.h",
+ "xcb/render.h",
+ "xcb/shape.h",
+ "xcb/shm.h",
+ "xcb/sync.h",
+ "xcb/xfixes.h",
+ "xcb/xinerama.h",
+ "xcb/xcb_icccm.h",
+ "xcb/xcb_renderutil.h"
+ ],
+ "main": [
+ "int primaryScreen = 0;",
+ "xcb_connection_t *c = xcb_connect(\"\", &primaryScreen);",
+
+ "/* RENDER */",
+ "xcb_generic_error_t *error = nullptr;",
+ "xcb_render_query_pict_formats_cookie_t formatsCookie =",
+ " xcb_render_query_pict_formats(c);",
+ "xcb_render_query_pict_formats_reply_t *formatsReply =",
+ " xcb_render_query_pict_formats_reply(c, formatsCookie, &error);",
+
+ "/* RENDERUTIL: xcb_renderutil.h include won't compile unless version >= 0.3.9 */",
+ "xcb_render_util_find_standard_format(nullptr, XCB_PICT_STANDARD_ARGB_32);"
+ ]
+ },
+ "use": "xcb_icccm xcb_image xcb_keysyms xcb_randr xcb_render xcb_renderutil xcb_shape xcb_shm xcb_sync xcb_xfixes xcb_xinerama xcb"
+ },
"x11prefix": {
"label": "X11 prefix",
"type": "getPkgConfigVariable",
@@ -940,10 +1104,11 @@
"angle": {
"label": "ANGLE",
"autoDetect": "features.opengles2 || features.opengl-dynamic",
- "condition": "config.win32 && tests.directx",
+ "condition": "features.dxguid && tests.fxc && (features.direct3d9 || (config.winrt && features.direct3d11 && libs.d3dcompiler))",
"output": [
"publicFeature",
- { "type": "define", "name": "QT_OPENGL_ES_2_ANGLE" }
+ { "type": "define", "name": "QT_OPENGL_ES_2_ANGLE" },
+ { "type": "varAssign", "name": "QMAKE_FXC_LOCATION", "value": "tests.fxc.value" }
]
},
"angle_d3d11_qdtd": {
@@ -967,19 +1132,59 @@
"directwrite": {
"label": "DirectWrite",
"emitIf": "config.win32",
- "condition": "libs.directwrite",
+ "condition": "libs.dwrite",
+ "output": [ "privateFeature" ]
+ },
+ "directwrite1": {
+ "label": "DirectWrite 1",
+ "emitIf": "config.win32",
+ "condition": "libs.dwrite_1",
"output": [ "privateFeature" ]
},
"directwrite2": {
"label": "DirectWrite 2",
"emitIf": "config.win32",
- "condition": "features.directwrite && tests.directwrite2",
+ "condition": "features.directwrite1 && libs.dwrite_2",
+ "output": [ "privateFeature" ]
+ },
+ "dxguid": {
+ "label": "DirectX GUID",
+ "condition": "config.win32 && libs.dxguid",
+ "output": [ "privateFeature" ]
+ },
+ "direct3d9": {
+ "label": "Direct 3D 9",
+ "condition": "config.win32 && !config.winrt && libs.d3d9",
+ "output": [ "privateFeature" ]
+ },
+ "dxgi": {
+ "label": "DirectX GI",
+ "condition": "config.win32 && libs.dxgi",
+ "output": [ "privateFeature" ]
+ },
+ "dxgi1_2": {
+ "label": "DirectX GI 1.2",
+ "condition": "features.dxgi && libs.dxgi1_2",
+ "output": [ "privateFeature" ]
+ },
+ "direct3d11": {
+ "label": "Direct 3D 11",
+ "condition": "features.dxgi && libs.d3d11",
+ "output": [ "privateFeature" ]
+ },
+ "direct3d11_1": {
+ "label": "Direct 3D 11.1",
+ "condition": "features.direct3d11 && features.dxgi1_2 && libs.d3d11_1",
"output": [ "privateFeature" ]
},
"direct2d": {
"label": "Direct 2D",
- "section": "Platform plugins",
- "condition": "config.win32 && !config.winrt && libs.direct2d",
+ "condition": "config.win32 && !config.winrt && features.direct3d11 && libs.d2d1",
+ "output": [ "privateFeature" ]
+ },
+ "direct2d1_1": {
+ "label": "Direct 2D 1.1",
+ "condition": "features.direct2d && libs.d2d1_1",
"output": [ "privateFeature" ]
},
"evdev": {
@@ -1318,7 +1523,7 @@
"enable": "input.xcb == 'system'",
"disable": "input.xcb == 'qt'",
"autoDetect": "!config.darwin",
- "condition": "features.xcb && libs.xcb_syslibs",
+ "condition": "features.xcb && tests.xcb_syslibs",
"output": [ "privateFeature" ]
},
"x11-prefix": {
@@ -1326,12 +1531,24 @@
"emitIf": "features.xcb",
"output": [ { "type": "varAssign", "name": "QMAKE_X11_PREFIX", "value": "tests.x11prefix.value" } ]
},
- "xcb-glx": {
- "label": "XCB GLX",
+ "xcb-glx-plugin": {
+ "label": "GLX Plugin",
"emitIf": "features.xcb",
+ "condition": "features.xcb-xlib && features.opengl && !features.opengles2",
+ "output": [ "privateFeature" ]
+ },
+ "xcb-glx": {
+ "label": " XCB GLX",
+ "emitIf": "features.xcb && features.xcb-glx-plugin",
"condition": "libs.xcb_glx",
"output": [ "privateFeature" ]
},
+ "xcb-egl-plugin": {
+ "label": "EGL-X11 Plugin",
+ "emitIf": "features.xcb",
+ "condition": "features.egl_x11 && features.opengl",
+ "output": [ "privateFeature" ]
+ },
"xcb-native-painting": {
"label": "Native painting (experimental)",
"emitIf": "features.xcb",
@@ -1344,12 +1561,6 @@
"condition": "features.xcb-native-painting",
"output": [ "privateFeature" ]
},
- "xcb-render": {
- "label": "XCB render",
- "emitIf": "features.xcb",
- "condition": "!features.system-xcb || libs.xcb_render",
- "output": [ "privateFeature" ]
- },
"xkb": {
"label": "XCB XKB",
"emitIf": "features.xcb",
@@ -1619,8 +1830,7 @@ or may depend on your system and XQuartz setup."
"condition": "features.gui && config.linux && !config.android && !features.xcb && !features.eglfs && !features.directfb && !features.linuxfb && !features.mirclient",
"message": "No QPA platform plugin enabled! This will
produce a Qt that cannot run GUI applications.
-The dependencies needed for xcb to build are listed in
-src/plugins/platforms/xcb/README"
+See \"Platform backends\" in the output of --help."
},
{
"type": "warning",
@@ -1703,7 +1913,15 @@ QMAKE_LIBDIR_OPENGL[_ES2] and QMAKE_LIBS_OPENGL[_ES2] in the mkspec for your pla
"integrityhid",
"mtdev",
"tslib",
- "xkbcommon"
+ "xkbcommon",
+ {
+ "section": "X11 specific",
+ "entries": [
+ "xlib",
+ "xcb-xlib",
+ "egl_x11"
+ ]
+ }
]
},
{
@@ -1731,10 +1949,18 @@ QMAKE_LIBDIR_OPENGL[_ES2] and QMAKE_LIBS_OPENGL[_ES2] in the mkspec for your pla
]
},
{
- "section": "X11",
+ "section": "XCB",
"condition": "features.xcb",
"entries": [
- "system-xcb", "egl_x11", "xkb", "xlib", "xcb-render", "xcb-glx", "xcb-xinput", "xcb-xlib", "xcb-native-painting"
+ "system-xcb", "xkb", "xcb-xinput", "xcb-native-painting",
+ {
+ "section": "GL integrations",
+ "entries": [
+ "xcb-glx-plugin",
+ "xcb-glx",
+ "xcb-egl-plugin"
+ ]
+ }
]
},
{
diff --git a/src/gui/configure.pri b/src/gui/configure.pri
index e21489ec28..1b95449a10 100644
--- a/src/gui/configure.pri
+++ b/src/gui/configure.pri
@@ -15,30 +15,40 @@ defineTest(qtConfLibrary_freetype) {
return(true)
}
-# Check for Direct X SDK (include, lib, and direct shader compiler 'fxc').
+# Check for Direct X shader compiler 'fxc'.
# Up to Direct X SDK June 2010 and for MinGW, this is pointed to by the
# DXSDK_DIR variable. Starting with Windows Kit 8, it is included in
-# the Windows SDK. Checking for the header is not sufficient, since it
-# is also present in MinGW.
-defineTest(qtConfTest_directX) {
- dxdir = $$getenv("DXSDK_DIR")
- !isEmpty(dxdir) {
- EXTRA_INCLUDEPATH += $$dxdir/include
- equals(QT_ARCH, x86_64): \
- EXTRA_LIBDIR += $$dxdir/lib/x64
+# the Windows SDK.
+defineTest(qtConfTest_fxc) {
+ !mingw {
+ fxc = $$qtConfFindInPath("fxc.exe")
+ } else {
+ equals(QMAKE_HOST.arch, x86_64): \
+ fns = x64/fxc.exe
else: \
- EXTRA_LIBDIR += $$dxdir/lib/x86
- EXTRA_PATH += $$dxdir/Utilities/bin/x86
+ fns = x86/fxc.exe
+ dxdir = $$(DXSDK_DIR)
+ !isEmpty(dxdir) {
+ fxc = $$dxdir/Utilities/bin/$$fns
+ } else {
+ winkitbindir = $$(WindowsSdkVerBinPath)
+ !isEmpty(winkitbindir) {
+ fxc = $$winkitbindir/$$fns
+ } else {
+ winkitdir = $$(WindowsSdkDir)
+ !isEmpty(winkitdir): \
+ fxc = $$winkitdir/bin/$$fns
+ }
+ }
}
- $$qtConfEvaluate("features.sse2") {
- ky = $$size($${1}.files._KEYS_)
- $${1}.files._KEYS_ += $$ky
- # Not present on MinGW-32
- $${1}.files.$${ky} = "intrin.h"
+ !isEmpty(fxc):exists($$fxc) {
+ $${1}.value = $$clean_path($$fxc)
+ export($${1}.value)
+ $${1}.cache += value
+ export($${1}.cache)
+ return(true)
}
-
- qtConfTest_files($${1}): return(true)
return(false)
}
diff --git a/src/gui/doc/snippets/code/src_gui_vulkan_qvulkaninstance.cpp b/src/gui/doc/snippets/code/src_gui_vulkan_qvulkaninstance.cpp
index 50afe7c0ff..c4dd9fea18 100644
--- a/src/gui/doc/snippets/code/src_gui_vulkan_qvulkaninstance.cpp
+++ b/src/gui/doc/snippets/code/src_gui_vulkan_qvulkaninstance.cpp
@@ -102,7 +102,7 @@
}
bool event(QEvent *e) {
- if (e->type == QEvent::UpdateRequest)
+ if (e->type() == QEvent::UpdateRequest)
render();
return QWindow::event(e);
}
diff --git a/src/gui/image/qpixmap_win.cpp b/src/gui/image/qpixmap_win.cpp
index b8d13ac092..b5f8d43041 100644
--- a/src/gui/image/qpixmap_win.cpp
+++ b/src/gui/image/qpixmap_win.cpp
@@ -422,8 +422,11 @@ static QImage imageFromWinHBITMAP_GetDiBits(HBITMAP bitmap, bool forceQuads, int
if (info.bmiHeader.biHeight > 0) // Force top-down
info.bmiHeader.biHeight = -info.bmiHeader.biHeight;
info.bmiHeader.biCompression = BI_RGB; // Extract using no compression (can be BI_BITFIELD)
- if (forceQuads)
+ size_t allocSize = info.bmiHeader.biSizeImage;
+ if (forceQuads) {
info.bmiHeader.biBitCount = 32;
+ allocSize = info.bmiHeader.biWidth * qAbs(info.bmiHeader.biHeight) * 4;
+ }
const QImage::Format imageFormat = imageFromWinHBITMAP_Format(info.bmiHeader, hbitmapFormat);
if (imageFormat == QImage::Format_Invalid) {
@@ -431,7 +434,7 @@ static QImage imageFromWinHBITMAP_GetDiBits(HBITMAP bitmap, bool forceQuads, int
return QImage();
}
- QScopedPointer<uchar> data(new uchar[info.bmiHeader.biSizeImage]);
+ QScopedArrayPointer<uchar> data(new uchar[allocSize]);
if (!GetDIBits(displayDc, bitmap, 0, qAbs(info.bmiHeader.biHeight), data.data(), &info, DIB_RGB_COLORS)) {
qErrnoWarning("%s: GetDIBits() failed to get data.", __FUNCTION__);
return QImage();
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 7caaf3a8fa..90b6d16551 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -997,6 +997,10 @@ void QRasterPaintEnginePrivate::drawImage(const QPointF &pt,
{
if (alpha == 0 || !clip.isValid())
return;
+ if (pt.x() > qreal(clip.right()) || pt.y() > qreal(clip.bottom()))
+ return;
+ if ((pt.x() + img.width()) < qreal(clip.left()) || (pt.y() + img.height()) < qreal(clip.top()))
+ return;
Q_ASSERT(img.depth() >= 8);
@@ -1063,6 +1067,10 @@ void QRasterPaintEnginePrivate::blitImage(const QPointF &pt,
{
if (!clip.isValid())
return;
+ if (pt.x() > qreal(clip.right()) || pt.y() > qreal(clip.bottom()))
+ return;
+ if ((pt.x() + img.width()) < qreal(clip.left()) || (pt.y() + img.height()) < qreal(clip.top()))
+ return;
Q_ASSERT(img.depth() >= 8);
diff --git a/src/gui/painting/qrgba64_p.h b/src/gui/painting/qrgba64_p.h
index b7e4d4d905..ca879de27c 100644
--- a/src/gui/painting/qrgba64_p.h
+++ b/src/gui/painting/qrgba64_p.h
@@ -266,10 +266,10 @@ inline QRgba64 rgbBlend(QRgba64 d, QRgba64 s, uint rgbAlpha)
const int mr = qRed(rgbAlpha);
const int mg = qGreen(rgbAlpha);
const int mb = qBlue(rgbAlpha);
- blend.setRed (qt_div_255(s.red() * mr + d.red() * (255 - mr)));
- blend.setGreen(qt_div_255(s.green() * mg + d.green() * (255 - mg)));
- blend.setBlue (qt_div_255(s.blue() * mb + d.blue() * (255 - mb)));
- blend.setAlpha(s.alpha());
+ blend = qRgba64(qt_div_255(s.red() * mr + d.red() * (255 - mr)),
+ qt_div_255(s.green() * mg + d.green() * (255 - mg)),
+ qt_div_255(s.blue() * mb + d.blue() * (255 - mb)),
+ s.alpha());
#endif
return blend;
}
diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp
index 2a7e0eaa0c..99b04aaba6 100644
--- a/src/gui/painting/qtextureglyphcache.cpp
+++ b/src/gui/painting/qtextureglyphcache.cpp
@@ -335,7 +335,7 @@ void QImageTextureGlyphCache::fillTexture(const Coord &c, glyph_t g, QFixed subP
// TODO optimize this
mask = mask.alphaChannel();
mask.invertPixels();
- mask = mask.convertToFormat(QImage::Format_Mono);
+ mask = mask.convertToFormat(QImage::Format_Mono, Qt::ThresholdDither);
}
int mw = qMin(mask.width(), c.w);
diff --git a/src/gui/text/qharfbuzzng.cpp b/src/gui/text/qharfbuzzng.cpp
index 21f880e7be..2f25aea92b 100644
--- a/src/gui/text/qharfbuzzng.cpp
+++ b/src/gui/text/qharfbuzzng.cpp
@@ -689,6 +689,8 @@ _hb_qt_font_create(QFontEngine *fe)
hb_font_set_scale(font, QFixed(x_ppem).value(), -QFixed(y_ppem).value());
hb_font_set_ppem(font, x_ppem, y_ppem);
+ hb_font_set_ptem(font, fe->fontDef.pointSize);
+
return font;
}
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 8de16038ad..bdb5592e9e 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -3192,6 +3192,16 @@ QString QTextEngine::elidedText(Qt::TextElideMode mode, const QFixed &width, int
QChar ellipsisChar(0x2026);
+ // We only want to use the ellipsis character if it is from the main
+ // font (not one of the fallbacks), since using a fallback font
+ // will affect the metrics of the text, potentially causing it to shift
+ // when it is being elided.
+ if (engine->type() == QFontEngine::Multi) {
+ QFontEngineMulti *multiEngine = static_cast<QFontEngineMulti *>(engine);
+ multiEngine->ensureEngineAt(0);
+ engine = multiEngine->engine(0);
+ }
+
glyph_t glyph = engine->glyphIndex(ellipsisChar.unicode());
QGlyphLayout glyphs;
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index be306ed224..f3f0caa379 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -2598,6 +2598,7 @@ void QTextLine::draw(QPainter *p, const QPointF &pos, const QTextLayout::FormatR
Qt::IntersectClip);
else
x /= 2; // Centered
+ p->setFont(f);
p->drawText(QPointF(iterator.x.toReal() + x,
y.toReal()), visualTab);
}
@@ -2671,8 +2672,11 @@ void QTextLine::draw(QPainter *p, const QPointF &pos, const QTextLayout::FormatR
if (c.style() != Qt::NoBrush)
p->setPen(c.color());
QChar visualSpace(si.analysis.flags == QScriptAnalysis::Space ? (ushort)0xb7 : (ushort)0xb0);
+ QFont oldFont = p->font();
+ p->setFont(eng->font(si));
p->drawText(QPointF(iterator.x.toReal(), itemBaseLine.toReal()), visualSpace);
p->setPen(pen);
+ p->setFont(oldFont);
}
}
eng->drawDecorations(p);
diff --git a/src/network/access/qnetworkreplywasmimpl.cpp b/src/network/access/qnetworkreplywasmimpl.cpp
index 23ca62acd4..3bfe927c9f 100644
--- a/src/network/access/qnetworkreplywasmimpl.cpp
+++ b/src/network/access/qnetworkreplywasmimpl.cpp
@@ -222,11 +222,17 @@ QByteArray QNetworkReplyWasmImpl::methodName() const
void QNetworkReplyWasmImpl::close()
{
+ setFinished(true);
+ emit finished();
+
QNetworkReply::close();
}
void QNetworkReplyWasmImpl::abort()
{
+ Q_D(const QNetworkReplyWasmImpl);
+ d->doAbort();
+
close();
}
@@ -307,32 +313,29 @@ void QNetworkReplyWasmImplPrivate::setReplyAttributes(quintptr data, int statusC
handler->q_func()->setAttribute(QNetworkRequest::HttpReasonPhraseAttribute, statusReason);
}
+void QNetworkReplyWasmImplPrivate::doAbort() const
+{
+ m_xhr.call<void>("abort");
+}
+
void QNetworkReplyWasmImplPrivate::doSendRequest()
{
Q_Q(QNetworkReplyWasmImpl);
totalDownloadSize = 0;
- val xhr = val::global("XMLHttpRequest").new_();
+ m_xhr = val::global("XMLHttpRequest").new_();
std::string verb = q->methodName().toStdString();
- QUrl url;
QString extraDataString;
- if (request.url().hasQuery()) { //strip query from url
- extraDataString = request.url().query(QUrl::FullyEncoded);
- QString urlStr = request.url().toString();
- url.setUrl(urlStr.left(urlStr.indexOf("?")));
- } else {
- url = request.url();
- }
- xhr.call<void>("open", verb, url.toString().toStdString());
+ m_xhr.call<void>("open", verb, request.url().toString().toStdString());
- xhr.set("onerror", val::module_property("QNetworkReplyWasmImplPrivate_requestErrorCallback"));
- xhr.set("onload", val::module_property("QNetworkReplyWasmImplPrivate_loadCallback"));
- xhr.set("onprogress", val::module_property("QNetworkReplyWasmImplPrivate_progressCallback"));
- xhr.set("onreadystatechange", val::module_property("QNetworkReplyWasmImplPrivate_responseHeadersCallback"));
+ m_xhr.set("onerror", val::module_property("QNetworkReplyWasmImplPrivate_requestErrorCallback"));
+ m_xhr.set("onload", val::module_property("QNetworkReplyWasmImplPrivate_loadCallback"));
+ m_xhr.set("onprogress", val::module_property("QNetworkReplyWasmImplPrivate_progressCallback"));
+ m_xhr.set("onreadystatechange", val::module_property("QNetworkReplyWasmImplPrivate_responseHeadersCallback"));
- xhr.set("data-handler", val(quintptr(reinterpret_cast<void *>(this))));
+ m_xhr.set("data-handler", val(quintptr(reinterpret_cast<void *>(this))));
QByteArray contentType = request.rawHeader("Content-Type");
@@ -351,7 +354,7 @@ void QNetworkReplyWasmImplPrivate::doSendRequest()
}
if (contentType.contains("json")) {
if (!extraDataString.isEmpty()) {
- xhr.set("responseType", val("json"));
+ m_xhr.set("responseType", val("json"));
dataToSend = val(extraDataString.toStdString());
}
}
@@ -368,9 +371,9 @@ void QNetworkReplyWasmImplPrivate::doSendRequest()
}
// set request headers
for (auto header : request.rawHeaderList()) {
- xhr.call<void>("setRequestHeader", header.toStdString(), request.rawHeader(header).toStdString());
+ m_xhr.call<void>("setRequestHeader", header.toStdString(), request.rawHeader(header).toStdString());
}
- xhr.call<void>("send", dataToSend);
+ m_xhr.call<void>("send", dataToSend);
}
void QNetworkReplyWasmImplPrivate::emitReplyError(QNetworkReply::NetworkError errorCode, const QString &errorString)
diff --git a/src/network/access/qnetworkreplywasmimpl_p.h b/src/network/access/qnetworkreplywasmimpl_p.h
index 69c90de41a..e1e6bf4e24 100644
--- a/src/network/access/qnetworkreplywasmimpl_p.h
+++ b/src/network/access/qnetworkreplywasmimpl_p.h
@@ -62,6 +62,7 @@
#include <emscripten.h>
#include <emscripten/html5.h>
+#include <emscripten/val.h>
QT_BEGIN_NAMESPACE
@@ -134,6 +135,9 @@ public:
QIODevice *outgoingData;
QSharedPointer<QRingBuffer> outgoingDataBuffer;
+ emscripten::val m_xhr = emscripten::val::null();
+ void doAbort() const;
+
static QNetworkReply::NetworkError statusCodeFromHttp(int httpStatusCode, const QUrl &url);
Q_DECLARE_PUBLIC(QNetworkReplyWasmImpl)
};
diff --git a/src/network/configure.json b/src/network/configure.json
index 019f8378c7..10c4f87a2e 100644
--- a/src/network/configure.json
+++ b/src/network/configure.json
@@ -26,7 +26,11 @@
"corewlan": {
"label": "CoreWLan",
"export": "",
- "test": "corewlan",
+ "test": {
+ "lang": "objc++",
+ "main": "[CWInterface interfaceWithName:@\"en2\"];"
+ },
+ "headers": [ "CoreWLAN/CoreWLAN.h", "CoreWLAN/CWInterface.h" ],
"sources": [
"-framework CoreWLAN -framework Foundation"
]
@@ -39,13 +43,13 @@
"libproxy": {
"label": "libproxy",
"test": {
- "include": [ "proxy.h" ],
"main": [
"pxProxyFactory *factory = px_proxy_factory_new();",
"px_proxy_factory_get_proxies(factory, \"http://qt-project.org\");",
"px_proxy_factory_free(factory);"
]
},
+ "headers": "proxy.h",
"sources": [
"-lproxy"
]
@@ -53,7 +57,17 @@
"openssl_headers": {
"label": "OpenSSL Headers",
"export": "openssl",
- "test": "openssl",
+ "test": {
+ "tail": [
+ "#if !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER-0 < 0x10000000L",
+ "# error OpenSSL >= 1.0.0 is required",
+ "#endif",
+ "#if OPENSSL_VERSION_NUMBER-0 >= 0x10002000L && !defined(OPENSSL_NO_EC) && !defined(SSL_CTRL_SET_CURVES)",
+ "# error OpenSSL was reported as >= 1.0.2 but is missing required features, possibly it's libressl which is unsupported",
+ "#endif"
+ ]
+ },
+ "headers": [ "openssl/ssl.h", "openssl/opensslv.h" ],
"sources": [
{
"comment": "placeholder for OPENSSL_PATH",
@@ -63,23 +77,24 @@
},
"openssl": {
"label": "OpenSSL",
- "test": "openssl",
+ "test": {
+ "inherit": "openssl_headers",
+ "main": "SSL_free(SSL_new(0));"
+ },
"sources": [
{ "type": "openssl" },
{
- "comment": "placeholder for OPENSSL_{PATH,LIBS{,_{DEBUG,RELEASE}}}",
- "libs": "",
- "condition": "config.win32 && !features.shared"
- },
- {
"libs": "-lssleay32 -llibeay32",
- "condition": "config.win32 && features.shared"
+ "condition": "config.win32"
},
{
"libs": "-llibssl -llibcrypto",
- "condition": "config.win32"
+ "condition": "config.msvc"
},
- { "libs": "-lssl -lcrypto", "condition": "!config.win32" }
+ {
+ "libs": "-lssl -lcrypto",
+ "condition": "!config.msvc"
+ }
]
}
},
@@ -147,7 +162,14 @@
"openssl11": {
"label": "OpenSSL 1.1 support",
"type": "compile",
- "test": "unix/openssl11",
+ "test": {
+ "include": "openssl/opensslv.h",
+ "tail": [
+ "#if !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER-0 < 0x10100000L",
+ "# error OpenSSL >= 1.1 is required",
+ "#endif"
+ ]
+ },
"use": "openssl"
},
"dtls": {
@@ -195,20 +217,24 @@
},
"openssl": {
"label": "OpenSSL",
- "enable": "input.openssl == 'yes' || input.openssl == 'linked' || input.openssl == 'runtime'",
- "disable": "input.openssl == 'no' || input.ssl == 'no'",
- "autoDetect": "!config.winrt && !config.wasm",
- "condition": "!features.securetransport && (features.openssl-linked || libs.openssl_headers)",
+ "enable": "false",
+ "condition": "features.openssl-runtime || features.openssl-linked",
"output": [
"privateFeature",
{ "type": "publicQtConfig", "condition": "!features.openssl-linked" },
{ "type": "define", "negative": true, "name": "QT_NO_OPENSSL" }
]
},
+ "openssl-runtime": {
+ "autoDetect": "!config.winrt && !config.wasm",
+ "enable": "input.openssl == 'yes' || input.openssl == 'runtime'",
+ "disable": "input.openssl == 'no' || input.openssl == 'linked' || input.ssl == 'no'",
+ "condition": "!features.securetransport && libs.openssl_headers"
+ },
"openssl-linked": {
"label": " Qt directly linked to OpenSSL",
+ "autoDetect": false,
"enable": "input.openssl == 'linked'",
- "disable": "input.openssl != 'linked'",
"condition": "!features.securetransport && libs.openssl",
"output": [
"privateFeature",
diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp
index 2f93c5fa2b..e86793cb21 100644
--- a/src/network/socket/qabstractsocket.cpp
+++ b/src/network/socket/qabstractsocket.cpp
@@ -1549,7 +1549,7 @@ void QAbstractSocket::setPauseMode(PauseModes pauseMode)
By default, the socket is bound using the DefaultForPlatform BindMode.
If a port is not specified, a random port is chosen.
- On success, the functions returns \c true and the socket enters
+ On success, the function returns \c true and the socket enters
BoundState; otherwise it returns \c false.
*/
diff --git a/src/network/ssl/qdtls.cpp b/src/network/ssl/qdtls.cpp
index bbb22aa527..3185bfa124 100644
--- a/src/network/ssl/qdtls.cpp
+++ b/src/network/ssl/qdtls.cpp
@@ -370,6 +370,7 @@ void QDtlsBasePrivate::setConfiguration(const QSslConfiguration &configuration)
dtlsConfiguration.nextProtocolNegotiationStatus = configuration.nextProtocolNegotiationStatus();
dtlsConfiguration.dtlsCookieEnabled = configuration.dtlsCookieVerificationEnabled();
dtlsConfiguration.allowRootCertOnDemandLoading = configuration.d->allowRootCertOnDemandLoading;
+ dtlsConfiguration.backendConfig = configuration.backendConfiguration();
clearDtlsError();
}
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index a5556ccee3..ba4a1dcaa1 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -157,7 +157,7 @@ class QGLDefaultOverlayFormat: public QGLFormat
public:
inline QGLDefaultOverlayFormat()
{
- setOption(QGL::FormatOption(0xffff << 16)); // turn off all options
+ setOption(QGL::FormatOption(0xffffU << 16)); // turn off all options
setOption(QGL::DirectRendering);
setPlane(1);
}
diff --git a/src/platformsupport/eglconvenience/qt_egl_p.h b/src/platformsupport/eglconvenience/qt_egl_p.h
index e2c6b0ceb6..ea554927de 100644
--- a/src/platformsupport/eglconvenience/qt_egl_p.h
+++ b/src/platformsupport/eglconvenience/qt_egl_p.h
@@ -52,7 +52,9 @@
//
#ifdef QT_EGL_NO_X11
-# define MESA_EGL_NO_X11_HEADERS // MESA
+# ifndef MESA_EGL_NO_X11_HEADERS
+# define MESA_EGL_NO_X11_HEADERS // MESA
+# endif
# if !defined(Q_OS_INTEGRITY)
# define WIN_INTERFACE_CUSTOM // NV
# endif // Q_OS_INTEGRITY
diff --git a/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp b/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp
index 7b4f6aa107..04a5026395 100644
--- a/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp
+++ b/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp
@@ -591,7 +591,7 @@ static void convertRGBToARGB_helper(const uchar *src, uint *dst, int width, int
uchar green = src[x + 1];
uchar blue = src[x + 1 + offs];
LcdFilter::filterPixel(red, green, blue);
- *dd++ = (0xFF << 24) | (red << 16) | (green << 8) | blue;
+ *dd++ = (0xFFU << 24) | (red << 16) | (green << 8) | blue;
}
dst += width;
src += src_pitch;
@@ -616,7 +616,7 @@ static void convertRGBToARGB_V_helper(const uchar *src, uint *dst, int width, in
uchar green = src[x + src_pitch];
uchar blue = src[x + src_pitch + offs];
LcdFilter::filterPixel(red, green, blue);
- *dst++ = (0XFF << 24) | (red << 16) | (green << 8) | blue;
+ *dst++ = (0XFFU << 24) | (red << 16) | (green << 8) | blue;
}
src += 3*src_pitch;
}
@@ -637,7 +637,7 @@ static inline void convertGRAYToARGB(const uchar *src, uint *dst, int width, int
const uchar * const e = p + width;
while (p < e) {
uchar gray = *p++;
- *dst++ = (0xFF << 24) | (gray << 16) | (gray << 8) | gray;
+ *dst++ = (0xFFU << 24) | (gray << 16) | (gray << 8) | gray;
}
src += src_pitch;
}
diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
index ba23271e55..047773d8e3 100644
--- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
+++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
@@ -194,7 +194,7 @@ struct FontDescription {
QFont::Weight weight;
QFont::Style style;
QFont::Stretch stretch;
- int pixelSize;
+ qreal pointSize;
bool fixedPitch;
QSupportedWritingSystems writingSystems;
};
@@ -210,7 +210,7 @@ Q_DECL_UNUSED static inline QDebug operator<<(QDebug debug, const FontDescriptio
<< ", weight=" << fd.weight
<< ", style=" << fd.style
<< ", stretch=" << fd.stretch
- << ", pixelSize=" << fd.pixelSize
+ << ", pointSize=" << fd.pointSize
<< ", fixedPitch=" << fd.fixedPitch
<< ", writingSystems=" << fd.writingSystems
<< ")";
@@ -286,9 +286,11 @@ static void getFontDescription(CTFontDescriptorRef font, FontDescription *fd)
if (CFNumberIsFloatType(size)) {
double d;
CFNumberGetValue(size, kCFNumberDoubleType, &d);
- fd->pixelSize = d;
+ fd->pointSize = d;
} else {
- CFNumberGetValue(size, kCFNumberIntType, &fd->pixelSize);
+ int i;
+ CFNumberGetValue(size, kCFNumberIntType, &i);
+ fd->pointSize = i;
}
}
@@ -316,8 +318,8 @@ void QCoreTextFontDatabase::populateFromDescriptor(CTFontDescriptorRef font, con
CFRetain(font);
QPlatformFontDatabase::registerFont(family, fd.styleName, fd.foundryName, fd.weight, fd.style, fd.stretch,
- true /* antialiased */, true /* scalable */,
- fd.pixelSize, fd.fixedPitch, fd.writingSystems, (void *) font);
+ true /* antialiased */, true /* scalable */, 0 /* pixelSize, ignored as font is scalable */,
+ fd.fixedPitch, fd.writingSystems, (void *)font);
}
static NSString * const kQtFontDataAttribute = @"QtFontDataAttribute";
@@ -727,7 +729,7 @@ QFont *QCoreTextFontDatabase::themeFont(QPlatformTheme::Font f) const
else
CFRelease(fontDesc);
- QFont *font = new QFont(fd.familyName, fd.pixelSize, fd.weight, fd.style == QFont::StyleItalic);
+ QFont *font = new QFont(fd.familyName, fd.pointSize, fd.weight, fd.style == QFont::StyleItalic);
return font;
}
diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
index 19b450b643..7957cd130a 100644
--- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
+++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
@@ -736,7 +736,7 @@ bool QCoreTextFontEngine::shouldSmoothFont() const
bool QCoreTextFontEngine::expectsGammaCorrectedBlending() const
{
- return shouldSmoothFont();
+ return shouldSmoothFont() && fontSmoothing() == Subpixel;
}
qreal QCoreTextFontEngine::fontSmoothingGamma()
diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp
index 9ff50bdf05..40ac46df85 100644
--- a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp
+++ b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp
@@ -1264,11 +1264,6 @@ QWindowsFontDatabase::~QWindowsFontDatabase()
removeApplicationFonts();
}
-QFontEngineMulti *QWindowsFontDatabase::fontEngineMulti(QFontEngine *fontEngine, QChar::Script script)
-{
- return new QWindowsMultiFontEngine(fontEngine, script);
-}
-
QFontEngine * QWindowsFontDatabase::fontEngine(const QFontDef &fontDef, void *handle)
{
const QString faceName(static_cast<const QChar*>(handle));
diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h
index 9d0aa7f723..afba86bbe1 100644
--- a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h
+++ b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h
@@ -98,7 +98,6 @@ public:
void populateFontDatabase() override;
void populateFamily(const QString &familyName) override;
- QFontEngineMulti *fontEngineMulti(QFontEngine *fontEngine, QChar::Script script) override;
QFontEngine *fontEngine(const QFontDef &fontDef, void *handle) override;
QFontEngine *fontEngine(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference) override;
QStringList fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script) const override;
diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp b/src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp
index 2a41209225..d1d11883c1 100644
--- a/src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp
+++ b/src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp
@@ -1199,120 +1199,6 @@ void QWindowsFontEngine::initFontInfo(const QFontDef &request,
}
}
-/*!
- \class QWindowsMultiFontEngine
- \brief Standard Windows Multi font engine.
- \internal
- \ingroup qt-lighthouse-win
-
- "Merges" several font engines that have gaps in the
- supported writing systems.
-
- Will probably be superseded by a common Free Type font engine in Qt 5.X.
-*/
-QWindowsMultiFontEngine::QWindowsMultiFontEngine(QFontEngine *fe, int script)
- : QFontEngineMulti(fe, script)
-{
-}
-
-#ifndef QT_NO_DIRECTWRITE
-static QString msgDirectWriteFunctionFailed(HRESULT hr, const char *function,
- const QString &fam, const QString &substitute)
-{
- _com_error error(hr);
- QString result;
- QTextStream str(&result);
- str << function << " failed for \"" << fam << '"';
- if (substitute != fam)
- str << " (substitute: \"" << substitute << "\")";
- str << ": error " << hex << showbase << ulong(hr) << ' ' << noshowbase << dec
- << ": " << QString::fromWCharArray(error.ErrorMessage());
- return result;
-}
-#endif // !QT_NO_DIRECTWRITE
-
-QFontEngine *QWindowsMultiFontEngine::loadEngine(int at)
-{
- QFontEngine *fontEngine = engine(0);
- QSharedPointer<QWindowsFontEngineData> data;
- LOGFONT lf;
-
-#ifndef QT_NO_DIRECTWRITE
- if (fontEngine->type() == QFontEngine::DirectWrite) {
- QWindowsFontEngineDirectWrite *fe = static_cast<QWindowsFontEngineDirectWrite *>(fontEngine);
- lf = QWindowsFontDatabase::fontDefToLOGFONT(fe->fontDef, QString());
-
- data = fe->fontEngineData();
- } else
-#endif
- {
- QWindowsFontEngine *fe = static_cast<QWindowsFontEngine*>(fontEngine);
- lf = fe->m_logfont;
-
- data = fe->fontEngineData();
- }
-
- const QString fam = fallbackFamilyAt(at - 1);
- const int faceNameLength = qMin(fam.length(), LF_FACESIZE - 1);
- memcpy(lf.lfFaceName, fam.utf16(), faceNameLength * sizeof(wchar_t));
- lf.lfFaceName[faceNameLength] = 0;
-
-#ifndef QT_NO_DIRECTWRITE
- if (fontEngine->type() == QFontEngine::DirectWrite) {
- const QString nameSubstitute = QWindowsFontEngineDirectWrite::fontNameSubstitute(fam);
- if (nameSubstitute != fam) {
- const int nameSubstituteLength = qMin(nameSubstitute.length(), LF_FACESIZE - 1);
- memcpy(lf.lfFaceName, nameSubstitute.utf16(), nameSubstituteLength * sizeof(wchar_t));
- lf.lfFaceName[nameSubstituteLength] = 0;
- }
-
- HFONT hfont = CreateFontIndirect(&lf);
- if (hfont == nullptr) {
- qErrnoWarning("%s: CreateFontIndirect failed", __FUNCTION__);
- } else {
- HGDIOBJ oldFont = SelectObject(data->hdc, hfont);
-
- IDWriteFontFace *directWriteFontFace = nullptr;
- QWindowsFontEngineDirectWrite *fedw = nullptr;
- HRESULT hr = data->directWriteGdiInterop->CreateFontFaceFromHdc(data->hdc, &directWriteFontFace);
- if (SUCCEEDED(hr)) {
- Q_ASSERT(directWriteFontFace);
- fedw = new QWindowsFontEngineDirectWrite(directWriteFontFace,
- fontEngine->fontDef.pixelSize,
- data);
- fedw->fontDef.weight = fontEngine->fontDef.weight;
- if (fontEngine->fontDef.style > QFont::StyleNormal)
- fedw->fontDef.style = fontEngine->fontDef.style;
- fedw->fontDef.family = fam;
- fedw->fontDef.hintingPreference = fontEngine->fontDef.hintingPreference;
- fedw->fontDef.stretch = fontEngine->fontDef.stretch;
- } else {
- qWarning("%s: %s", __FUNCTION__,
- qPrintable(msgDirectWriteFunctionFailed(hr, "CreateFontFace", fam, nameSubstitute)));
- }
-
- SelectObject(data->hdc, oldFont);
- DeleteObject(hfont);
-
- if (fedw != nullptr)
- return fedw;
- }
- }
-#endif
-
- // Get here if original font is not DirectWrite or DirectWrite creation failed for some
- // reason
-
- QFontEngine *fe = new QWindowsFontEngine(fam, lf, data);
- fe->fontDef.weight = fontEngine->fontDef.weight;
- if (fontEngine->fontDef.style > QFont::StyleNormal)
- fe->fontDef.style = fontEngine->fontDef.style;
- fe->fontDef.family = fam;
- fe->fontDef.hintingPreference = fontEngine->fontDef.hintingPreference;
- fe->fontDef.stretch = fontEngine->fontDef.stretch;
- return fe;
-}
-
bool QWindowsFontEngine::supportsTransformation(const QTransform &transform) const
{
// Support all transformations for ttf files, and translations for raster fonts
diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h b/src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h
index a151cf7343..2b575a9b45 100644
--- a/src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h
+++ b/src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h
@@ -67,8 +67,6 @@ class QWindowsFontEngineData;
class QWindowsFontEngine : public QFontEngine
{
Q_DISABLE_COPY(QWindowsFontEngine)
- friend class QWindowsMultiFontEngine;
-
public:
QWindowsFontEngine(const QString &name, LOGFONT lf,
const QSharedPointer<QWindowsFontEngineData> &fontEngineData);
@@ -169,14 +167,6 @@ private:
mutable int designAdvancesSize = 0;
};
-class QWindowsMultiFontEngine : public QFontEngineMulti
-{
-public:
- explicit QWindowsMultiFontEngine(QFontEngine *fe, int script);
-
- QFontEngine *loadEngine(int at) override;
-};
-
QT_END_NAMESPACE
Q_DECLARE_METATYPE(HFONT)
diff --git a/src/platformsupport/fontdatabases/windows/windows.pri b/src/platformsupport/fontdatabases/windows/windows.pri
index 0e64084cf1..9c529f55ea 100644
--- a/src/platformsupport/fontdatabases/windows/windows.pri
+++ b/src/platformsupport/fontdatabases/windows/windows.pri
@@ -15,9 +15,14 @@ qtConfig(freetype) {
HEADERS += $$PWD/qwindowsfontdatabase_ft_p.h
}
-qtConfig(directwrite) {
- qtConfig(directwrite2): \
+qtConfig(directwrite):qtConfig(direct2d) {
+ qtConfig(directwrite2) {
+ QMAKE_USE_PRIVATE += dwrite_2
DEFINES *= QT_USE_DIRECTWRITE2
+ } else {
+ QMAKE_USE_PRIVATE += dwrite
+ }
+ QMAKE_USE_PRIVATE += d2d1
SOURCES += $$PWD/qwindowsfontenginedirectwrite.cpp
HEADERS += $$PWD/qwindowsfontenginedirectwrite_p.h
diff --git a/src/platformsupport/fontdatabases/winrt/winrt.pri b/src/platformsupport/fontdatabases/winrt/winrt.pri
index 291ada220f..7617df2e7a 100644
--- a/src/platformsupport/fontdatabases/winrt/winrt.pri
+++ b/src/platformsupport/fontdatabases/winrt/winrt.pri
@@ -8,4 +8,6 @@ HEADERS += \
DEFINES += __WRL_NO_DEFAULT_LIB__
-LIBS += -lws2_32 -ldwrite
+LIBS += -lws2_32
+
+QMAKE_USE_PRIVATE += dwrite_1
diff --git a/src/plugins/platforms/android/androidjniclipboard.cpp b/src/plugins/platforms/android/androidjniclipboard.cpp
index d169035339..671d0b56d0 100644
--- a/src/plugins/platforms/android/androidjniclipboard.cpp
+++ b/src/plugins/platforms/android/androidjniclipboard.cpp
@@ -38,6 +38,7 @@
****************************************************************************/
#include "androidjniclipboard.h"
+#include <QtCore/QUrl>
#include <QtCore/private/qjni_p.h>
QT_BEGIN_NAMESPACE
@@ -62,27 +63,60 @@ namespace QtAndroidClipboard
return;
}
}
-
- void setClipboardText(const QString &text)
+ void setClipboardMimeData(QMimeData *data)
{
- QJNIObjectPrivate::callStaticMethod<void>(applicationClass(),
- "setClipboardText",
- "(Ljava/lang/String;)V",
- QJNIObjectPrivate::fromString(text).object());
- }
-
- bool hasClipboardText()
- {
- return QJNIObjectPrivate::callStaticMethod<jboolean>(applicationClass(),
- "hasClipboardText");
+ QJNIObjectPrivate::callStaticMethod<void>(applicationClass(), "clearClipData");
+ if (data->hasText()) {
+ QJNIObjectPrivate::callStaticMethod<void>(applicationClass(),
+ "setClipboardText", "(Ljava/lang/String;)V",
+ QJNIObjectPrivate::fromString(data->text()).object());
+ }
+ if (data->hasHtml()) {
+ QJNIObjectPrivate::callStaticMethod<void>(applicationClass(),
+ "setClipboardHtml",
+ "(Ljava/lang/String;Ljava/lang/String;)V",
+ QJNIObjectPrivate::fromString(data->text()).object(),
+ QJNIObjectPrivate::fromString(data->html()).object());
+ }
+ if (data->hasUrls()) {
+ QList<QUrl> urls = data->urls();
+ for (const auto &u : qAsConst(urls)) {
+ QJNIObjectPrivate::callStaticMethod<void>(applicationClass(), "setClipboardUri",
+ "(Ljava/lang/String;)V",
+ QJNIObjectPrivate::fromString(u.toEncoded()).object());
+ }
+ }
}
- QString clipboardText()
+ QMimeData *getClipboardMimeData()
{
- QJNIObjectPrivate text = QJNIObjectPrivate::callStaticObjectMethod(applicationClass(),
- "getClipboardText",
- "()Ljava/lang/String;");
- return text.toString();
+ QMimeData *data = new QMimeData;
+ if (QJNIObjectPrivate::callStaticMethod<jboolean>(applicationClass(), "hasClipboardText")) {
+ data->setText(QJNIObjectPrivate::callStaticObjectMethod(applicationClass(),
+ "getClipboardText",
+ "()Ljava/lang/String;").toString());
+ }
+ if (QJNIObjectPrivate::callStaticMethod<jboolean>(applicationClass(), "hasClipboardHtml")) {
+ data->setHtml(QJNIObjectPrivate::callStaticObjectMethod(applicationClass(),
+ "getClipboardHtml",
+ "()Ljava/lang/String;").toString());
+ }
+ if (QJNIObjectPrivate::callStaticMethod<jboolean>(applicationClass(), "hasClipboardUri")) {
+ QJNIObjectPrivate uris = QJNIObjectPrivate::callStaticObjectMethod(applicationClass(),
+ "getClipboardUris",
+ "()[Ljava/lang/String;");
+ if (uris.isValid()) {
+ QList<QUrl> urls;
+ QJNIEnvironmentPrivate env;
+ jobjectArray juris = static_cast<jobjectArray>(uris.object());
+ const jint nUris = env->GetArrayLength(juris);
+ urls.reserve(static_cast<int>(nUris));
+ for (int i = 0; i < nUris; ++i)
+ urls << QUrl(QJNIObjectPrivate(env->GetObjectArrayElement(juris, i)).toString());
+ data->setUrls(urls);
+ }
+ }
+ return data;
}
void onClipboardDataChanged(JNIEnv */*env*/, jobject /*thiz*/)
diff --git a/src/plugins/platforms/android/androidjniclipboard.h b/src/plugins/platforms/android/androidjniclipboard.h
index 2ec566e729..e83e6b555c 100644
--- a/src/plugins/platforms/android/androidjniclipboard.h
+++ b/src/plugins/platforms/android/androidjniclipboard.h
@@ -51,9 +51,8 @@ namespace QtAndroidClipboard
{
// Clipboard support
void setClipboardManager(QAndroidPlatformClipboard *manager);
- void setClipboardText(const QString &text);
- bool hasClipboardText();
- QString clipboardText();
+ void setClipboardMimeData(QMimeData *data);
+ QMimeData *getClipboardMimeData();
void onClipboardDataChanged(JNIEnv */*env*/, jobject /*thiz*/);
// Clipboard support
}
diff --git a/src/plugins/platforms/android/qandroidplatformclipboard.cpp b/src/plugins/platforms/android/qandroidplatformclipboard.cpp
index dc5147b259..17dfe27d12 100644
--- a/src/plugins/platforms/android/qandroidplatformclipboard.cpp
+++ b/src/plugins/platforms/android/qandroidplatformclipboard.cpp
@@ -52,16 +52,15 @@ QMimeData *QAndroidPlatformClipboard::mimeData(QClipboard::Mode mode)
{
Q_UNUSED(mode);
Q_ASSERT(supportsMode(mode));
- m_mimeData.setText(QtAndroidClipboard::hasClipboardText()
- ? QtAndroidClipboard::clipboardText()
- : QString());
- return &m_mimeData;
+ QMimeData *data = QtAndroidClipboard::getClipboardMimeData();
+ data->setParent(this);
+ return data;
}
void QAndroidPlatformClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode)
{
- if (supportsMode(mode))
- QtAndroidClipboard::setClipboardText(data != 0 && data->hasText() ? data->text() : QString());
+ if (data && supportsMode(mode))
+ QtAndroidClipboard::setClipboardMimeData(data);
if (data != 0)
data->deleteLater();
}
diff --git a/src/plugins/platforms/android/qandroidplatformclipboard.h b/src/plugins/platforms/android/qandroidplatformclipboard.h
index dfc3629c10..3ed9d323f8 100644
--- a/src/plugins/platforms/android/qandroidplatformclipboard.h
+++ b/src/plugins/platforms/android/qandroidplatformclipboard.h
@@ -46,7 +46,7 @@
#ifndef QT_NO_CLIPBOARD
QT_BEGIN_NAMESPACE
-class QAndroidPlatformClipboard: public QPlatformClipboard
+class QAndroidPlatformClipboard : public QObject, public QPlatformClipboard
{
public:
QAndroidPlatformClipboard();
@@ -54,9 +54,6 @@ public:
QMimeData *mimeData(QClipboard::Mode mode = QClipboard::Clipboard) override;
void setMimeData(QMimeData *data, QClipboard::Mode mode = QClipboard::Clipboard) override;
bool supportsMode(QClipboard::Mode mode) const override;
-
-private:
- QMimeData m_mimeData;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm
index 0158895441..4982f5ee05 100644
--- a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm
+++ b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm
@@ -105,6 +105,8 @@ QT_USE_NAMESPACE
@end
@interface QT_MANGLE_NAMESPACE(QNSImageView) : NSImageView
+@property (nonatomic, assign) BOOL down;
+@property (nonatomic, assign) QT_MANGLE_NAMESPACE(QNSStatusItem) *parent;
@end
QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSStatusItem);
@@ -277,36 +279,32 @@ QT_END_NAMESPACE
@implementation NSStatusItem (Qt)
@end
-@implementation QNSImageView {
- BOOL down;
- QT_MANGLE_NAMESPACE(QNSStatusItem) *parent;
-}
-
+@implementation QNSImageView
- (instancetype)initWithParent:(QNSStatusItem *)myParent {
self = [super init];
- parent = myParent;
- down = NO;
+ self.parent = myParent;
+ self.down = NO;
return self;
}
- (void)menuTrackingDone:(NSNotification *)__unused notification
{
- down = NO;
+ self.down = NO;
[self setNeedsDisplay:YES];
}
- (void)mousePressed:(NSEvent *)mouseEvent
{
- down = YES;
+ self.down = YES;
int clickCount = [mouseEvent clickCount];
[self setNeedsDisplay:YES];
if (clickCount == 2) {
[self menuTrackingDone:nil];
- [parent doubleClickSelector:self];
+ [self.parent doubleClickSelector:self];
} else {
- [parent triggerSelector:self button:cocoaButton2QtButton(mouseEvent)];
+ [self.parent triggerSelector:self button:cocoaButton2QtButton(mouseEvent)];
}
}
@@ -344,7 +342,7 @@ QT_END_NAMESPACE
}
- (void)drawRect:(NSRect)rect {
- [[parent item] drawStatusBarBackgroundInRect:rect withHighlight:down];
+ [[self.parent item] drawStatusBarBackgroundInRect:rect withHighlight:self.down];
[super drawRect:rect];
}
@end
@@ -374,6 +372,7 @@ QT_END_NAMESPACE
- (void)dealloc {
[[NSStatusBar systemStatusBar] removeStatusItem:item];
[[NSNotificationCenter defaultCenter] removeObserver:imageCell];
+ imageCell.parent = nil;
[imageCell release];
[item release];
[super dealloc];
diff --git a/src/plugins/platforms/cocoa/qcocoatheme.mm b/src/plugins/platforms/cocoa/qcocoatheme.mm
index 240deeddbd..efe670abed 100644
--- a/src/plugins/platforms/cocoa/qcocoatheme.mm
+++ b/src/plugins/platforms/cocoa/qcocoatheme.mm
@@ -80,12 +80,7 @@
#include <CoreServices/CoreServices.h>
-#if !QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_14)
-@interface NSApplication (MojaveForwardDeclarations)
-@property (readonly, strong) NSAppearance *effectiveAppearance NS_AVAILABLE_MAC(10_14);
-@end
-#endif
-
+#if QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_14)
@interface QT_MANGLE_NAMESPACE(QCocoaThemeAppAppearanceObserver) : NSObject
@property (readonly, nonatomic) QCocoaTheme *theme;
- (instancetype)initWithTheme:(QCocoaTheme *)theme;
@@ -124,6 +119,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QCocoaThemeAppAppearanceObserver);
self.theme->handleSystemThemeChange();
}
@end
+#endif // QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_14)
QT_BEGIN_NAMESPACE
@@ -132,8 +128,10 @@ const char *QCocoaTheme::name = "cocoa";
QCocoaTheme::QCocoaTheme()
: m_systemPalette(nullptr), m_appearanceObserver(nil)
{
+#if QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_14)
if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::MacOSMojave)
m_appearanceObserver = [[QCocoaThemeAppAppearanceObserver alloc] initWithTheme:this];
+#endif
[[NSNotificationCenter defaultCenter] addObserverForName:NSSystemColorsDidChangeNotification
object:nil queue:nil usingBlock:^(NSNotification *) {
@@ -228,16 +226,12 @@ const QPalette *QCocoaTheme::palette(Palette type) const
return nullptr;
}
-QHash<QPlatformTheme::Font, QFont *> qt_mac_createRoleFonts()
-{
- QCoreTextFontDatabase *ctfd = static_cast<QCoreTextFontDatabase *>(QGuiApplicationPrivate::platformIntegration()->fontDatabase());
- return ctfd->themeFonts();
-}
-
const QFont *QCocoaTheme::font(Font type) const
{
if (m_fonts.isEmpty()) {
- m_fonts = qt_mac_createRoleFonts();
+ const auto *platformIntegration = QGuiApplicationPrivate::platformIntegration();
+ const auto *coreTextFontDb = static_cast<QCoreTextFontDatabase *>(platformIntegration->fontDatabase());
+ m_fonts = coreTextFontDb->themeFonts();
}
return m_fonts.value(type, nullptr);
}
diff --git a/src/plugins/platforms/direct2d/direct2d.pro b/src/plugins/platforms/direct2d/direct2d.pro
index 3bfd02bdc8..9764272632 100644
--- a/src/plugins/platforms/direct2d/direct2d.pro
+++ b/src/plugins/platforms/direct2d/direct2d.pro
@@ -8,7 +8,8 @@ QT += \
qtConfig(accessibility): QT += accessibility_support-private
qtConfig(vulkan): QT += vulkan_support-private
-LIBS += -ldwmapi -ld2d1 -ld3d11 -ldwrite -lversion -lgdi32
+LIBS += -ldwmapi -lversion -lgdi32
+QMAKE_USE_PRIVATE += dwrite_1 d2d1_1 d3d11_1 dxgi1_2
include(../windows/windows.pri)
diff --git a/src/plugins/platforms/offscreen/qoffscreenintegration.cpp b/src/plugins/platforms/offscreen/qoffscreenintegration.cpp
index 01cd254501..9815be16a3 100644
--- a/src/plugins/platforms/offscreen/qoffscreenintegration.cpp
+++ b/src/plugins/platforms/offscreen/qoffscreenintegration.cpp
@@ -45,6 +45,7 @@
#include <QtEventDispatcherSupport/private/qgenericunixeventdispatcher_p.h>
#if defined(Q_OS_MAC)
#include <qpa/qplatformfontdatabase.h>
+#include <QtFontDatabaseSupport/private/qcoretextfontdatabase_p.h>
#else
#include <QtFontDatabaseSupport/private/qgenericunixfontdatabase_p.h>
#endif
@@ -67,6 +68,8 @@
QT_BEGIN_NAMESPACE
+class QCoreTextFontEngine;
+
template <typename BaseEventDispatcher>
class QOffscreenEventDispatcher : public BaseEventDispatcher
{
@@ -101,7 +104,7 @@ QOffscreenIntegration::QOffscreenIntegration()
{
#if defined(Q_OS_UNIX)
#if defined(Q_OS_MAC)
- m_fontDatabase.reset(new QPlatformFontDatabase());
+ m_fontDatabase.reset(new QCoreTextFontDatabaseEngineFactory<QCoreTextFontEngine>);
#else
m_fontDatabase.reset(new QGenericUnixFontDatabase());
#endif
diff --git a/src/plugins/platforms/platforms.pro b/src/plugins/platforms/platforms.pro
index 5bf2b77421..acc55adf6f 100644
--- a/src/plugins/platforms/platforms.pro
+++ b/src/plugins/platforms/platforms.pro
@@ -14,10 +14,10 @@ qtConfig(xcb) {
uikit:!watchos: SUBDIRS += ios
osx: SUBDIRS += cocoa
-win32:!winrt: SUBDIRS += windows
-winrt: SUBDIRS += winrt
+win32:!winrt:qtConfig(direct3d9): SUBDIRS += windows
+winrt:qtConfig(direct3d11): SUBDIRS += winrt
-qtConfig(direct2d) {
+qtConfig(direct3d11_1):qtConfig(direct2d1_1):qtConfig(directwrite1) {
SUBDIRS += direct2d
}
@@ -46,7 +46,7 @@ haiku {
SUBDIRS += haiku
}
-wasm: SUBDIRS = wasm
+wasm: SUBDIRS += wasm
qtConfig(mirclient): SUBDIRS += mirclient
diff --git a/src/plugins/platforms/qnx/qqnxintegration.cpp b/src/plugins/platforms/qnx/qqnxintegration.cpp
index 8c8521325c..db79780407 100644
--- a/src/plugins/platforms/qnx/qqnxintegration.cpp
+++ b/src/plugins/platforms/qnx/qqnxintegration.cpp
@@ -88,7 +88,10 @@
#include <private/qsimpledrag_p.h>
#include <QtCore/QDebug>
-
+#include <QtCore/QJsonDocument>
+#include <QtCore/QJsonObject>
+#include <QtCore/QJsonArray>
+#include <QtCore/QFile>
#include <errno.h>
#if defined(QQNXINTEGRATION_DEBUG)
@@ -490,6 +493,108 @@ void QQnxIntegration::removeWindow(screen_window_t qnxWindow)
m_windowMapper.remove(qnxWindow);
}
+/*!
+ Get display ID for given \a display
+
+ Returns -1 for failure, otherwise returns display ID
+ */
+static int getIdOfDisplay(screen_display_t display)
+{
+ int displayId;
+ if (screen_get_display_property_iv(display,
+ SCREEN_PROPERTY_ID,
+ &displayId) == 0) {
+ return displayId;
+ }
+ return -1;
+}
+
+/*!
+ Read JSON configuration file for the QNX display order
+
+ Returns true if file was read successfully and fills \a requestedDisplays
+ */
+static bool getRequestedDisplays(QJsonArray &requestedDisplays)
+{
+ // Check if display configuration file is provided
+ QByteArray json = qgetenv("QT_QPA_QNX_DISPLAY_CONFIG");
+ if (json.isEmpty())
+ return false;
+
+ // Check if configuration file exists
+ QFile file(QString::fromUtf8(json));
+ if (!file.open(QFile::ReadOnly)) {
+ qWarning() << "Could not open config file" << json << "for reading";
+ return false;
+ }
+
+ // Read config file and check it's json
+ const QJsonDocument doc = QJsonDocument::fromJson(file.readAll());
+ if (!doc.isObject()) {
+ qWarning() << "Invalid config file" << json
+ << "- no top-level JSON object";
+ return false;
+ }
+
+ // Read the requested display order
+ const QJsonObject object = doc.object();
+ requestedDisplays = object.value(QLatin1String("displayOrder")).toArray();
+
+ return true;
+}
+
+/*!
+ Match \a availableDisplays with display order defined in a json file
+ pointed to by QT_QPA_QNX_DISPLAY_CONFIG. Display order must use same
+ identifiers as defined for displays in graphics.conf. Number of
+ available displays must be specified in \a displayCount
+
+ An example configuration is below:
+ \badcode
+ {
+ "displayOrder": [ 3, 1 ]
+ }
+ \endcode
+
+ Returns ordered list of displays. If no order was specified, returns
+ displays in the same order as in the original list.
+*/
+QList<screen_display_t *> QQnxIntegration::sortDisplays(screen_display_t *availableDisplays, int displayCount)
+{
+ // Intermediate list for sorting
+ QList<screen_display_t *> allDisplays;
+ for (int i = 0; i < displayCount; i++)
+ allDisplays.append(&availableDisplays[i]);
+
+ // Read requested display order if available
+ QJsonArray requestedDisplays;
+ if (!getRequestedDisplays(requestedDisplays))
+ return allDisplays;
+
+ // Go through all the requested displays IDs
+ QList<screen_display_t *> orderedDisplays;
+ for (const QJsonValue &value : qAsConst(requestedDisplays)) {
+ int requestedValue = value.toInt();
+
+ // Move all displays with matching ID from the intermediate list
+ // to the beginning of the ordered list
+ QMutableListIterator<screen_display_t *> iter(allDisplays);
+ while (iter.hasNext()) {
+ screen_display_t *display = iter.next();
+ if (getIdOfDisplay(*display) == requestedValue) {
+ orderedDisplays.append(display);
+ iter.remove();
+ break;
+ }
+ }
+ }
+
+ // Place all unordered displays to the end of list
+ orderedDisplays.append(allDisplays);
+
+ return orderedDisplays;
+}
+
void QQnxIntegration::createDisplays()
{
qIntegrationDebug();
@@ -508,15 +613,16 @@ void QQnxIntegration::createDisplays()
screen_display_t *displays = (screen_display_t *)alloca(sizeof(screen_display_t) * displayCount);
result = screen_get_context_property_pv(m_screenContext, SCREEN_PROPERTY_DISPLAYS,
(void **)displays);
+ QList<screen_display_t *> orderedDisplays = sortDisplays(displays, displayCount);
Q_SCREEN_CRITICALERROR(result, "Failed to query displays");
// If it's primary, we create a QScreen for it even if it's not attached
// since Qt will dereference QGuiApplication::primaryScreen()
- createDisplay(displays[0], /*isPrimary=*/true);
+ createDisplay(*orderedDisplays[0], /*isPrimary=*/true);
for (int i=1; i<displayCount; i++) {
int isAttached = 1;
- result = screen_get_display_property_iv(displays[i], SCREEN_PROPERTY_ATTACHED,
+ result = screen_get_display_property_iv(*orderedDisplays[i], SCREEN_PROPERTY_ATTACHED,
&isAttached);
Q_SCREEN_CHECKERROR(result, "Failed to query display attachment");
@@ -526,7 +632,7 @@ void QQnxIntegration::createDisplays()
}
qIntegrationDebug("Creating screen for display %d", i);
- createDisplay(displays[i], /*isPrimary=*/false);
+ createDisplay(*orderedDisplays[i], /*isPrimary=*/false);
} // of displays iteration
}
diff --git a/src/plugins/platforms/qnx/qqnxintegration.h b/src/plugins/platforms/qnx/qqnxintegration.h
index 2993607489..4a6f15fc08 100644
--- a/src/plugins/platforms/qnx/qqnxintegration.h
+++ b/src/plugins/platforms/qnx/qqnxintegration.h
@@ -141,6 +141,8 @@ private:
void addWindow(screen_window_t qnxWindow, QWindow *window);
void removeWindow(screen_window_t qnxWindow);
+ QList<screen_display_t *> sortDisplays(screen_display_t *displays,
+ int displayCount);
screen_context_t m_screenContext;
QQnxScreenEventThread *m_screenEventThread;
diff --git a/src/plugins/platforms/wasm/qwasmeventtranslator.cpp b/src/plugins/platforms/wasm/qwasmeventtranslator.cpp
index a3fdcd1025..8ab109f03c 100644
--- a/src/plugins/platforms/wasm/qwasmeventtranslator.cpp
+++ b/src/plugins/platforms/wasm/qwasmeventtranslator.cpp
@@ -63,6 +63,7 @@ EMSCRIPTEN_BINDINGS(mouse_module) {
QWasmEventTranslator::QWasmEventTranslator(QObject *parent)
: QObject(parent)
, draggedWindow(nullptr)
+ , lastWindow(nullptr)
, pressedButtons(Qt::NoButton)
, resizeMode(QWasmWindow::ResizeNone)
{
@@ -370,15 +371,16 @@ void QWasmEventTranslator::processMouse(int eventType, const EmscriptenMouseEven
Qt::KeyboardModifiers modifiers = translateMouseEventModifier(mouseEvent);
QWindow *window2 = QWasmIntegration::get()->compositor()->windowAt(point, 5);
+ if (window2 != nullptr)
+ lastWindow = window2;
+
QWasmWindow *htmlWindow = static_cast<QWasmWindow*>(window2->handle());
- bool onFrame = false;
- if (window2 && !window2->geometry().contains(point))
- onFrame = true;
- QPoint localPoint(point.x() - window2->geometry().x(), point.y() - window2->geometry().y());
+ bool interior = window2 && window2->geometry().contains(point);
+ QPoint localPoint(point.x() - window2->geometry().x(), point.y() - window2->geometry().y());
switch (eventType) {
- case 5: //down
+ case EMSCRIPTEN_EVENT_MOUSEDOWN:
{
if (window2)
window2->raise();
@@ -403,7 +405,7 @@ void QWasmEventTranslator::processMouse(int eventType, const EmscriptenMouseEven
htmlWindow->injectMousePressed(localPoint, point, button, modifiers);
break;
}
- case 6: //up
+ case EMSCRIPTEN_EVENT_MOUSEUP:
{
pressedButtons.setFlag(translateMouseButton(mouseEvent->button), false);
buttonEventType = QEvent::MouseButtonRelease;
@@ -414,7 +416,6 @@ void QWasmEventTranslator::processMouse(int eventType, const EmscriptenMouseEven
pressedWindow = nullptr;
}
-
if (mouseEvent->button == 0) {
draggedWindow = nullptr;
resizeMode = QWasmWindow::ResizeNone;
@@ -424,7 +425,7 @@ void QWasmEventTranslator::processMouse(int eventType, const EmscriptenMouseEven
oldWindow->injectMouseReleased(localPoint, point, button, modifiers);
break;
}
- case 8://move //drag event
+ case EMSCRIPTEN_EVENT_MOUSEMOVE: // drag event
{
buttonEventType = QEvent::MouseMove;
if (!(htmlWindow->m_windowState & Qt::WindowFullScreen) && !(htmlWindow->m_windowState & Qt::WindowMaximized)) {
@@ -440,11 +441,15 @@ void QWasmEventTranslator::processMouse(int eventType, const EmscriptenMouseEven
}
break;
}
- default:
+ default: // MOUSELEAVE MOUSEENTER
break;
};
-
- if (window2 && !onFrame) {
+ if (!window2 && buttonEventType == QEvent::MouseButtonRelease) {
+ window2 = lastWindow;
+ lastWindow = nullptr;
+ interior = true;
+ }
+ if (window2 && interior) {
QWindowSystemInterface::handleMouseEvent<QWindowSystemInterface::SynchronousDelivery>(
window2, timestamp, localPoint, point, pressedButtons, button, buttonEventType, modifiers);
}
diff --git a/src/plugins/platforms/wasm/qwasmeventtranslator.h b/src/plugins/platforms/wasm/qwasmeventtranslator.h
index 11430a57a2..f3dff8e48c 100644
--- a/src/plugins/platforms/wasm/qwasmeventtranslator.h
+++ b/src/plugins/platforms/wasm/qwasmeventtranslator.h
@@ -197,6 +197,7 @@ private:
private:
QWindow *draggedWindow;
QWindow *pressedWindow;
+ QWindow *lastWindow;
Qt::MouseButtons pressedButtons;
QWasmWindow::ResizeMode resizeMode;
diff --git a/src/plugins/platforms/windows/windows.pri b/src/plugins/platforms/windows/windows.pri
index db06a6a2a3..7004d7e854 100644
--- a/src/plugins/platforms/windows/windows.pri
+++ b/src/plugins/platforms/windows/windows.pri
@@ -9,6 +9,8 @@ mingw: LIBS *= -luuid
# For the dialog helpers:
LIBS += -lshlwapi -lshell32 -ladvapi32 -lwtsapi32
+QMAKE_USE_PRIVATE += d3d9/nolink
+
DEFINES *= QT_NO_CAST_FROM_ASCII QT_NO_FOREACH
SOURCES += \
diff --git a/src/plugins/platforms/winrt/qwinrtintegration.cpp b/src/plugins/platforms/winrt/qwinrtintegration.cpp
index 4f37583bed..78cbc3aec3 100644
--- a/src/plugins/platforms/winrt/qwinrtintegration.cpp
+++ b/src/plugins/platforms/winrt/qwinrtintegration.cpp
@@ -75,13 +75,6 @@
#include <windows.ui.viewmanagement.h>
#include <windows.graphics.display.h>
-#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
-# include <windows.phone.ui.input.h>
-# include <windows.foundation.metadata.h>
- using namespace ABI::Windows::Foundation::Metadata;
-#endif
-
-
using namespace Microsoft::WRL;
using namespace Microsoft::WRL::Wrappers;
using namespace ABI::Windows::Foundation;
@@ -92,27 +85,14 @@ using namespace ABI::Windows::UI::Core;
using namespace ABI::Windows::UI::ViewManagement;
using namespace ABI::Windows::Graphics::Display;
using namespace ABI::Windows::ApplicationModel::Core;
-#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
-using namespace ABI::Windows::Phone::UI::Input;
-#endif
typedef IEventHandler<IInspectable *> ResumeHandler;
typedef IEventHandler<SuspendingEventArgs *> SuspendHandler;
-#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
-typedef IEventHandler<BackPressedEventArgs*> BackPressedHandler;
-typedef IEventHandler<CameraEventArgs*> CameraButtonHandler;
-#endif
QT_BEGIN_NAMESPACE
typedef HRESULT (__stdcall ICoreApplication::*CoreApplicationCallbackRemover)(EventRegistrationToken);
uint qHash(CoreApplicationCallbackRemover key) { void *ptr = *(void **)(&key); return qHash(ptr); }
-#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
-typedef HRESULT (__stdcall IHardwareButtonsStatics::*HardwareButtonsCallbackRemover)(EventRegistrationToken);
-uint qHash(HardwareButtonsCallbackRemover key) { void *ptr = *(void **)(&key); return qHash(ptr); }
-typedef HRESULT (__stdcall IHardwareButtonsStatics2::*HardwareButtons2CallbackRemover)(EventRegistrationToken);
-uint qHash(HardwareButtons2CallbackRemover key) { void *ptr = *(void **)(&key); return qHash(ptr); }
-#endif
class QWinRTIntegrationPrivate
{
@@ -128,15 +108,6 @@ public:
ComPtr<ICoreApplication> application;
QHash<CoreApplicationCallbackRemover, EventRegistrationToken> applicationTokens;
-#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
- ComPtr<IHardwareButtonsStatics> hardwareButtons;
- QHash<HardwareButtonsCallbackRemover, EventRegistrationToken> buttonsTokens;
- ComPtr<IHardwareButtonsStatics2> cameraButtons;
- QHash<HardwareButtons2CallbackRemover, EventRegistrationToken> cameraTokens;
- boolean hasHardwareButtons;
- bool cameraHalfPressed : 1;
- bool cameraPressed : 1;
-#endif
};
QWinRTIntegration::QWinRTIntegration() : d_ptr(new QWinRTIntegrationPrivate)
@@ -156,45 +127,6 @@ QWinRTIntegration::QWinRTIntegration() : d_ptr(new QWinRTIntegrationPrivate)
&d->applicationTokens[&ICoreApplication::remove_Resuming]);
Q_ASSERT_SUCCEEDED(hr);
-#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
- d->hasHardwareButtons = false;
- ComPtr<IApiInformationStatics> apiInformationStatics;
- hr = RoGetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Foundation_Metadata_ApiInformation).Get(),
- IID_PPV_ARGS(&apiInformationStatics));
-
- if (SUCCEEDED(hr)) {
- const HStringReference valueRef(L"Windows.Phone.UI.Input.HardwareButtons");
- hr = apiInformationStatics->IsTypePresent(valueRef.Get(), &d->hasHardwareButtons);
- }
-
- if (d->hasHardwareButtons) {
- hr = RoGetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Phone_UI_Input_HardwareButtons).Get(),
- IID_PPV_ARGS(&d->hardwareButtons));
- Q_ASSERT_SUCCEEDED(hr);
- hr = d->hardwareButtons->add_BackPressed(Callback<BackPressedHandler>(this, &QWinRTIntegration::onBackButtonPressed).Get(),
- &d->buttonsTokens[&IHardwareButtonsStatics::remove_BackPressed]);
- Q_ASSERT_SUCCEEDED(hr);
-
- hr = RoGetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Phone_UI_Input_HardwareButtons).Get(),
- IID_PPV_ARGS(&d->cameraButtons));
- Q_ASSERT_SUCCEEDED(hr);
- if (qEnvironmentVariableIntValue("QT_QPA_ENABLE_CAMERA_KEYS")) {
- hr = d->cameraButtons->add_CameraPressed(Callback<CameraButtonHandler>(this, &QWinRTIntegration::onCameraPressed).Get(),
- &d->cameraTokens[&IHardwareButtonsStatics2::remove_CameraPressed]);
- Q_ASSERT_SUCCEEDED(hr);
- hr = d->cameraButtons->add_CameraHalfPressed(Callback<CameraButtonHandler>(this, &QWinRTIntegration::onCameraHalfPressed).Get(),
- &d->cameraTokens[&IHardwareButtonsStatics2::remove_CameraHalfPressed]);
- Q_ASSERT_SUCCEEDED(hr);
- hr = d->cameraButtons->add_CameraReleased(Callback<CameraButtonHandler>(this, &QWinRTIntegration::onCameraReleased).Get(),
- &d->cameraTokens[&IHardwareButtonsStatics2::remove_CameraReleased]);
- Q_ASSERT_SUCCEEDED(hr);
- }
- d->cameraPressed = false;
- d->cameraHalfPressed = false;
- }
-#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
-
-
QEventDispatcherWinRT::runOnXamlThread([d]() {
d->mainScreen = new QWinRTScreen;
return S_OK;
@@ -214,18 +146,6 @@ QWinRTIntegration::~QWinRTIntegration()
Q_D(QWinRTIntegration);
HRESULT hr;
-#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
- if (d->hasHardwareButtons) {
- for (QHash<HardwareButtonsCallbackRemover, EventRegistrationToken>::const_iterator i = d->buttonsTokens.begin(); i != d->buttonsTokens.end(); ++i) {
- hr = (d->hardwareButtons.Get()->*i.key())(i.value());
- Q_ASSERT_SUCCEEDED(hr);
- }
- for (QHash<HardwareButtons2CallbackRemover, EventRegistrationToken>::const_iterator i = d->cameraTokens.begin(); i != d->cameraTokens.end(); ++i) {
- hr = (d->cameraButtons.Get()->*i.key())(i.value());
- Q_ASSERT_SUCCEEDED(hr);
- }
- }
-#endif
// Do not execute this on Windows Phone as the application is already
// shutting down and trying to unregister suspending/resume handler will
// cause exceptions and assert in debug mode
@@ -353,58 +273,6 @@ QPlatformTheme *QWinRTIntegration::createPlatformTheme(const QString &name) cons
// System-level integration points
-#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
-HRESULT QWinRTIntegration::onBackButtonPressed(IInspectable *, IBackPressedEventArgs *args)
-{
- Q_D(QWinRTIntegration);
- QWindow *window = d->mainScreen->topWindow();
- QWindowSystemInterface::setSynchronousWindowSystemEvents(true);
- const bool pressed = QWindowSystemInterface::handleExtendedKeyEvent(window, QEvent::KeyPress, Qt::Key_Back, Qt::NoModifier,
- 0, 0, 0, QString(), false, 1, false);
- const bool released = QWindowSystemInterface::handleExtendedKeyEvent(window, QEvent::KeyRelease, Qt::Key_Back, Qt::NoModifier,
- 0, 0, 0, QString(), false, 1, false);
- QWindowSystemInterface::setSynchronousWindowSystemEvents(false);
- args->put_Handled(pressed || released);
- return S_OK;
-}
-
-HRESULT QWinRTIntegration::onCameraPressed(IInspectable *, ICameraEventArgs *)
-{
- Q_D(QWinRTIntegration);
- QWindow *window = d->mainScreen->topWindow();
- QWindowSystemInterface::handleExtendedKeyEvent(window, QEvent::KeyPress, Qt::Key_Camera, Qt::NoModifier,
- 0, 0, 0, QString(), false, 1, false);
- d->cameraPressed = true;
- return S_OK;
-}
-
-HRESULT QWinRTIntegration::onCameraHalfPressed(IInspectable *, ICameraEventArgs *)
-{
- Q_D(QWinRTIntegration);
- QWindow *window = d->mainScreen->topWindow();
- QWindowSystemInterface::handleExtendedKeyEvent(window, QEvent::KeyPress, Qt::Key_CameraFocus, Qt::NoModifier,
- 0, 0, 0, QString(), false, 1, false);
- d->cameraHalfPressed = true;
- return S_OK;
-}
-
-HRESULT QWinRTIntegration::onCameraReleased(IInspectable *, ICameraEventArgs *)
-{
- Q_D(QWinRTIntegration);
- QWindow *window = d->mainScreen->topWindow();
- if (d->cameraHalfPressed)
- QWindowSystemInterface::handleExtendedKeyEvent(window, QEvent::KeyRelease, Qt::Key_CameraFocus, Qt::NoModifier,
- 0, 0, 0, QString(), false, 1, false);
-
- if (d->cameraPressed)
- QWindowSystemInterface::handleExtendedKeyEvent(window, QEvent::KeyRelease, Qt::Key_Camera, Qt::NoModifier,
- 0, 0, 0, QString(), false, 1, false);
- d->cameraHalfPressed = false;
- d->cameraPressed = false;
- return S_OK;
-}
-#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
-
HRESULT QWinRTIntegration::onSuspended(IInspectable *, ISuspendingEventArgs *)
{
QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationSuspended);
diff --git a/src/plugins/platforms/winrt/qwinrtintegration.h b/src/plugins/platforms/winrt/qwinrtintegration.h
index 636e594b4b..e944ed5d79 100644
--- a/src/plugins/platforms/winrt/qwinrtintegration.h
+++ b/src/plugins/platforms/winrt/qwinrtintegration.h
@@ -50,16 +50,6 @@ namespace ABI {
namespace Foundation {
struct IAsyncAction;
}
-#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
- namespace Phone {
- namespace UI {
- namespace Input {
- struct IBackPressedEventArgs;
- struct ICameraEventArgs;
- }
- }
- }
-#endif
}
}
struct IAsyncInfo;
@@ -111,12 +101,6 @@ public:
QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override;
private:
-#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
- HRESULT onBackButtonPressed(IInspectable *, ABI::Windows::Phone::UI::Input::IBackPressedEventArgs *args);
- HRESULT onCameraPressed(IInspectable *, ABI::Windows::Phone::UI::Input::ICameraEventArgs *);
- HRESULT onCameraHalfPressed(IInspectable *, ABI::Windows::Phone::UI::Input::ICameraEventArgs *);
- HRESULT onCameraReleased(IInspectable *, ABI::Windows::Phone::UI::Input::ICameraEventArgs *);
-#endif
HRESULT onSuspended(IInspectable *, ABI::Windows::ApplicationModel::ISuspendingEventArgs *);
HRESULT onResume(IInspectable *, IInspectable *);
diff --git a/src/plugins/platforms/winrt/winrt.pro b/src/plugins/platforms/winrt/winrt.pro
index 6a847465e4..43132a1a76 100644
--- a/src/plugins/platforms/winrt/winrt.pro
+++ b/src/plugins/platforms/winrt/winrt.pro
@@ -8,7 +8,8 @@ QT += \
DEFINES *= QT_NO_CAST_FROM_ASCII __WRL_NO_DEFAULT_LIB__
-LIBS += -lws2_32 -ld3d11
+LIBS += -lws2_32
+QMAKE_USE_PRIVATE += d3d11
SOURCES = \
main.cpp \
diff --git a/src/plugins/platforms/xcb/gl_integrations/gl_integrations.pro b/src/plugins/platforms/xcb/gl_integrations/gl_integrations.pro
index b8f878ffe8..dde176433c 100644
--- a/src/plugins/platforms/xcb/gl_integrations/gl_integrations.pro
+++ b/src/plugins/platforms/xcb/gl_integrations/gl_integrations.pro
@@ -1,10 +1,10 @@
TEMPLATE = subdirs
QT_FOR_CONFIG += gui-private
-qtConfig(egl):qtConfig(egl_x11):qtConfig(opengl) {
+qtConfig(xcb-egl-plugin) {
SUBDIRS += xcb_egl
}
-qtConfig(xcb-xlib):qtConfig(opengl):!qtConfig(opengles2) {
+qtConfig(xcb-glx-plugin) {
SUBDIRS += xcb_glx
}
diff --git a/src/plugins/platforms/xcb/qxcbbackingstore.cpp b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
index ba9a3e68ee..f9240a45cc 100644
--- a/src/plugins/platforms/xcb/qxcbbackingstore.cpp
+++ b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
@@ -45,16 +45,8 @@
#include <xcb/shm.h>
#include <xcb/xcb_image.h>
-#if QT_CONFIG(xcb_render)
#include <xcb/render.h>
-// 'template' is used as a function argument name in xcb_renderutil.h
-#define template template_param
-// extern "C" is missing too
-extern "C" {
#include <xcb/xcb_renderutil.h>
-}
-#undef template
-#endif
#include <sys/ipc.h>
#include <sys/shm.h>
@@ -962,16 +954,13 @@ QXcbSystemTrayBackingStore::QXcbSystemTrayBackingStore(QWindow *window)
if (depth != 32) {
platformWindow->setParentRelativeBackPixmap();
-#if QT_CONFIG(xcb_render)
initXRenderMode();
-#endif
m_useGrabbedBackgound = !m_usingXRenderMode;
}
}
QXcbSystemTrayBackingStore::~QXcbSystemTrayBackingStore()
{
-#if QT_CONFIG(xcb_render)
if (m_xrenderPicture) {
xcb_render_free_picture(xcb_connection(), m_xrenderPicture);
m_xrenderPicture = XCB_NONE;
@@ -984,7 +973,6 @@ QXcbSystemTrayBackingStore::~QXcbSystemTrayBackingStore()
xcb_render_free_picture(xcb_connection(), m_windowPicture);
m_windowPicture = XCB_NONE;
}
-#endif // QT_CONFIG(xcb_render)
}
void QXcbSystemTrayBackingStore::beginPaint(const QRegion &region)
@@ -1006,7 +994,6 @@ void QXcbSystemTrayBackingStore::render(xcb_window_t window, const QRegion &regi
return;
}
-#if QT_CONFIG(xcb_render)
m_image->put(m_xrenderPixmap, region, offset);
const QRect bounds = region.boundingRect();
const QPoint target = bounds.topLeft();
@@ -1017,7 +1004,6 @@ void QXcbSystemTrayBackingStore::render(xcb_window_t window, const QRegion &regi
m_xrenderPicture, 0, m_windowPicture,
target.x(), target.y(), 0, 0, target.x(), target.y(),
source.width(), source.height());
-#endif // QT_CONFIG(xcb_render)
}
void QXcbSystemTrayBackingStore::recreateImage(QXcbWindow *win, const QSize &size)
@@ -1034,7 +1020,6 @@ void QXcbSystemTrayBackingStore::recreateImage(QXcbWindow *win, const QSize &siz
return;
}
-#if QT_CONFIG(xcb_render)
if (m_xrenderPicture) {
xcb_render_free_picture(xcb_connection(), m_xrenderPicture);
m_xrenderPicture = XCB_NONE;
@@ -1057,10 +1042,8 @@ void QXcbSystemTrayBackingStore::recreateImage(QXcbWindow *win, const QSize &siz
m_image->resize(size);
else
m_image = new QXcbBackingStoreImage(this, size, 32, QImage::Format_ARGB32_Premultiplied);
-#endif // QT_CONFIG(xcb_render)
}
-#if QT_CONFIG(xcb_render)
void QXcbSystemTrayBackingStore::initXRenderMode()
{
if (!connection()->hasXRender())
@@ -1104,6 +1087,5 @@ void QXcbSystemTrayBackingStore::initXRenderMode()
m_usingXRenderMode = true;
}
-#endif // QT_CONFIG(xcb_render)
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/xcb/qxcbbackingstore.h b/src/plugins/platforms/xcb/qxcbbackingstore.h
index b91e5c7dc2..0c30929d4e 100644
--- a/src/plugins/platforms/xcb/qxcbbackingstore.h
+++ b/src/plugins/platforms/xcb/qxcbbackingstore.h
@@ -99,14 +99,13 @@ protected:
void recreateImage(QXcbWindow *win, const QSize &size) override;
private:
-#if QT_CONFIG(xcb_render)
void initXRenderMode();
xcb_pixmap_t m_xrenderPixmap = XCB_NONE;
xcb_render_picture_t m_xrenderPicture = XCB_NONE;
xcb_render_pictformat_t m_xrenderPictFormat = XCB_NONE;
xcb_render_picture_t m_windowPicture = XCB_NONE;
-#endif
+
bool m_usingXRenderMode = false;
bool m_useGrabbedBackgound = false;
QPixmap m_grabbedBackground;
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp
index 37ee980924..29acf0e86d 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp
@@ -39,6 +39,7 @@
#include <QtGui/private/qguiapplication_p.h>
#include <QtCore/QDebug>
+#include <QtCore/QCoreApplication>
#include "qxcbconnection.h"
#include "qxcbkeyboard.h"
@@ -817,7 +818,7 @@ xcb_window_t QXcbConnection::getQtSelectionOwner()
0); // value list
QXcbWindow::setWindowTitle(connection(), m_qtSelectionOwner,
- QStringLiteral("Qt Selection Window"));
+ QLatin1String("Qt Selection Owner for ") + QCoreApplication::applicationName());
}
return m_qtSelectionOwner;
}
diff --git a/src/plugins/platforms/xcb/qxcbconnection_basic.cpp b/src/plugins/platforms/xcb/qxcbconnection_basic.cpp
index b8335d1240..c69912c361 100644
--- a/src/plugins/platforms/xcb/qxcbconnection_basic.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection_basic.cpp
@@ -44,12 +44,10 @@
#include <xcb/sync.h>
#include <xcb/xfixes.h>
#include <xcb/xinerama.h>
+#include <xcb/render.h>
#if QT_CONFIG(xcb_xinput)
#include <xcb/xinput.h>
#endif
-#if QT_CONFIG(xcb_render)
-#include <xcb/render.h>
-#endif
#if QT_CONFIG(xkb)
#define explicit dont_use_cxx_explicit
#include <xcb/xkb.h>
@@ -139,12 +137,10 @@ QXcbBasicConnection::QXcbBasicConnection(const char *displayName)
xcb_extension_t *extensions[] = {
&xcb_shm_id, &xcb_xfixes_id, &xcb_randr_id, &xcb_shape_id, &xcb_sync_id,
+ &xcb_render_id,
#if QT_CONFIG(xkb)
&xcb_xkb_id,
#endif
-#if QT_CONFIG(xcb_render)
- &xcb_render_id,
-#endif
#if QT_CONFIG(xcb_xinput)
&xcb_input_id,
#endif
@@ -293,7 +289,6 @@ void QXcbBasicConnection::initializeShm()
void QXcbBasicConnection::initializeXRandr()
{
-#if QT_CONFIG(xcb_render)
const xcb_query_extension_reply_t *reply = xcb_get_extension_data(m_xcbConnection, &xcb_render_id);
if (!reply || !reply->present) {
qCDebug(lcQpaXcb, "XRender extension not present on the X server");
@@ -311,7 +306,6 @@ void QXcbBasicConnection::initializeXRandr()
m_hasXRandr = true;
m_xrenderVersion.first = xrenderQuery->major_version;
m_xrenderVersion.second = xrenderQuery->minor_version;
-#endif
}
void QXcbBasicConnection::initializeXinerama()
diff --git a/src/plugins/platforms/xcb/qxcbcursor.cpp b/src/plugins/platforms/xcb/qxcbcursor.cpp
index 7831671d42..fbadab4d50 100644
--- a/src/plugins/platforms/xcb/qxcbcursor.cpp
+++ b/src/plugins/platforms/xcb/qxcbcursor.cpp
@@ -607,14 +607,10 @@ xcb_cursor_t QXcbCursor::createBitmapCursor(QCursor *cursor)
QPoint spot = cursor->hotSpot();
xcb_cursor_t c = XCB_NONE;
if (cursor->pixmap().depth() > 1) {
-#if QT_CONFIG(xcb_render)
if (connection()->hasXRender(0, 5))
c = qt_xcb_createCursorXRender(m_screen, cursor->pixmap().toImage(), spot);
else
qCWarning(lcQpaXcb, "xrender >= 0.5 required to create pixmap cursors");
-#else
- qCWarning(lcQpaXcb, "This build of Qt does not support pixmap cursors");
-#endif
} else {
xcb_connection_t *conn = xcb_connection();
xcb_pixmap_t cp = qt_xcb_XPixmapFromBitmap(m_screen, cursor->bitmap()->toImage());
diff --git a/src/plugins/platforms/xcb/qxcbimage.cpp b/src/plugins/platforms/xcb/qxcbimage.cpp
index 44c7d22344..8f33e6ed31 100644
--- a/src/plugins/platforms/xcb/qxcbimage.cpp
+++ b/src/plugins/platforms/xcb/qxcbimage.cpp
@@ -42,16 +42,9 @@
#include <QtGui/QColor>
#include <QtGui/private/qimage_p.h>
#include <QtGui/private/qdrawhelper_p.h>
-#if QT_CONFIG(xcb_render)
+
#include <xcb/render.h>
-// 'template' is used as a function argument name in xcb_renderutil.h
-#define template template_param
-// extern "C" is missing too
-extern "C" {
#include <xcb/xcb_renderutil.h>
-}
-#undef template
-#endif
#include "qxcbconnection.h"
#include "qxcbintegration.h"
@@ -236,7 +229,6 @@ xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image)
xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image,
const QPoint &spot)
{
-#if QT_CONFIG(xcb_render)
xcb_connection_t *conn = screen->xcb_connection();
const int w = image.width();
const int h = image.height();
@@ -289,13 +281,6 @@ xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image,
xcb_render_free_picture(conn, pic);
xcb_free_pixmap(conn, pix);
return cursor;
-
-#else
- Q_UNUSED(screen);
- Q_UNUSED(image);
- Q_UNUSED(spot);
- return XCB_NONE;
-#endif
}
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/xcb/xcb_qpa_lib.pro b/src/plugins/platforms/xcb/xcb_qpa_lib.pro
index 50b7f7f97d..db3d6629b3 100644
--- a/src/plugins/platforms/xcb/xcb_qpa_lib.pro
+++ b/src/plugins/platforms/xcb/xcb_qpa_lib.pro
@@ -95,12 +95,14 @@ qtConfig(vulkan) {
}
!qtConfig(system-xcb) {
- QMAKE_USE += xcb-static xcb
+ QMAKE_USE += xcb-static
} else {
- qtConfig(xcb-render): QMAKE_USE += xcb_render
qtConfig(xcb-xinput): QMAKE_USE += xcb_xinput
- QMAKE_USE += xcb_syslibs
+ QMAKE_USE += \
+ xcb_icccm xcb_image xcb_keysyms xcb_randr xcb_render xcb_renderutil \
+ xcb_shape xcb_shm xcb_sync xcb_xfixes xcb_xinerama
}
+QMAKE_USE += xcb
QMAKE_USE += xkbcommon
qtConfig(xkb) {
diff --git a/src/plugins/sqldrivers/configure.json b/src/plugins/sqldrivers/configure.json
index 4802d3b04d..cd20eef1df 100644
--- a/src/plugins/sqldrivers/configure.json
+++ b/src/plugins/sqldrivers/configure.json
@@ -39,9 +39,8 @@
"libraries": {
"db2": {
"label": "DB2 (IBM)",
- "test": {
- "include": [ "sqlcli.h", "sqlcli1.h" ]
- },
+ "test": {},
+ "headers": [ "sqlcli.h", "sqlcli1.h" ],
"sources": [
{ "libs": "-ldb2cli", "condition": "config.win32" },
{ "libs": "-ldb2", "condition": "!config.win32" }
@@ -49,9 +48,8 @@
},
"ibase": {
"label": "InterBase",
- "test": {
- "include": "ibase.h"
- },
+ "test": {},
+ "headers": "ibase.h",
"sources": [
{ "libs": "-lgds32_ms", "condition": "config.win32" },
{ "libs": "-lgds", "condition": "!config.win32" }
@@ -65,9 +63,9 @@
"# include <windows.h>",
"#endif"
],
- "include": "mysql.h",
"main": "mysql_get_client_version();"
},
+ "headers": "mysql.h",
"sources": [
{ "type": "mysqlConfig", "query": "--libs_r", "cleanlibs": true },
{ "type": "mysqlConfig", "query": "--libs", "cleanlibs": true },
@@ -81,12 +79,12 @@
"psql": {
"label": "PostgreSQL",
"test": {
- "include": "libpq-fe.h",
"main": [
"PQescapeBytea(0, 0, 0);",
"PQunescapeBytea(0, 0);"
]
},
+ "headers": "libpq-fe.h",
"sources": [
{ "type": "pkgConfig", "args": "libpq" },
{ "type": "psqlConfig" },
@@ -96,9 +94,8 @@
},
"tds": {
"label": "TDS (Sybase)",
- "test": {
- "include": [ "sybfront.h", "sybdb.h" ]
- },
+ "test": {},
+ "headers": [ "sybfront.h", "sybdb.h" ],
"sources": [
{ "type": "sybaseEnv", "libs": "-lNTWDBLIB", "condition": "config.win32" },
{ "type": "sybaseEnv", "libs": "-lsybdb", "condition": "!config.win32" }
@@ -106,9 +103,8 @@
},
"oci": {
"label": "OCI (Oracle)",
- "test": {
- "include": "oci.h"
- },
+ "test": {},
+ "headers": "oci.h",
"sources": [
{ "libs": "-loci", "condition": "config.win32" },
{ "libs": "-lclntsh", "condition": "!config.win32" }
@@ -122,12 +118,12 @@
"# include <windows.h>",
"#endif"
],
- "include": [ "sql.h", "sqlext.h" ],
"main": [
"SQLHANDLE env;",
"SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &env);"
]
},
+ "headers": [ "sql.h", "sqlext.h" ],
"sources": [
{ "libs": "-lodbc32", "condition": "config.win32" },
{ "libs": "-liodbc", "condition": "config.darwin" },
@@ -136,9 +132,8 @@
},
"sqlite2": {
"label": "SQLite (version 2)",
- "test": {
- "include": "sqlite.h"
- },
+ "test": {},
+ "headers": "sqlite.h",
"sources": [
"-lsqlite"
]
@@ -147,9 +142,9 @@
"label": "SQLite (version 3)",
"export": "sqlite",
"test": {
- "include": "sqlite3.h",
"main": "sqlite3_open_v2(0, 0, 0, 0);"
},
+ "headers": "sqlite3.h",
"sources": [
{ "type": "pkgConfig", "args": "sqlite3" },
"-lsqlite3"
diff --git a/src/plugins/sqldrivers/configure.pri b/src/plugins/sqldrivers/configure.pri
index 747a47e7b8..84c8114c7b 100644
--- a/src/plugins/sqldrivers/configure.pri
+++ b/src/plugins/sqldrivers/configure.pri
@@ -9,7 +9,7 @@ defineTest(qtConfLibrary_psqlConfig) {
!qtConfResolvePathLibs($${1}.libs, $$libdir, -lpq): \
return(false)
qtRunLoggedCommand("$$pg_config --includedir", includedir)|return(false)
- !qtConfResolvePathIncs($${1}.includedir, $$includedir): \
+ !qtConfResolvePathIncs($${1}.includedir, $$includedir, $$2): \
return(false)
return(true)
}
@@ -63,7 +63,7 @@ defineTest(qtConfLibrary_mysqlConfig) {
includedir =
for (id, rawincludedir): \
includedir += $$clean_path($$id)
- !qtConfResolvePathIncs($${1}.includedir, $$includedir): \
+ !qtConfResolvePathIncs($${1}.includedir, $$includedir, $$2): \
return(false)
return(true)
}
diff --git a/src/plugins/sqldrivers/psql/qsql_psql.cpp b/src/plugins/sqldrivers/psql/qsql_psql.cpp
index bf0493b0c3..7ad9db1ea8 100644
--- a/src/plugins/sqldrivers/psql/qsql_psql.cpp
+++ b/src/plugins/sqldrivers/psql/qsql_psql.cpp
@@ -1060,8 +1060,10 @@ static QPSQLDriver::Protocol qMakePSQLVersion(int vMaj, int vMin)
}
case 10:
return QPSQLDriver::Version10;
+ case 11:
+ return QPSQLDriver::Version11;
default:
- if (vMaj > 10)
+ if (vMaj > 11)
return QPSQLDriver::UnknownLaterVersion;
break;
}
diff --git a/src/plugins/sqldrivers/psql/qsql_psql_p.h b/src/plugins/sqldrivers/psql/qsql_psql_p.h
index 2873a9f851..7e1849d857 100644
--- a/src/plugins/sqldrivers/psql/qsql_psql_p.h
+++ b/src/plugins/sqldrivers/psql/qsql_psql_p.h
@@ -92,6 +92,7 @@ public:
Version9_5 = 21,
Version9_6 = 22,
Version10 = 23,
+ Version11 = 24,
UnknownLaterVersion = 100000
};
diff --git a/src/plugins/styles/windowsvista/qwindowsvistastyle.cpp b/src/plugins/styles/windowsvista/qwindowsvistastyle.cpp
index 7b35d1b58c..771552a121 100644
--- a/src/plugins/styles/windowsvista/qwindowsvistastyle.cpp
+++ b/src/plugins/styles/windowsvista/qwindowsvistastyle.cpp
@@ -1664,9 +1664,15 @@ void QWindowsVistaStyle::drawComplexControl(ComplexControl control, const QStyle
theme.stateId = CBXS_NORMAL;
d->drawBackground(theme);
}
+ if ((sub & SC_ComboBoxEditField) && (flags & State_HasFocus)) {
+ QStyleOptionFocusRect fropt;
+ fropt.QStyleOption::operator=(*cmb);
+ fropt.rect = proxy()->subControlRect(CC_ComboBox, option, SC_ComboBoxEditField, widget);
+ proxy()->drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget);
+ }
}
- }
- break;
+ }
+ break;
case CC_ScrollBar:
if (const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(option))
{
diff --git a/src/printsupport/configure.json b/src/printsupport/configure.json
index abc704fa18..7183d2e737 100644
--- a/src/printsupport/configure.json
+++ b/src/printsupport/configure.json
@@ -17,9 +17,9 @@
"cups": {
"label": "CUPS",
"test": {
- "include": "cups/cups.h",
"main": "cupsGetNamedDest(CUPS_HTTP_DEFAULT, NULL, NULL); // CUPS 1.4 test"
},
+ "headers": "cups/cups.h",
"sources": [
"-lcups"
]
diff --git a/src/printsupport/dialogs/qpagesetupdialog_win.cpp b/src/printsupport/dialogs/qpagesetupdialog_win.cpp
index 23fff82f25..464381bbe4 100644
--- a/src/printsupport/dialogs/qpagesetupdialog_win.cpp
+++ b/src/printsupport/dialogs/qpagesetupdialog_win.cpp
@@ -134,6 +134,8 @@ int QPageSetupDialog::exec()
QDialog::setVisible(false);
if (result) {
engine->setGlobalDevMode(psd.hDevNames, psd.hDevMode);
+ d->printer->setPageSize(QPageSize(QSizeF(psd.ptPaperSize.x / multiplier, psd.ptPaperSize.y / multiplier),
+ layout.units() == QPageLayout::Inch ? QPageSize::Inch : QPageSize::Millimeter));
const QMarginsF margins(psd.rtMargin.left, psd.rtMargin.top, psd.rtMargin.right, psd.rtMargin.bottom);
d->printer->setPageMargins(margins / multiplier, layout.units());
diff --git a/src/testlib/doc/snippets/code/src_corelib_kernel_qtestsupport_core.cpp b/src/testlib/doc/snippets/code/src_corelib_kernel_qtestsupport_core.cpp
index ed3e9bd0c0..e793cb1f55 100644
--- a/src/testlib/doc/snippets/code/src_corelib_kernel_qtestsupport_core.cpp
+++ b/src/testlib/doc/snippets/code/src_corelib_kernel_qtestsupport_core.cpp
@@ -3,9 +3,9 @@
** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtTest module of the Qt Toolkit.
+** This file is part of the documentation of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
@@ -14,24 +14,35 @@
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "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 The Qt Company Ltd 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
+** OWNER 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."
**
** $QT_END_LICENSE$
**
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp
index 61a5542c83..7272df4265 100644
--- a/src/tools/moc/moc.cpp
+++ b/src/tools/moc/moc.cpp
@@ -260,7 +260,7 @@ bool Moc::parseEnum(EnumDef *def)
{
bool isTypdefEnum = false; // typedef enum { ... } Foo;
- if (test(CLASS))
+ if (test(CLASS) || test(STRUCT))
def->isEnumClass = true;
if (test(IDENTIFIER)) {
diff --git a/src/tools/uic/cpp/cppwriteinitialization.cpp b/src/tools/uic/cpp/cppwriteinitialization.cpp
index 4f6ac1eb97..7ab6c31cb2 100644
--- a/src/tools/uic/cpp/cppwriteinitialization.cpp
+++ b/src/tools/uic/cpp/cppwriteinitialization.cpp
@@ -35,6 +35,7 @@
#include "globaldefs.h"
#include <qtextstream.h>
+#include <qversionnumber.h>
#include <qdebug.h>
#include <algorithm>
@@ -1765,6 +1766,13 @@ QString WriteInitialization::domColor2QString(const DomColor *c)
.arg(c->elementBlue());
}
+static inline QVersionNumber colorRoleVersionAdded(const QString &roleName)
+{
+ if (roleName == QLatin1String("PlaceholderText"))
+ return QVersionNumber(5, 12, 0);
+ return QVersionNumber();
+}
+
void WriteInitialization::writeColorGroup(DomColorGroup *colorGroup, const QString &group, const QString &paletteName)
{
if (!colorGroup)
@@ -1785,10 +1793,19 @@ void WriteInitialization::writeColorGroup(DomColorGroup *colorGroup, const QStri
const auto &colorRoles = colorGroup->elementColorRole();
for (const DomColorRole *colorRole : colorRoles) {
if (colorRole->hasAttributeRole()) {
+ const QString roleName = colorRole->attributeRole();
+ const QVersionNumber versionAdded = colorRoleVersionAdded(roleName);
const QString brushName = writeBrushInitialization(colorRole->elementBrush());
+ if (!versionAdded.isNull()) {
+ m_output << "#if QT_VERSION >= QT_VERSION_CHECK("
+ << versionAdded.majorVersion() << ", " << versionAdded.minorVersion()
+ << ", " << versionAdded.microVersion() << ")\n";
+ }
m_output << m_indent << paletteName << ".setBrush(" << group
- << ", " << "QPalette::" << colorRole->attributeRole()
+ << ", " << "QPalette::" << roleName
<< ", " << brushName << ");\n";
+ if (!versionAdded.isNull())
+ m_output << "#endif\n";
}
}
}
diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp
index 06f0393b4c..1fb5e61301 100644
--- a/src/widgets/dialogs/qdialog.cpp
+++ b/src/widgets/dialogs/qdialog.cpp
@@ -145,10 +145,48 @@ bool QDialogPrivate::canBeNativeDialog() const
return false;
}
-QWindow *QDialogPrivate::parentWindow() const
+/*!
+ \internal
+
+ Properly hides dialog and sets the \p resultCode
+ */
+void QDialogPrivate::hide(int resultCode)
{
- if (const QWidget *parent = q_func()->nativeParentWidget())
+ Q_Q(QDialog);
+
+ q->setResult(resultCode);
+ q->hide();
+
+ close_helper(QWidgetPrivate::CloseNoEvent);
+ resetModalitySetByOpen();
+}
+
+/*!
+ \internal
+
+ Emits finished() signal with \p resultCode. If the \p dialogCode
+ is equal to 0 emits rejected(), if the \p dialogCode is equal to
+ 1 emits accepted().
+ */
+void QDialogPrivate::finalize(int resultCode, int dialogCode)
+{
+ Q_Q(QDialog);
+
+ if (dialogCode == QDialog::Accepted)
+ emit q->accepted();
+ else if (dialogCode == QDialog::Rejected)
+ emit q->rejected();
+
+ emit q->finished(resultCode);
+}
+
+QWindow *QDialogPrivate::transientParentWindow() const
+{
+ Q_Q(const QDialog);
+ if (const QWidget *parent = q->nativeParentWidget())
return parent->windowHandle();
+ else if (q->windowHandle())
+ return q->windowHandle()->transientParent();
return 0;
}
@@ -158,7 +196,7 @@ bool QDialogPrivate::setNativeDialogVisible(bool visible)
if (visible) {
Q_Q(QDialog);
helperPrepareShow(helper);
- nativeDialogInUse = helper->show(q->windowFlags(), q->windowModality(), parentWindow());
+ nativeDialogInUse = helper->show(q->windowFlags(), q->windowModality(), transientParentWindow());
} else if (nativeDialogInUse) {
helper->hide();
}
@@ -590,17 +628,8 @@ int QDialog::exec()
void QDialog::done(int r)
{
Q_D(QDialog);
- setResult(r);
- hide();
-
- d->close_helper(QWidgetPrivate::CloseNoEvent);
- d->resetModalitySetByOpen();
-
- emit finished(r);
- if (r == Accepted)
- emit accepted();
- else if (r == Rejected)
- emit rejected();
+ d->hide(r);
+ d->finalize(r, r);
}
/*!
diff --git a/src/widgets/dialogs/qdialog_p.h b/src/widgets/dialogs/qdialog_p.h
index 99fff08e65..92634f6793 100644
--- a/src/widgets/dialogs/qdialog_p.h
+++ b/src/widgets/dialogs/qdialog_p.h
@@ -87,7 +87,7 @@ public:
{}
~QDialogPrivate();
- QWindow *parentWindow() const;
+ QWindow *transientParentWindow() const;
bool setNativeDialogVisible(bool visible);
QVariant styleHint(QPlatformDialogHelper::StyleHint hint) const;
void deletePlatformHelper();
@@ -122,6 +122,9 @@ public:
QPlatformDialogHelper *platformHelper() const;
virtual bool canBeNativeDialog() const;
+ void hide(int resultCode);
+ void finalize(int resultCode, int dialogCode);
+
private:
virtual void initHelper(QPlatformDialogHelper *) {}
virtual void helperPrepareShow(QPlatformDialogHelper *) {}
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
index 69496dbd29..eb3479b3e0 100644
--- a/src/widgets/dialogs/qfiledialog.cpp
+++ b/src/widgets/dialogs/qfiledialog.cpp
@@ -2866,7 +2866,11 @@ void QFileDialogPrivate::init(const QUrl &directory, const QString &nameFilter,
q->setFileMode(QFileDialog::AnyFile);
if (!nameFilter.isEmpty())
q->setNameFilter(nameFilter);
+ // QTBUG-70798, prevent the default blocking the restore logic.
+ const bool dontStoreDir = !directory.isValid() && !lastVisitedDir()->isValid();
q->setDirectoryUrl(workingDirectory(directory));
+ if (dontStoreDir)
+ lastVisitedDir()->clear();
if (directory.isLocalFile())
q->selectFile(initialSelection(directory));
else
diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp
index 8b3549c3f5..d29f74e93d 100644
--- a/src/widgets/dialogs/qfilesystemmodel.cpp
+++ b/src/widgets/dialogs/qfilesystemmodel.cpp
@@ -2032,8 +2032,7 @@ bool QFileSystemModelPrivate::passNameFilters(const QFileSystemNode *node) const
: QRegularExpression::CaseInsensitiveOption;
for (const auto &nameFilter : nameFilters) {
- const QString wildcard = QRegularExpression::wildcardToRegularExpression(nameFilter);
- QRegularExpression rx(QRegularExpression::anchoredPattern(wildcard), options);
+ QRegularExpression rx(QRegularExpression::wildcardToRegularExpression(nameFilter), options);
QRegularExpressionMatch match = rx.match(node->fileName);
if (match.hasMatch())
return true;
diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp
index e8f34ec946..ac1952a642 100644
--- a/src/widgets/dialogs/qmessagebox.cpp
+++ b/src/widgets/dialogs/qmessagebox.cpp
@@ -209,6 +209,7 @@ public:
void setupLayout();
void _q_buttonClicked(QAbstractButton *);
void _q_clicked(QPlatformDialogHelper::StandardButton button, QPlatformDialogHelper::ButtonRole role);
+ void setClickedButton(QAbstractButton *button);
QAbstractButton *findButton(int button0, int button1, int button2, int flags);
void addOldButtons(int button0, int button1, int button2);
@@ -216,6 +217,8 @@ public:
QAbstractButton *abstractButtonForId(int id) const;
int execReturnCode(QAbstractButton *button);
+ int dialogCodeForButton(QAbstractButton *button) const;
+
void detectEscapeButton();
void updateSize();
int layoutMinimumWidth();
@@ -466,6 +469,27 @@ int QMessageBoxPrivate::execReturnCode(QAbstractButton *button)
return ret;
}
+/*!
+ \internal
+
+ Returns 0 for RejectedRole and NoRole, 1 for AcceptedRole and YesRole, -1 otherwise
+ */
+int QMessageBoxPrivate::dialogCodeForButton(QAbstractButton *button) const
+{
+ Q_Q(const QMessageBox);
+
+ switch (q->buttonRole(button)) {
+ case QMessageBox::AcceptRole:
+ case QMessageBox::YesRole:
+ return QDialog::Accepted;
+ case QMessageBox::RejectRole:
+ case QMessageBox::NoRole:
+ return QDialog::Rejected;
+ default:
+ return -1;
+ }
+}
+
void QMessageBoxPrivate::_q_buttonClicked(QAbstractButton *button)
{
Q_Q(QMessageBox);
@@ -477,20 +501,30 @@ void QMessageBoxPrivate::_q_buttonClicked(QAbstractButton *button)
} else
#endif
{
- clickedButton = button;
- q->done(execReturnCode(button)); // does not trigger closeEvent
- emit q->buttonClicked(button);
+ setClickedButton(button);
if (receiverToDisconnectOnClose) {
QObject::disconnect(q, signalToDisconnectOnClose, receiverToDisconnectOnClose,
memberToDisconnectOnClose);
- receiverToDisconnectOnClose = 0;
+ receiverToDisconnectOnClose = nullptr;
}
signalToDisconnectOnClose.clear();
memberToDisconnectOnClose.clear();
}
}
+void QMessageBoxPrivate::setClickedButton(QAbstractButton *button)
+{
+ Q_Q(QMessageBox);
+
+ clickedButton = button;
+ emit q->buttonClicked(clickedButton);
+
+ auto resultCode = execReturnCode(button);
+ hide(resultCode);
+ finalize(resultCode, dialogCodeForButton(button));
+}
+
void QMessageBoxPrivate::_q_clicked(QPlatformDialogHelper::StandardButton button, QPlatformDialogHelper::ButtonRole role)
{
Q_Q(QMessageBox);
diff --git a/src/widgets/itemviews/qtableview.cpp b/src/widgets/itemviews/qtableview.cpp
index 9725a768de..9c509583e6 100644
--- a/src/widgets/itemviews/qtableview.cpp
+++ b/src/widgets/itemviews/qtableview.cpp
@@ -766,6 +766,66 @@ bool QTableViewPrivate::spanContainsSection(const QHeaderView *header, int logic
/*!
\internal
+ Searches for the next cell which is available for e.g. keyboard navigation
+ The search is done by row
+*/
+int QTableViewPrivate::nextActiveVisualRow(int rowToStart, int column, int limit,
+ SearchDirection searchDirection) const
+{
+ const int lc = logicalColumn(column);
+ int visualRow = rowToStart;
+ const auto isCellActive = [this](int vr, int lc)
+ {
+ const int lr = logicalRow(vr);
+ return !isRowHidden(lr) && isCellEnabled(lr, lc);
+ };
+ switch (searchDirection) {
+ case SearchDirection::Increasing:
+ if (visualRow < limit) {
+ while (!isCellActive(visualRow, lc)) {
+ if (++visualRow == limit)
+ return rowToStart;
+ }
+ }
+ break;
+ case SearchDirection::Decreasing:
+ while (visualRow > limit && !isCellActive(visualRow, lc))
+ --visualRow;
+ break;
+ }
+ return visualRow;
+}
+
+/*!
+ \internal
+ Searches for the next cell which is available for e.g. keyboard navigation
+ The search is done by column
+*/
+int QTableViewPrivate::nextActiveVisualColumn(int row, int columnToStart, int limit,
+ SearchDirection searchDirection) const
+{
+ const int lr = logicalRow(row);
+ int visualColumn = columnToStart;
+ const auto isCellActive = [this](int lr, int vc)
+ {
+ const int lc = logicalColumn(vc);
+ return !isColumnHidden(lc) && isCellEnabled(lr, lc);
+ };
+ switch (searchDirection) {
+ case SearchDirection::Increasing:
+ while (visualColumn < limit && !isCellActive(lr, visualColumn))
+ ++visualColumn;
+ break;
+ case SearchDirection::Decreasing:
+ while (visualColumn > limit && !isCellActive(lr, visualColumn))
+ --visualColumn;
+ break;
+ }
+ return visualColumn;
+}
+
+/*!
+ \internal
Returns the visual rect for the given \a span.
*/
QRect QTableViewPrivate::visualSpanRect(const QSpanCollection::Span &span) const
@@ -1800,35 +1860,34 @@ QModelIndex QTableView::moveCursor(CursorAction cursorAction, Qt::KeyboardModifi
break;
}
case MoveHome:
- visualColumn = 0;
- while (visualColumn < right && d->isVisualColumnHiddenOrDisabled(visualRow, visualColumn))
- ++visualColumn;
- if (modifiers & Qt::ControlModifier) {
- visualRow = 0;
- while (visualRow < bottom && d->isVisualRowHiddenOrDisabled(visualRow, visualColumn))
- ++visualRow;
- }
+ visualColumn = d->nextActiveVisualColumn(visualRow, 0, right,
+ QTableViewPrivate::SearchDirection::Increasing);
+ if (modifiers & Qt::ControlModifier)
+ visualRow = d->nextActiveVisualRow(0, visualColumn, bottom,
+ QTableViewPrivate::SearchDirection::Increasing);
break;
case MoveEnd:
- visualColumn = right;
+ visualColumn = d->nextActiveVisualColumn(visualRow, right, -1,
+ QTableViewPrivate::SearchDirection::Decreasing);
if (modifiers & Qt::ControlModifier)
- visualRow = bottom;
+ visualRow = d->nextActiveVisualRow(bottom, current.column(), -1,
+ QTableViewPrivate::SearchDirection::Decreasing);
break;
case MovePageUp: {
- int newRow = rowAt(visualRect(current).bottom() - d->viewport->height());
- if (newRow == -1) {
- int visualRow = 0;
- while (visualRow < bottom && isRowHidden(d->logicalRow(visualRow)))
- ++visualRow;
- newRow = d->logicalRow(visualRow);
- }
- return d->model->index(newRow, current.column(), d->root);
+ int newLogicalRow = rowAt(visualRect(current).bottom() - d->viewport->height());
+ int visualRow = (newLogicalRow == -1 ? 0 : d->visualRow(newLogicalRow));
+ visualRow = d->nextActiveVisualRow(visualRow, current.column(), bottom,
+ QTableViewPrivate::SearchDirection::Increasing);
+ newLogicalRow = d->logicalRow(visualRow);
+ return d->model->index(newLogicalRow, current.column(), d->root);
}
case MovePageDown: {
- int newRow = rowAt(visualRect(current).top() + d->viewport->height());
- if (newRow == -1)
- newRow = d->logicalRow(bottom);
- return d->model->index(newRow, current.column(), d->root);
+ int newLogicalRow = rowAt(visualRect(current).top() + d->viewport->height());
+ int visualRow = (newLogicalRow == -1 ? bottom : d->visualRow(newLogicalRow));
+ visualRow = d->nextActiveVisualRow(visualRow, current.column(), -1,
+ QTableViewPrivate::SearchDirection::Decreasing);
+ newLogicalRow = d->logicalRow(visualRow);
+ return d->model->index(newLogicalRow, current.column(), d->root);
}}
d->visualCursor = QPoint(visualColumn, visualRow);
diff --git a/src/widgets/itemviews/qtableview_p.h b/src/widgets/itemviews/qtableview_p.h
index 805787597c..a50e6b6410 100644
--- a/src/widgets/itemviews/qtableview_p.h
+++ b/src/widgets/itemviews/qtableview_p.h
@@ -234,16 +234,16 @@ public:
inline bool isCellEnabled(int row, int column) const {
return isIndexEnabled(model->index(row, column, root));
}
- inline bool isVisualRowHiddenOrDisabled(int row, int column) const {
- int r = logicalRow(row);
- int c = logicalColumn(column);
- return isRowHidden(r) || !isCellEnabled(r, c);
- }
- inline bool isVisualColumnHiddenOrDisabled(int row, int column) const {
- int r = logicalRow(row);
- int c = logicalColumn(column);
- return isColumnHidden(c) || !isCellEnabled(r, c);
- }
+
+ enum class SearchDirection
+ {
+ Increasing,
+ Decreasing
+ };
+ int nextActiveVisualRow(int rowToStart, int column, int limit,
+ SearchDirection searchDirection) const;
+ int nextActiveVisualColumn(int row, int columnToStart, int limit,
+ SearchDirection searchDirection) const;
QRect visualSpanRect(const QSpanCollection::Span &span) const;
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index 2410daf047..f9db6155af 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -1064,8 +1064,10 @@ QStyle *QApplication::style()
if (!QApplicationPrivate::styleOverride.isEmpty()) {
const QString style = QApplicationPrivate::styleOverride.toLower();
app_style = QStyleFactory::create(style);
- if (!app_style)
- qWarning("QApplication: invalid style override passed, ignoring it.");
+ if (Q_UNLIKELY(!app_style)) {
+ qWarning("QApplication: invalid style override passed, ignoring it.\n"
+ " Available styles: %s", qPrintable(QStyleFactory::keys().join(QLatin1String(", "))));
+ }
}
if (!app_style)
app_style = QStyleFactory::create(QApplicationPrivate::desktopStyleKey());
diff --git a/src/widgets/kernel/qtooltip.cpp b/src/widgets/kernel/qtooltip.cpp
index b9d8758fe0..cf0f3f153b 100644
--- a/src/widgets/kernel/qtooltip.cpp
+++ b/src/widgets/kernel/qtooltip.cpp
@@ -41,6 +41,7 @@
#endif
#include <QtWidgets/private/qtwidgetsglobal_p.h>
+#include <QtWidgets/private/qlabel_p.h>
#include <qapplication.h>
#include <qdesktopwidget.h>
@@ -127,6 +128,7 @@ public:
~QTipLabel();
static QTipLabel *instance;
+ void adjustTooltipScreen(const QPoint &pos);
void updateSize(const QPoint &pos);
bool eventFilter(QObject *, QEvent *) override;
@@ -221,6 +223,12 @@ void QTipLabel::reuseTip(const QString &text, int msecDisplayTime, const QPoint
void QTipLabel::updateSize(const QPoint &pos)
{
+#ifndef Q_OS_WINRT
+ // ### The code below does not always work well on WinRT
+ // (e.g COIN fails an auto test - tst_QToolTip::qtbug64550_stylesheet - QTBUG-72652)
+ d_func()->setScreenForPoint(pos);
+#endif
+ // Ensure that we get correct sizeHints by placing this window on the right screen.
QFontMetrics fm(font());
QSize extra(1, 0);
// Make it look good with the default ToolTip font on Mac, which has a small descent.
@@ -228,6 +236,7 @@ void QTipLabel::updateSize(const QPoint &pos)
++extra.rheight();
setWordWrap(Qt::mightBeRichText(text()));
QSize sh = sizeHint();
+ // ### When the above WinRT code is fixed, windowhandle should be used to find the screen.
QScreen *screen = QGuiApplication::screenAt(pos);
if (!screen)
screen = QGuiApplication::primaryScreen();
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 9a07c55e10..fef07cfe0d 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -2571,6 +2571,27 @@ void QWidgetPrivate::createWinId()
}
}
+/*!
+\internal
+Ensures that the widget is set on the screen point is on. This is handy getting a correct
+size hint before a resize in e.g QMenu and QToolTip
+*/
+
+void QWidgetPrivate::setScreenForPoint(const QPoint &pos)
+{
+ Q_Q(QWidget);
+ if (!q->isWindow())
+ return;
+ // Find the screen for pos and make the widget undertand it is on that screen.
+ const QScreen *currentScreen = windowHandle() ? windowHandle()->screen() : nullptr;
+ QScreen *actualScreen = QGuiApplication::screenAt(pos);
+ if (actualScreen && currentScreen != actualScreen) {
+ if (!windowHandle()) // Try to create a window handle if not created.
+ createWinId();
+ if (windowHandle())
+ windowHandle()->setScreen(actualScreen);
+ }
+}
/*!
\internal
diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h
index be45c4c868..6f1ce67c4c 100644
--- a/src/widgets/kernel/qwidget_p.h
+++ b/src/widgets/kernel/qwidget_p.h
@@ -355,6 +355,8 @@ public:
void createRecursively();
void createWinId();
+ void setScreenForPoint(const QPoint &pos);
+
void createTLExtra();
void createExtra();
void deleteExtra();
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index 10dfad2754..9fbbe1893a 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -1675,7 +1675,8 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
alignment |= Qt::AlignLeft | Qt::AlignVCenter;
}
tr.translate(shiftX, shiftY);
- const QString text = toolbutton->fontMetrics.elidedText(toolbutton->text, Qt::ElideMiddle, tr.width());
+ const QString text = toolbutton->fontMetrics.elidedText(toolbutton->text, Qt::ElideMiddle,
+ tr.width(), alignment);
proxy()->drawItemText(p, QStyle::visualRect(opt->direction, rect, tr), alignment, toolbutton->palette,
toolbutton->state & State_Enabled, text,
QPalette::ButtonText);
diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp
index df151067df..c565932889 100644
--- a/src/widgets/styles/qfusionstyle.cpp
+++ b/src/widgets/styles/qfusionstyle.cpp
@@ -725,7 +725,6 @@ void QFusionStyle::drawPrimitive(PrimitiveElement elem,
// Draw Outline
painter->setPen( QPen(hasFocus ? highlightedOutline : outline));
- painter->setBrush(option->palette.base());
painter->drawRoundedRect(r.adjusted(0, 0, -1, -1), 2, 2);
if (hasFocus) {
diff --git a/src/widgets/styles/qstyle.cpp b/src/widgets/styles/qstyle.cpp
index 8006be8c27..ac4fb7fbd1 100644
--- a/src/widgets/styles/qstyle.cpp
+++ b/src/widgets/styles/qstyle.cpp
@@ -1998,7 +1998,7 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment,
This enum value has been introduced in Qt 5.10.
\value SH_SpinBox_ButtonsInsideFrame
- Determnines if the spin box buttons are inside the line edit frame.
+ Determines if the spin box buttons are inside the line edit frame.
This enum value has been introduced in Qt 5.11.
\value SH_SpinBox_StepModifier
diff --git a/src/widgets/widgets/qabstractslider.cpp b/src/widgets/widgets/qabstractslider.cpp
index 99ee1eccb7..2172ebc99c 100644
--- a/src/widgets/widgets/qabstractslider.cpp
+++ b/src/widgets/widgets/qabstractslider.cpp
@@ -829,7 +829,6 @@ void QAbstractSlider::keyPressEvent(QKeyEvent *ev)
break;
#endif
- // It seems we need to use invertedAppearance for Left and right, otherwise, things look weird.
case Qt::Key_Left:
#ifdef QT_KEYPAD_NAVIGATION
// In QApplication::KeypadNavigationDirectional, we want to change the slider
@@ -848,9 +847,9 @@ void QAbstractSlider::keyPressEvent(QKeyEvent *ev)
else
#endif
if (isRightToLeft())
- action = d->invertedAppearance ? SliderSingleStepSub : SliderSingleStepAdd;
+ action = d->invertedControls ? SliderSingleStepSub : SliderSingleStepAdd;
else
- action = !d->invertedAppearance ? SliderSingleStepSub : SliderSingleStepAdd;
+ action = !d->invertedControls ? SliderSingleStepSub : SliderSingleStepAdd;
break;
case Qt::Key_Right:
#ifdef QT_KEYPAD_NAVIGATION
@@ -868,9 +867,9 @@ void QAbstractSlider::keyPressEvent(QKeyEvent *ev)
else
#endif
if (isRightToLeft())
- action = d->invertedAppearance ? SliderSingleStepAdd : SliderSingleStepSub;
+ action = d->invertedControls ? SliderSingleStepAdd : SliderSingleStepSub;
else
- action = !d->invertedAppearance ? SliderSingleStepAdd : SliderSingleStepSub;
+ action = !d->invertedControls ? SliderSingleStepAdd : SliderSingleStepSub;
break;
case Qt::Key_Up:
#ifdef QT_KEYPAD_NAVIGATION
diff --git a/src/widgets/widgets/qdatetimeedit.cpp b/src/widgets/widgets/qdatetimeedit.cpp
index 68bfd175ff..c66400f423 100644
--- a/src/widgets/widgets/qdatetimeedit.cpp
+++ b/src/widgets/widgets/qdatetimeedit.cpp
@@ -553,7 +553,7 @@ void QDateTimeEdit::setMaximumTime(const QTime &max)
{
Q_D(QDateTimeEdit);
if (max.isValid()) {
- const QDateTime m(d->maximum.toDate(), max);
+ const QDateTime m(d->maximum.toDate(), max, d->spec);
setMaximumDateTime(m);
}
}
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp
index c79e88f094..e3c29ff6ee 100644
--- a/src/widgets/widgets/qmenu.cpp
+++ b/src/widgets/widgets/qmenu.cpp
@@ -896,23 +896,6 @@ void QMenuPrivate::_q_overrideMenuActionDestroyed()
menuAction=defaultMenuAction;
}
-void QMenuPrivate::adjustMenuScreen(const QPoint &p)
-{
- Q_Q(QMenu);
- // The windowHandle must point to the screen where the menu will be shown.
- // The (item) size calculations depend on the menu screen,
- // so a wrong screen would often cause wrong sizes (on high DPI)
- const QScreen *currentScreen = q->windowHandle() ? q->windowHandle()->screen() : nullptr;
- QScreen *actualScreen = QGuiApplication::screenAt(p);
- if (actualScreen && currentScreen != actualScreen) {
- if (!q->windowHandle()) // Try to create a window handle if not created.
- createWinId();
- if (q->windowHandle())
- q->windowHandle()->setScreen(actualScreen);
- itemsDirty = true;
- }
-}
-
void QMenuPrivate::updateLayoutDirection()
{
Q_Q(QMenu);
@@ -2375,7 +2358,8 @@ void QMenu::popup(const QPoint &p, QAction *atAction)
d->motions = 0;
d->doChildEffects = true;
d->updateLayoutDirection();
- d->adjustMenuScreen(p);
+ // Ensure that we get correct sizeHints by placing this window on the right screen.
+ d->setScreenForPoint(p);
const bool contextMenu = d->isContextMenu();
if (d->lastContextMenu != contextMenu) {
diff --git a/src/widgets/widgets/qmenu_p.h b/src/widgets/widgets/qmenu_p.h
index 721a35bf90..f740919dc7 100644
--- a/src/widgets/widgets/qmenu_p.h
+++ b/src/widgets/widgets/qmenu_p.h
@@ -456,7 +456,6 @@ public:
bool hasMouseMoved(const QPoint &globalPos);
- void adjustMenuScreen(const QPoint &p);
void updateLayoutDirection();
QPointer<QPlatformMenu> platformMenu;
diff --git a/tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp b/tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp
index 9a54c0a70d..1b40e77648 100644
--- a/tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp
+++ b/tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp
@@ -81,6 +81,8 @@ private slots:
void setData_emits_both_roles_data();
void setData_emits_both_roles();
+ void setData_emits_on_change_only();
+
void supportedDragDropActions();
};
@@ -246,6 +248,24 @@ void tst_QStringListModel::setData_emits_both_roles()
expected);
}
+void tst_QStringListModel::setData_emits_on_change_only()
+{
+ QStringListModel model(QStringList{QStringLiteral("one"), QStringLiteral("two")});
+ QSignalSpy dataChangedSpy(&model, &QAbstractItemModel::dataChanged);
+ QVERIFY(dataChangedSpy.isValid());
+ const QModelIndex modelIdx = model.index(0, 0);
+ const QString newStringData = QStringLiteral("test");
+ QVERIFY(model.setData(modelIdx, newStringData));
+ QCOMPARE(dataChangedSpy.count(), 1);
+ const QList<QVariant> spyList = dataChangedSpy.takeFirst();
+ QCOMPARE(spyList.at(0).value<QModelIndex>(), modelIdx);
+ QCOMPARE(spyList.at(1).value<QModelIndex>(), modelIdx);
+ const QVector<int> expectedRoles{Qt::DisplayRole, Qt::EditRole};
+ QCOMPARE(spyList.at(2).value<QVector<int> >(), expectedRoles);
+ QVERIFY(model.setData(modelIdx, newStringData));
+ QVERIFY(dataChangedSpy.isEmpty());
+}
+
void tst_QStringListModel::supportedDragDropActions()
{
QStringListModel model;
diff --git a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
index 5d9b5ca95c..e6fac74ccc 100644
--- a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
+++ b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
@@ -123,6 +123,7 @@ private slots:
void compareCustomType();
void compareCustomEqualOnlyType();
void customDebugStream();
+ void unknownType();
};
struct BaseGenericType
@@ -2529,6 +2530,16 @@ void tst_QMetaType::customDebugStream()
qDebug() << v1;
}
+void tst_QMetaType::unknownType()
+{
+ QMetaType invalid(QMetaType::UnknownType);
+ QVERIFY(!invalid.create());
+ QVERIFY(!invalid.sizeOf());
+ QVERIFY(!invalid.metaObject());
+ int buffer = 0xBAD;
+ invalid.construct(&buffer);
+ QCOMPARE(buffer, 0xBAD);
+}
// Compile-time test, it should be possible to register function pointer types
class Undefined;
diff --git a/tests/auto/corelib/kernel/qtimer/BLACKLIST b/tests/auto/corelib/kernel/qtimer/BLACKLIST
index b355bc22c2..e5136624d8 100644
--- a/tests/auto/corelib/kernel/qtimer/BLACKLIST
+++ b/tests/auto/corelib/kernel/qtimer/BLACKLIST
@@ -1,5 +1,3 @@
[remainingTime]
windows
osx
-[basic_chrono]
-osx ci
diff --git a/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp b/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp
index 2d65d3433f..72f88a235d 100644
--- a/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp
+++ b/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp
@@ -93,7 +93,7 @@ void tst_QCollator::compare_data()
QTest::addColumn<int>("caseInsensitiveResult");
QTest::addColumn<bool>("numericMode");
QTest::addColumn<bool>("ignorePunctuation");
- QTest::addColumn<int>("punctuationResult");
+ QTest::addColumn<int>("punctuationResult"); // Test ignores punctuation *and case*
/*
It's hard to test English, because it's treated differently
@@ -169,8 +169,12 @@ void tst_QCollator::compare_data()
QTest::newRow("french6") << QString("fr_FR") << QString("Test 9") << QString("Test_19") << -1 << -1 << true << true << -1;
QTest::newRow("french7") << QString("fr_FR") << QString("test_19") << QString("test 19") << 1 << 1 << true << false << 1;
QTest::newRow("french8") << QString("fr_FR") << QString("test.19") << QString("test,19") << 1 << 1 << true << true << 0;
-}
+ // C locale: case sensitive [A-Z] < [a-z] but case insensitive [Aa] < [Bb] <...< [Zz]
+ const QString C = QStringLiteral("C");
+ QTest::newRow("C:ABBA:AaaA") << C << QStringLiteral("ABBA") << QStringLiteral("AaaA") << -1 << 1 << false << false << 1;
+ QTest::newRow("C:AZa:aAZ") << C << QStringLiteral("AZa") << QStringLiteral("aAZ") << -1 << 1 << false << false << 1;
+}
void tst_QCollator::compare()
{
@@ -184,6 +188,10 @@ void tst_QCollator::compare()
QFETCH(int, punctuationResult);
QCollator collator(locale);
+ // Need to canonicalize sign to -1, 0 or 1, as .compare() can produce any -ve for <, any +ve for >.
+ auto asSign = [](int compared) {
+ return compared < 0 ? -1 : compared > 0 ? 1 : 0;
+ };
#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
if (collator.locale() != QLocale())
@@ -193,12 +201,12 @@ void tst_QCollator::compare()
if (numericMode)
collator.setNumericMode(true);
- QCOMPARE(collator.compare(s1, s2), result);
+ QCOMPARE(asSign(collator.compare(s1, s2)), result);
collator.setCaseSensitivity(Qt::CaseInsensitive);
- QCOMPARE(collator.compare(s1, s2), caseInsensitiveResult);
+ QCOMPARE(asSign(collator.compare(s1, s2)), caseInsensitiveResult);
#if !QT_CONFIG(iconv)
collator.setIgnorePunctuation(ignorePunctuation);
- QCOMPARE(collator.compare(s1, s2), punctuationResult);
+ QCOMPARE(asSign(collator.compare(s1, s2)), punctuationResult);
#endif
}
diff --git a/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp b/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp
index c23ee3b0ba..c02756d76a 100644
--- a/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp
+++ b/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp
@@ -2169,47 +2169,47 @@ void tst_QRegularExpression::wildcard_data()
addRow("*.html", "test.html", 0);
addRow("*.html", "test.htm", -1);
- addRow("bar*", "foobarbaz", 3);
+ addRow("*bar*", "foobarbaz", 0);
addRow("*", "Qt Rocks!", 0);
- addRow(".html", "test.html", 4);
- addRow(".h", "test.cpp", -1);
- addRow(".???l", "test.html", 4);
- addRow("?", "test.html", 0);
- addRow("?m", "test.html", 6);
- addRow("[*]", "test.html", -1);
- addRow("[?]","test.html", -1);
- addRow("[?]","test.h?ml", 6);
- addRow("[[]","test.h[ml", 6);
- addRow("[]]","test.h]ml", 6);
- addRow(".h[a-z]ml", "test.html", 4);
- addRow(".h[A-Z]ml", "test.html", -1);
- addRow(".h[A-Z]ml", "test.hTml", 4);
- addRow(".h[!A-Z]ml", "test.hTml", -1);
- addRow(".h[!A-Z]ml", "test.html", 4);
- addRow(".h[!T]ml", "test.hTml", -1);
- addRow(".h[!T]ml", "test.html", 4);
- addRow(".h[!T]m[!L]", "test.htmL", -1);
- addRow(".h[!T]m[!L]", "test.html", 4);
- addRow(".h[][!]", "test.h]ml", 4);
- addRow(".h[][!]", "test.h[ml", 4);
- addRow(".h[][!]", "test.h!ml", 4);
-
- addRow("foo/*/bar", "Qt/foo/baz/bar", 3);
- addRow("foo/(*)/bar", "Qt/foo/baz/bar", -1);
- addRow("foo/(*)/bar", "Qt/foo/(baz)/bar", 3);
- addRow("foo/?/bar", "Qt/foo/Q/bar", 3);
- addRow("foo/?/bar", "Qt/foo/Qt/bar", -1);
- addRow("foo/(?)/bar", "Qt/foo/Q/bar", -1);
- addRow("foo/(?)/bar", "Qt/foo/(Q)/bar", 3);
+ addRow("*.html", "test.html", 0);
+ addRow("*.h", "test.cpp", -1);
+ addRow("*.???l", "test.html", 0);
+ addRow("*?", "test.html", 0);
+ addRow("*?ml", "test.html", 0);
+ addRow("*[*]", "test.html", -1);
+ addRow("*[?]","test.html", -1);
+ addRow("*[?]ml","test.h?ml", 0);
+ addRow("*[[]ml","test.h[ml", 0);
+ addRow("*[]]ml","test.h]ml", 0);
+ addRow("*.h[a-z]ml", "test.html", 0);
+ addRow("*.h[A-Z]ml", "test.html", -1);
+ addRow("*.h[A-Z]ml", "test.hTml", 0);
+ addRow("*.h[!A-Z]ml", "test.hTml", -1);
+ addRow("*.h[!A-Z]ml", "test.html", 0);
+ addRow("*.h[!T]ml", "test.hTml", -1);
+ addRow("*.h[!T]ml", "test.html", 0);
+ addRow("*.h[!T]m[!L]", "test.htmL", -1);
+ addRow("*.h[!T]m[!L]", "test.html", 0);
+ addRow("*.h[][!]ml", "test.h]ml", 0);
+ addRow("*.h[][!]ml", "test.h[ml", 0);
+ addRow("*.h[][!]ml", "test.h!ml", 0);
+
+ addRow("foo/*/bar", "foo/baz/bar", 0);
+ addRow("foo/(*)/bar", "foo/baz/bar", -1);
+ addRow("foo/(*)/bar", "foo/(baz)/bar", 0);
+ addRow("foo/?/bar", "foo/Q/bar", 0);
+ addRow("foo/?/bar", "foo/Qt/bar", -1);
+ addRow("foo/(?)/bar", "foo/Q/bar", -1);
+ addRow("foo/(?)/bar", "foo/(Q)/bar", 0);
#ifdef Q_OS_WIN
- addRow("foo\\*\\bar", "Qt\\foo\\baz\\bar", 3);
- addRow("foo\\(*)\\bar", "Qt\\foo\\baz\\bar", -1);
- addRow("foo\\(*)\\bar", "Qt\\foo\\(baz)\\bar", 3);
- addRow("foo\\?\\bar", "Qt\\foo\\Q\\bar", 3);
- addRow("foo\\?\\bar", "Qt\\foo\\Qt\\bar", -1);
- addRow("foo\\(?)\\bar", "Qt\\foo\\Q\\bar", -1);
- addRow("foo\\(?)\\bar", "Qt\\foo\\(Q)\\bar", 3);
+ addRow("foo\\*\\bar", "foo\\baz\\bar", 0);
+ addRow("foo\\(*)\\bar", "foo\\baz\\bar", -1);
+ addRow("foo\\(*)\\bar", "foo\\(baz)\\bar", 0);
+ addRow("foo\\?\\bar", "foo\\Q\\bar", 0);
+ addRow("foo\\?\\bar", "foo\\Qt\\bar", -1);
+ addRow("foo\\(?)\\bar", "foo\\Q\\bar", -1);
+ addRow("foo\\(?)\\bar", "foo\\(Q)\\bar", 0);
#endif
}
diff --git a/tests/auto/gui/image/qimage/tst_qimage.cpp b/tests/auto/gui/image/qimage/tst_qimage.cpp
index 5ffd75f931..eded206d37 100644
--- a/tests/auto/gui/image/qimage/tst_qimage.cpp
+++ b/tests/auto/gui/image/qimage/tst_qimage.cpp
@@ -233,6 +233,7 @@ private slots:
#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
void toWinHBITMAP_data();
void toWinHBITMAP();
+ void fromMonoHBITMAP();
#endif // Q_OS_WIN && !Q_OS_WINRT
private:
@@ -3635,6 +3636,19 @@ void tst_QImage::toWinHBITMAP()
DeleteDC(bitmapDc);
ReleaseDC(0, displayDc);
}
+
+void tst_QImage::fromMonoHBITMAP() // QTBUG-72343, corruption for mono bitmaps
+{
+ enum : int { width = 32, height = 32, size = width * height / 8 }; // 32x32 mono bitmap
+ char bitmapData[size];
+ memset(bitmapData, 0, size);
+ const HBITMAP hbitmap = CreateBitmap(width, height, /* planes */ 1, /* bitcount */ 1, bitmapData);
+ const QImage image = qt_imageFromWinHBITMAP(hbitmap);
+ QCOMPARE(image.size(), QSize(width, height));
+ QCOMPARE(image.scanLine(0)[0], 0u);
+ DeleteObject(hbitmap);
+}
+
#endif // Q_OS_WIN && !Q_OS_WINRT
QTEST_GUILESS_MAIN(tst_QImage)
diff --git a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
index 9bf9e99bf9..bc0baed15c 100644
--- a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
+++ b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
@@ -299,6 +299,8 @@ private slots:
void fillPolygon();
+ void drawImageAtPointF();
+
private:
void fillData();
void setPenColor(QPainter& p);
@@ -5292,6 +5294,20 @@ void tst_QPainter::fillPolygon()
}
}
+void tst_QPainter::drawImageAtPointF()
+{
+ // Just test we do not crash
+ QImage image1(10, 10, QImage::Format_RGB32);
+ QImage image2(200, 200, QImage::Format_RGB32);
+
+ QPainter paint(&image2);
+ paint.setClipRect(97, 46, 14, 14);
+ paint.setCompositionMode(QPainter::CompositionMode_Source);
+ paint.drawImage(QPointF(96, std::numeric_limits<int>::max()), image1);
+ paint.drawImage(QPointF(std::numeric_limits<int>::min(), 48), image1);
+ paint.end();
+}
+
QTEST_MAIN(tst_QPainter)
#include "tst_qpainter.moc"
diff --git a/tests/auto/gui/text/qfontmetrics/testfont.qrc b/tests/auto/gui/text/qfontmetrics/testfont.qrc
index bc0c0b0959..30b4a3f82e 100644
--- a/tests/auto/gui/text/qfontmetrics/testfont.qrc
+++ b/tests/auto/gui/text/qfontmetrics/testfont.qrc
@@ -1,5 +1,6 @@
<RCC>
<qresource prefix="/fonts">
<file>ucs4font.ttf</file>
+ <file alias="testfont.ttf">../../../shared/resources/testfont.ttf</file>
</qresource>
</RCC>
diff --git a/tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp b/tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp
index 9e705b4a00..a0e8525268 100644
--- a/tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp
+++ b/tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp
@@ -58,6 +58,7 @@ private slots:
void lineWidth();
void mnemonicTextWidth();
void leadingBelowLine();
+ void elidedMetrics();
};
void tst_QFontMetrics::same()
@@ -331,5 +332,31 @@ void tst_QFontMetrics::leadingBelowLine()
QCOMPARE(line.base(), line.ascent);
}
+void tst_QFontMetrics::elidedMetrics()
+{
+ QString testFont = QFINDTESTDATA("fonts/testfont.ttf");
+ QVERIFY(!testFont.isEmpty());
+
+ int id = QFontDatabase::addApplicationFont(testFont);
+ QVERIFY(id >= 0);
+
+ QFont font(QFontDatabase::applicationFontFamilies(id).at(0));
+ font.setPixelSize(12.0);
+
+ QFontMetricsF metrics(font);
+ QString s = QStringLiteral("VeryLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongText");
+
+ QRectF boundingRect = metrics.boundingRect(s);
+
+ QString elided = metrics.elidedText(s, Qt::ElideRight, boundingRect.width() / 2.0);
+
+ QRectF elidedBoundingRect = metrics.boundingRect(elided);
+
+ QCOMPARE(boundingRect.height(), elidedBoundingRect.height());
+ QCOMPARE(boundingRect.y(), elidedBoundingRect.y());
+
+ QFontDatabase::removeApplicationFont(id);
+}
+
QTEST_MAIN(tst_QFontMetrics)
#include "tst_qfontmetrics.moc"
diff --git a/tests/auto/tools/moc/cxx11-enums.h b/tests/auto/tools/moc/cxx11-enums.h
index 93ab16c157..cc14c0acda 100644
--- a/tests/auto/tools/moc/cxx11-enums.h
+++ b/tests/auto/tools/moc/cxx11-enums.h
@@ -40,13 +40,22 @@ public:
enum class TypedEnumClass : char { C0, C1, C2, C3 };
enum NormalEnum { D2 = 2, D3, D0 =0 , D1 };
enum class ClassFlag { F0 = 1, F1 = 2, F2 = 4, F3 = 8};
+
+ enum struct EnumStruct { G0, G1, G2, G3 };
+ enum struct TypedEnumStruct : char { H0, H1, H2, H3 };
+ enum struct StructFlag { I0 = 1, I1 = 2, I2 = 4, I3 = 8};
+
Q_DECLARE_FLAGS(ClassFlags, ClassFlag)
+ Q_DECLARE_FLAGS(StructFlags, StructFlag)
Q_ENUM(EnumClass)
Q_ENUM(TypedEnum)
Q_ENUM(TypedEnumClass)
Q_ENUM(NormalEnum)
+ Q_ENUM(EnumStruct)
+ Q_ENUM(TypedEnumStruct)
Q_FLAG(ClassFlags)
+ Q_FLAG(StructFlags)
};
// Also test the Q_ENUMS macro
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp
index 92a94055a4..293cbd8323 100644
--- a/tests/auto/tools/moc/tst_moc.cpp
+++ b/tests/auto/tools/moc/tst_moc.cpp
@@ -2266,6 +2266,9 @@ void tst_Moc::cxx11Enums_data()
QTest::newRow("NormalEnum 2") << meta2 << QByteArray("NormalEnum") << QByteArray("NormalEnum") << 'D' << false;
QTest::newRow("ClassFlags") << meta1 << QByteArray("ClassFlags") << QByteArray("ClassFlag") << 'F' << true;
QTest::newRow("ClassFlags 2") << meta2 << QByteArray("ClassFlags") << QByteArray("ClassFlag") << 'F' << true;
+ QTest::newRow("EnumStruct") << meta1 << QByteArray("EnumStruct") << QByteArray("EnumStruct") << 'G' << true;
+ QTest::newRow("TypedEnumStruct") << meta1 << QByteArray("TypedEnumStruct") << QByteArray("TypedEnumStruct") << 'H' << true;
+ QTest::newRow("StructFlags") << meta1 << QByteArray("StructFlags") << QByteArray("StructFlag") << 'I' << true;
}
void tst_Moc::cxx11Enums()
diff --git a/tests/auto/tools/qmakelib/qmakelib.pro b/tests/auto/tools/qmakelib/qmakelib.pro
index 140bece708..29f17f6a14 100644
--- a/tests/auto/tools/qmakelib/qmakelib.pro
+++ b/tests/auto/tools/qmakelib/qmakelib.pro
@@ -1,6 +1,7 @@
CONFIG += testcase
TARGET = tst_qmakelib
QT = core testlib
+win32: LIBS += -ladvapi32
INCLUDEPATH += ../../../../qmake/library
VPATH += ../../../../qmake/library
@@ -13,6 +14,7 @@ SOURCES += \
parsertest.cpp \
evaltest.cpp \
ioutils.cpp \
+ registry.cpp \
proitems.cpp \
qmakevfs.cpp \
qmakeparser.cpp \
diff --git a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp
index 049468fd7c..76314564f1 100644
--- a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp
+++ b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp
@@ -38,49 +38,6 @@
#include <qpa/qplatformtheme.h>
#include <private/qguiapplication_p.h>
-#define CONVENIENCE_FUNC_SYMS(func) \
- { \
- int x1 = QMessageBox::func(0, "Foo", "Bar"); \
- int x3 = QMessageBox::func(0, "Foo", "Bar", "Save"); \
- int x6 = QMessageBox::func(0, "Foo", "Bar", "Save", "Save As"); \
- int x7 = QMessageBox::func(0, "Foo", "Bar", "Save", "Save As", "Dont Save"); \
- int x8 = QMessageBox::func(0, "Foo", "Bar", "Save", "Save As", "Dont Save", 1); \
- int x9 = QMessageBox::func(0, "Foo", "Bar", "Save", "Save As", "Dont Save", 1, 2); \
- int x10 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::YesAll, QMessageBox::Yes); \
- int x11 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::YesAll, QMessageBox::Yes, \
- QMessageBox::No); \
- qDebug("%d %d %d %d %d %d %d %d", x1, x3, x6, x7, x8, x9, x10, x11); \
- { \
- int x4 = QMessageBox::func(0, "Foo", "Bar", (int)QMessageBox::Yes, (int)QMessageBox::No); \
- int x5 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::Yes, (int)QMessageBox::No); \
- int x6 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::Yes | QMessageBox::Default, (int)QMessageBox::No); \
- int x7 = QMessageBox::func(0, "Foo", "Bar", (int)QMessageBox::Yes, QMessageBox::No); \
- int x8 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::Yes, QMessageBox::No); \
- int x9 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::Yes | QMessageBox::Default, QMessageBox::No); \
- int x10 = QMessageBox::func(0, "Foo", "Bar", (int)QMessageBox::Yes, (int)QMessageBox::No, (int)QMessageBox::Ok); \
- int x11 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::Yes, (int)QMessageBox::No, (int)QMessageBox::Ok); \
- int x12 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::Yes | QMessageBox::Default, (int)QMessageBox::No, (int)QMessageBox::Ok); \
- int x13 = QMessageBox::func(0, "Foo", "Bar", (int)QMessageBox::Yes, QMessageBox::No, (int)QMessageBox::Ok); \
- int x14 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::Yes, QMessageBox::No, (int)QMessageBox::Ok); \
- int x15 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, (int)QMessageBox::Ok); \
- int x16 = QMessageBox::func(0, "Foo", "Bar", (int)QMessageBox::Yes, (int)QMessageBox::No, QMessageBox::Ok); \
- int x17 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::Yes, (int)QMessageBox::No, QMessageBox::Ok); \
- int x18 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::Yes | QMessageBox::Default, (int)QMessageBox::No, QMessageBox::Ok); \
- int x19 = QMessageBox::func(0, "Foo", "Bar", (int)QMessageBox::Yes, QMessageBox::No, QMessageBox::Ok); \
- int x20 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::Yes, QMessageBox::No, QMessageBox::Ok); \
- int x21 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, QMessageBox::Ok); \
- qDebug("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d", x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21); \
- } \
- }
-
-#define CONVENIENCE_FUNC_SYMS_EXTRA(func) \
- { \
- int x1 = QMessageBox::func(0, "Foo", "Bar", (int)QMessageBox::Yes); \
- int x2 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::Yes); \
- int x3 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::Yes | QMessageBox::Default); \
- qDebug("%d %d %d", x1, x2, x3); \
- }
-
class tst_QMessageBox : public QObject
{
Q_OBJECT
@@ -103,13 +60,16 @@ private slots:
void staticSourceCompat();
void instanceSourceCompat();
- void testSymbols();
void incorrectDefaultButton();
void updateSize();
void setInformativeText();
void iconPixmap();
+ // QTBUG-44131
+ void acceptedRejectedSignals();
+ void acceptedRejectedSignals_data();
+
void cleanup();
};
@@ -210,9 +170,9 @@ void tst_QMessageBox::button()
{
QMessageBox msgBox;
msgBox.addButton("retry", QMessageBox::DestructiveRole);
- QVERIFY(msgBox.button(QMessageBox::Ok) == 0); // not added yet
+ QVERIFY(msgBox.button(QMessageBox::Ok) == nullptr); // not added yet
QPushButton *b1 = msgBox.addButton(QMessageBox::Ok);
- QCOMPARE(msgBox.button(QMessageBox::Ok), (QAbstractButton *)b1); // just added
+ QCOMPARE(msgBox.button(QMessageBox::Ok), static_cast<QAbstractButton *>(b1)); // just added
QCOMPARE(msgBox.standardButton(b1), QMessageBox::Ok);
msgBox.addButton(QMessageBox::Cancel);
QCOMPARE(msgBox.standardButtons(), QMessageBox::Ok | QMessageBox::Cancel);
@@ -220,12 +180,12 @@ void tst_QMessageBox::button()
// remove the cancel, should not exist anymore
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
QVERIFY(!msgBox.button(QMessageBox::Cancel));
- QVERIFY(msgBox.button(QMessageBox::Yes) != 0);
+ QVERIFY(msgBox.button(QMessageBox::Yes) != nullptr);
// should not crash
QPushButton *b4 = new QPushButton;
msgBox.addButton(b4, QMessageBox::DestructiveRole);
- msgBox.addButton(0, QMessageBox::ActionRole);
+ msgBox.addButton(nullptr, QMessageBox::ActionRole);
}
void tst_QMessageBox::defaultButton()
@@ -237,7 +197,7 @@ void tst_QMessageBox::defaultButton()
QVERIFY(!msgBox.defaultButton());
QPushButton pushButton;
msgBox.setDefaultButton(&pushButton);
- QVERIFY(msgBox.defaultButton() == 0); // we have not added it yet
+ QVERIFY(msgBox.defaultButton() == nullptr); // we have not added it yet
QPushButton *retryButton = msgBox.addButton(QMessageBox::Retry);
msgBox.setDefaultButton(retryButton);
QCOMPARE(msgBox.defaultButton(), retryButton);
@@ -248,11 +208,11 @@ void tst_QMessageBox::defaultButton()
closeHelper.start(Qt::Key_Enter, &msgBox);
msgBox.exec();
- QCOMPARE(msgBox.clickedButton(), (QAbstractButton *)retryButton);
+ QCOMPARE(msgBox.clickedButton(), static_cast<QAbstractButton *>(retryButton));
QAbstractButton *okButton = msgBox.button(QMessageBox::Ok);
msgBox.setDefaultButton(QMessageBox::Ok);
- QCOMPARE(msgBox.defaultButton(), (QPushButton *)okButton);
+ QCOMPARE(msgBox.defaultButton(), static_cast<QPushButton *>(okButton));
closeHelper.start(Qt::Key_Enter, &msgBox);
msgBox.exec();
QCOMPARE(msgBox.clickedButton(), okButton);
@@ -260,7 +220,7 @@ void tst_QMessageBox::defaultButton()
QCOMPARE(msgBox.defaultButton(), okButton);
msgBox.removeButton(okButton);
delete okButton;
- okButton = 0;
+ okButton = nullptr;
QVERIFY(!msgBox.defaultButton());
msgBox.setDefaultButton(QMessageBox::Ok);
QVERIFY(!msgBox.defaultButton());
@@ -287,7 +247,7 @@ void tst_QMessageBox::escapeButton()
QVERIFY(msgBox.clickedButton() == msgBox.button(QMessageBox::Cancel)); // auto detected (cancel)
msgBox.setEscapeButton(retryButton);
- QCOMPARE(msgBox.escapeButton(), (QAbstractButton *)retryButton);
+ QCOMPARE(msgBox.escapeButton(), static_cast<QAbstractButton *>(retryButton));
// with escape
closeHelper.start(Qt::Key_Escape, &msgBox);
@@ -297,7 +257,7 @@ void tst_QMessageBox::escapeButton()
// with close
closeHelper.start(ExecCloseHelper::CloseWindow, &msgBox);
msgBox.exec();
- QCOMPARE(msgBox.clickedButton(), (QAbstractButton *)retryButton);
+ QCOMPARE(msgBox.clickedButton(), static_cast<QAbstractButton *>(retryButton));
QAbstractButton *okButton = msgBox.button(QMessageBox::Ok);
msgBox.setEscapeButton(QMessageBox::Ok);
@@ -309,7 +269,7 @@ void tst_QMessageBox::escapeButton()
QCOMPARE(msgBox.escapeButton(), okButton);
msgBox.removeButton(okButton);
delete okButton;
- okButton = 0;
+ okButton = nullptr;
QVERIFY(!msgBox.escapeButton());
msgBox.setEscapeButton(QMessageBox::Ok);
QVERIFY(!msgBox.escapeButton());
@@ -353,28 +313,28 @@ void tst_QMessageBox::statics()
ExecCloseHelper closeHelper;
for (int i = 0; i < 4; i++) {
closeHelper.start(Qt::Key_Escape);
- QMessageBox::StandardButton sb = (*statics[i])(0, "caption",
+ QMessageBox::StandardButton sb = (*statics[i])(nullptr, "caption",
"text", QMessageBox::Yes | QMessageBox::No | QMessageBox::Help | QMessageBox::Cancel,
QMessageBox::NoButton);
QCOMPARE(sb, QMessageBox::Cancel);
QVERIFY(closeHelper.done());
closeHelper.start(ExecCloseHelper::CloseWindow);
- sb = (*statics[i])(0, "caption",
+ sb = (*statics[i])(nullptr, "caption",
"text", QMessageBox::Yes | QMessageBox::No | QMessageBox::Help | QMessageBox::Cancel,
QMessageBox::NoButton);
QCOMPARE(sb, QMessageBox::Cancel);
QVERIFY(closeHelper.done());
closeHelper.start(Qt::Key_Enter);
- sb = (*statics[i])(0, "caption",
+ sb = (*statics[i])(nullptr, "caption",
"text", QMessageBox::Yes | QMessageBox::No | QMessageBox::Help,
QMessageBox::Yes);
QCOMPARE(sb, QMessageBox::Yes);
QVERIFY(closeHelper.done());
closeHelper.start(Qt::Key_Enter);
- sb = (*statics[i])(0, "caption",
+ sb = (*statics[i])(nullptr, "caption",
"text", QMessageBox::Yes | QMessageBox::No | QMessageBox::Help,
QMessageBox::No);
QCOMPARE(sb, QMessageBox::No);
@@ -400,7 +360,7 @@ void tst_QMessageBox::about()
{
ExecCloseHelper closeHelper;
closeHelper.start(Qt::Key_Escape);
- QMessageBox::about(0, "Caption", "This is an auto test");
+ QMessageBox::about(nullptr, "Caption", "This is an auto test");
// On Mac, about and aboutQt are not modal, so we need to
// explicitly run the event loop
#ifdef Q_OS_MAC
@@ -412,7 +372,7 @@ void tst_QMessageBox::about()
const int keyToSend = Qt::Key_Enter;
closeHelper.start(keyToSend);
- QMessageBox::aboutQt(0, "Caption");
+ QMessageBox::aboutQt(nullptr, "Caption");
#ifdef Q_OS_MAC
QTRY_VERIFY(closeHelper.done());
#else
@@ -427,7 +387,7 @@ void tst_QMessageBox::staticSourceCompat()
// source compat tests for < 4.2
ExecCloseHelper closeHelper;
closeHelper.start(Qt::Key_Enter);
- ret = QMessageBox::information(0, "title", "text", QMessageBox::Yes, QMessageBox::No);
+ ret = QMessageBox::information(nullptr, "title", "text", QMessageBox::Yes, QMessageBox::No);
int expectedButton = int(QMessageBox::Yes);
if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()) {
const int dialogButtonBoxLayout = theme->themeHint(QPlatformTheme::DialogButtonBoxLayout).toInt();
@@ -439,39 +399,39 @@ void tst_QMessageBox::staticSourceCompat()
QVERIFY(closeHelper.done());
closeHelper.start(Qt::Key_Enter);
- ret = QMessageBox::information(0, "title", "text", QMessageBox::Yes | QMessageBox::Default, QMessageBox::No);
+ ret = QMessageBox::information(nullptr, "title", "text", QMessageBox::Yes | QMessageBox::Default, QMessageBox::No);
QCOMPARE(ret, int(QMessageBox::Yes));
QVERIFY(closeHelper.done());
closeHelper.start(Qt::Key_Enter);
- ret = QMessageBox::information(0, "title", "text", QMessageBox::Yes, QMessageBox::No | QMessageBox::Default);
+ ret = QMessageBox::information(nullptr, "title", "text", QMessageBox::Yes, QMessageBox::No | QMessageBox::Default);
QCOMPARE(ret, int(QMessageBox::No));
QVERIFY(closeHelper.done());
closeHelper.start(Qt::Key_Enter);
- ret = QMessageBox::information(0, "title", "text", QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape);
+ ret = QMessageBox::information(nullptr, "title", "text", QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape);
QCOMPARE(ret, int(QMessageBox::Yes));
QVERIFY(closeHelper.done());
closeHelper.start(Qt::Key_Enter);
- ret = QMessageBox::information(0, "title", "text", QMessageBox::Yes | QMessageBox::Escape, QMessageBox::No | QMessageBox::Default);
+ ret = QMessageBox::information(nullptr, "title", "text", QMessageBox::Yes | QMessageBox::Escape, QMessageBox::No | QMessageBox::Default);
QCOMPARE(ret, int(QMessageBox::No));
QVERIFY(closeHelper.done());
// the button text versions
closeHelper.start(Qt::Key_Enter);
- ret = QMessageBox::information(0, "title", "text", "Yes", "No", QString(), 1);
+ ret = QMessageBox::information(nullptr, "title", "text", "Yes", "No", QString(), 1);
QCOMPARE(ret, 1);
QVERIFY(closeHelper.done());
if (0) { // don't run these tests since the dialog won't close!
closeHelper.start(Qt::Key_Escape);
- ret = QMessageBox::information(0, "title", "text", "Yes", "No", QString(), 1);
+ ret = QMessageBox::information(nullptr, "title", "text", "Yes", "No", QString(), 1);
QCOMPARE(ret, -1);
QVERIFY(closeHelper.done());
closeHelper.start(Qt::Key_Escape);
- ret = QMessageBox::information(0, "title", "text", "Yes", "No", QString(), 0, 1);
+ ret = QMessageBox::information(nullptr, "title", "text", "Yes", "No", QString(), 0, 1);
QCOMPARE(ret, 1);
QVERIFY(closeHelper.done());
}
@@ -505,96 +465,6 @@ void tst_QMessageBox::instanceSourceCompat()
#endif
}
-void tst_QMessageBox::testSymbols()
-{
- return;
-
- QMessageBox::Icon icon;
- icon = QMessageBox::NoIcon;
- icon = QMessageBox::Information;
- icon = QMessageBox::Warning;
- icon = QMessageBox::Critical;
- icon = QMessageBox::Question;
-
- QMessageBox mb1;
- QMessageBox mb2(0);
- QMessageBox mb3(&mb1);
- QMessageBox mb3b("title", "text", QMessageBox::Critical, int(QMessageBox::Yes),
- int(QMessageBox::No), int(QMessageBox::Cancel), &mb1, Qt::Dialog);
-
- QMessageBox::Button button = QMessageBox::NoButton;
- button = QMessageBox::Ok;
- button = QMessageBox::Cancel;
- button = QMessageBox::Yes;
- button = QMessageBox::No;
- button = QMessageBox::Abort;
- button = QMessageBox::Retry;
- button = QMessageBox::Ignore;
- button = QMessageBox::YesAll;
- button = QMessageBox::NoAll;
- button = QMessageBox::ButtonMask;
- button = QMessageBox::Default;
- button = QMessageBox::Escape;
- button = QMessageBox::FlagMask;
- QVERIFY(button);
-
- const QString text = QStringLiteral("Foo");
- mb1.setText(text);
- QCOMPARE(mb1.text(), text);
-
- icon = mb1.icon();
- QCOMPARE(icon, QMessageBox::NoIcon);
- mb1.setIcon(QMessageBox::Question);
- QCOMPARE(mb1.icon(), QMessageBox::Question);
-
- QPixmap iconPixmap = mb1.iconPixmap();
- mb1.setIconPixmap(iconPixmap);
- QCOMPARE(mb1.icon(), QMessageBox::NoIcon);
-
- QCOMPARE(mb1.buttonText(QMessageBox::Ok), QLatin1String("OK"));
- QCOMPARE(mb1.buttonText(QMessageBox::Cancel), QString());
- QCOMPARE(mb1.buttonText(QMessageBox::Ok | QMessageBox::Default), QString());
-
- const QString button1 = QStringLiteral("Bar");
- mb2.setButtonText(QMessageBox::Cancel, QStringLiteral("Foo"));
- mb2.setButtonText(QMessageBox::Ok, button1);
- mb2.setButtonText(QMessageBox::Ok | QMessageBox::Default, QStringLiteral("Baz"));
-
- QCOMPARE(mb2.buttonText(QMessageBox::Cancel), QString());
- QCOMPARE(mb2.buttonText(QMessageBox::Ok), button1);
-
- QVERIFY(mb3b.buttonText(QMessageBox::Yes).endsWith("Yes"));
- QCOMPARE(mb3b.buttonText(QMessageBox::YesAll), QString());
- QCOMPARE(mb3b.buttonText(QMessageBox::Ok), QString());
-
- const QString button2 = QStringLiteral("Blah");
- mb3b.setButtonText(QMessageBox::Yes, button2);
- mb3b.setButtonText(QMessageBox::YesAll, QStringLiteral("Zoo"));
- mb3b.setButtonText(QMessageBox::Ok, QStringLiteral("Zoo"));
-
- QCOMPARE(mb3b.buttonText(QMessageBox::Yes), button2);
- QCOMPARE(mb3b.buttonText(QMessageBox::YesAll), QString());
- QCOMPARE(mb3b.buttonText(QMessageBox::Ok), QString());
-
- QCOMPARE(mb1.textFormat(), Qt::AutoText);
- mb1.setTextFormat(Qt::PlainText);
- QCOMPARE(mb1.textFormat(), Qt::PlainText);
-
- CONVENIENCE_FUNC_SYMS(information);
- CONVENIENCE_FUNC_SYMS_EXTRA(information);
- CONVENIENCE_FUNC_SYMS(question);
- CONVENIENCE_FUNC_SYMS_EXTRA(question);
- CONVENIENCE_FUNC_SYMS(warning);
- CONVENIENCE_FUNC_SYMS(critical);
-
- QSize sizeHint = mb1.sizeHint();
- QVERIFY(sizeHint.width() > 20 && sizeHint.height() > 20);
-
- QMessageBox::about(&mb1, "title", "text");
- QMessageBox::aboutQt(&mb1);
- QMessageBox::aboutQt(&mb1, "title");
-}
-
void tst_QMessageBox::detailsText()
{
QMessageBox box;
@@ -618,9 +488,8 @@ void tst_QMessageBox::detailsButtonText()
QDialogButtonBox* bb = box.findChild<QDialogButtonBox*>("qt_msgbox_buttonbox");
QVERIFY(bb); //get the detail button
- QList<QAbstractButton *> list = bb->buttons();
- QAbstractButton* btn = NULL;
- foreach(btn, list) {
+ auto list = bb->buttons();
+ for (auto btn : list) {
if (btn && (btn->inherits("QPushButton"))) {
if (btn->text().remove(QLatin1Char('&')) != QMessageBox::tr("OK")
&& btn->text() != QMessageBox::tr("Show Details...")) {
@@ -640,12 +509,12 @@ void tst_QMessageBox::expandDetails_QTBUG_32473()
QDialogButtonBox* bb = box.findChild<QDialogButtonBox*>("qt_msgbox_buttonbox");
QVERIFY(bb);
- QList<QAbstractButton *> list = bb->buttons();
- QAbstractButton* moreButton = NULL;
- foreach (QAbstractButton* btn, list)
- if (btn && bb->buttonRole(btn) == QDialogButtonBox::ActionRole)
- moreButton = btn;
- QVERIFY(moreButton);
+ auto list = bb->buttons();
+ auto it = std::find_if(list.rbegin(), list.rend(), [&](QAbstractButton *btn) {
+ return btn && bb->buttonRole(btn) == QDialogButtonBox::ActionRole; });
+ QVERIFY(it != list.rend());
+ auto moreButton = *it;
+
QVERIFY(QTest::qWaitForWindowExposed(&box));
QRect geom = box.geometry();
box.resized = false;
@@ -667,19 +536,19 @@ void tst_QMessageBox::incorrectDefaultButton()
closeHelper.start(Qt::Key_Escape);
//Do not crash here
QTest::ignoreMessage(QtWarningMsg, "QDialogButtonBox::createButton: Invalid ButtonRole, button not added");
- QMessageBox::question( 0, "", "I've been hit!",QMessageBox::Ok | QMessageBox::Cancel,QMessageBox::Save );
+ QMessageBox::question(nullptr, "", "I've been hit!",QMessageBox::Ok | QMessageBox::Cancel,QMessageBox::Save);
QVERIFY(closeHelper.done());
closeHelper.start(Qt::Key_Escape);
QTest::ignoreMessage(QtWarningMsg, "QDialogButtonBox::createButton: Invalid ButtonRole, button not added");
- QMessageBox::question( 0, "", "I've been hit!",QFlag(QMessageBox::Ok | QMessageBox::Cancel),QMessageBox::Save );
+ QMessageBox::question(nullptr, "", "I've been hit!",QFlag(QMessageBox::Ok | QMessageBox::Cancel),QMessageBox::Save);
QVERIFY(closeHelper.done());
closeHelper.start(Qt::Key_Escape);
QTest::ignoreMessage(QtWarningMsg, "QDialogButtonBox::createButton: Invalid ButtonRole, button not added");
QTest::ignoreMessage(QtWarningMsg, "QDialogButtonBox::createButton: Invalid ButtonRole, button not added");
//do not crash here -> call old function of QMessageBox in this case
- QMessageBox::question( 0, "", "I've been hit!",QMessageBox::Ok | QMessageBox::Cancel,QMessageBox::Save | QMessageBox::Cancel,QMessageBox::Ok);
+ QMessageBox::question(nullptr, "", "I've been hit!",QMessageBox::Ok | QMessageBox::Cancel,QMessageBox::Save | QMessageBox::Cancel,QMessageBox::Ok);
QVERIFY(closeHelper.done());
}
@@ -718,5 +587,96 @@ void tst_QMessageBox::iconPixmap()
QCOMPARE(messageBox.iconPixmap(), QPixmap());
}
+using SignalSignature = void(QDialog::*)();
+Q_DECLARE_METATYPE(SignalSignature);
+Q_DECLARE_METATYPE(QMessageBox::ButtonRole)
+
+using ButtonsCreator = std::function<QVector<QPushButton*>(QMessageBox &)>;
+Q_DECLARE_METATYPE(ButtonsCreator);
+
+using RoleSet = QSet<QMessageBox::ButtonRole>;
+Q_DECLARE_METATYPE(RoleSet);
+
+void tst_QMessageBox::acceptedRejectedSignals()
+{
+ QMessageBox messageBox(QMessageBox::Information, "Test window", "Test text");
+
+ QFETCH(ButtonsCreator, buttonsCreator);
+ QVERIFY(buttonsCreator);
+
+ const auto buttons = buttonsCreator(messageBox);
+ QVERIFY(!buttons.isEmpty());
+
+ QFETCH(RoleSet, roles);
+ QFETCH(SignalSignature, signalSignature);
+ for (auto button: buttons) {
+ QVERIFY(button);
+
+ messageBox.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&messageBox));
+
+ QSignalSpy spy(&messageBox, signalSignature);
+ QVERIFY(spy.isValid());
+ button->click();
+
+ if (roles.contains(messageBox.buttonRole(button)))
+ QCOMPARE(spy.count(), 1);
+ else
+ QVERIFY(spy.isEmpty());
+ }
+}
+
+static void addAcceptedRow(const char *title, ButtonsCreator bc)
+{
+ QTest::newRow(title) << (RoleSet() << QMessageBox::AcceptRole << QMessageBox::YesRole)
+ << &QDialog::accepted << bc;
+}
+
+static void addRejectedRow(const char *title, ButtonsCreator bc)
+{
+ QTest::newRow(title) << (RoleSet() << QMessageBox::RejectRole << QMessageBox::NoRole)
+ << &QDialog::rejected << bc;
+}
+
+static void addCustomButtonsData()
+{
+ ButtonsCreator buttonsCreator = [](QMessageBox &messageBox) {
+ QVector<QPushButton*> buttons(QMessageBox::NRoles);
+ for (int i = QMessageBox::AcceptRole; i < QMessageBox::NRoles; ++i) {
+ buttons[i] = messageBox.addButton(
+ QString("Button role: %1").arg(i), QMessageBox::ButtonRole(i));
+ }
+
+ return buttons;
+ };
+
+ addAcceptedRow("Accepted_CustomButtons", buttonsCreator);
+ addRejectedRow("Rejected_CustomButtons", buttonsCreator);
+}
+
+static void addStandardButtonsData()
+{
+ ButtonsCreator buttonsCreator = [](QMessageBox &messageBox) {
+ QVector<QPushButton*> buttons;
+ for (int i = QMessageBox::FirstButton; i <= QMessageBox::LastButton; i <<= 1)
+ buttons << messageBox.addButton(QMessageBox::StandardButton(i));
+
+ return buttons;
+ };
+
+ addAcceptedRow("Accepted_StandardButtons", buttonsCreator);
+ addRejectedRow("Rejected_StandardButtons", buttonsCreator);
+}
+
+void tst_QMessageBox::acceptedRejectedSignals_data()
+{
+ QTest::addColumn<RoleSet>("roles");
+ QTest::addColumn<SignalSignature>("signalSignature");
+ QTest::addColumn<ButtonsCreator>("buttonsCreator");
+
+ addStandardButtonsData();
+ addCustomButtonsData();
+}
+
QTEST_MAIN(tst_QMessageBox)
#include "tst_qmessagebox.moc"
diff --git a/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp b/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp
index ab746dfee8..1b95b5a3ca 100644
--- a/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp
+++ b/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp
@@ -1264,19 +1264,47 @@ void tst_QTableView::moveCursorStrikesBack_data()
for (int i = 0; i < 7; ++i)
fullList << i;
- QTest::newRow("All disabled, wrap forward. Timeout => FAIL") << -1 << -1
+ QTest::newRow("All disabled, wrap forward. => invalid index") << -1 << -1
<< fullList
<< fullList
<< QRect()
<< 1 << 0 << (IntList() << int(QtTestTableView::MoveNext))
- << 1 << 0;
+ << -1 << -1;
- QTest::newRow("All disabled, wrap backwards. Timeout => FAIL") << -1 << -1
+ QTest::newRow("All disabled, wrap backwards. => invalid index") << -1 << -1
<< fullList
<< fullList
<< QRect()
<< 1 << 0 << (IntList() << int(QtTestTableView::MovePrevious))
+ << -1 << -1;
+
+ QTest::newRow("Last column disabled, MoveEnd. QTBUG-72400") << -1 << -1
+ << IntList()
+ << (IntList() << 6)
+ << QRect()
+ << 0 << 0 << (IntList() << int(QtTestTableView::MoveEnd))
+ << 0 << 5;
+
+ QTest::newRow("First column disabled, MoveHome. QTBUG-72400") << -1 << -1
+ << IntList()
+ << (IntList() << 0)
+ << QRect()
+ << 0 << 6 << (IntList() << int(QtTestTableView::MoveHome))
+ << 0 << 1;
+
+ QTest::newRow("First row disabled, MovePageUp. QTBUG-72400") << -1 << -1
+ << (IntList() << 0)
+ << IntList()
+ << QRect()
+ << 2 << 0 << (IntList() << int(QtTestTableView::MovePageUp))
<< 1 << 0;
+
+ QTest::newRow("Last row disabled, MovePageDown. QTBUG-72400") << -1 << -1
+ << (IntList() << 6)
+ << IntList()
+ << QRect()
+ << 4 << 0 << (IntList() << int(QtTestTableView::MovePageDown))
+ << 5 << 0;
}
void tst_QTableView::moveCursorStrikesBack()
@@ -1302,6 +1330,9 @@ void tst_QTableView::moveCursorStrikesBack()
if (span.height() && span.width())
view.setSpan(span.top(), span.left(), span.height(), span.width());
view.show();
+ QVERIFY(QTest::qWaitForWindowActive(&view));
+ // resize to make sure there are scrollbars
+ view.resize(view.columnWidth(0) * 7, view.rowHeight(0) * 7);
QModelIndex index = model.index(startRow, startColumn);
view.setCurrentIndex(index);
@@ -1320,9 +1351,6 @@ void tst_QTableView::moveCursorStrikesBack()
newColumn = newIndex.column();
}
- // expected fails, task 119433
- if(newRow == -1)
- return;
QCOMPARE(newRow, expectedRow);
QCOMPARE(newColumn, expectedColumn);
}
diff --git a/tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp b/tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp
index 70ae453896..1a0d7a9289 100644
--- a/tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp
+++ b/tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp
@@ -467,160 +467,1001 @@ void tst_QAbstractSlider::keyPressed_data()
QTest::addColumn<int>("maximum");
QTest::addColumn<int>("stepSize");
QTest::addColumn<int>("pageSize");
+ QTest::addColumn<bool>("invertedAppearance");
+ QTest::addColumn<bool>("invertedControls");
QTest::addColumn<QList<Qt::Key> >("keySequence");
- QTest::addColumn<int>("expectedSliderPositionHorizontal");
- QTest::addColumn<int>("expectedSliderPositionVertical");
- QTest::addColumn<int>("expectedSliderPositionHorizontalInverted"); // :)
- QTest::addColumn<int>("expectedSliderPositionVerticalInverted");
-
+ QTest::addColumn<int>("expectedSliderPosition");
QList<Qt::Key> list;
-
list << Qt::Key_Down;
- QTest::newRow("Step down once 1") << 10 // initial position
- << 0 // minimum
- << 100 // maximum
- << 3 // single step size
- << 0 // page step size
- << list // key sequence
- << 7 // result in case of horizontal slider
- << 7 // result in case of vertical slider
- << 13 // result in case of inverted horiz. slider
- << 13; // result in case of inverted vertical slider
+ QTest::newRow("Step down once 1, horizontal")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 0 // page step size
+ << false// inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 7; // expected position
+
+ QTest::newRow("Step down once 1, horizontal, appearance inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 0 // page step size
+ << true // inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 7; // expected position
+
+ QTest::newRow("Step down once 1, horizontal, controls inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 0 // page step size
+ << false// inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 13; // expected position
+
+ QTest::newRow("Step down once 1, horizontal, both inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 0 // page step size
+ << true // inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 13; // expected position
+
+ QTest::newRow("Step down once 1, vertical")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 0 // page step size
+ << false// inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 7; // expected position
+
+ QTest::newRow("Step down once 1, vertical, appearance inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 0 // page step size
+ << true // inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 7; // expected position
+
+ QTest::newRow("Step down once 1, vertical, controls inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 0 // page step size
+ << false// inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 13; // expected position
+
+ QTest::newRow("Step down once 1, vertical, both inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 0 // page step size
+ << true // inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 13; // expected position
list = QList<Qt::Key>();
list << Qt::Key_Up;
- QTest::newRow("Step down once 2") << 10 // initial position
- << 0 // minimum
- << 100 // maximum
- << 3 // single step size
- << 0 // page step size
- << list // key sequence
- << 13 // result in case of horizontal slider
- << 13 // result in case of vertical slider
- << 7 // result in case of inverted horiz. slider
- << 7; // result in case of inverted vertical slider
-
+ QTest::newRow("Step up once 2, horizontal")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 0 // page step size
+ << false// inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 13; // expected position
+
+ QTest::newRow("Step up once 2, horizontal, appearance inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 0 // page step size
+ << true // inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 13; // expected position
+
+ QTest::newRow("Step up once 2, horizontal, controls inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 0 // page step size
+ << false// inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 7; // expected position
+
+ QTest::newRow("Step up once 2, horizontal, both inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 0 // page step size
+ << true // inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 7; // expected position
+
+ QTest::newRow("Step up once 2, vertical")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 0 // page step size
+ << false// inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 13; // expected position
+
+ QTest::newRow("Step up once 2, vertical, appearance inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 0 // page step size
+ << true // inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 13; // expected position
+
+ QTest::newRow("Step up once 2, vertical, controls inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 0 // page step size
+ << false// inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 7; // expected position
+
+ QTest::newRow("Step up once 2, vertical, both inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 0 // page step size
+ << true // inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 7; // expected position
list = QList<Qt::Key>();
list << Qt::Key_Left;
- QTest::newRow("Step left once") << 10 // initial position
- << 0 // minimum
- << 100 // maximum
- << 3 // single step size
- << 0 // page step size
- << list // key sequence
- << 7 // result in case of horizontal slider
- << 7 // result in case of vertical slider
- << 13 // result in case of inverted horiz. slider
- << 13; // result in case of inverted vertical slider
+ QTest::newRow("Step left once 2, horizontal")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 0 // page step size
+ << false// inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 7; // expected position
+
+ QTest::newRow("Step left once 2, horizontal, appearance inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 0 // page step size
+ << true // inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 7; // expected position
+
+ QTest::newRow("Step left once 2, horizontal, controls inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 0 // page step size
+ << false// inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 13; // expected position
+
+ QTest::newRow("Step left once 2, horizontal, both inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 0 // page step size
+ << true // inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 13; // expected position
+
+ QTest::newRow("Step left once 2, vertical")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 0 // page step size
+ << false// inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 7; // expected position
+
+ QTest::newRow("Step left once 2, vertical, appearance inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 0 // page step size
+ << true // inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 7; // expected position
+
+ QTest::newRow("Step left once 2, vertical, controls inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 0 // page step size
+ << false// inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 13; // expected position
+
+ QTest::newRow("Step left once 2, vertical, both inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 0 // page step size
+ << true // inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 13; // expected position
list = QList<Qt::Key>();
list << Qt::Key_Right;
- QTest::newRow("Step right once") << 10 // initial position
- << 0 // minimum
- << 100 // maximum
- << 3 // single step size
- << 0 // page step size
- << list // key sequence
- << 13 // result in case of horizontal slider
- << 13 // result in case of vertical slider
- << 7 // result in case of inverted horiz. slider
- << 7; // result in case of inverted vertical slider
+ QTest::newRow("Step right once 2, horizontal")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 0 // page step size
+ << false// inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 13; // expected position
+
+ QTest::newRow("Step right once 2, horizontal, appearance inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 0 // page step size
+ << true // inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 13; // expected position
+
+ QTest::newRow("Step right once 2, horizontal, controls inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 0 // page step size
+ << false// inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 7; // expected position
+
+ QTest::newRow("Step right once 2, horizontal, both inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 0 // page step size
+ << true // inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 7; // expected position
+
+ QTest::newRow("Step right once 2, vertical")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 0 // page step size
+ << false// inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 13; // expected position
+
+ QTest::newRow("Step right once 2, vertical, appearance inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 0 // page step size
+ << true // inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 13; // expected position
+
+ QTest::newRow("Step right once 2, vertical, controls inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 0 // page step size
+ << false// inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 7; // expected position
+
+ QTest::newRow("Step right once 2, vertical, both inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 0 // page step size
+ << true // inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 7; // expected position
list = QList<Qt::Key>();
list << Qt::Key_PageDown;
- QTest::newRow("Page down once") << 10 // initial position
- << 0 // minimum
- << 100 // maximum
- << 0 // single step size
- << 3 // page step size
- << list // key sequence
- << 7 // result in case of horizontal slider
- << 7 // result in case of vertical slider
- << 13 // result in case of inverted horiz. slider
- << 13; // result in case of inverted vertical slider
+ QTest::newRow("Page down once, horizontal")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 0 // single step size
+ << 3 // page step size
+ << false// inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 7; // expected position
+
+ QTest::newRow("Page down once, horizontal, appearance inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 0 // single step size
+ << 3 // page step size
+ << true // inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 7; // expected position
+
+ QTest::newRow("Page down once, horizontal, controls inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 0 // single step size
+ << 3 // page step size
+ << false// inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 13; // expected position
+
+ QTest::newRow("Page down once, horizontal, both inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 0 // single step size
+ << 3 // page step size
+ << true // inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 13; // expected position
+
+ QTest::newRow("Page down once, vertical")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 0 // single step size
+ << 3 // page step size
+ << false// inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 7; // expected position
+
+ QTest::newRow("Page down once, vertical, appearance inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 0 // single step size
+ << 3 // page step size
+ << true // inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 7; // expected position
+
+ QTest::newRow("Page down once, vertical, controls inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 0 // single step size
+ << 3 // page step size
+ << false// inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 13; // expected position
+
+ QTest::newRow("Page down once, vertical, both inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 0 // single step size
+ << 3 // page step size
+ << true // inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 13; // expected position
list = QList<Qt::Key>();
list << Qt::Key_PageUp;
- QTest::newRow("Page up once") << 10 // initial position
- << 0 // minimum
- << 100 // maximum
- << 0 // single step size
- << 3 // page step size
- << list // key sequence
- << 13 // result in case of horizontal slider
- << 13 // result in case of vertical slider
- << 7 // result in case of inverted horiz. slider
- << 7; // result in case of inverted vertical slider
+ QTest::newRow("Page up once, horizontal")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 0 // single step size
+ << 3 // page step size
+ << false// inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 13; // expected position
+
+ QTest::newRow("Page up once, horizontal, appearance inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 0 // single step size
+ << 3 // page step size
+ << true // inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 13; // expected position
+
+ QTest::newRow("Page up once, horizontal, controls inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 0 // single step size
+ << 3 // page step size
+ << false// inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 7; // expected position
+
+ QTest::newRow("Page up once, horizontal, both inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 0 // single step size
+ << 3 // page step size
+ << true // inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 7; // expected position
+
+ QTest::newRow("Page up once, vertical")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 0 // single step size
+ << 3 // page step size
+ << false// inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 13; // expected position
+
+ QTest::newRow("Page up once, vertical, appearance inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 0 // single step size
+ << 3 // page step size
+ << true // inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 13; // expected position
+
+ QTest::newRow("Page up once, vertical, controls inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 0 // single step size
+ << 3 // page step size
+ << false// inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 7; // expected position
+
+ QTest::newRow("Page up once, vertical, both inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 0 // single step size
+ << 3 // page step size
+ << true // inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 7; // expected position
list = QList<Qt::Key>();
list << Qt::Key_Up << Qt::Key_Up << Qt::Key_PageDown << Qt::Key_PageDown << Qt::Key_Left << Qt::Key_Left
<< Qt::Key_Right << Qt::Key_Down << Qt::Key_PageUp << Qt::Key_PageUp << Qt::Key_Down << Qt::Key_Right;
- QTest::newRow("Symmetric seq") << 50 // initial position
- << 0 // minimum
- << 100 // maximum
- << 3 // single step size
- << 3 // page step size
- << list // key sequence
- << 50 // result in case of horizontal slider
- << 50 // result in case of vertical slider
- << 50 // result in case of inverted horiz. slider
- << 50; // result in case of inverted vertical slider
-
+ QTest::newRow("Symmetric seq, horizontal")
+ << 50 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 3 // page step size
+ << false// inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 50; // expected position
+
+ QTest::newRow("Symmetric seq, horizontal, appearance inverted")
+ << 50 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 3 // page step size
+ << true // inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 50; // expected position
+
+ QTest::newRow("Symmetric seq, horizontal, controls inverted")
+ << 50 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 3 // page step size
+ << false// inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 50; // expected position
+
+ QTest::newRow("Symmetric seq, horizontal, both inverted")
+ << 50 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 3 // page step size
+ << true // inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 50; // expected position
+
+ QTest::newRow("Symmetric seq, vertical")
+ << 50 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 3 // page step size
+ << false// inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 50; // expected position
+
+ QTest::newRow("Symmetric seq, vertical, appearance inverted")
+ << 50 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 3 // page step size
+ << true // inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 50; // expected position
+
+ QTest::newRow("Symmetric seq, vertical, controls inverted")
+ << 50 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 3 // page step size
+ << false// inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 50; // expected position
+
+ QTest::newRow("Symmetric seq, vertical, both inverted")
+ << 50 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 3 // page step size
+ << true // inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 50; // expected position
list = QList<Qt::Key>();
list << Qt::Key_Home;
- QTest::newRow("Home") << 10 // initial position
- << 0 // minimum
- << 100 // maximum
- << 0 // single step size
- << 3 // page step size
- << list // key sequence
- << 0 // result in case of horizontal slider
- << 0 // result in case of vertical slider
- << 0 // result in case of inverted horiz. slider
- << 0; // result in case of inverted vertical slider
+ QTest::newRow("Home, horizontal")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 0 // single step size
+ << 3 // page step size
+ << false// inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 0; // expected position
+
+ QTest::newRow("Home, horizontal, appearance inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 0 // single step size
+ << 3 // page step size
+ << true // inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 0; // expected position
+
+ QTest::newRow("Home, horizontal, controls inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 0 // single step size
+ << 3 // page step size
+ << false// inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 0; // expected position
+
+ QTest::newRow("Home, horizontal, both inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 0 // single step size
+ << 3 // page step size
+ << true // inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 0; // expected position
+
+ QTest::newRow("Home, vertical")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 0 // single step size
+ << 3 // page step size
+ << false// inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 0; // expected position
+
+ QTest::newRow("Home, vertical, appearance inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 0 // single step size
+ << 3 // page step size
+ << true // inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 0; // expected position
+
+ QTest::newRow("Home, vertical, controls inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 0 // single step size
+ << 3 // page step size
+ << false// inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 0; // expected position
+
+ QTest::newRow("Home, vertical, both inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 0 // single step size
+ << 3 // page step size
+ << true // inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 0; // expected position
list = QList<Qt::Key>();
list << Qt::Key_End;
- QTest::newRow("End") << 10 // initial position
- << 0 // minimum
- << 100 // maximum
- << 0 // single step size
- << 3 // page step size
- << list // key sequence
- << 100 // result in case of horizontal slider
- << 100 // result in case of vertical slider
- << 100 // result in case of inverted horiz. slider
- << 100; // result in case of inverted vertical slider
+ QTest::newRow("End, horizontal")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 0 // single step size
+ << 3 // page step size
+ << false// inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 100; // expected position
+
+ QTest::newRow("End, horizontal, appearance inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 0 // single step size
+ << 3 // page step size
+ << true // inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 100; // expected position
+
+ QTest::newRow("End, horizontal, controls inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 0 // single step size
+ << 3 // page step size
+ << false// inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 100; // expected position
+
+ QTest::newRow("End, horizontal, both inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 0 // single step size
+ << 3 // page step size
+ << true // inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 100; // expected position
+
+ QTest::newRow("End, vertical")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 0 // single step size
+ << 3 // page step size
+ << false// inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 100; // expected position
+
+ QTest::newRow("End, vertical, appearance inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 0 // single step size
+ << 3 // page step size
+ << true // inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 100; // expected position
+
+ QTest::newRow("End, vertical, controls inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 0 // single step size
+ << 3 // page step size
+ << false// inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 100; // expected position
+
+ QTest::newRow("End, vertical, both inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 0 // single step size
+ << 3 // page step size
+ << true // inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 100; // expected position
list = QList<Qt::Key>();
list << Qt::Key_End << Qt::Key_Up;
- QTest::newRow("Past end")<< 10 // initial position
- << 0 // minimum
- << 100 // maximum
- << 3 // single step size
- << 3 // page step size
- << list // key sequence
- << 100 // result in case of horizontal slider
- << 100 // result in case of vertical slider
- << 97 // result in case of inverted horiz. slider
- << 97; // result in case of inverted vertical slider
+ QTest::newRow("Past end, horizontal")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 3 // page step size
+ << false// inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 100; // expected position
+
+ QTest::newRow("Past end, horizontal, appearance inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 3 // page step size
+ << true // inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 100; // expected position
+
+ QTest::newRow("Past end, horizontal, controls inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 3 // page step size
+ << false// inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 97; // expected position
+
+ QTest::newRow("Past end, horizontal, both inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 3 // page step size
+ << true // inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 97; // expected position
+
+ QTest::newRow("Past end, vertical")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 3 // page step size
+ << false// inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 100; // expected position
+
+ QTest::newRow("Past end, vertical, appearance inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 3 // page step size
+ << true // inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 100; // expected position
+
+ QTest::newRow("Past end, vertical, controls inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 3 // page step size
+ << false// inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 97; // expected position
+
+ QTest::newRow("Past end, vertical, both inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 3 // page step size
+ << true // inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 97; // expected position
list = QList<Qt::Key>();
list << Qt::Key_Home << Qt::Key_Down;
- QTest::newRow("Past home")<< 10 // initial position
- << 0 // minimum
- << 100 // maximum
- << 3 // single step size
- << 3 // page step size
- << list // key sequence
- << 0 // result in case of horizontal slider
- << 0 // result in case of vertical slider
- << 3 // result in case of inverted horiz. slider
- << 3; // result in case of inverted vertical slider
-
+ QTest::newRow("Past home, horizontal")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 3 // page step size
+ << false// inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 0; // expected position
+
+ QTest::newRow("Past home, horizontal, appearance inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 3 // page step size
+ << true // inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 0; // expected position
+
+ QTest::newRow("Past home, horizontal, controls inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 3 // page step size
+ << false// inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 3; // expected position
+
+ QTest::newRow("Past home, horizontal, both inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 3 // page step size
+ << true // inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 3; // expected position
+
+ QTest::newRow("Past home, vertical")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 3 // page step size
+ << false// inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 0; // expected position
+
+ QTest::newRow("Past home, vertical, appearance inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 3 // page step size
+ << false// inverted appearance
+ << false// inverted controls
+ << list // key sequence
+ << 0; // expected position
+
+ QTest::newRow("Past home, vertical, controls inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 3 // page step size
+ << false// inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 3; // expected position
+
+ QTest::newRow("Past home, vertical, both inverted")
+ << 10 // initial position
+ << 0 // minimum
+ << 100 // maximum
+ << 3 // single step size
+ << 3 // page step size
+ << true // inverted appearance
+ << true // inverted controls
+ << list // key sequence
+ << 3; // expected position
}
void tst_QAbstractSlider::keyPressed()
@@ -630,60 +1471,22 @@ void tst_QAbstractSlider::keyPressed()
QFETCH(int, maximum);
QFETCH(int, stepSize);
QFETCH(int, pageSize);
+ QFETCH(bool, invertedAppearance);
+ QFETCH(bool, invertedControls);
QFETCH(QList<Qt::Key>, keySequence);
- QFETCH(int, expectedSliderPositionHorizontal);
- QFETCH(int, expectedSliderPositionVertical);
- QFETCH(int, expectedSliderPositionHorizontalInverted);
- QFETCH(int, expectedSliderPositionVerticalInverted);
+ QFETCH(int, expectedSliderPosition);
- // Horizontal non-inverted
slider->setRange(minimum,maximum);
slider->setSliderPosition(initialSliderPosition);
slider->setSingleStep(stepSize);
slider->setPageStep(pageSize);
slider->setOrientation(Qt::Horizontal);
- slider->setInvertedAppearance(false);
- slider->setInvertedControls(false);
+ slider->setInvertedAppearance(invertedAppearance);
+ slider->setInvertedControls(invertedControls);
for (int i=0;i<keySequence.count();i++) {
QTest::keyClick(slider, keySequence.at(i));
}
- QCOMPARE(slider->sliderPosition(), expectedSliderPositionHorizontal);
-
- // Horizontal inverted
- slider->setRange(minimum,maximum);
- slider->setSliderPosition(initialSliderPosition);
- slider->setSingleStep(stepSize);
- slider->setPageStep(pageSize);
- slider->setOrientation(Qt::Horizontal);
- slider->setInvertedAppearance(true);
- slider->setInvertedControls(true);
- for (int i=0;i<keySequence.count();i++)
- QTest::keyPress(slider, keySequence.at(i));
- QCOMPARE(slider->sliderPosition(), expectedSliderPositionHorizontalInverted);
-
- // Vertical non-inverted
- slider->setRange(minimum,maximum);
- slider->setSliderPosition(initialSliderPosition);
- slider->setSingleStep(stepSize);
- slider->setPageStep(pageSize);
- slider->setOrientation(Qt::Vertical);
- slider->setInvertedAppearance(false);
- slider->setInvertedControls(false);
- for (int i=0;i<keySequence.count();i++)
- QTest::keyPress(slider, keySequence.at(i));
- QCOMPARE(slider->sliderPosition(), expectedSliderPositionVertical);
-
- // Vertical inverted
- slider->setRange(minimum,maximum);
- slider->setSliderPosition(initialSliderPosition);
- slider->setSingleStep(stepSize);
- slider->setPageStep(pageSize);
- slider->setOrientation(Qt::Vertical);
- slider->setInvertedAppearance(true);
- slider->setInvertedControls(true);
- for (int i=0;i<keySequence.count();i++)
- QTest::keyPress(slider, keySequence.at(i));
- QCOMPARE(slider->sliderPosition(), expectedSliderPositionVerticalInverted);
+ QCOMPARE(slider->sliderPosition(), expectedSliderPosition);
}
#if QT_CONFIG(wheelevent)
diff --git a/tests/manual/textrendering/nativetext/main.cpp b/tests/manual/textrendering/nativetext/main.cpp
index 5c7621e61f..b481e44bae 100644
--- a/tests/manual/textrendering/nativetext/main.cpp
+++ b/tests/manual/textrendering/nativetext/main.cpp
@@ -101,7 +101,9 @@ public:
const int ascent = fontMetrics().ascent();
- p.setPen(Qt::magenta);
+ QPen metricsPen(QColor(112, 216, 255), 1.0);
+ metricsPen.setCosmetic(true);
+ p.setPen(metricsPen);
p.drawLine(QPoint(0, ascent), QPoint(width(), ascent));
p.end();
@@ -152,13 +154,22 @@ public:
if (font().styleStrategy() & QFont::NoAntialias)
CGContextSetShouldAntialias(ctx, false);
- // Retain count already tracked by QMacCGContext above
- NSGraphicsContext.currentContext = [NSGraphicsContext graphicsContextWithCGContext:ctx flipped:YES];
- [text().toNSString() drawAtPoint:CGPointZero withAttributes:@{
- NSFontAttributeName : (NSFont *)fontEngine->handle(),
- NSForegroundColorAttributeName : nsColor
- }];
- NSGraphicsContext.currentContext = nil;
+ // Flip to what CT expects
+ CGContextScaleCTM(ctx, 1, -1);
+ CGContextTranslateCTM(ctx, 0, -height());
+
+ // Set up baseline
+ CGContextSetTextPosition(ctx, 0, height() - fontMetrics().ascent());
+
+ auto *attributedString = [[NSAttributedString alloc] initWithString:text().toNSString()
+ attributes:@{
+ NSFontAttributeName : (NSFont *)fontEngine->handle(),
+ NSForegroundColorAttributeName : nsColor
+ }
+ ];
+
+ QCFType<CTLineRef> line = CTLineCreateWithAttributedString(CFAttributedStringRef([attributedString autorelease]));
+ CTLineDraw(line, ctx);
#endif
}
@@ -190,17 +201,16 @@ public:
case 0: return qMakePair(QColor(), QColor());
case 1: return qMakePair(QColor(Qt::black), QColor(Qt::white));
case 2: return qMakePair(QColor(Qt::white), QColor(Qt::black));
- case 3: return qMakePair(QColor(Qt::green), QColor(Qt::red));
+ case 3: return qMakePair(QColor(Qt::magenta), QColor(Qt::green));
case 4: return qMakePair(QColor(0, 0, 0, 128), QColor(Qt::white));
case 5: return qMakePair(QColor(255, 255, 255, 128), QColor(Qt::black));
default: return qMakePair(QColor(), QColor());
}
}();
- layout->addWidget(new TextRenderer(12, text, color.first, color.second));
- layout->addWidget(new TextRenderer(24, text, color.first, color.second));
- layout->addWidget(new TextRenderer(36, text, color.first, color.second));
- layout->addWidget(new TextRenderer(48, text, color.first, color.second));
+ for (int pointSize : {8, 12, 24, 36, 48})
+ layout->addWidget(new TextRenderer(pointSize, text, color.first, color.second));
+
static_cast<QHBoxLayout*>(m_previews->layout())->addLayout(layout);
}