From 1216f596bdb776da24851111cec764e04105bd62 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 8 Jun 2017 14:30:33 +0200 Subject: [PATCH 01/54] make qconfig.pri export QT__VERSION variables again ... and rename those determined by toolchain.prf to QMAKE_* (this was already the case for the newly introduced msvc and icc variables). this restores the ability for user projects to query the toolchain qt itself was built with, which is necessary for compatibility checks. in fact, we may do such validation in toolchain.prf itself at a later point. Change-Id: I35f4c393c5e4e0fe987c0844714b7a8f8687c24e Reviewed-by: Joerg Bornemann --- configure.pri | 31 +++++++++++++++++++++++++++++++ mkspecs/features/data/macros.cpp | 18 +++++++++--------- mkspecs/features/toolchain.prf | 30 +++++++++++------------------- 3 files changed, 51 insertions(+), 28 deletions(-) diff --git a/configure.pri b/configure.pri index 673252dc515..7d719e67979 100644 --- a/configure.pri +++ b/configure.pri @@ -1064,6 +1064,37 @@ defineReplace(qtConfOutputPostProcess_publicPro) { !isEmpty(config.input.qt_libinfix): output += "QT_LIBINFIX = $$config.input.qt_libinfix" !isEmpty(config.input.qt_namespace): output += "QT_NAMESPACE = $$config.input.qt_namespace" + !isEmpty(QMAKE_GCC_MAJOR_VERSION) { + output += \ + "QT_GCC_MAJOR_VERSION = $$QMAKE_GCC_MAJOR_VERSION" \ + "QT_GCC_MINOR_VERSION = $$QMAKE_GCC_MINOR_VERSION" \ + "QT_GCC_PATCH_VERSION = $$QMAKE_GCC_PATCH_VERSION" + } + !isEmpty(QMAKE_CLANG_MAJOR_VERSION) { + output += \ + "QT_CLANG_MAJOR_VERSION = $$QMAKE_CLANG_MAJOR_VERSION" \ + "QT_CLANG_MINOR_VERSION = $$QMAKE_CLANG_MINOR_VERSION" \ + "QT_CLANG_PATCH_VERSION = $$QMAKE_CLANG_PATCH_VERSION" + } + !isEmpty(QMAKE_APPLE_CLANG_MAJOR_VERSION) { + output += \ + "QT_APPLE_CLANG_MAJOR_VERSION = $$QMAKE_APPLE_CLANG_MAJOR_VERSION" \ + "QT_APPLE_CLANG_MINOR_VERSION = $$QMAKE_APPLE_CLANG_MINOR_VERSION" \ + "QT_APPLE_CLANG_PATCH_VERSION = $$QMAKE_APPLE_CLANG_PATCH_VERSION" + } + !isEmpty(QMAKE_MSC_VER) { + output += \ + "QT_MSVC_MAJOR_VERSION = $$replace(QMAKE_MSC_FULL_VER, "(..)(..)(.*)", "\\1")" \ + "QT_MSVC_MINOR_VERSION = $$format_number($$replace(QMAKE_MSC_FULL_VER, "(..)(..)(.*)", "\\2"))" \ + "QT_MSVC_PATCH_VERSION = $$replace(QMAKE_MSC_FULL_VER, "(..)(..)(.*)", "\\3")" + } + !isEmpty(QMAKE_ICC_VER) { + output += \ + "QT_ICC_MAJOR_VERSION = $$replace(QMAKE_ICC_VER, "(..)(..)", "\\1")" \ + "QT_ICC_MINOR_VERSION = $$format_number($$replace(QMAKE_ICC_VER, "(..)(..)", "\\2"))" \ + "QT_ICC_PATCH_VERSION = $$QMAKE_ICC_UPDATE_VER" + } + output += "QT_EDITION = $$config.input.qt_edition" !contains(config.input.qt_edition, "(OpenSource|Preview)") { output += \ diff --git a/mkspecs/features/data/macros.cpp b/mkspecs/features/data/macros.cpp index e677dace12a..9dcb8f09148 100644 --- a/mkspecs/features/data/macros.cpp +++ b/mkspecs/features/data/macros.cpp @@ -13,17 +13,17 @@ QMAKE_APPLE_CC = __APPLE_CC__ #endif #ifdef __clang__ #ifdef __APPLE_CC__ -QT_APPLE_CLANG_MAJOR_VERSION = __clang_major__ -QT_APPLE_CLANG_MINOR_VERSION = __clang_minor__ -QT_APPLE_CLANG_PATCH_VERSION = __clang_patchlevel__ +QMAKE_APPLE_CLANG_MAJOR_VERSION = __clang_major__ +QMAKE_APPLE_CLANG_MINOR_VERSION = __clang_minor__ +QMAKE_APPLE_CLANG_PATCH_VERSION = __clang_patchlevel__ #else -QT_CLANG_MAJOR_VERSION = __clang_major__ -QT_CLANG_MINOR_VERSION = __clang_minor__ -QT_CLANG_PATCH_VERSION = __clang_patchlevel__ +QMAKE_CLANG_MAJOR_VERSION = __clang_major__ +QMAKE_CLANG_MINOR_VERSION = __clang_minor__ +QMAKE_CLANG_PATCH_VERSION = __clang_patchlevel__ #endif #endif #ifdef __GNUC__ -QT_GCC_MAJOR_VERSION = __GNUC__ -QT_GCC_MINOR_VERSION = __GNUC_MINOR__ -QT_GCC_PATCH_VERSION = __GNUC_PATCHLEVEL__ +QMAKE_GCC_MAJOR_VERSION = __GNUC__ +QMAKE_GCC_MINOR_VERSION = __GNUC_MINOR__ +QMAKE_GCC_PATCH_VERSION = __GNUC_PATCHLEVEL__ #endif diff --git a/mkspecs/features/toolchain.prf b/mkspecs/features/toolchain.prf index d3487ef1ab7..6cab503b0f7 100644 --- a/mkspecs/features/toolchain.prf +++ b/mkspecs/features/toolchain.prf @@ -155,35 +155,27 @@ 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) { +!isEmpty(QMAKE_MSC_VER): \ QMAKE_COMPILER_DEFINES += _MSC_VER=$$QMAKE_MSC_VER _MSC_FULL_VER=$$QMAKE_MSC_FULL_VER - QT_MSVC_MAJOR_VERSION = $$replace(QMAKE_MSC_FULL_VER, "(..)(..)(.*)", "\\1") - QT_MSVC_MINOR_VERSION = $$format_number($$replace(QMAKE_MSC_FULL_VER, "(..)(..)(.*)", "\\2")) - QT_MSVC_PATCH_VERSION = $$replace(QMAKE_MSC_FULL_VER, "(..)(..)(.*)", "\\3")) -} -!isEmpty(QMAKE_ICC_VER) { +!isEmpty(QMAKE_ICC_VER): \ QMAKE_COMPILER_DEFINES += __INTEL_COMPILER=$$QMAKE_ICC_VER __INTEL_COMPILER_UPDATE=$$QMAKE_ICC_UPDATE_VER - QT_ICC_MAJOR_VERSION = $$replace(QMAKE_ICC_VER, "(..)(..)", "\\1") - QT_ICC_MINOR_VERSION = $$format_number($$replace(QMAKE_ICC_VER, "(..)(..)", "\\2")) - QT_ICC_PATCH_VERSION = $$QMAKE_ICC_UPDATE_VER -} !isEmpty(QMAKE_APPLE_CC): \ QMAKE_COMPILER_DEFINES += __APPLE_CC__=$$QMAKE_APPLE_CC !isEmpty(QT_APPLE_CLANG_MAJOR_VERSION): \ QMAKE_COMPILER_DEFINES += __clang__ \ - __clang_major__=$$QT_APPLE_CLANG_MAJOR_VERSION \ - __clang_minor__=$$QT_APPLE_CLANG_MINOR_VERSION \ - __clang_patchlevel__=$$QT_APPLE_CLANG_PATCH_VERSION + __clang_major__=$$QMAKE_APPLE_CLANG_MAJOR_VERSION \ + __clang_minor__=$$QMAKE_APPLE_CLANG_MINOR_VERSION \ + __clang_patchlevel__=$$QMAKE_APPLE_CLANG_PATCH_VERSION !isEmpty(QT_CLANG_MAJOR_VERSION): \ QMAKE_COMPILER_DEFINES += __clang__ \ - __clang_major__=$$QT_CLANG_MAJOR_VERSION \ - __clang_minor__=$$QT_CLANG_MINOR_VERSION \ - __clang_patchlevel__=$$QT_CLANG_PATCH_VERSION + __clang_major__=$$QMAKE_CLANG_MAJOR_VERSION \ + __clang_minor__=$$QMAKE_CLANG_MINOR_VERSION \ + __clang_patchlevel__=$$QMAKE_CLANG_PATCH_VERSION !isEmpty(QT_GCC_MAJOR_VERSION): \ QMAKE_COMPILER_DEFINES += \ - __GNUC__=$$QT_GCC_MAJOR_VERSION \ - __GNUC_MINOR__=$$QT_GCC_MINOR_VERSION \ - __GNUC_PATCHLEVEL__=$$QT_GCC_PATCH_VERSION + __GNUC__=$$QMAKE_GCC_MAJOR_VERSION \ + __GNUC_MINOR__=$$QMAKE_GCC_MINOR_VERSION \ + __GNUC_PATCHLEVEL__=$$QMAKE_GCC_PATCH_VERSION QMAKE_CFLAGS += $$QMAKE_CFLAGS_MSVC_COMPAT QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_MSVC_COMPAT From 76223ecbaa3b01a9c2ab641bd30d674f7c46a4d6 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 8 Jun 2017 14:39:05 +0200 Subject: [PATCH 02/54] complain when toolchain.prf fails to run the compiler Task-number: QTBUG-60059 Change-Id: I2babe8aaf7cdf5912686f679d14bebc82231a846 Reviewed-by: Joerg Bornemann --- mkspecs/features/toolchain.prf | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/mkspecs/features/toolchain.prf b/mkspecs/features/toolchain.prf index 6cab503b0f7..34bd8f1d788 100644 --- a/mkspecs/features/toolchain.prf +++ b/mkspecs/features/toolchain.prf @@ -47,7 +47,9 @@ isEmpty($${target_prefix}.INCDIRS) { # gcc is fine with just preprocessing cxx_flags += -E -v - output = $$system("$$cmd_prefix $$QMAKE_CXX $$qtMakeExpand($$cxx_flags) -xc++ - 2>&1 $$cmd_suffix", lines) + output = $$system("$$cmd_prefix $$QMAKE_CXX $$qtMakeExpand($$cxx_flags) -xc++ - 2>&1 $$cmd_suffix", lines, ec) + !equals(ec, 0): \ + error("Cannot run compiler '$$QMAKE_CXX'. Maybe you forgot to setup the environment?") add_includes = false add_libraries = false for (line, output) { @@ -102,13 +104,19 @@ isEmpty($${target_prefix}.INCDIRS) { # defineReplace(qtVariablesFromMSVC) { - return($$system("$$1 -nologo -E $$2 $$system_quote($$PWD/data/macros.cpp) NUL", lines)) + ret = $$system("$$1 -nologo -E $$2 $$system_quote($$PWD/data/macros.cpp) NUL", lines, ec) + !equals(ec, 0): \ + error("Cannot run compiler '$$1'. Maybe you forgot to setup the environment?") + return($$ret) } defineReplace(qtVariablesFromGCC) { null_device = /dev/null equals(QMAKE_HOST.os, Windows): null_device = NUL - return($$system("$$1 -E $$system_quote($$PWD/data/macros.cpp) <$$null_device 2>$$null_device", lines)) + ret = $$system("$$1 -E $$system_quote($$PWD/data/macros.cpp) <$$null_device 2>$$null_device", lines, ec) + !equals(ec, 0): \ + error("Cannot run compiler '$$1'. Maybe you forgot to setup the environment?") + return($$ret) } isEmpty($${target_prefix}.COMPILER_MACROS) { From 5dab77ba968ceac57efe108abd5c580d1df24d21 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 15 May 2017 14:14:28 +0200 Subject: [PATCH 03/54] build the configure tests in the top-level build dir there isn't really a point in doing strict shadow builds of them, and it complicates stand-alone building of sub-projects (because it points below the build root). Task-number: QTBUG-58372 Change-Id: Ia3bde3826baac44749b27452fd4aeb9491ecb94e Reviewed-by: Joerg Bornemann --- configure.pri | 2 +- mkspecs/features/qt_configure.prf | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.pri b/configure.pri index 7d719e67979..76bb27e4ae4 100644 --- a/configure.pri +++ b/configure.pri @@ -252,7 +252,7 @@ defineTest(qtConfTest_architecture) { error("Could not determine $$eval($${1}.label). See config.log for details.") test = $$eval($${1}.test) - test_out_dir = $$shadowed($$QMAKE_CONFIG_TESTS_DIR/$$test) + test_out_dir = $$OUT_PWD/$$basename(QMAKE_CONFIG_TESTS_DIR)/$$test unix:exists($$test_out_dir/arch): \ content = $$cat($$test_out_dir/arch, blob) else: win32:exists($$test_out_dir/arch.exe): \ diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index 964c2393c25..f3db6b467dc 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -326,7 +326,7 @@ defineTest(qtConfParseCommandLine) { } defineReplace(qtConfToolchainSupportsFlag) { - test_out_dir = $$shadowed($$QMAKE_CONFIG_TESTS_DIR) + test_out_dir = $$OUT_PWD/$$basename(QMAKE_CONFIG_TESTS_DIR) test_cmd_base = "$$QMAKE_CD $$system_quote($$system_path($$test_out_dir)) &&" conftest = "int main() { return 0; }" @@ -849,7 +849,7 @@ defineTest(qtConfTest_compile) { isEmpty(host): host = false test_dir = $$QMAKE_CONFIG_TESTS_DIR/$$test - test_base_out_dir = $$shadowed($$QMAKE_CONFIG_TESTS_DIR) + test_base_out_dir = $$OUT_PWD/$$basename(QMAKE_CONFIG_TESTS_DIR) test_out_dir = $$test_base_out_dir/$$test !isEmpty($${1}.pro): \ test_dir = $$test_dir/$$eval($${1}.pro) From e53a1c8bed436b27d324a29eb6db983e86d7ecb0 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 10 May 2017 18:47:06 +0200 Subject: [PATCH 04/54] prune obsolete use_libmysqlclient_r feature it's not used since d5dc46d31. Change-Id: I853aec26acddea52da419bd1b517c2fbe31203ed Reviewed-by: Joerg Bornemann --- src/sql/configure.json | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/sql/configure.json b/src/sql/configure.json index 49444c7e5fb..dc7fffa02d2 100644 --- a/src/sql/configure.json +++ b/src/sql/configure.json @@ -141,11 +141,6 @@ "condition": "libs.mysql", "output": [ "publicFeature" ] }, - "use_libmysqlclient_r": { - "label": "MySql (threadsafe)", - "condition": "features.sql-mysql && (libs.mysql.source == 0 || libs.mysql.source == 2)", - "output": [ "privateConfig" ] - }, "sql-oci": { "label": "OCI (Oracle)", "condition": "libs.oci", From 350698da992b3b894035b8ffec1655108d3a392e Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 31 May 2017 08:11:37 +0200 Subject: [PATCH 05/54] QDialog: Fix typo in documentation Change-Id: I0cbcd007976a974d7491595b59cc463f6443d4b0 Reviewed-by: Leena Miettinen --- src/widgets/dialogs/qdialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp index 8e74c659fa7..60e1c43721b 100644 --- a/src/widgets/dialogs/qdialog.cpp +++ b/src/widgets/dialogs/qdialog.cpp @@ -1049,7 +1049,7 @@ QSize QDialog::minimumSizeHint() const \brief whether show() should pop up the dialog as modal or modeless By default, this property is \c false and show() pops up the dialog - as modeless. Setting his property to true is equivalent to setting + as modeless. Setting this property to true is equivalent to setting QWidget::windowModality to Qt::ApplicationModal. exec() ignores the value of this property and always pops up the From 2e8aecc37943343eae71d7336613923bd5425aab Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 9 Jun 2017 12:54:05 +0200 Subject: [PATCH 06/54] Do not disable MSVC extensions when generating moc_predefs.h Do not pass /Za to MSVC to generate moc_predefs.h, because this option is incompatible with compiler options like /fp:fast that may be user-specified. The /Za option added, because moc failed parsing header files that contain MSVC extensions. Moc was fixed in 94a2aec0, and we can safely remove the /Za option. Task-number: QTBUG-58391 Change-Id: I9791224b1773d0f81d2bbb7915787a7c5e68430c Reviewed-by: Olivier Goffart (Woboq GmbH) --- mkspecs/features/moc.prf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mkspecs/features/moc.prf b/mkspecs/features/moc.prf index 15eb38af31f..955933d8747 100644 --- a/mkspecs/features/moc.prf +++ b/mkspecs/features/moc.prf @@ -31,10 +31,10 @@ if(gcc|intel_icl|msvc):!rim_qcc:!uikit:!no_moc_predefs:if(!macos|count(QMAKE_APP moc_predefs.name = "Generate moc_predefs.h" moc_predefs.CONFIG = no_link gcc: moc_predefs.commands = $$QMAKE_CXX $$QMAKE_CXXFLAGS -dM -E -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN} - else:intel_icl: moc_predefs.commands = $$QMAKE_CXX $$QMAKE_CXXFLAGS -QdM -P -Za -Fi${QMAKE_FILE_OUT} ${QMAKE_FILE_IN} + else:intel_icl: moc_predefs.commands = $$QMAKE_CXX $$QMAKE_CXXFLAGS -QdM -P -Fi${QMAKE_FILE_OUT} ${QMAKE_FILE_IN} else:msvc { moc_predefs.commands += $$QMAKE_CXX -Bx$$shell_quote($$shell_path($$QMAKE_QMAKE)) $$QMAKE_CXXFLAGS \ - -E -Za ${QMAKE_FILE_IN} 2>NUL >${QMAKE_FILE_OUT} + -E ${QMAKE_FILE_IN} 2>NUL >${QMAKE_FILE_OUT} } else: error("Oops, I messed up") moc_predefs.output = $$MOC_DIR/moc_predefs.h moc_predefs.input = MOC_PREDEF_FILE From 7f5635cbb1ec7ba6e1c536b898eb737cdd76796e Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Thu, 8 Jun 2017 11:20:22 +0300 Subject: [PATCH 07/54] qmake: Avoid raw string comparison Detected by clang. Change-Id: I4c734d1af77a331d178ce91610ab08a8048fe410 Reviewed-by: Oswald Buddenhagen Reviewed-by: Jesus Fernandez --- qmake/generators/makefile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index d3221b7a253..a1f3352aa35 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -176,7 +176,7 @@ MakefileGenerator::initOutPaths() #ifdef Q_OS_WIN // We don't want to add a separator for DLLDESTDIR on Windows (###why?) - if(!(dirs[x] == "DLLDESTDIR")) + if (dkey != "DLLDESTDIR") #endif { if(!pathRef.endsWith(Option::dir_sep)) From d71761ec1f443cdd3b16e84bfe20becabbe9daaa Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Thu, 8 Jun 2017 11:29:19 +0300 Subject: [PATCH 08/54] qmake: Delete unused variables in MSBuild object model Detected by clang. Remove also comments that reference unused variables. Change-Id: I6de54d96cd23b93eed6d109629a9462b7770e94e Reviewed-by: Oswald Buddenhagen --- .../generators/win32/msbuild_objectmodel.cpp | 27 ------------------- 1 file changed, 27 deletions(-) diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp index 129fb28e014..38bf3a0cbd0 100644 --- a/qmake/generators/win32/msbuild_objectmodel.cpp +++ b/qmake/generators/win32/msbuild_objectmodel.cpp @@ -42,7 +42,6 @@ const char _CLCompile[] = "ClCompile"; const char _ItemGroup[] = "ItemGroup"; const char _Link[] = "Link"; const char _Lib[] = "Lib"; -const char _ManifestTool[] = "ManifestTool"; const char _Midl[] = "Midl"; const char _ResourceCompile[] = "ResourceCompile"; @@ -55,7 +54,6 @@ const char _AdditionalManifestDependencies[] = "AdditionalManifestDependencie const char _AdditionalOptions[] = "AdditionalOptions"; const char _AdditionalUsingDirectories[] = "AdditionalUsingDirectories"; const char _AllowIsolation[] = "AllowIsolation"; -const char _AlwaysAppend[] = "AlwaysAppend"; const char _ApplicationConfigurationMode[] = "ApplicationConfigurationMode"; const char _AssemblerListingLocation[] = "AssemblerListingLocation"; const char _AssemblerOutput[] = "AssemblerOutput"; @@ -82,7 +80,6 @@ const char _CompileAsWinRT[] = "CompileAsWinRT"; const char _ConfigurationType[] = "ConfigurationType"; const char _CPreprocessOptions[] = "CPreprocessOptions"; const char _CreateHotpatchableImage[] = "CreateHotpatchableImage"; -const char _CreateHotPatchableImage[] = "CreateHotPatchableImage"; const char _Culture[] = "Culture"; const char _DataExecutionPrevention[] = "DataExecutionPrevention"; const char _DebugInformationFormat[] = "DebugInformationFormat"; @@ -92,7 +89,6 @@ const char _DelaySign[] = "DelaySign"; const char _DeleteExtensionsOnClean[] = "DeleteExtensionsOnClean"; const char _DisableLanguageExtensions[] = "DisableLanguageExtensions"; const char _DisableSpecificWarnings[] = "DisableSpecificWarnings"; -const char _DisplayLibrary[] = "DisplayLibrary"; const char _DLLDataFileName[] = "DLLDataFileName"; const char _EmbedManagedResourceFile[] = "EmbedManagedResourceFile"; const char _EmbedManifest[] = "EmbedManifest"; @@ -166,8 +162,6 @@ const char _ModuleDefinitionFile[] = "ModuleDefinitionFile"; const char _MultiProcessorCompilation[] = "MultiProcessorCompilation"; const char _Name[] = "Name"; const char _NoEntryPoint[] = "NoEntryPoint"; -const char _NullTerminateStrings[] = "NullTerminateStrings"; -const char _ObjectFiles[] = "ObjectFiles"; const char _ObjectFileName[] = "ObjectFileName"; const char _OmitDefaultLibName[] = "OmitDefaultLibName"; const char _OmitFramePointers[] = "OmitFramePointers"; @@ -195,7 +189,6 @@ const char _ProxyFileName[] = "ProxyFileName"; const char _RandomizedBaseAddress[] = "RandomizedBaseAddress"; const char _RedirectOutputAndErrors[] = "RedirectOutputAndErrors"; const char _RegisterOutput[] = "RegisterOutput"; -const char _RemoveObjects[] = "RemoveObjects"; const char _ResourceOutputFileName[] = "ResourceOutputFileName"; const char _RuntimeLibrary[] = "RuntimeLibrary"; const char _RuntimeTypeInfo[] = "RuntimeTypeInfo"; @@ -211,7 +204,6 @@ const char _StringPooling[] = "StringPooling"; const char _StripPrivateSymbols[] = "StripPrivateSymbols"; const char _StructMemberAlignment[] = "StructMemberAlignment"; const char _SubSystem[] = "SubSystem"; -const char _SupportNobindOfDelayLoadedDLL[] = "SupportNobindOfDelayLoadedDLL"; const char _SupportUnloadOfDelayLoadedDLL[] = "SupportUnloadOfDelayLoadedDLL"; const char _SuppressCompilerWarnings[] = "SuppressCompilerWarnings"; const char _SuppressStartupBanner[] = "SuppressStartupBanner"; @@ -220,8 +212,6 @@ const char _SwapRunFromNet[] = "SwapRunFromNet"; const char _TargetEnvironment[] = "TargetEnvironment"; const char _TargetMachine[] = "TargetMachine"; const char _TerminalServerAware[] = "TerminalServerAware"; -const char _TrackerLogDirectory[] = "TrackerLogDirectory"; -const char _TreatLibWarningAsErrors[] = "TreatLibWarningAsErrors"; const char _TreatLinkerWarningAsErrors[] = "TreatLinkerWarningAsErrors"; const char _TreatSpecificWarningsAsErrors[] = "TreatSpecificWarningsAsErrors"; const char _TreatWarningAsError[] = "TreatWarningAsError"; @@ -240,8 +230,6 @@ const char _UseOfATL[] = "UseOfATL"; const char _UseOfMfc[] = "UseOfMfc"; const char _UseUnicodeForAssemblerListing[] = "UseUnicodeForAssemblerListing"; const char _ValidateAllParameters[] = "ValidateAllParameters"; -const char _VCCustomBuildTool[] = "VCCustomBuildTool"; -const char _Verbose[] = "Verbose"; const char _Version[] = "Version"; const char _WarnAsError[] = "WarnAsError"; const char _WarningLevel[] = "WarningLevel"; @@ -1450,7 +1438,6 @@ void VCXProjectWriter::write(XmlOutput &xml, const VCCLCompilerTool &tool) << attrTagX(_AdditionalIncludeDirectories, tool.AdditionalIncludeDirectories, ";") << attrTagX(_AdditionalOptions, tool.AdditionalOptions, " ") << attrTagX(_AdditionalUsingDirectories, tool.AdditionalUsingDirectories, ";") -//unused << attrTagS(_AlwaysAppend, tool.AlwaysAppend) << attrTagS(_AssemblerListingLocation, tool.AssemblerListingLocation) << attrTagS(_AssemblerOutput, toString(tool.AssemblerOutput)) << attrTagS(_BasicRuntimeChecks, toString(tool.BasicRuntimeChecks)) @@ -1486,7 +1473,6 @@ void VCXProjectWriter::write(XmlOutput &xml, const VCCLCompilerTool &tool) << attrTagT(_MinimalRebuild, tool.MinimalRebuild) << attrTagT(_MultiProcessorCompilation, tool.MultiProcessorCompilation) << attrTagS(_ObjectFileName, tool.ObjectFile) -//unused << attrTagX(_ObjectFiles, tool.ObjectFiles, ";") << attrTagT(_OmitDefaultLibName, tool.OmitDefaultLibName) << attrTagT(_OmitFramePointers, tool.OmitFramePointers) << attrTagT(_OpenMPSupport, tool.OpenMP) @@ -1538,7 +1524,6 @@ void VCXProjectWriter::write(XmlOutput &xml, const VCLinkerTool &tool) << attrTagS(_CLRSupportLastError, tool.CLRSupportLastError) << attrTagS(_CLRThreadAttribute, tool.CLRThreadAttribute) << attrTagT(_CLRUnmanagedCodeCheck, tool.CLRUnmanagedCodeCheck) -//unused << attrTagS(_CreateHotPatchableImage, tool.CreateHotPatchableImage) << attrTagT(_DataExecutionPrevention, tool.DataExecutionPrevention) << attrTagX(_DelayLoadDLLs, tool.DelayLoadDLLs, ";") << attrTagT(_DelaySign, tool.DelaySign) @@ -1690,22 +1675,13 @@ void VCXProjectWriter::write(XmlOutput &xml, const VCLibrarianTool &tool) << attrTagX(_AdditionalDependencies, tool.AdditionalDependencies, ";") << attrTagX(_AdditionalLibraryDirectories, tool.AdditionalLibraryDirectories, ";") << attrTagX(_AdditionalOptions, tool.AdditionalOptions, " ") -//unused << attrTagS(_DisplayLibrary, tool.DisplayLibrary) -//unused << attrTagS(_ErrorReporting, tool.ErrorReporting) << attrTagX(_ExportNamedFunctions, tool.ExportNamedFunctions, ";") << attrTagX(_ForceSymbolReferences, tool.ForceSymbolReferences, ";") << attrTagT(_IgnoreAllDefaultLibraries, tool.IgnoreAllDefaultLibraries) << attrTagX(_IgnoreSpecificDefaultLibraries, tool.IgnoreDefaultLibraryNames, ";") -//unused << attrTagT(_LinkTimeCodeGeneration, tool.LinkTimeCodeGeneration) << attrTagS(_ModuleDefinitionFile, tool.ModuleDefinitionFile) -//unused << attrTagS(_Name, tool.Name) << attrTagS(_OutputFile, tool.OutputFile) -//unused << attrTagX(_RemoveObjects, tool.RemoveObjects, ";") -//unused << attrTagS(_SubSystem, tool.SubSystem) << attrTagT(_SuppressStartupBanner, tool.SuppressStartupBanner) -//unused << attrTagS(_TargetMachine, tool.TargetMachine) -//unused << attrTagT(_TreatLibWarningAsErrors, tool.TreatLibWarningAsErrors) -//unused << attrTagT(_Verbose, tool.Verbose) << closetag(_Lib); } @@ -1717,13 +1693,10 @@ void VCXProjectWriter::write(XmlOutput &xml, const VCResourceCompilerTool &tool) << attrTagX(_AdditionalOptions, tool.AdditionalOptions, " ") << attrTagS(_Culture, toString(tool.Culture)) << attrTagT(_IgnoreStandardIncludePath, tool.IgnoreStandardIncludePath) -//unused << attrTagT(_NullTerminateStrings, tool.NullTerminateStrings) << attrTagX(_PreprocessorDefinitions, tool.PreprocessorDefinitions, ";") << attrTagS(_ResourceOutputFileName, tool.ResourceOutputFileName) << attrTagT(_ShowProgress, toTriState(tool.ShowProgress)) << attrTagT(_SuppressStartupBanner, tool.SuppressStartupBanner) -//unused << attrTagS(_TrackerLogDirectory, tool.TrackerLogDirectory) -//unused << attrTagS(_UndefinePreprocessorDefinitions, tool.UndefinePreprocessorDefinitions) << closetag(_ResourceCompile); } From 67f9a8c57bc299e22ea9804d01e119a7f2d3e51d Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Thu, 8 Jun 2017 11:30:10 +0300 Subject: [PATCH 09/54] qmake: Use braces for struct initialization in MSVC object model Detected by clang Change-Id: I4c5fbdb402f55ce40e84a6a40ead6c32a60cfa22 Reviewed-by: Orgad Shaneh --- qmake/generators/win32/msvc_objectmodel.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index 579d3117ef6..74989e4e7e1 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -47,15 +47,15 @@ static DotNET vsVersionFromString(const char *versionString) DotNET version; }; static VSVersionMapping mapping[] = { - "7.0", NET2002, - "7.1", NET2003, - "8.0", NET2005, - "9.0", NET2008, - "10.0", NET2010, - "11.0", NET2012, - "12.0", NET2013, - "14.0", NET2015, - "15.0", NET2017 + { "7.0", NET2002 }, + { "7.1", NET2003 }, + { "8.0", NET2005 }, + { "9.0", NET2008 }, + { "10.0", NET2010 }, + { "11.0", NET2012 }, + { "12.0", NET2013 }, + { "14.0", NET2015 }, + { "15.0", NET2017 } }; DotNET result = NETUnknown; for (const auto entry : mapping) { From 9ac4a9ef260508337a236a5cb2a6b4295e1e0abd Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Thu, 8 Jun 2017 11:30:30 +0300 Subject: [PATCH 10/54] qmake: Fix initialization order in VcprojGenerator ctor Detected by clang Change-Id: I17b49b1737ca4a9ab6608a5d8701a9e1c50af5ae Reviewed-by: Oswald Buddenhagen --- qmake/generators/win32/msvc_vcproj.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index 48b8bea8124..ac198dcda36 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -111,8 +111,8 @@ const char _slnExtSections[] = "\n\tGlobalSection(ExtensibilityGlobals) = pos VcprojGenerator::VcprojGenerator() : Win32MakefileGenerator(), is64Bit(false), - projectWriter(0), - customBuildToolFilterFileSuffix(QStringLiteral(".cbt")) + customBuildToolFilterFileSuffix(QStringLiteral(".cbt")), + projectWriter(0) { } From f5f772849ca1ada44f3de537633eec2664b14fd4 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Thu, 8 Jun 2017 11:33:23 +0300 Subject: [PATCH 11/54] qmake: Delete static library before calling ar on MinGW This was already done on unix, but not for MinGW. If the archive already exists, it is appended rather than replaced. This can cause invalid references when whole-archive linking is used and some object file that was already linked was deleted. Change-Id: Ie265371f197d996d57002b248043736544ee641e Reviewed-by: Oswald Buddenhagen --- qmake/generators/win32/mingw_make.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/qmake/generators/win32/mingw_make.cpp b/qmake/generators/win32/mingw_make.cpp index 8d5a9a7d0fc..b9895fb10dc 100644 --- a/qmake/generators/win32/mingw_make.cpp +++ b/qmake/generators/win32/mingw_make.cpp @@ -36,6 +36,12 @@ #include #include +#ifdef Q_OS_WIN +#define NULL_DEVICE "NUL" +#else +#define NULL_DEVICE "/dev/null" +#endif + QT_BEGIN_NAMESPACE MingwMakefileGenerator::MingwMakefileGenerator() : Win32MakefileGenerator() @@ -318,6 +324,7 @@ void MingwMakefileGenerator::writeBuildRulesPart(QTextStream &t) if(!project->isEmpty("QMAKE_PRE_LINK")) t << "\n\t" <isActiveConfig("staticlib") && project->first("TEMPLATE") == "lib") { + t << "\n\t-$(DEL_FILE) $(DESTDIR_TARGET) 2>" NULL_DEVICE; if (project->values("OBJECTS").count() < var("QMAKE_LINK_OBJECT_MAX").toInt()) { t << "\n\t$(LIB) $(DESTDIR_TARGET) " << objectsLinkLine << " " ; } else { From 9205110cfe84204c0f8eb2b90f42e9131d27108e Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 9 Jun 2017 09:05:02 +0200 Subject: [PATCH 12/54] Refactor tst_QStyleSheetStyle::focus/hoverColors() - Put all widgets in one dialog so that show/setActive occurs only once. - Use the center of the widget geometry for positioning. - Remove BypassWindowManagerHint which likely causes qWaitForWindowActive() to fail. - Move the cursor out of the way and subsequently send mouse events to the QWindow Task-number: QTBUG-51400 Change-Id: I2176d8dbaead72d7a6fa89aa769e4c804eea7a0c Reviewed-by: Qt CI Bot Reviewed-by: Simon Hausmann --- .../qstylesheetstyle/tst_qstylesheetstyle.cpp | 119 ++++++++++-------- 1 file changed, 69 insertions(+), 50 deletions(-) diff --git a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp index d8c70a0cc16..693b0b8aee7 100644 --- a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp +++ b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp @@ -817,22 +817,45 @@ static bool testForColors(const QImage& image, const QColor& color, bool ensureP return false; } -static const QList sample_widgets() // returning const to avoid detaching when passing to range-for +class TestDialog : public QDialog { +public: + explicit TestDialog(const QString &styleSheet); + + QWidgetList widgets() const { return m_widgets; } + QLineEdit *focusDummy() const { return m_focusDummy; } + +private: + void addWidget(QWidget *w) + { + w->setStyleSheet(m_styleSheet); + m_layout->addWidget(w); + m_widgets.append(w); + } + + const QString m_styleSheet; + QVBoxLayout* m_layout; + QLineEdit *m_focusDummy; + QWidgetList m_widgets; +}; + +TestDialog::TestDialog(const QString &styleSheet) : + m_styleSheet(styleSheet), + m_layout(new QVBoxLayout(this)), + m_focusDummy(new QLineEdit) { - QList widgets; - widgets << new QPushButton("TESTING TESTING"); - widgets << new QLineEdit("TESTING TESTING"); - widgets << new QLabel("TESTING TESTING"); + m_layout->addWidget(m_focusDummy); // Avoids initial focus. + addWidget(new QPushButton("TESTING TESTING")); + addWidget(new QLineEdit("TESTING TESTING")); + addWidget(new QLabel("TESTING TESTING")); QSpinBox *spinbox = new QSpinBox; spinbox->setMaximum(1000000000); spinbox->setValue(123456789); - widgets << spinbox; + addWidget(spinbox); QComboBox *combobox = new QComboBox; combobox->setEditable(true); combobox->addItems(QStringList() << "TESTING TESTING"); - widgets << combobox; - widgets << new QLabel("TESTING TESTING"); - return widgets; + addWidget(spinbox); + addWidget(new QLabel("TESTING TESTING")); } void tst_QStyleSheetStyle::focusColors() @@ -852,28 +875,21 @@ void tst_QStyleSheetStyle::focusColors() "That doesn't mean that the feature doesn't work in practice."); #endif + TestDialog frame(QStringLiteral("*:focus { border:none; background: #e8ff66; color: #ff0084 }")); + frame.setWindowTitle(QTest::currentTestFunction()); - for (QWidget *widget : sample_widgets()) { - QDialog frame; - QLayout* layout = new QGridLayout; + centerOnScreen(&frame); + frame.show(); - QLineEdit* dummy = new QLineEdit; // Avoids initial focus. + QApplication::setActiveWindow(&frame); + QVERIFY(QTest::qWaitForWindowActive(&frame)); - widget->setStyleSheet("*:focus { border:none; background: #e8ff66; color: #ff0084 }"); - - layout->addWidget(dummy); - layout->addWidget(widget); - frame.setLayout(layout); - - centerOnScreen(&frame); - frame.show(); - QApplication::setActiveWindow(&frame); - QVERIFY(QTest::qWaitForWindowActive(&frame)); + for (QWidget *widget : frame.widgets()) { widget->setFocus(); QApplication::processEvents(); - QImage image(frame.width(), frame.height(), QImage::Format_ARGB32); - frame.render(&image); + QImage image(widget->width(), widget->height(), QImage::Format_ARGB32); + widget->render(&image); if (image.depth() < 24) QSKIP("Test doesn't support color depth < 24"); @@ -896,32 +912,35 @@ void tst_QStyleSheetStyle::hoverColors() #ifdef Q_OS_OSX QSKIP("This test is fragile on Mac, most likely due to QTBUG-33959."); #endif + TestDialog frame(QStringLiteral("*:hover { border:none; background: #e8ff66; color: #ff0084 }")); + frame.setWindowTitle(QTest::currentTestFunction()); - for (QWidget *widget : sample_widgets()) { - //without Qt::X11BypassWindowManagerHint the window manager may move the window after we moved the cursor - QDialog frame(0, Qt::X11BypassWindowManagerHint); - QLayout* layout = new QGridLayout; + centerOnScreen(&frame); + // Move the mouse cursor out of the way to suppress spontaneous QEvent::Enter + // events interfering with QApplicationPrivate::dispatchEnterLeave(). + // Mouse events can then be sent directly to the QWindow instead of the + // QWidget, triggering the enter/leave handling within the dialog window, + // speeding up the test. + QCursor::setPos(frame.geometry().topLeft() - QPoint(100, 0)); + frame.show(); - QLineEdit* dummy = new QLineEdit; + QApplication::setActiveWindow(&frame); + QVERIFY(QTest::qWaitForWindowActive(&frame)); - widget->setStyleSheet("*:hover { border:none; background: #e8ff66; color: #ff0084 }"); + QWindow *frameWindow = frame.windowHandle(); + QVERIFY(frameWindow); - layout->addWidget(dummy); - layout->addWidget(widget); - frame.setLayout(layout); + const QPoint dummyPos = frame.focusDummy()->geometry().center(); + QTest::mouseMove(frameWindow, dummyPos); - centerOnScreen(&frame); - frame.show(); - - QApplication::setActiveWindow(&frame); - QVERIFY(QTest::qWaitForWindowActive(&frame)); + for (QWidget *widget : frame.widgets()) { //move the mouse inside the widget, it should be colored - QTest::mouseMove ( widget, QPoint(6,6)); + const QRect widgetGeometry = widget->geometry(); + QTest::mouseMove(frameWindow, widgetGeometry.center()); + QTRY_VERIFY2(widget->testAttribute(Qt::WA_UnderMouse), widget->metaObject()->className()); - QTRY_VERIFY(widget->testAttribute(Qt::WA_UnderMouse)); - - QImage image(frame.width(), frame.height(), QImage::Format_ARGB32); - frame.render(&image); + QImage image(widgetGeometry.size(), QImage::Format_ARGB32); + widget->render(&image); QVERIFY2(testForColors(image, QColor(0xe8, 0xff, 0x66)), (QString::fromLatin1(widget->metaObject()->className()) @@ -931,10 +950,10 @@ void tst_QStyleSheetStyle::hoverColors() + " did not contain text color #ff0084").toLocal8Bit().constData()); //move the mouse outside the widget, it should NOT be colored - QTest::mouseMove ( dummy, QPoint(5,5)); - QTest::qWait(60); + QTest::mouseMove(frameWindow, dummyPos); + QTRY_VERIFY2(frame.focusDummy()->testAttribute(Qt::WA_UnderMouse), "FocusDummy"); - frame.render(&image); + widget->render(&image); QVERIFY2(!testForColors(image, QColor(0xe8, 0xff, 0x66)), (QString::fromLatin1(widget->metaObject()->className()) @@ -944,10 +963,10 @@ void tst_QStyleSheetStyle::hoverColors() + " did contain text color #ff0084").toLocal8Bit().constData()); //move the mouse again inside the widget, it should be colored - QTest::mouseMove (widget, QPoint(5,5)); - QTRY_VERIFY(widget->testAttribute(Qt::WA_UnderMouse)); + QTest::mouseMove (frameWindow, widgetGeometry.center()); + QTRY_VERIFY2(widget->testAttribute(Qt::WA_UnderMouse), widget->metaObject()->className()); - frame.render(&image); + widget->render(&image); QVERIFY2(testForColors(image, QColor(0xe8, 0xff, 0x66)), (QString::fromLatin1(widget->metaObject()->className()) From adc725714109d6d3c3473e6aabeadbcf7e334108 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 6 Jun 2017 15:13:26 +0200 Subject: [PATCH 13/54] Document QHostAddress::swap Change-Id: I0f47ffeb1a7dbda7dadbd78b2ea04167c42a503d Reviewed-by: Jesus Fernandez Reviewed-by: Marc Mutz --- src/network/kernel/qhostaddress.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/network/kernel/qhostaddress.cpp b/src/network/kernel/qhostaddress.cpp index b8c0584a625..2911b123b09 100644 --- a/src/network/kernel/qhostaddress.cpp +++ b/src/network/kernel/qhostaddress.cpp @@ -605,6 +605,14 @@ QHostAddress &QHostAddress::operator=(SpecialAddress address) return *this; } +/*! + \fn void QHostAddress::swap(QHostAddress &other) + \since 5.6 + + Swaps this host address with \a other. This operation is very fast + and never fails. +*/ + /*! \fn bool QHostAddress::operator!=(const QHostAddress &other) const \since 4.2 From 107343c8f4598bdbbf03a76899abf7190d9e3d19 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 10 May 2017 09:12:27 +0200 Subject: [PATCH 14/54] Doc: Tweak documentation about a default QHostAddress Change-Id: I78deb7156900a3a0e79890062a40752b5d2561c3 Reviewed-by: Thiago Macieira --- src/network/kernel/qhostaddress.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/network/kernel/qhostaddress.cpp b/src/network/kernel/qhostaddress.cpp index 2911b123b09..1b7061d050c 100644 --- a/src/network/kernel/qhostaddress.cpp +++ b/src/network/kernel/qhostaddress.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2017 The Qt Company Ltd. ** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** @@ -393,7 +393,7 @@ void QNetmaskAddress::setPrefixLength(QAbstractSocket::NetworkLayerProtocol prot /*! \enum QHostAddress::SpecialAddress - \value Null The null address object. Equivalent to QHostAddress(). + \value Null The null address object. Equivalent to QHostAddress(). See also QHostAddress::isNull(). \value LocalHost The IPv4 localhost address. Equivalent to QHostAddress("127.0.0.1"). \value LocalHostIPv6 The IPv6 localhost address. Equivalent to QHostAddress("::1"). \value Broadcast The IPv4 broadcast address. Equivalent to QHostAddress("255.255.255.255"). @@ -629,7 +629,9 @@ QHostAddress &QHostAddress::operator=(SpecialAddress address) */ /*! - Sets the host address to 0.0.0.0. + Sets the host address to null. + + \sa QHostAddress::Null */ void QHostAddress::clear() { @@ -990,9 +992,11 @@ bool QHostAddress::operator ==(SpecialAddress other) const } /*! - Returns \c true if this host address is null (INADDR_ANY or in6addr_any). - The default constructor creates a null address, and that address is - not valid for any host or interface. + Returns \c true if this host address is not valid for any host or interface. + + The default constructor creates a null address. + + \sa QHostAddress::Null */ bool QHostAddress::isNull() const { From 3a782e66fb457f3967bb4bea3af68ceb2ce601fd Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 9 Jun 2017 14:31:22 +0200 Subject: [PATCH 15/54] Add /NOLOGO to midl and rc calls This removes clutter from build logs. Task-number: QTBUG-52383 Change-Id: If057f26df017eb9c53a57bc2ba825ae2191130bc Reviewed-by: Oswald Buddenhagen --- mkspecs/common/msvc-desktop.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mkspecs/common/msvc-desktop.conf b/mkspecs/common/msvc-desktop.conf index acc8d235a28..5296050ad8e 100644 --- a/mkspecs/common/msvc-desktop.conf +++ b/mkspecs/common/msvc-desktop.conf @@ -98,9 +98,9 @@ QMAKE_LIBS_COMPAT = advapi32.lib shell32.lib comdlg32.lib user32.lib gdi32 QMAKE_LIBS_QT_ENTRY = -lqtmain -QMAKE_IDL = midl +QMAKE_IDL = midl /NOLOGO QMAKE_LIB = lib /NOLOGO -QMAKE_RC = rc +QMAKE_RC = rc /NOLOGO VCPROJ_EXTENSION = .vcproj VCSOLUTION_EXTENSION = .sln From 1645bdcbcea84b7606c31d60914ca73dfb4f93fa Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Fri, 9 Jun 2017 16:02:16 +0200 Subject: [PATCH 16/54] Drop dead qfiledialog_embedded.ui Change-Id: Ia20fe65d08a8a477dc1c56ad5dcd3db5144c25a1 Reviewed-by: Joerg Bornemann --- src/widgets/dialogs/dialogs.pri | 3 +- src/widgets/dialogs/qfiledialog_embedded.ui | 353 -------------------- 2 files changed, 1 insertion(+), 355 deletions(-) delete mode 100644 src/widgets/dialogs/qfiledialog_embedded.ui diff --git a/src/widgets/dialogs/dialogs.pri b/src/widgets/dialogs/dialogs.pri index 8614d2bcc63..c9438696fa4 100644 --- a/src/widgets/dialogs/dialogs.pri +++ b/src/widgets/dialogs/dialogs.pri @@ -22,8 +22,7 @@ win32 { SOURCES += dialogs/qwizard_win.cpp } -wince: FORMS += dialogs/qfiledialog_embedded.ui -else: FORMS += dialogs/qfiledialog.ui +FORMS += dialogs/qfiledialog.ui INCLUDEPATH += $$PWD SOURCES += \ diff --git a/src/widgets/dialogs/qfiledialog_embedded.ui b/src/widgets/dialogs/qfiledialog_embedded.ui deleted file mode 100644 index 933acdeaf26..00000000000 --- a/src/widgets/dialogs/qfiledialog_embedded.ui +++ /dev/null @@ -1,353 +0,0 @@ - - - ********************************************************************* -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWidgets 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$ -** -********************************************************************* - QFileDialog - - - - 0 - 0 - 240 - 320 - - - - true - - - - - - - 1 - 0 - - - - - - - - - - Back - - - - - - - Forward - - - - - - - Parent Directory - - - - - - - Create New Folder - - - - - - - List View - - - - - - - Detail View - - - - - - - - - - 0 - 0 - - - - Qt::Horizontal - - - false - - - - - QFrame::NoFrame - - - QFrame::Raised - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - - - - - - - - - - - 1 - 0 - - - - - - - - Qt::Vertical - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - 0 - 0 - - - - - - - - - - false - - - - 0 - 0 - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - false - - - - 0 - 0 - - - - - 0 - 0 - - - - Files of type: - - - - - - - false - - - - 0 - 0 - - - - - 0 - 0 - - - - Look in: - - - - - - - - QFileDialogTreeView - QTreeView -
private/qfiledialog_p.h
-
- - QFileDialogListView - QListView -
private/qfiledialog_p.h
-
- - QSidebar - QListWidget -
private/qsidebar_p.h
-
- - QFileDialogLineEdit - QLineEdit -
private/qfiledialog_p.h
-
- - QFileDialogComboBox - QComboBox -
private/qfiledialog_p.h
-
-
- - lookInCombo - backButton - forwardButton - toParentButton - newFolderButton - listModeButton - detailModeButton - sidebar - listView - fileNameEdit - fileTypeCombo - buttonBox - treeView - - - -
From 77c2dd401737f7f6e229216c778d710424c0303f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 7 Jun 2017 13:52:30 +0200 Subject: [PATCH 17/54] Only use -Xarch when specifying precompiled header if building multi arch The -Xarch option is not supported by ccache, so unless we need to distinguish precompiled headers for multiple architectures it's better to not pass it. Change-Id: Iae02d37f7a89aedebecedff7290f88d2de1ca362 Reviewed-by: Oswald Buddenhagen Reviewed-by: Jake Petroules --- mkspecs/features/mac/default_post.prf | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf index 2bba73d795f..395ac340012 100644 --- a/mkspecs/features/mac/default_post.prf +++ b/mkspecs/features/mac/default_post.prf @@ -162,8 +162,12 @@ macx-xcode { else: \ use_flag = -include + # Only use Xarch with multi-arch, as the option confuses ccache + count(VALID_ARCHS, 1, greaterThan): \ + QMAKE_CFLAGS_USE_PRECOMPILE += \ + -Xarch_$${arch} + QMAKE_CFLAGS_USE_PRECOMPILE += \ - -Xarch_$${arch} \ $${use_flag}${QMAKE_PCH_OUTPUT_$${arch}} } icc_pch_style { From aad21102e94d0327fe16e089252aeb21b4dbb9ae Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Tue, 30 May 2017 21:09:02 +0200 Subject: [PATCH 18/54] Convert features.columnview to QT_[REQUIRE_]CONFIG Side effect: fix of QT_NO_COLUMNVIEW <-> QT_NO_QCOLUMNVIEW inconsistency. Change-Id: I42702ea7b362a4b6fb5dad78ee105e6cbbf8bcf6 Reviewed-by: Oswald Buddenhagen --- src/widgets/itemviews/itemviews.pri | 16 +++++++++++----- src/widgets/itemviews/qcolumnview.h | 7 ++----- src/widgets/itemviews/qcolumnview_p.h | 8 +++----- src/widgets/itemviews/qcolumnviewgrip.cpp | 4 ---- src/widgets/itemviews/qcolumnviewgrip_p.h | 4 +--- src/widgets/styles/qcommonstyle.cpp | 4 ++-- 6 files changed, 19 insertions(+), 24 deletions(-) diff --git a/src/widgets/itemviews/itemviews.pri b/src/widgets/itemviews/itemviews.pri index d78bc4b40ee..ed0e3fe0722 100644 --- a/src/widgets/itemviews/itemviews.pri +++ b/src/widgets/itemviews/itemviews.pri @@ -28,9 +28,6 @@ HEADERS += \ itemviews/qitemeditorfactory_p.h \ itemviews/qtreewidgetitemiterator.h \ itemviews/qdatawidgetmapper.h \ - itemviews/qcolumnviewgrip_p.h \ - itemviews/qcolumnview.h \ - itemviews/qcolumnview_p.h \ itemviews/qstyleditemdelegate.h SOURCES += \ @@ -49,11 +46,20 @@ SOURCES += \ itemviews/qitemeditorfactory.cpp \ itemviews/qtreewidgetitemiterator.cpp \ itemviews/qdatawidgetmapper.cpp \ - itemviews/qcolumnview.cpp \ - itemviews/qcolumnviewgrip.cpp \ itemviews/qstyleditemdelegate.cpp } +qtConfig(columnview) { + HEADERS += \ + itemviews/qcolumnviewgrip_p.h \ + itemviews/qcolumnview.h \ + itemviews/qcolumnview_p.h + + SOURCES += \ + itemviews/qcolumnview.cpp \ + itemviews/qcolumnviewgrip.cpp +} + HEADERS += \ itemviews/qfileiconprovider.h \ itemviews/qfileiconprovider_p.h \ diff --git a/src/widgets/itemviews/qcolumnview.h b/src/widgets/itemviews/qcolumnview.h index 7d5e2f5cd12..42eac7426a1 100644 --- a/src/widgets/itemviews/qcolumnview.h +++ b/src/widgets/itemviews/qcolumnview.h @@ -43,11 +43,10 @@ #include #include +QT_REQUIRE_CONFIG(columnview); + QT_BEGIN_NAMESPACE - -#ifndef QT_NO_COLUMNVIEW - class QColumnViewPrivate; class Q_WIDGETS_EXPORT QColumnView : public QAbstractItemView { @@ -109,8 +108,6 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_clicked(const QModelIndex &)) }; -#endif // QT_NO_COLUMNVIEW - QT_END_NAMESPACE #endif // QCOLUMNVIEW_H diff --git a/src/widgets/itemviews/qcolumnview_p.h b/src/widgets/itemviews/qcolumnview_p.h index 7eff0f66cd4..fa276075fee 100644 --- a/src/widgets/itemviews/qcolumnview_p.h +++ b/src/widgets/itemviews/qcolumnview_p.h @@ -54,8 +54,6 @@ #include #include "qcolumnview.h" -#ifndef QT_NO_QCOLUMNVIEW - #include #include @@ -67,6 +65,8 @@ #include #include +QT_REQUIRE_CONFIG(columnview); + QT_BEGIN_NAMESPACE class QColumnViewPreviewColumn : public QAbstractItemView { @@ -190,9 +190,7 @@ public: const QStyleOptionViewItem &option, const QModelIndex &index) const Q_DECL_OVERRIDE; }; -#endif // QT_NO_QCOLUMNVIEW - QT_END_NAMESPACE -#endif //QCOLUMNVIEW_P_H +#endif //QCOLUMNVIEW_P_H diff --git a/src/widgets/itemviews/qcolumnviewgrip.cpp b/src/widgets/itemviews/qcolumnviewgrip.cpp index f7d6e6d2b04..4a4237805fd 100644 --- a/src/widgets/itemviews/qcolumnviewgrip.cpp +++ b/src/widgets/itemviews/qcolumnviewgrip.cpp @@ -37,8 +37,6 @@ ** ****************************************************************************/ -#ifndef QT_NO_QCOLUMNVIEW - #include "qcolumnviewgrip_p.h" #include #include @@ -190,5 +188,3 @@ originalXLocation(-1) QT_END_NAMESPACE #include "moc_qcolumnviewgrip_p.cpp" - -#endif // QT_NO_QCOLUMNVIEW diff --git a/src/widgets/itemviews/qcolumnviewgrip_p.h b/src/widgets/itemviews/qcolumnviewgrip_p.h index 3447f9f8249..16c0aefadac 100644 --- a/src/widgets/itemviews/qcolumnviewgrip_p.h +++ b/src/widgets/itemviews/qcolumnviewgrip_p.h @@ -54,7 +54,7 @@ #include #include -#ifndef QT_NO_QCOLUMNVIEW +QT_REQUIRE_CONFIG(columnview); QT_BEGIN_NAMESPACE @@ -98,6 +98,4 @@ public: QT_END_NAMESPACE -#endif // QT_NO_QCOLUMNVIEW - #endif //QCOLUMNVIEWGRIP_P_H diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index 752e385aa53..afcb50c8662 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -608,7 +608,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q } break; #endif // QT_NO_LINEEDIT -#ifndef QT_NO_COLUMNVIEW +#if QT_CONFIG(columnview) case PE_IndicatorColumnViewArrow: { if (const QStyleOptionViewItem *viewOpt = qstyleoption_cast(opt)) { bool reverse = (viewOpt->direction == Qt::RightToLeft); @@ -660,7 +660,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q p->restore(); } break; } -#endif //QT_NO_COLUMNVIEW +#endif //QT_CONFIG(columnview) case PE_IndicatorItemViewItemDrop: { QRect rect = opt->rect; if (opt->rect.height() == 0) From 71090f09509d52451e68b33e3e26807822849721 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 9 Jun 2017 22:20:58 -0700 Subject: [PATCH 19/54] JSON doc: update the RFC we link to MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit RFC 4627 is obsoleted by RFC 7159. Change-Id: Ia53158e207a94bf49489fffd14c6ab1ae0a19a72 Reviewed-by: Topi Reiniö --- src/corelib/doc/src/json.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/doc/src/json.qdoc b/src/corelib/doc/src/json.qdoc index a32772f910f..4c7e62a10a4 100644 --- a/src/corelib/doc/src/json.qdoc +++ b/src/corelib/doc/src/json.qdoc @@ -45,7 +45,7 @@ access. More details about the JSON data format can be found at \l{http://json.org}{json.org} - and in \l{http://tools.ietf.org/html/rfc4627}{RFC-4627}. + and in \l{https://tools.ietf.org/html/rfc7159}{RFC-7159}. \tableofcontents From 57d16c12ccb8d50e208078c37d13fa752eab98e1 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 9 Jun 2017 11:42:36 -0700 Subject: [PATCH 20/54] qsimd_p.h: Don't set the __xxx__ variables with Clang and GCC Commit 418184c2a0ad97cce12717a43f84fa6f12ece189 set some extra defines that Clang and GCC do set so that MSVC and ICC builds would properly get the features detected. But that meant we set them with Clang and GCC (technically, set them again, but to the same value so no warning was printed). Don't do that. This commit allows me to use "-march=native -mno-rdrnd" to disable the unconditional use of RDRAND instruction. That's required to valgrind any applications, as the current version (3.12) does not have support for that instruction. vex amd64->IR: unhandled instruction bytes: 0x48 0xF 0xC7 0xF0 0x48 0x8B 0x55 0xE8 0x48 0x89 vex amd64->IR: REX=1 REX.W=1 REX.R=0 REX.X=0 REX.B=0 vex amd64->IR: VEX=0 VEX.L=0 VEX.nVVVV=0x0 ESC=0F vex amd64->IR: PFX.66=0 PFX.F2=0 PFX.F3=0 ==78321== valgrind: Unrecognised instruction at address 0x4ef159c. ==78321== at 0x4EF159C: _rdrand64_step (immintrin.h:208) ==78321== by 0x4EF159C: qt_random_cpu(void*, long long) (qrandom.cpp:95) Change-Id: Ia3e896da908f42939148fffd14c6884501de4fa4 Reviewed-by: Allan Sandfeld Jensen --- src/corelib/tools/qsimd_p.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h index 28253b3ae9a..023a4b08d25 100644 --- a/src/corelib/tools/qsimd_p.h +++ b/src/corelib/tools/qsimd_p.h @@ -232,7 +232,7 @@ #if defined(__SSE4_2__) || (defined(QT_COMPILER_SUPPORTS_SSE4_2) && defined(QT_COMPILER_SUPPORTS_SIMD_ALWAYS)) #include -# if defined(__SSE4_2__) && defined(QT_COMPILER_SUPPORTS_SIMD_ALWAYS) +# if defined(__SSE4_2__) && defined(QT_COMPILER_SUPPORTS_SIMD_ALWAYS) && (defined(Q_CC_INTEL) || defined(Q_CC_MSVC)) // POPCNT instructions: // All processors that support SSE4.2 support POPCNT // (but neither MSVC nor the Intel compiler define this macro) @@ -245,7 +245,7 @@ // immintrin.h is the ultimate header, we don't need anything else after this #include -# if defined(__AVX__) && defined(QT_COMPILER_SUPPORTS_SIMD_ALWAYS) +# if defined(__AVX__) && defined(QT_COMPILER_SUPPORTS_SIMD_ALWAYS) && (defined(Q_CC_INTEL) || defined(Q_CC_MSVC)) // AES, PCLMULQDQ instructions: // All processors that support AVX support AES, PCLMULQDQ // (but neither MSVC nor the Intel compiler define these macros) @@ -253,7 +253,7 @@ # define __PCLMUL__ 1 # endif -# if defined(__AVX2__) && defined(QT_COMPILER_SUPPORTS_SIMD_ALWAYS) +# if defined(__AVX2__) && defined(QT_COMPILER_SUPPORTS_SIMD_ALWAYS) && (defined(Q_CC_INTEL) || defined(Q_CC_MSVC)) // F16C & RDRAND instructions: // All processors that support AVX2 support F16C & RDRAND: // (but neither MSVC nor the Intel compiler define these macros) From b91d37a600872298389e99fc354d76e9c37aa3bb Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Wed, 24 May 2017 17:17:00 -0700 Subject: [PATCH 21/54] QNSView: Remove tracking area on deallocation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ultimately, the tracking areas seem to be managed by the NSWindow (or at least somewhere else than the NSView itself). So, it can happen that we involuntarily leave dangling pointers in the system after the QNSView is released. This has shown to crash applications creating and deleting many native views on a single QNSWindow, e.g. calling winId() on a complex and dynamic QWidget hierarchy. The crash would happen when the QNSWindow receives a native enter event, which results on Cocoa trying to invoke the owner of a previously deallocated NSTrackingArea. Change-Id: I3ca7a39ee5f1ec51c2215639f61ba907de3d8659 Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/cocoa/qnsview.mm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index 72e90a53633..66c3b6fad40 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -177,7 +177,10 @@ static bool _q_dontOverrideCtrlLMB = false; - (void)dealloc { CGImageRelease(m_maskImage); - [m_trackingArea release]; + if (m_trackingArea) { + [self removeTrackingArea:m_trackingArea]; + [m_trackingArea release]; + } m_maskImage = 0; [m_inputSource release]; [[NSNotificationCenter defaultCenter] removeObserver:self]; From ea568c310d75fa921eba2c6ce2852f4617a176ea Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Tue, 6 Jun 2017 16:45:27 +0300 Subject: [PATCH 22/54] Android: Fix RTL selection handles directions Invert the selection handles icons when the selected text is rtl. Task-number: QTBUG-61073 Change-Id: I8339a14d1e4d9e79d218516daf3ac783911f6026 Reviewed-by: Olivier Goffart (Woboq GmbH) --- .../org/qtproject/qt5/android/CursorHandle.java | 12 +++++++----- .../qt5/android/QtActivityDelegate.java | 16 ++++++++++++---- .../src/org/qtproject/qt5/android/QtNative.java | 5 +++-- .../platforms/android/androidjniinput.cpp | 6 +++--- src/plugins/platforms/android/androidjniinput.h | 2 +- .../platforms/android/qandroidinputcontext.cpp | 5 +++-- 6 files changed, 29 insertions(+), 17 deletions(-) diff --git a/src/android/jar/src/org/qtproject/qt5/android/CursorHandle.java b/src/android/jar/src/org/qtproject/qt5/android/CursorHandle.java index 7d26b8fa04b..e6814c202df 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/CursorHandle.java +++ b/src/android/jar/src/org/qtproject/qt5/android/CursorHandle.java @@ -107,13 +107,14 @@ public class CursorHandle implements ViewTreeObserver.OnPreDrawListener private int m_id; private int m_attr; private Activity m_activity; - private int m_posX; - private int m_posY; + private int m_posX = 0; + private int m_posY = 0; private int m_lastX; private int m_lastY; int tolerance; + private boolean m_rtl; - public CursorHandle(Activity activity, View layout, int id, int attr) { + public CursorHandle(Activity activity, View layout, int id, int attr, boolean rtl) { m_activity = activity; m_id = id; m_attr = attr; @@ -122,6 +123,7 @@ public class CursorHandle implements ViewTreeObserver.OnPreDrawListener activity.getWindowManager().getDefaultDisplay().getMetrics(metrics); tolerance = Math.round(2 * metrics.density); m_lastX = m_lastY = -1 - tolerance; + m_rtl = rtl; } private boolean initOverlay(){ @@ -160,9 +162,9 @@ public class CursorHandle implements ViewTreeObserver.OnPreDrawListener if (m_id == QtNative.IdCursorHandle) { x2 -= m_cursorView.getWidth() / 2 ; - } else if (m_id == QtNative.IdLeftHandle) { + } else if ((m_id == QtNative.IdLeftHandle && !m_rtl) || (m_id == QtNative.IdRightHandle && m_rtl)) { x2 -= m_cursorView.getWidth() * 3 / 4; - } else if (m_id == QtNative.IdRightHandle) { + } else { x2 -= m_cursorView.getWidth() / 4; } diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java index 26f877235fa..32d4abf43af 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java @@ -490,7 +490,7 @@ public class QtActivityDelegate be adjusted. mode is one of QAndroidInputContext::CursorHandleShowMode */ - public void updateHandles(int mode, int x1, int y1, int x2, int y2) + public void updateHandles(int mode, int x1, int y1, int x2, int y2, boolean rtl) { if (mode == CursorHandleNotShown) { if (m_cursorHandle != null) @@ -498,6 +498,8 @@ public class QtActivityDelegate if (m_rightSelectionHandle != null) { m_rightSelectionHandle.hide(); m_leftSelectionHandle.hide(); + m_rightSelectionHandle = null; + m_leftSelectionHandle = null; } if (m_editMenu != null) m_editMenu.hide(); @@ -506,19 +508,25 @@ public class QtActivityDelegate } else if (mode == CursorHandleShowNormal || mode == CursorHandleShowPopup) { if (m_cursorHandle == null) { m_cursorHandle = new CursorHandle(m_activity, m_layout, QtNative.IdCursorHandle, - android.R.attr.textSelectHandle); + android.R.attr.textSelectHandle, false); } m_cursorHandle.setPosition(x1, y1); if (m_rightSelectionHandle != null) { m_rightSelectionHandle.hide(); m_leftSelectionHandle.hide(); + m_rightSelectionHandle = null; + m_leftSelectionHandle = null; } } else if (mode == CursorHandleShowSelection) { if (m_rightSelectionHandle == null) { m_leftSelectionHandle = new CursorHandle(m_activity, m_layout, QtNative.IdLeftHandle, - android.R.attr.textSelectHandleLeft); + !rtl ? android.R.attr.textSelectHandleLeft : + android.R.attr.textSelectHandleRight, + rtl); m_rightSelectionHandle = new CursorHandle(m_activity, m_layout, QtNative.IdRightHandle, - android.R.attr.textSelectHandleRight); + !rtl ? android.R.attr.textSelectHandleRight : + android.R.attr.textSelectHandleLeft, + rtl); } m_leftSelectionHandle.setPosition(x1,y1); m_rightSelectionHandle.setPosition(x2,y2); 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 ccd8ec410e5..b11883a1052 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java @@ -516,12 +516,13 @@ public class QtNative final int x1, final int y1, final int x2, - final int y2) + final int y2, + final boolean rtl) { runAction(new Runnable() { @Override public void run() { - m_activityDelegate.updateHandles(mode, x1, y1, x2, y2); + m_activityDelegate.updateHandles(mode, x1, y1, x2, y2, rtl); } }); } diff --git a/src/plugins/platforms/android/androidjniinput.cpp b/src/plugins/platforms/android/androidjniinput.cpp index 8372bf64844..048be662bed 100644 --- a/src/plugins/platforms/android/androidjniinput.cpp +++ b/src/plugins/platforms/android/androidjniinput.cpp @@ -121,11 +121,11 @@ namespace QtAndroidInput return m_softwareKeyboardRect; } - void updateHandles(int mode, QPoint cursor, QPoint anchor) + void updateHandles(int mode, QPoint cursor, QPoint anchor, bool rtl) { - QJNIObjectPrivate::callStaticMethod(applicationClass(), "updateHandles", "(IIIII)V", + QJNIObjectPrivate::callStaticMethod(applicationClass(), "updateHandles", "(IIIIIZ)V", mode, cursor.x(), cursor.y(), anchor.x(), - anchor.y()); + anchor.y(), rtl); } static void mouseDown(JNIEnv */*env*/, jobject /*thiz*/, jint /*winId*/, jint x, jint y) diff --git a/src/plugins/platforms/android/androidjniinput.h b/src/plugins/platforms/android/androidjniinput.h index af18a96dc1e..c09b426f499 100644 --- a/src/plugins/platforms/android/androidjniinput.h +++ b/src/plugins/platforms/android/androidjniinput.h @@ -58,7 +58,7 @@ namespace QtAndroidInput // Software keyboard support // cursor/selection handles - void updateHandles(int handleCount, QPoint cursor = QPoint(), QPoint anchor = QPoint()); + void updateHandles(int handleCount, QPoint cursor = QPoint(), QPoint anchor = QPoint(), bool rtl = false); bool registerNatives(JNIEnv *env); } diff --git a/src/plugins/platforms/android/qandroidinputcontext.cpp b/src/plugins/platforms/android/qandroidinputcontext.cpp index 4ab8a9d0603..279cb338f4d 100644 --- a/src/plugins/platforms/android/qandroidinputcontext.cpp +++ b/src/plugins/platforms/android/qandroidinputcontext.cpp @@ -537,7 +537,7 @@ void QAndroidInputContext::updateSelectionHandles() ? QHighDpiScaling::factor(window) : QHighDpiScaling::factor(QtAndroid::androidPlatformIntegration()->screen()); - QInputMethodQueryEvent query(Qt::ImCursorPosition | Qt::ImAnchorPosition | Qt::ImEnabled); + QInputMethodQueryEvent query(Qt::ImCursorPosition | Qt::ImAnchorPosition | Qt::ImEnabled | Qt::ImCurrentSelection); QCoreApplication::sendEvent(m_focusObject, &query); int cpos = query.value(Qt::ImCursorPosition).toInt(); int anchor = query.value(Qt::ImAnchorPosition).toInt(); @@ -563,7 +563,8 @@ void QAndroidInputContext::updateSelectionHandles() QPoint leftPoint(leftRect.bottomLeft().toPoint() * pixelDensity); QPoint righPoint(rightRect.bottomRight().toPoint() * pixelDensity); - QtAndroidInput::updateHandles(CursorHandleShowSelection, leftPoint, righPoint); + QtAndroidInput::updateHandles(CursorHandleShowSelection, leftPoint, righPoint, + query.value(Qt::ImCurrentSelection).toString().isRightToLeft()); if (m_cursorHandleShown == CursorHandleShowPopup) { // make sure the popup does not reappear when the selection menu closes From 26fd805f500acfdcf730f2488a66e18c72d0ff9a Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Tue, 30 May 2017 21:45:23 +0200 Subject: [PATCH 23/54] macOS/iOS: Correctly ignore punctuation in QCollator When punctuation is ignored then the kUCCollatePunctionSignificantMask should not be set. This was originally thought to not be working due to a bug on the Apple platforms, but this is not the case. [ChangeLog][Platform Specific Changes][macOS][iOS] QCollator now respects the ignorePunctuation property on Apple based platforms correctly. Task-number: QTBUG-41978 Change-Id: I62044076387d6e4479f4aaef3c2f48f49dbd160e Reviewed-by: Lars Knoll --- src/corelib/tools/qcollator.cpp | 2 +- src/corelib/tools/qcollator_macx.cpp | 2 +- .../corelib/tools/qcollator/tst_qcollator.cpp | 84 ++++++++++++------- 3 files changed, 57 insertions(+), 31 deletions(-) diff --git a/src/corelib/tools/qcollator.cpp b/src/corelib/tools/qcollator.cpp index e34d16079f9..f1e3d6652d1 100644 --- a/src/corelib/tools/qcollator.cpp +++ b/src/corelib/tools/qcollator.cpp @@ -254,7 +254,7 @@ bool QCollator::numericMode() const The default is locale dependent. - \note This method is not currently supported on Apple platforms or if Qt is configured to not use ICU on Linux. + \note This method is not currently supported if Qt is configured to not use ICU on Linux. \sa ignorePunctuation() */ diff --git a/src/corelib/tools/qcollator_macx.cpp b/src/corelib/tools/qcollator_macx.cpp index d4682724301..9aa59a81dc8 100644 --- a/src/corelib/tools/qcollator_macx.cpp +++ b/src/corelib/tools/qcollator_macx.cpp @@ -66,7 +66,7 @@ void QCollatorPrivate::init() options |= kUCCollateCaseInsensitiveMask; if (numericMode) options |= kUCCollateDigitsAsNumberMask | kUCCollateDigitsOverrideMask; - if (ignorePunctuation) + if (!ignorePunctuation) options |= kUCCollatePunctuationSignificantMask; OSStatus status = UCCreateCollator( diff --git a/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp b/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp index d09910fd5c3..35a9af05f60 100644 --- a/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp +++ b/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp @@ -30,6 +30,7 @@ #include #include +#include #include @@ -88,6 +89,8 @@ void tst_QCollator::compare_data() QTest::addColumn("result"); QTest::addColumn("caseInsensitiveResult"); QTest::addColumn("numericMode"); + QTest::addColumn("ignorePunctuation"); + QTest::addColumn("punctuationResult"); /* A few tests below are commented out on the mac. It's unclear why they fail, @@ -102,55 +105,72 @@ void tst_QCollator::compare_data() comparison of Latin-1 values, although I'm not sure. So I just test digits to make sure that it's not totally broken. */ - QTest::newRow("english1") << QString("en_US") << QString("5") << QString("4") << 1 << 1 << false; - QTest::newRow("english2") << QString("en_US") << QString("4") << QString("6") << -1 << -1 << false; - QTest::newRow("english3") << QString("en_US") << QString("5") << QString("6") << -1 << -1 << false; - QTest::newRow("english4") << QString("en_US") << QString("a") << QString("b") << -1 << -1 << false; - QTest::newRow("english5") << QString("en_US") << QString("test 9") << QString("test 19") << -1 << -1 << true; + QTest::newRow("english1") << QString("en_US") << QString("5") << QString("4") << 1 << 1 << false << false << 1; + QTest::newRow("english2") << QString("en_US") << QString("4") << QString("6") << -1 << -1 << false << false << -1; + QTest::newRow("english3") << QString("en_US") << QString("5") << QString("6") << -1 << -1 << false << false << -1; + QTest::newRow("english4") << QString("en_US") << QString("a") << QString("b") << -1 << -1 << false << false << -1; + QTest::newRow("english5") << QString("en_US") << QString("test 9") << QString("test 19") << -1 << -1 << true << false << -1; + QTest::newRow("english6") << QString("en_US") << QString("test 9") << QString("test_19") << -1 << -1 << true << true << -1; + QTest::newRow("english7") << QString("en_US") << QString("test_19") << QString("test 19") << 1 << 1 << true << false << 1; + QTest::newRow("english8") << QString("en_US") << QString("test.19") << QString("test,19") << 1 << 1 << true << true << 0; /* In Swedish, a with ring above (E5) comes before a with diaresis (E4), which comes before o diaresis (F6), which all come after z. */ - QTest::newRow("swedish1") << QString("sv_SE") << QString::fromLatin1("\xe5") << QString::fromLatin1("\xe4") << -1 << -1 << false; - QTest::newRow("swedish2") << QString("sv_SE") << QString::fromLatin1("\xe4") << QString::fromLatin1("\xf6") << -1 << -1 << false; - QTest::newRow("swedish3") << QString("sv_SE") << QString::fromLatin1("\xe5") << QString::fromLatin1("\xf6") << -1 << -1 << false; - QTest::newRow("swedish4") << QString("sv_SE") << QString::fromLatin1("z") << QString::fromLatin1("\xe5") << -1 << -1 << false; - QTest::newRow("swedish5") << QString("sv_SE") << QString("9") << QString("19") << -1 << -1 << true; + QTest::newRow("swedish1") << QString("sv_SE") << QString::fromLatin1("\xe5") << QString::fromLatin1("\xe4") << -1 << -1 << false << false << -1; + QTest::newRow("swedish2") << QString("sv_SE") << QString::fromLatin1("\xe4") << QString::fromLatin1("\xf6") << -1 << -1 << false << false << -1; + QTest::newRow("swedish3") << QString("sv_SE") << QString::fromLatin1("\xe5") << QString::fromLatin1("\xf6") << -1 << -1 << false << false << -1; + QTest::newRow("swedish4") << QString("sv_SE") << QString::fromLatin1("z") << QString::fromLatin1("\xe5") << -1 << -1 << false << false << -1; + QTest::newRow("swedish5") << QString("sv_SE") << QString("9") << QString("19") << -1 << -1 << true << false << -1; + QTest::newRow("swedish6") << QString("sv_SE") << QString("Test 9") << QString("Test_19") << -1 << -1 << true << true << -1; + QTest::newRow("swedish7") << QString("sv_SE") << QString("test_19") << QString("test 19") << 1 << 1 << true << false << 1; + QTest::newRow("swedish8") << QString("sv_SE") << QString("test.19") << QString("test,19") << 1 << 1 << true << true << 0; + /* In Norwegian, ae (E6) comes before o with stroke (D8), which comes before a with ring above (E5). */ - QTest::newRow("norwegian1") << QString("no_NO") << QString::fromLatin1("\xe6") << QString::fromLatin1("\xd8") << -1 << -1 << false; - QTest::newRow("norwegian2") << QString("no_NO") << QString::fromLatin1("\xd8") << QString::fromLatin1("\xe5") << -1 << -1 << false; - QTest::newRow("norwegian3") << QString("no_NO") << QString::fromLatin1("\xe6") << QString::fromLatin1("\xe5") << -1 << -1 << false; - QTest::newRow("norwegian4") << QString("no_NO") << QString("9") << QString("19") << -1 << -1 << true; + QTest::newRow("norwegian1") << QString("no_NO") << QString::fromLatin1("\xe6") << QString::fromLatin1("\xd8") << -1 << -1 << false << false << -1; + QTest::newRow("norwegian2") << QString("no_NO") << QString::fromLatin1("\xd8") << QString::fromLatin1("\xe5") << -1 << -1 << false << false << -1; + QTest::newRow("norwegian3") << QString("no_NO") << QString::fromLatin1("\xe6") << QString::fromLatin1("\xe5") << -1 << -1 << false << false << -1; + QTest::newRow("norwegian4") << QString("no_NO") << QString("9") << QString("19") << -1 << -1 << true << false << -1; + QTest::newRow("norwegian5") << QString("no_NO") << QString("Test 9") << QString("Test_19") << -1 << -1 << true << true << -1; + QTest::newRow("norwegian6") << QString("no_NO") << QString("Test 9") << QString("Test_19") << -1 << -1 << true << true << -1; + QTest::newRow("norwegian7") << QString("no_NO") << QString("test_19") << QString("test 19") << 1 << 1 << true << false << 1; + QTest::newRow("norwegian8") << QString("no_NO") << QString("test.19") << QString("test,19") << 1 << 1 << true << true << 0; /* In German, z comes *after* a with diaresis (E4), which comes before o diaresis (F6). */ - QTest::newRow("german1") << QString("de_DE") << QString::fromLatin1("a") << QString::fromLatin1("\xe4") << -1 << -1 << false; - QTest::newRow("german2") << QString("de_DE") << QString::fromLatin1("b") << QString::fromLatin1("\xe4") << 1 << 1 << false; - QTest::newRow("german3") << QString("de_DE") << QString::fromLatin1("z") << QString::fromLatin1("\xe4") << 1 << 1 << false; - QTest::newRow("german4") << QString("de_DE") << QString::fromLatin1("\xe4") << QString::fromLatin1("\xf6") << -1 << -1 << false; - QTest::newRow("german5") << QString("de_DE") << QString::fromLatin1("z") << QString::fromLatin1("\xf6") << 1 << 1 << false; - QTest::newRow("german6") << QString("de_DE") << QString::fromLatin1("\xc0") << QString::fromLatin1("\xe0") << 1 << 0 << false; - QTest::newRow("german7") << QString("de_DE") << QString::fromLatin1("\xd6") << QString::fromLatin1("\xf6") << 1 << 0 << false; - QTest::newRow("german8") << QString("de_DE") << QString::fromLatin1("oe") << QString::fromLatin1("\xf6") << 1 << 1 << false; - QTest::newRow("german9") << QString("de_DE") << QString("A") << QString("a") << 1 << 0 << false; - QTest::newRow("german10") << QString("de_DE") << QString("9") << QString("19") << -1 << -1 << true; + QTest::newRow("german1") << QString("de_DE") << QString::fromLatin1("a") << QString::fromLatin1("\xe4") << -1 << -1 << false << false << -1; + QTest::newRow("german2") << QString("de_DE") << QString::fromLatin1("b") << QString::fromLatin1("\xe4") << 1 << 1 << false << false << 1; + QTest::newRow("german3") << QString("de_DE") << QString::fromLatin1("z") << QString::fromLatin1("\xe4") << 1 << 1 << false << false << 1; + QTest::newRow("german4") << QString("de_DE") << QString::fromLatin1("\xe4") << QString::fromLatin1("\xf6") << -1 << -1 << false << false << -1; + QTest::newRow("german5") << QString("de_DE") << QString::fromLatin1("z") << QString::fromLatin1("\xf6") << 1 << 1 << false << false << 1; + QTest::newRow("german6") << QString("de_DE") << QString::fromLatin1("\xc0") << QString::fromLatin1("\xe0") << 1 << 0 << false << false << 0; + QTest::newRow("german7") << QString("de_DE") << QString::fromLatin1("\xd6") << QString::fromLatin1("\xf6") << 1 << 0 << false << false << 0; + QTest::newRow("german8") << QString("de_DE") << QString::fromLatin1("oe") << QString::fromLatin1("\xf6") << 1 << 1 << false << false << 1; + QTest::newRow("german9") << QString("de_DE") << QString("A") << QString("a") << 1 << 0 << false << false << 0; + QTest::newRow("german10") << QString("de_DE") << QString("9") << QString("19") << -1 << -1 << true << false << -1; + QTest::newRow("german11") << QString("de_DE") << QString("Test 9") << QString("Test_19") << -1 << -1 << true << true << -1; + QTest::newRow("german12") << QString("de_DE") << QString("test_19") << QString("test 19") << 1 << 1 << true << false << 1; + QTest::newRow("german13") << QString("de_DE") << QString("test.19") << QString("test,19") << 1 << 1 << true << true << 0; /* French sorting of e and e with accent */ - QTest::newRow("french1") << QString("fr_FR") << QString::fromLatin1("\xe9") << QString::fromLatin1("e") << 1 << 1 << false; - QTest::newRow("french2") << QString("fr_FR") << QString::fromLatin1("\xe9t") << QString::fromLatin1("et") << 1 << 1 << false; - QTest::newRow("french3") << QString("fr_FR") << QString::fromLatin1("\xe9") << QString::fromLatin1("d") << 1 << 1 << false; - QTest::newRow("french4") << QString("fr_FR") << QString::fromLatin1("\xe9") << QString::fromLatin1("f") << -1 << -1 << false; - QTest::newRow("french5") << QString("fr_FR") << QString("9") << QString("19") << -1 << -1 << true; + QTest::newRow("french1") << QString("fr_FR") << QString::fromLatin1("\xe9") << QString::fromLatin1("e") << 1 << 1 << false << false << 1; + QTest::newRow("french2") << QString("fr_FR") << QString::fromLatin1("\xe9t") << QString::fromLatin1("et") << 1 << 1 << false << false << 1; + QTest::newRow("french3") << QString("fr_FR") << QString::fromLatin1("\xe9") << QString::fromLatin1("d") << 1 << 1 << false << false << 1; + QTest::newRow("french4") << QString("fr_FR") << QString::fromLatin1("\xe9") << QString::fromLatin1("f") << -1 << -1 << false << false << -1; + QTest::newRow("french5") << QString("fr_FR") << QString("9") << QString("19") << -1 << -1 << true << false << -1; + 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; } @@ -162,6 +182,8 @@ void tst_QCollator::compare() QFETCH(int, result); QFETCH(int, caseInsensitiveResult); QFETCH(bool, numericMode); + QFETCH(bool, ignorePunctuation); + QFETCH(int, punctuationResult); QCollator collator(locale); @@ -176,6 +198,10 @@ void tst_QCollator::compare() QCOMPARE(collator.compare(s1, s2), result); collator.setCaseSensitivity(Qt::CaseInsensitive); QCOMPARE(collator.compare(s1, s2), caseInsensitiveResult); +#if !QT_CONFIG(iconv) + collator.setIgnorePunctuation(ignorePunctuation); + QCOMPARE(collator.compare(s1, s2), punctuationResult); +#endif } From 96955dbe10b9b67330cc72fc9a2e016a5d7c4a82 Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Fri, 9 Jun 2017 16:08:40 +0200 Subject: [PATCH 24/54] qsslsocket_mac - check that SecCertificateRef is not null That's the only place there we can potentially pass a null pointer to CFArrayAppendValue (all other calls are conditionally-protected). This results in (surprise! ... ?) Objective-C exception (while we call something that is a pure-C API). So far we cannot reproduce this crash and can only speculate: probably this happens with invalid (can be either really invalid or the result of our generic QSslCertificate's failure to read/ parse)) custom CA certificates appended to a QSslConfiguration object by applications using QSslSocket/QNAM. The fix will probably make a handshake to fail, but this seems to be better than a crash anyway. Task-number: QTBUG-58213 Change-Id: Ie4f9ab2138bc383adc9f9ed55ed61be2d3cf7020 Reviewed-by: Edward Welbourne --- src/network/ssl/qsslsocket_mac.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/network/ssl/qsslsocket_mac.cpp b/src/network/ssl/qsslsocket_mac.cpp index 78aceadb810..10f6fb4e410 100644 --- a/src/network/ssl/qsslsocket_mac.cpp +++ b/src/network/ssl/qsslsocket_mac.cpp @@ -1219,8 +1219,10 @@ bool QSslSocketBackendPrivate::verifyPeerTrust() QCFType certArray = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks); for (const QSslCertificate &cert : qAsConst(configuration.caCertificates)) { QCFType certData = cert.d->derData.toCFData(); - QCFType certRef = SecCertificateCreateWithData(NULL, certData); - CFArrayAppendValue(certArray, certRef); + if (QCFType secRef = SecCertificateCreateWithData(NULL, certData)) + CFArrayAppendValue(certArray, secRef); + else + qCWarning(lcSsl, "Failed to create SecCertificate from QSslCertificate"); } SecTrustSetAnchorCertificates(trust, certArray); From 1a5fa66269eb7c7e1e2f9372cb2b87738b5cac72 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Thu, 8 Jun 2017 11:43:36 +0300 Subject: [PATCH 25/54] GitIgnore config.status.bat and config.tests/.qmake.stash Change-Id: Ia53119f8fbbe13b4865378833dcdac73c9368d9b Reviewed-by: Oswald Buddenhagen --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index cc75d82ea12..4e8ce90b8ed 100644 --- a/.gitignore +++ b/.gitignore @@ -9,11 +9,12 @@ /config.tests/*/*/* !/config.tests/*/*/*[.]* /config.tests/.qmake.cache +/config.tests/.qmake.stash /config.tests/arch/arch /config.tests/conftest-out /config.tests/conftest.cpp /config.opt -/config.status +/config.status* /config.summary /config.log /config.cache From b4381100280adbfa4cb6c4d8c84eed8f1dc126b9 Mon Sep 17 00:00:00 2001 From: Thomas Sondergaard Date: Sun, 11 Jun 2017 18:09:21 +0200 Subject: [PATCH 26/54] Rename QProcessEnvironmentPrivate::hash to vars Also use auto for iterators to vars. This is a small refactoring in preparation for changing type of vars to QMap. Task-number: QTBUG-61315 Change-Id: I5731d7916b6f54a0da5be2da378c09a7688bd870 Reviewed-by: Thiago Macieira --- src/corelib/io/qprocess.cpp | 36 +++++++++++++++---------------- src/corelib/io/qprocess_darwin.mm | 2 +- src/corelib/io/qprocess_p.h | 6 +++--- src/corelib/io/qprocess_unix.cpp | 8 +++---- src/corelib/io/qprocess_win.cpp | 8 +++---- 5 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp index c0ec35ff325..2226b4435bd 100644 --- a/src/corelib/io/qprocess.cpp +++ b/src/corelib/io/qprocess.cpp @@ -154,8 +154,8 @@ QT_BEGIN_NAMESPACE QStringList QProcessEnvironmentPrivate::toList() const { QStringList result; - result.reserve(hash.size()); - for (Hash::const_iterator it = hash.cbegin(), end = hash.cend(); it != end; ++it) + result.reserve(vars.size()); + for (auto it = vars.cbegin(), end = vars.cend(); it != end; ++it) result << nameToString(it.key()) + QLatin1Char('=') + valueToString(it.value()); return result; } @@ -181,9 +181,9 @@ QProcessEnvironment QProcessEnvironmentPrivate::fromList(const QStringList &list QStringList QProcessEnvironmentPrivate::keys() const { QStringList result; - result.reserve(hash.size()); - Hash::ConstIterator it = hash.constBegin(), - end = hash.constEnd(); + result.reserve(vars.size()); + auto it = vars.constBegin(); + const auto end = vars.constEnd(); for ( ; it != end; ++it) result << nameToString(it.key()); return result; @@ -191,14 +191,14 @@ QStringList QProcessEnvironmentPrivate::keys() const void QProcessEnvironmentPrivate::insert(const QProcessEnvironmentPrivate &other) { - Hash::ConstIterator it = other.hash.constBegin(), - end = other.hash.constEnd(); + auto it = other.vars.constBegin(); + const auto end = other.vars.constEnd(); for ( ; it != end; ++it) - hash.insert(it.key(), it.value()); + vars.insert(it.key(), it.value()); #ifdef Q_OS_UNIX - QHash::ConstIterator nit = other.nameMap.constBegin(), - nend = other.nameMap.constEnd(); + auto nit = other.nameMap.constBegin(); + const auto nend = other.nameMap.constEnd(); for ( ; nit != nend; ++nit) nameMap.insert(nit.key(), nit.value()); #endif @@ -271,7 +271,7 @@ bool QProcessEnvironment::operator==(const QProcessEnvironment &other) const if (d) { if (other.d) { QProcessEnvironmentPrivate::OrderedMutexLocker locker(d, other.d); - return d->hash == other.d->hash; + return d->vars == other.d->vars; } else { return isEmpty(); } @@ -289,7 +289,7 @@ bool QProcessEnvironment::operator==(const QProcessEnvironment &other) const bool QProcessEnvironment::isEmpty() const { // Needs no locking, as no hash nodes are accessed - return d ? d->hash.isEmpty() : true; + return d ? d->vars.isEmpty() : true; } /*! @@ -301,7 +301,7 @@ bool QProcessEnvironment::isEmpty() const void QProcessEnvironment::clear() { if (d) - d->hash.clear(); + d->vars.clear(); // Unix: Don't clear d->nameMap, as the environment is likely to be // re-populated with the same keys again. } @@ -318,7 +318,7 @@ bool QProcessEnvironment::contains(const QString &name) const if (!d) return false; QProcessEnvironmentPrivate::MutexLocker locker(d); - return d->hash.contains(d->prepareName(name)); + return d->vars.contains(d->prepareName(name)); } /*! @@ -337,7 +337,7 @@ void QProcessEnvironment::insert(const QString &name, const QString &value) { // our re-impl of detach() detaches from null d.detach(); // detach before prepareName() - d->hash.insert(d->prepareName(name), d->prepareValue(value)); + d->vars.insert(d->prepareName(name), d->prepareValue(value)); } /*! @@ -352,7 +352,7 @@ void QProcessEnvironment::remove(const QString &name) { if (d) { d.detach(); // detach before prepareName() - d->hash.remove(d->prepareName(name)); + d->vars.remove(d->prepareName(name)); } } @@ -369,8 +369,8 @@ QString QProcessEnvironment::value(const QString &name, const QString &defaultVa return defaultValue; QProcessEnvironmentPrivate::MutexLocker locker(d); - QProcessEnvironmentPrivate::Hash::ConstIterator it = d->hash.constFind(d->prepareName(name)); - if (it == d->hash.constEnd()) + const auto it = d->vars.constFind(d->prepareName(name)); + if (it == d->vars.constEnd()) return defaultValue; return d->valueToString(it.value()); diff --git a/src/corelib/io/qprocess_darwin.mm b/src/corelib/io/qprocess_darwin.mm index dd7a8275b92..2c3c296cb49 100644 --- a/src/corelib/io/qprocess_darwin.mm +++ b/src/corelib/io/qprocess_darwin.mm @@ -48,7 +48,7 @@ QProcessEnvironment QProcessEnvironment::systemEnvironment() __block QProcessEnvironment env; [[[NSProcessInfo processInfo] environment] enumerateKeysAndObjectsUsingBlock:^(NSString *name, NSString *value, BOOL *__unused stop) { - env.d->hash.insert( + env.d->vars.insert( QProcessEnvironmentPrivate::Key(QString::fromNSString(name).toLocal8Bit()), QProcessEnvironmentPrivate::Value(QString::fromNSString(value).toLocal8Bit())); }]; diff --git a/src/corelib/io/qprocess_p.h b/src/corelib/io/qprocess_p.h index 6e0630eb66b..b8820510b31 100644 --- a/src/corelib/io/qprocess_p.h +++ b/src/corelib/io/qprocess_p.h @@ -197,17 +197,17 @@ public: // do not need a lock, as they detach objects (however, we need to // ensure that they really detach before using prepareName()). MutexLocker locker(&other); - hash = other.hash; + vars = other.vars; nameMap = other.nameMap; // We need to detach our members, so that our mutex can protect them. // As we are being detached, they likely would be detached a moment later anyway. - hash.detach(); + vars.detach(); nameMap.detach(); } #endif typedef QHash Hash; - Hash hash; + Hash vars; #ifdef Q_OS_UNIX typedef QHash NameHash; diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp index b822417ddfa..53803e15d68 100644 --- a/src/corelib/io/qprocess_unix.cpp +++ b/src/corelib/io/qprocess_unix.cpp @@ -136,7 +136,7 @@ QProcessEnvironment QProcessEnvironment::systemEnvironment() QByteArray name(entry, equal - entry); QByteArray value(equal + 1); - env.d->hash.insert(QProcessEnvironmentPrivate::Key(name), + env.d->vars.insert(QProcessEnvironmentPrivate::Key(name), QProcessEnvironmentPrivate::Value(value)); } return env; @@ -348,8 +348,8 @@ static char **_q_dupEnvironment(const QProcessEnvironmentPrivate::Hash &environm envp[environment.count()] = 0; envp[environment.count() + 1] = 0; - QProcessEnvironmentPrivate::Hash::ConstIterator it = environment.constBegin(); - const QProcessEnvironmentPrivate::Hash::ConstIterator end = environment.constEnd(); + auto it = environment.constBegin(); + const auto end = environment.constEnd(); for ( ; it != end; ++it) { QByteArray key = it.key().key; QByteArray value = it.value().bytes(); @@ -436,7 +436,7 @@ void QProcessPrivate::startProcess() char **envp = 0; if (environment.d.constData()) { QProcessEnvironmentPrivate::MutexLocker locker(environment.d); - envp = _q_dupEnvironment(environment.d.constData()->hash, &envc); + envp = _q_dupEnvironment(environment.d.constData()->vars, &envc); } // Encode the working directory if it's non-empty, otherwise just pass 0. diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp index 329d1842f0e..9adb5138b7b 100644 --- a/src/corelib/io/qprocess_win.cpp +++ b/src/corelib/io/qprocess_win.cpp @@ -75,7 +75,7 @@ QProcessEnvironment QProcessEnvironment::systemEnvironment() int nameLen = equal - entry; QString name = QString::fromWCharArray(entry, nameLen); QString value = QString::fromWCharArray(equal + 1, entryLen - nameLen - 1); - env.d->hash.insert(QProcessEnvironmentPrivate::Key(name), value); + env.d->vars.insert(QProcessEnvironmentPrivate::Key(name), value); } entry += entryLen + 1; } @@ -413,8 +413,8 @@ static QByteArray qt_create_environment(const QProcessEnvironmentPrivate::Hash & } int pos = 0; - QProcessEnvironmentPrivate::Hash::ConstIterator it = copy.constBegin(), - end = copy.constEnd(); + auto it = copy.constBegin(); + const auto end = copy.constEnd(); static const wchar_t equal = L'='; static const wchar_t nul = L'\0'; @@ -475,7 +475,7 @@ void QProcessPrivate::startProcess() QString args = qt_create_commandline(program, arguments); QByteArray envlist; if (environment.d.constData()) - envlist = qt_create_environment(environment.d.constData()->hash); + envlist = qt_create_environment(environment.d.constData()->vars); if (!nativeArguments.isEmpty()) { if (!args.isEmpty()) args += QLatin1Char(' '); From 65a317e6745ee267bef7295f4dfe31d5ec62f7aa Mon Sep 17 00:00:00 2001 From: Thomas Sondergaard Date: Sun, 11 Jun 2017 18:41:57 +0200 Subject: [PATCH 27/54] Use QMap in QProcessEnvironment so variables are sorted The motivation for this change is to make it simple to pass a correctly sorted environment block to Win32 CreateProcess(). It is also nice in other contexts that the environment variables are sorted. The change is made for all platforms. This keeps it simple and the only ill effect is slightly slower lookups. Concerning the environment block passed to Win32 CreateProcess: The environment block that is passed to CreateProcess() must be sorted case-insensitively and without regard to locale. See https://msdn.microsoft.com/en-us/library/windows/desktop/ms682009(v=vs.85).aspx The need for sorting the environment block is also mentioned in the CreateProcess() documentation, but with less details: https://msdn.microsoft.com/en-us/library/windows/desktop/ms682425(v=vs.85).aspx Task-number: QTBUG-61315 Change-Id: Ie1edd443301de79cf5f699d45beab01b7c0f9de3 Reviewed-by: Thiago Macieira --- src/corelib/io/qprocess_p.h | 35 +++++++--------- src/corelib/io/qprocess_unix.cpp | 4 +- src/corelib/io/qprocess_win.cpp | 4 +- .../auto/corelib/io/qprocess/tst_qprocess.cpp | 42 +++++++++++++++++++ 4 files changed, 62 insertions(+), 23 deletions(-) diff --git a/src/corelib/io/qprocess_p.h b/src/corelib/io/qprocess_p.h index b8820510b31..c5abf7b762b 100644 --- a/src/corelib/io/qprocess_p.h +++ b/src/corelib/io/qprocess_p.h @@ -55,6 +55,7 @@ #include "QtCore/qprocess.h" #include "QtCore/qstringlist.h" #include "QtCore/qhash.h" +#include "QtCore/qmap.h" #include "QtCore/qshareddata.h" #include "private/qiodevice_p.h" @@ -90,22 +91,19 @@ public: QProcEnvKey(const QProcEnvKey &other) : QString(other) {} bool operator==(const QProcEnvKey &other) const { return !compare(other, Qt::CaseInsensitive); } }; -inline uint qHash(const QProcEnvKey &key) { return qHash(key.toCaseFolded()); } + +inline bool operator<(const QProcEnvKey &a, const QProcEnvKey &b) +{ + // On windows use case-insensitive ordering because that is how Windows needs the environment + // block sorted (https://msdn.microsoft.com/en-us/library/windows/desktop/ms682009(v=vs.85).aspx) + return a.compare(b, Qt::CaseInsensitive) < 0; +} + +Q_DECLARE_TYPEINFO(QProcEnvKey, Q_MOVABLE_TYPE); typedef QString QProcEnvValue; #else -class QProcEnvKey -{ -public: - QProcEnvKey() : hash(0) {} - explicit QProcEnvKey(const QByteArray &other) : key(other), hash(qHash(key)) {} - QProcEnvKey(const QProcEnvKey &other) { *this = other; } - bool operator==(const QProcEnvKey &other) const { return key == other.key; } - - QByteArray key; - uint hash; -}; -inline uint qHash(const QProcEnvKey &key) Q_DECL_NOTHROW { return key.hash; } +using QProcEnvKey = QByteArray; class QProcEnvValue { @@ -138,7 +136,6 @@ public: }; Q_DECLARE_TYPEINFO(QProcEnvValue, Q_MOVABLE_TYPE); #endif -Q_DECLARE_TYPEINFO(QProcEnvKey, Q_MOVABLE_TYPE); class QProcessEnvironmentPrivate: public QSharedData { @@ -161,13 +158,13 @@ public: inline Key prepareName(const QString &name) const { Key &ent = nameMap[name]; - if (ent.key.isEmpty()) - ent = Key(name.toLocal8Bit()); + if (ent.isEmpty()) + ent = name.toLocal8Bit(); return ent; } inline QString nameToString(const Key &name) const { - const QString sname = QString::fromLocal8Bit(name.key); + const QString sname = QString::fromLocal8Bit(name); nameMap[sname] = name; return sname; } @@ -206,8 +203,8 @@ public: } #endif - typedef QHash Hash; - Hash vars; + using Map = QMap; + Map vars; #ifdef Q_OS_UNIX typedef QHash NameHash; diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp index 53803e15d68..98d196ff7bb 100644 --- a/src/corelib/io/qprocess_unix.cpp +++ b/src/corelib/io/qprocess_unix.cpp @@ -338,7 +338,7 @@ bool QProcessPrivate::openChannel(Channel &channel) } } -static char **_q_dupEnvironment(const QProcessEnvironmentPrivate::Hash &environment, int *envc) +static char **_q_dupEnvironment(const QProcessEnvironmentPrivate::Map &environment, int *envc) { *envc = 0; if (environment.isEmpty()) @@ -351,7 +351,7 @@ static char **_q_dupEnvironment(const QProcessEnvironmentPrivate::Hash &environm auto it = environment.constBegin(); const auto end = environment.constEnd(); for ( ; it != end; ++it) { - QByteArray key = it.key().key; + QByteArray key = it.key(); QByteArray value = it.value().bytes(); key.reserve(key.length() + 1 + value.length()); key.append('='); diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp index 9adb5138b7b..05c9d6594c4 100644 --- a/src/corelib/io/qprocess_win.cpp +++ b/src/corelib/io/qprocess_win.cpp @@ -390,11 +390,11 @@ static QString qt_create_commandline(const QString &program, const QStringList & return args; } -static QByteArray qt_create_environment(const QProcessEnvironmentPrivate::Hash &environment) +static QByteArray qt_create_environment(const QProcessEnvironmentPrivate::Map &environment) { QByteArray envlist; if (!environment.isEmpty()) { - QProcessEnvironmentPrivate::Hash copy = environment; + QProcessEnvironmentPrivate::Map copy = environment; // add PATH if necessary (for DLL loading) QProcessEnvironmentPrivate::Key pathKey(QLatin1String("PATH")); diff --git a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp index 0783a65d8b3..f4d6d5cb408 100644 --- a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp +++ b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp @@ -94,6 +94,7 @@ private slots: void setEnvironment(); void setProcessEnvironment_data(); void setProcessEnvironment(); + void environmentIsSorted(); void spaceInName(); void setStandardInputFile(); void setStandardOutputFile_data(); @@ -1733,6 +1734,47 @@ void tst_QProcess::setProcessEnvironment() } } +void tst_QProcess::environmentIsSorted() +{ + QProcessEnvironment env; + env.insert(QLatin1String("a"), QLatin1String("foo_a")); + env.insert(QLatin1String("B"), QLatin1String("foo_B")); + env.insert(QLatin1String("c"), QLatin1String("foo_c")); + env.insert(QLatin1String("D"), QLatin1String("foo_D")); + env.insert(QLatin1String("e"), QLatin1String("foo_e")); + env.insert(QLatin1String("F"), QLatin1String("foo_F")); + env.insert(QLatin1String("Path"), QLatin1String("foo_Path")); + env.insert(QLatin1String("SystemRoot"), QLatin1String("foo_SystemRoot")); + + const QStringList envlist = env.toStringList(); + +#ifdef Q_OS_WIN32 + // The environment block passed to CreateProcess "[Requires that] All strings in the + // environment block must be sorted alphabetically by name. The sort is case-insensitive, + // Unicode order, without regard to locale." + // https://msdn.microsoft.com/en-us/library/windows/desktop/ms682009(v=vs.85).aspx + // So on Windows we sort that way. + const QStringList expected = { QLatin1String("a=foo_a"), + QLatin1String("B=foo_B"), + QLatin1String("c=foo_c"), + QLatin1String("D=foo_D"), + QLatin1String("e=foo_e"), + QLatin1String("F=foo_F"), + QLatin1String("Path=foo_Path"), + QLatin1String("SystemRoot=foo_SystemRoot") }; +#else + const QStringList expected = { QLatin1String("B=foo_B"), + QLatin1String("D=foo_D"), + QLatin1String("F=foo_F"), + QLatin1String("Path=foo_Path"), + QLatin1String("SystemRoot=foo_SystemRoot"), + QLatin1String("a=foo_a"), + QLatin1String("c=foo_c"), + QLatin1String("e=foo_e") }; +#endif + QCOMPARE(envlist, expected); +} + void tst_QProcess::systemEnvironment() { QVERIFY(!QProcess::systemEnvironment().isEmpty()); From 9a73b7ac96453963693d69ebd71691636d90a154 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Thu, 8 Jun 2017 11:30:44 +0300 Subject: [PATCH 28/54] QLogging: Fix unused static function warning Detected by clang Change-Id: Ia7d1bf085d838d19319ee1060dcb3c0086a510e4 Reviewed-by: Kai Koehne --- src/corelib/global/qlogging.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp index 6a91b2cfd05..b5ba9351940 100644 --- a/src/corelib/global/qlogging.cpp +++ b/src/corelib/global/qlogging.cpp @@ -254,7 +254,7 @@ Q_CORE_EXPORT bool qt_logging_to_console() \sa QMessageLogContext, qDebug(), qInfo(), qWarning(), qCritical(), qFatal() */ -#ifdef Q_OS_WIN +#if defined(Q_CC_MSVC) && defined(QT_DEBUG) && defined(_DEBUG) && defined(_CRT_ERROR) static inline void convert_to_wchar_t_elided(wchar_t *d, size_t space, const char *s) Q_DECL_NOEXCEPT { size_t len = qstrlen(s); From 3e1a7251b4c1878b7be79ab2ea6eed3421d16a9d Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Wed, 7 Jun 2017 10:07:43 +0200 Subject: [PATCH 29/54] ANGLE: Fix crash with ltcg on Visual Studio 2015 Update 3 Release builds of applications that used Qt configured with "link time code generation" crashed (memory access violation), when calling GetInternalFormatInfo in Context::initCaps. It looks like this is a compiler problem that can be avoided by not using a reference for the return value. Task-number: QTBUG-55718 Change-Id: Ic1fb95d7b518a49859f41c819e860864387a8d3c Reviewed-by: Joerg Bornemann --- .../angle/src/libANGLE/formatutils.cpp | 2 +- src/3rdparty/angle/src/libANGLE/formatutils.h | 2 +- .../angle/src/libANGLE/validationES3.cpp | 18 +-- ...with-ltcg-on-Visual-Studio-2015-Upda.patch | 110 ++++++++++++++++++ 4 files changed, 121 insertions(+), 11 deletions(-) create mode 100644 src/angle/patches/0013-ANGLE-Fix-crash-with-ltcg-on-Visual-Studio-2015-Upda.patch diff --git a/src/3rdparty/angle/src/libANGLE/formatutils.cpp b/src/3rdparty/angle/src/libANGLE/formatutils.cpp index 3a4df126c5f..f8b9a8bab8e 100644 --- a/src/3rdparty/angle/src/libANGLE/formatutils.cpp +++ b/src/3rdparty/angle/src/libANGLE/formatutils.cpp @@ -652,7 +652,7 @@ const Type &GetTypeInfo(GLenum type) } } -const InternalFormat &GetInternalFormatInfo(GLenum internalFormat) +const InternalFormat GetInternalFormatInfo(GLenum internalFormat) { const InternalFormatInfoMap &formatMap = GetInternalFormatMap(); InternalFormatInfoMap::const_iterator iter = formatMap.find(internalFormat); diff --git a/src/3rdparty/angle/src/libANGLE/formatutils.h b/src/3rdparty/angle/src/libANGLE/formatutils.h index 6863e4ddc42..2165e6badd2 100644 --- a/src/3rdparty/angle/src/libANGLE/formatutils.h +++ b/src/3rdparty/angle/src/libANGLE/formatutils.h @@ -79,7 +79,7 @@ struct InternalFormat GLint skipRows, GLint skipPixels) const; }; -const InternalFormat &GetInternalFormatInfo(GLenum internalFormat); +const InternalFormat GetInternalFormatInfo(GLenum internalFormat); GLenum GetSizedInternalFormat(GLenum internalFormat, GLenum type); diff --git a/src/3rdparty/angle/src/libANGLE/validationES3.cpp b/src/3rdparty/angle/src/libANGLE/validationES3.cpp index e08e5d261b1..2db64ec4cc3 100644 --- a/src/3rdparty/angle/src/libANGLE/validationES3.cpp +++ b/src/3rdparty/angle/src/libANGLE/validationES3.cpp @@ -775,20 +775,20 @@ static bool IsValidES3CopyTexImageCombination(GLenum textureInternalFormat, GLen // with the values of the source buffer's [channel sizes]. Table 3.17 is used if the // FRAMEBUFFER_ATTACHMENT_ENCODING is LINEAR and table 3.18 is used if the FRAMEBUFFER_ATTACHMENT_ENCODING // is SRGB. - const InternalFormat *sourceEffectiveFormat = NULL; + InternalFormat sourceEffectiveFormat; if (readBufferHandle != 0) { // Not the default framebuffer, therefore the read buffer must be a user-created texture or renderbuffer if (framebufferInternalFormatInfo.pixelBytes > 0) { - sourceEffectiveFormat = &framebufferInternalFormatInfo; + sourceEffectiveFormat = framebufferInternalFormatInfo; } else { // Renderbuffers cannot be created with an unsized internal format, so this must be an unsized-format // texture. We can use the same table we use when creating textures to get its effective sized format. GLenum sizedInternalFormat = GetSizedInternalFormat(framebufferInternalFormatInfo.format, framebufferInternalFormatInfo.type); - sourceEffectiveFormat = &GetInternalFormatInfo(sizedInternalFormat); + sourceEffectiveFormat = GetInternalFormatInfo(sizedInternalFormat); } } else @@ -800,7 +800,7 @@ static bool IsValidES3CopyTexImageCombination(GLenum textureInternalFormat, GLen GLenum effectiveFormat; if (GetEffectiveInternalFormat(framebufferInternalFormatInfo, textureInternalFormatInfo, &effectiveFormat)) { - sourceEffectiveFormat = &GetInternalFormatInfo(effectiveFormat); + sourceEffectiveFormat = GetInternalFormatInfo(effectiveFormat); } else { @@ -816,7 +816,7 @@ static bool IsValidES3CopyTexImageCombination(GLenum textureInternalFormat, GLen (framebufferInternalFormatInfo.blueBits >= 1 && framebufferInternalFormatInfo.blueBits <= 8) && (framebufferInternalFormatInfo.alphaBits >= 1 && framebufferInternalFormatInfo.alphaBits <= 8)) { - sourceEffectiveFormat = &GetInternalFormatInfo(GL_SRGB8_ALPHA8); + sourceEffectiveFormat = GetInternalFormatInfo(GL_SRGB8_ALPHA8); } else { @@ -834,10 +834,10 @@ static bool IsValidES3CopyTexImageCombination(GLenum textureInternalFormat, GLen { // Section 3.8.5 of the GLES 3.0.3 spec, pg 139, requires that, if the destination format is sized, // component sizes of the source and destination formats must exactly match - if (textureInternalFormatInfo.redBits != sourceEffectiveFormat->redBits || - textureInternalFormatInfo.greenBits != sourceEffectiveFormat->greenBits || - textureInternalFormatInfo.blueBits != sourceEffectiveFormat->blueBits || - textureInternalFormatInfo.alphaBits != sourceEffectiveFormat->alphaBits) + if (textureInternalFormatInfo.redBits != sourceEffectiveFormat.redBits || + textureInternalFormatInfo.greenBits != sourceEffectiveFormat.greenBits || + textureInternalFormatInfo.blueBits != sourceEffectiveFormat.blueBits || + textureInternalFormatInfo.alphaBits != sourceEffectiveFormat.alphaBits) { return false; } diff --git a/src/angle/patches/0013-ANGLE-Fix-crash-with-ltcg-on-Visual-Studio-2015-Upda.patch b/src/angle/patches/0013-ANGLE-Fix-crash-with-ltcg-on-Visual-Studio-2015-Upda.patch new file mode 100644 index 00000000000..ee847d3d9a9 --- /dev/null +++ b/src/angle/patches/0013-ANGLE-Fix-crash-with-ltcg-on-Visual-Studio-2015-Upda.patch @@ -0,0 +1,110 @@ +From c30bdc7d961ff09d74117e038c1bb9f06ad49738 Mon Sep 17 00:00:00 2001 +From: Oliver Wolff +Date: Wed, 7 Jun 2017 10:07:43 +0200 +Subject: [PATCH] ANGLE: Fix crash with ltcg on Visual Studio 2015 Update 3 + +Release builds of applications that used Qt configured with "link time +code generation" crashed (memory access violation), when calling +GetInternalFormatInfo in Context::initCaps. + +It looks like this is a compiler problem that can be avoided by not +using a reference for the return value. + +Task-number: QTBUG-55718 +Change-Id: Ic1fb95d7b518a49859f41c819e860864387a8d3c +--- + src/3rdparty/angle/src/libANGLE/formatutils.cpp | 2 +- + src/3rdparty/angle/src/libANGLE/formatutils.h | 2 +- + src/3rdparty/angle/src/libANGLE/validationES3.cpp | 18 +++++++++--------- + 3 files changed, 11 insertions(+), 11 deletions(-) + +diff --git a/src/3rdparty/angle/src/libANGLE/formatutils.cpp b/src/3rdparty/angle/src/libANGLE/formatutils.cpp +index 3a4df12..f8b9a8b 100644 +--- a/src/3rdparty/angle/src/libANGLE/formatutils.cpp ++++ b/src/3rdparty/angle/src/libANGLE/formatutils.cpp +@@ -652,7 +652,7 @@ const Type &GetTypeInfo(GLenum type) + } + } + +-const InternalFormat &GetInternalFormatInfo(GLenum internalFormat) ++const InternalFormat GetInternalFormatInfo(GLenum internalFormat) + { + const InternalFormatInfoMap &formatMap = GetInternalFormatMap(); + InternalFormatInfoMap::const_iterator iter = formatMap.find(internalFormat); +diff --git a/src/3rdparty/angle/src/libANGLE/formatutils.h b/src/3rdparty/angle/src/libANGLE/formatutils.h +index 6863e4d..2165e6b 100644 +--- a/src/3rdparty/angle/src/libANGLE/formatutils.h ++++ b/src/3rdparty/angle/src/libANGLE/formatutils.h +@@ -79,7 +79,7 @@ struct InternalFormat + GLint skipRows, + GLint skipPixels) const; + }; +-const InternalFormat &GetInternalFormatInfo(GLenum internalFormat); ++const InternalFormat GetInternalFormatInfo(GLenum internalFormat); + + GLenum GetSizedInternalFormat(GLenum internalFormat, GLenum type); + +diff --git a/src/3rdparty/angle/src/libANGLE/validationES3.cpp b/src/3rdparty/angle/src/libANGLE/validationES3.cpp +index e08e5d2..2db64ec 100644 +--- a/src/3rdparty/angle/src/libANGLE/validationES3.cpp ++++ b/src/3rdparty/angle/src/libANGLE/validationES3.cpp +@@ -775,20 +775,20 @@ static bool IsValidES3CopyTexImageCombination(GLenum textureInternalFormat, GLen + // with the values of the source buffer's [channel sizes]. Table 3.17 is used if the + // FRAMEBUFFER_ATTACHMENT_ENCODING is LINEAR and table 3.18 is used if the FRAMEBUFFER_ATTACHMENT_ENCODING + // is SRGB. +- const InternalFormat *sourceEffectiveFormat = NULL; ++ InternalFormat sourceEffectiveFormat; + if (readBufferHandle != 0) + { + // Not the default framebuffer, therefore the read buffer must be a user-created texture or renderbuffer + if (framebufferInternalFormatInfo.pixelBytes > 0) + { +- sourceEffectiveFormat = &framebufferInternalFormatInfo; ++ sourceEffectiveFormat = framebufferInternalFormatInfo; + } + else + { + // Renderbuffers cannot be created with an unsized internal format, so this must be an unsized-format + // texture. We can use the same table we use when creating textures to get its effective sized format. + GLenum sizedInternalFormat = GetSizedInternalFormat(framebufferInternalFormatInfo.format, framebufferInternalFormatInfo.type); +- sourceEffectiveFormat = &GetInternalFormatInfo(sizedInternalFormat); ++ sourceEffectiveFormat = GetInternalFormatInfo(sizedInternalFormat); + } + } + else +@@ -800,7 +800,7 @@ static bool IsValidES3CopyTexImageCombination(GLenum textureInternalFormat, GLen + GLenum effectiveFormat; + if (GetEffectiveInternalFormat(framebufferInternalFormatInfo, textureInternalFormatInfo, &effectiveFormat)) + { +- sourceEffectiveFormat = &GetInternalFormatInfo(effectiveFormat); ++ sourceEffectiveFormat = GetInternalFormatInfo(effectiveFormat); + } + else + { +@@ -816,7 +816,7 @@ static bool IsValidES3CopyTexImageCombination(GLenum textureInternalFormat, GLen + (framebufferInternalFormatInfo.blueBits >= 1 && framebufferInternalFormatInfo.blueBits <= 8) && + (framebufferInternalFormatInfo.alphaBits >= 1 && framebufferInternalFormatInfo.alphaBits <= 8)) + { +- sourceEffectiveFormat = &GetInternalFormatInfo(GL_SRGB8_ALPHA8); ++ sourceEffectiveFormat = GetInternalFormatInfo(GL_SRGB8_ALPHA8); + } + else + { +@@ -834,10 +834,10 @@ static bool IsValidES3CopyTexImageCombination(GLenum textureInternalFormat, GLen + { + // Section 3.8.5 of the GLES 3.0.3 spec, pg 139, requires that, if the destination format is sized, + // component sizes of the source and destination formats must exactly match +- if (textureInternalFormatInfo.redBits != sourceEffectiveFormat->redBits || +- textureInternalFormatInfo.greenBits != sourceEffectiveFormat->greenBits || +- textureInternalFormatInfo.blueBits != sourceEffectiveFormat->blueBits || +- textureInternalFormatInfo.alphaBits != sourceEffectiveFormat->alphaBits) ++ if (textureInternalFormatInfo.redBits != sourceEffectiveFormat.redBits || ++ textureInternalFormatInfo.greenBits != sourceEffectiveFormat.greenBits || ++ textureInternalFormatInfo.blueBits != sourceEffectiveFormat.blueBits || ++ textureInternalFormatInfo.alphaBits != sourceEffectiveFormat.alphaBits) + { + return false; + } +-- +2.5.3.windows.1 + From 73f8b605e3354f1ab85f36c8d20bdf0de2b1f74e Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Fri, 2 Jun 2017 11:28:31 +0200 Subject: [PATCH 30/54] uic: Fix possible crash when reading the size hint property It may crash on (probably a bit broken) qtbase/src/printsupport/dialogs/qpagesetupwidget.ui Change-Id: Ibca95a3d8aa4899adbc952aee7b46621ac888c6a Reviewed-by: Friedemann Kleint --- src/tools/uic/cpp/cppwriteinitialization.cpp | 7 +- .../tools/uic/baseline/qpagesetupwidget.ui | 181 +++++++++++------- .../tools/uic/baseline/qpagesetupwidget.ui.h | 139 +++++++++----- 3 files changed, 207 insertions(+), 120 deletions(-) diff --git a/src/tools/uic/cpp/cppwriteinitialization.cpp b/src/tools/uic/cpp/cppwriteinitialization.cpp index bbef010a9c3..d208ec6718e 100644 --- a/src/tools/uic/cpp/cppwriteinitialization.cpp +++ b/src/tools/uic/cpp/cppwriteinitialization.cpp @@ -84,9 +84,10 @@ namespace { int w = 0; int h = 0; if (properties.contains(QLatin1String("sizeHint"))) { - const DomSize *sizeHint = properties.value(QLatin1String("sizeHint"))->elementSize(); - w = sizeHint->elementWidth(); - h = sizeHint->elementHeight(); + if (const DomSize *sizeHint = properties.value(QLatin1String("sizeHint"))->elementSize()) { + w = sizeHint->elementWidth(); + h = sizeHint->elementHeight(); + } } output << w << ", " << h << ", "; diff --git a/tests/auto/tools/uic/baseline/qpagesetupwidget.ui b/tests/auto/tools/uic/baseline/qpagesetupwidget.ui index ace2ab8f447..960a9dac17a 100644 --- a/tests/auto/tools/uic/baseline/qpagesetupwidget.ui +++ b/tests/auto/tools/uic/baseline/qpagesetupwidget.ui @@ -6,7 +6,7 @@ 0 0 416 - 488 + 515 @@ -16,44 +16,24 @@ 0 - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - + + + Paper - - - - + + + + Page size: - - paperSize + + pageSizeCombo - + @@ -61,14 +41,14 @@ Width: - paperWidth + pageWidth - + 9999.989999999999782 @@ -80,12 +60,12 @@ Height: - paperHeight + pageHeight - + 9999.989999999999782 @@ -122,9 +102,32 @@ - - - + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + Orientation @@ -175,12 +178,9 @@ - - - - - - + + + Margins @@ -280,9 +280,25 @@ - - - + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 0 + 20 + + + + + + + bottom margin @@ -296,28 +312,15 @@ - - - + + + Qt::Horizontal QSizePolicy::MinimumExpanding - - - 0 - 20 - - - - - - - - Qt::Horizontal - - + QSizePolicy::MinimumExpanding @@ -333,15 +336,57 @@ - - - + + + + Page Layout + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Page order: + + + + + + + + + + Pages per sheet: + + + + + + + + + Qt::Vertical 20 - 0 + 40 diff --git a/tests/auto/tools/uic/baseline/qpagesetupwidget.ui.h b/tests/auto/tools/uic/baseline/qpagesetupwidget.ui.h index 0c6fc92ea21..d75f7f11464 100644 --- a/tests/auto/tools/uic/baseline/qpagesetupwidget.ui.h +++ b/tests/auto/tools/uic/baseline/qpagesetupwidget.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'qpagesetupwidget.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.9.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -31,21 +31,22 @@ class Ui_QPageSetupWidget { public: QGridLayout *gridLayout_3; - QHBoxLayout *horizontalLayout_4; - QComboBox *unit; - QSpacerItem *horizontalSpacer_3; QGroupBox *groupBox_2; QGridLayout *gridLayout_2; QLabel *pageSizeLabel; - QComboBox *paperSize; + QComboBox *pageSizeCombo; QLabel *widthLabel; QHBoxLayout *horizontalLayout_3; - QDoubleSpinBox *paperWidth; + QDoubleSpinBox *pageWidth; QLabel *heightLabel; - QDoubleSpinBox *paperHeight; + QDoubleSpinBox *pageHeight; QLabel *paperSourceLabel; QComboBox *paperSource; QSpacerItem *horizontalSpacer_4; + QHBoxLayout *horizontalLayout_4; + QComboBox *unitCombo; + QSpacerItem *horizontalSpacer_3; + QWidget *preview; QGroupBox *groupBox_3; QVBoxLayout *verticalLayout; QRadioButton *portrait; @@ -53,7 +54,6 @@ public: QRadioButton *reverseLandscape; QRadioButton *reversePortrait; QSpacerItem *verticalSpacer_5; - QWidget *preview; QGroupBox *groupBox; QHBoxLayout *horizontalLayout_2; QGridLayout *gridLayout; @@ -64,33 +64,26 @@ public: QSpacerItem *horizontalSpacer; QDoubleSpinBox *rightMargin; QSpacerItem *horizontalSpacer_8; - QDoubleSpinBox *bottomMargin; QSpacerItem *horizontalSpacer_2; + QDoubleSpinBox *bottomMargin; QSpacerItem *horizontalSpacer_5; + QGroupBox *pagesPerSheetButtonGroup; + QGridLayout *gridLayout_4; + QComboBox *pagesPerSheetCombo; + QSpacerItem *horizontalSpacer_6; + QLabel *label; + QComboBox *pagesPerSheetLayoutCombo; + QLabel *label_2; QSpacerItem *verticalSpacer; void setupUi(QWidget *QPageSetupWidget) { if (QPageSetupWidget->objectName().isEmpty()) QPageSetupWidget->setObjectName(QStringLiteral("QPageSetupWidget")); - QPageSetupWidget->resize(416, 488); + QPageSetupWidget->resize(416, 515); gridLayout_3 = new QGridLayout(QPageSetupWidget); gridLayout_3->setContentsMargins(0, 0, 0, 0); gridLayout_3->setObjectName(QStringLiteral("gridLayout_3")); - horizontalLayout_4 = new QHBoxLayout(); - horizontalLayout_4->setObjectName(QStringLiteral("horizontalLayout_4")); - unit = new QComboBox(QPageSetupWidget); - unit->setObjectName(QStringLiteral("unit")); - - horizontalLayout_4->addWidget(unit); - - horizontalSpacer_3 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - horizontalLayout_4->addItem(horizontalSpacer_3); - - - gridLayout_3->addLayout(horizontalLayout_4, 0, 0, 1, 2); - groupBox_2 = new QGroupBox(QPageSetupWidget); groupBox_2->setObjectName(QStringLiteral("groupBox_2")); gridLayout_2 = new QGridLayout(groupBox_2); @@ -100,10 +93,10 @@ public: gridLayout_2->addWidget(pageSizeLabel, 0, 0, 1, 1); - paperSize = new QComboBox(groupBox_2); - paperSize->setObjectName(QStringLiteral("paperSize")); + pageSizeCombo = new QComboBox(groupBox_2); + pageSizeCombo->setObjectName(QStringLiteral("pageSizeCombo")); - gridLayout_2->addWidget(paperSize, 0, 1, 1, 1); + gridLayout_2->addWidget(pageSizeCombo, 0, 1, 1, 1); widthLabel = new QLabel(groupBox_2); widthLabel->setObjectName(QStringLiteral("widthLabel")); @@ -112,22 +105,22 @@ public: horizontalLayout_3 = new QHBoxLayout(); horizontalLayout_3->setObjectName(QStringLiteral("horizontalLayout_3")); - paperWidth = new QDoubleSpinBox(groupBox_2); - paperWidth->setObjectName(QStringLiteral("paperWidth")); - paperWidth->setMaximum(9999.99); + pageWidth = new QDoubleSpinBox(groupBox_2); + pageWidth->setObjectName(QStringLiteral("pageWidth")); + pageWidth->setMaximum(9999.99); - horizontalLayout_3->addWidget(paperWidth); + horizontalLayout_3->addWidget(pageWidth); heightLabel = new QLabel(groupBox_2); heightLabel->setObjectName(QStringLiteral("heightLabel")); horizontalLayout_3->addWidget(heightLabel); - paperHeight = new QDoubleSpinBox(groupBox_2); - paperHeight->setObjectName(QStringLiteral("paperHeight")); - paperHeight->setMaximum(9999.99); + pageHeight = new QDoubleSpinBox(groupBox_2); + pageHeight->setObjectName(QStringLiteral("pageHeight")); + pageHeight->setMaximum(9999.99); - horizontalLayout_3->addWidget(paperHeight); + horizontalLayout_3->addWidget(pageHeight); gridLayout_2->addLayout(horizontalLayout_3, 1, 1, 1, 1); @@ -149,6 +142,25 @@ public: gridLayout_3->addWidget(groupBox_2, 1, 0, 1, 2); + horizontalLayout_4 = new QHBoxLayout(); + horizontalLayout_4->setObjectName(QStringLiteral("horizontalLayout_4")); + unitCombo = new QComboBox(QPageSetupWidget); + unitCombo->setObjectName(QStringLiteral("unitCombo")); + + horizontalLayout_4->addWidget(unitCombo); + + horizontalSpacer_3 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + horizontalLayout_4->addItem(horizontalSpacer_3); + + + gridLayout_3->addLayout(horizontalLayout_4, 0, 0, 1, 2); + + preview = new QWidget(QPageSetupWidget); + preview->setObjectName(QStringLiteral("preview")); + + gridLayout_3->addWidget(preview, 2, 1, 2, 1); + groupBox_3 = new QGroupBox(QPageSetupWidget); groupBox_3->setObjectName(QStringLiteral("groupBox_3")); verticalLayout = new QVBoxLayout(groupBox_3); @@ -181,11 +193,6 @@ public: gridLayout_3->addWidget(groupBox_3, 2, 0, 1, 1); - preview = new QWidget(QPageSetupWidget); - preview->setObjectName(QStringLiteral("preview")); - - gridLayout_3->addWidget(preview, 2, 1, 2, 1); - groupBox = new QGroupBox(QPageSetupWidget); groupBox->setObjectName(QStringLiteral("groupBox")); horizontalLayout_2 = new QHBoxLayout(groupBox); @@ -230,6 +237,10 @@ public: gridLayout->addLayout(horizontalLayout, 1, 0, 1, 3); + horizontalSpacer_2 = new QSpacerItem(0, 20, QSizePolicy::MinimumExpanding, QSizePolicy::Minimum); + + gridLayout->addItem(horizontalSpacer_2, 0, 2, 1, 1); + bottomMargin = new QDoubleSpinBox(groupBox); bottomMargin->setObjectName(QStringLiteral("bottomMargin")); bottomMargin->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); @@ -237,10 +248,6 @@ public: gridLayout->addWidget(bottomMargin, 2, 1, 1, 1); - horizontalSpacer_2 = new QSpacerItem(0, 20, QSizePolicy::MinimumExpanding, QSizePolicy::Minimum); - - gridLayout->addItem(horizontalSpacer_2, 0, 2, 1, 1); - horizontalSpacer_5 = new QSpacerItem(0, 20, QSizePolicy::MinimumExpanding, QSizePolicy::Minimum); gridLayout->addItem(horizontalSpacer_5, 0, 0, 1, 1); @@ -251,14 +258,45 @@ public: gridLayout_3->addWidget(groupBox, 3, 0, 1, 1); - verticalSpacer = new QSpacerItem(20, 0, QSizePolicy::Minimum, QSizePolicy::Expanding); + pagesPerSheetButtonGroup = new QGroupBox(QPageSetupWidget); + pagesPerSheetButtonGroup->setObjectName(QStringLiteral("pagesPerSheetButtonGroup")); + gridLayout_4 = new QGridLayout(pagesPerSheetButtonGroup); + gridLayout_4->setObjectName(QStringLiteral("gridLayout_4")); + pagesPerSheetCombo = new QComboBox(pagesPerSheetButtonGroup); + pagesPerSheetCombo->setObjectName(QStringLiteral("pagesPerSheetCombo")); - gridLayout_3->addItem(verticalSpacer, 4, 0, 1, 1); + gridLayout_4->addWidget(pagesPerSheetCombo, 0, 1, 1, 1); + + horizontalSpacer_6 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + gridLayout_4->addItem(horizontalSpacer_6, 0, 2, 1, 1); + + label = new QLabel(pagesPerSheetButtonGroup); + label->setObjectName(QStringLiteral("label")); + + gridLayout_4->addWidget(label, 1, 0, 1, 1); + + pagesPerSheetLayoutCombo = new QComboBox(pagesPerSheetButtonGroup); + pagesPerSheetLayoutCombo->setObjectName(QStringLiteral("pagesPerSheetLayoutCombo")); + + gridLayout_4->addWidget(pagesPerSheetLayoutCombo, 1, 1, 1, 1); + + label_2 = new QLabel(pagesPerSheetButtonGroup); + label_2->setObjectName(QStringLiteral("label_2")); + + gridLayout_4->addWidget(label_2, 0, 0, 1, 1); + + + gridLayout_3->addWidget(pagesPerSheetButtonGroup, 5, 0, 1, 2); + + verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); + + gridLayout_3->addItem(verticalSpacer, 6, 0, 1, 1); #ifndef QT_NO_SHORTCUT - pageSizeLabel->setBuddy(paperSize); - widthLabel->setBuddy(paperWidth); - heightLabel->setBuddy(paperHeight); + pageSizeLabel->setBuddy(pageSizeCombo); + widthLabel->setBuddy(pageWidth); + heightLabel->setBuddy(pageHeight); paperSourceLabel->setBuddy(paperSource); #endif // QT_NO_SHORTCUT @@ -305,6 +343,9 @@ public: #ifndef QT_NO_ACCESSIBILITY bottomMargin->setAccessibleName(QApplication::translate("QPageSetupWidget", "bottom margin", Q_NULLPTR)); #endif // QT_NO_ACCESSIBILITY + pagesPerSheetButtonGroup->setTitle(QApplication::translate("QPageSetupWidget", "Page Layout", Q_NULLPTR)); + label->setText(QApplication::translate("QPageSetupWidget", "Page order:", Q_NULLPTR)); + label_2->setText(QApplication::translate("QPageSetupWidget", "Pages per sheet:", Q_NULLPTR)); } // retranslateUi }; From 9bd01b9618294f51afcfa07d716b964b371d0f2d Mon Sep 17 00:00:00 2001 From: Kimmo Ollila Date: Mon, 8 May 2017 11:31:41 +0300 Subject: [PATCH 31/54] Remove message of integrityfb from config summary This cleans the config summary output Change-Id: I4e78f00c722e646a730906d462f7632d6012a6d8 Reviewed-by: Lars Knoll Reviewed-by: Oswald Buddenhagen Reviewed-by: Tero Alamaki --- src/gui/configure.json | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gui/configure.json b/src/gui/configure.json index ee3615390d0..2fb03a452ab 100644 --- a/src/gui/configure.json +++ b/src/gui/configure.json @@ -1152,7 +1152,6 @@ QMAKE_LIBDIR_OPENGL[_ES2] and QMAKE_LIBS_OPENGL[_ES2] in the mkspec for your pla "linuxfb", "vnc", "mirclient", { "type": "feature", - "message": "INTEGRITY framebuffer", "condition": "config.integrity", "args": "integrityfb" }, From fd4be4c7d2c6dd80f7fc926c50a44b80ff20b1c2 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Thu, 8 Jun 2017 14:27:01 +0200 Subject: [PATCH 32/54] Doc: Do not exclude *_x11.cpp files from the documentation build QX11Info class from the Qt X11 Extras module is documented in qx11info_x11.cpp, and it needs to be parsed. Change-Id: I32e8415d93e67dbf16267d4af63979c1db0870b0 Reviewed-by: Andy Shaw --- doc/global/qt-cpp-defines.qdocconf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/global/qt-cpp-defines.qdocconf b/doc/global/qt-cpp-defines.qdocconf index f4f083d3e8d..e185c20b8f4 100644 --- a/doc/global/qt-cpp-defines.qdocconf +++ b/doc/global/qt-cpp-defines.qdocconf @@ -240,5 +240,4 @@ excludefiles += \ "*_unix.cpp" \ "*_udev.cpp" \ "*_vxworks.cpp" \ - "*_darwin.cpp" \ - "*_x11.cpp" + "*_darwin.cpp" From 24decb49d6c53afa866644bbfb62bcde30cfe8fc Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Wed, 24 May 2017 10:46:07 +0200 Subject: [PATCH 33/54] winrt: Fix tst_QImageReader Change-Id: I3a7db49329d8f1677c17267f5878d5144ad37823 Reviewed-by: Friedemann Kleint --- tests/auto/gui/image/qimagereader/tst_qimagereader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp index 18649b3de51..19948edcdf2 100644 --- a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp +++ b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp @@ -193,7 +193,7 @@ void tst_QImageReader::getSetCheck() } tst_QImageReader::tst_QImageReader() : - m_temporaryDir(QStringLiteral("tst_qimagereaderXXXXXX")) + m_temporaryDir(QDir::tempPath() + QStringLiteral("/tst_qimagereaderXXXXXX")) { m_temporaryDir.setAutoRemove(true); } From 876aed331d7c6d7df81da1dace73dea49176ad1e Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Wed, 24 May 2017 10:45:37 +0200 Subject: [PATCH 34/54] Fix tst_QIcon for configurations with builtin_testdata Change-Id: Ibf9fcf7d3a8d58c9c488637a45985593950defaf Reviewed-by: Simon Hausmann --- tests/auto/gui/image/qicon/qicon.pro | 2 +- tests/auto/gui/image/qicon/tst_qicon.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/gui/image/qicon/qicon.pro b/tests/auto/gui/image/qicon/qicon.pro index f5570c24978..b3c60bf32b6 100644 --- a/tests/auto/gui/image/qicon/qicon.pro +++ b/tests/auto/gui/image/qicon/qicon.pro @@ -4,6 +4,6 @@ TARGET = tst_qicon QT += testlib qtHaveModule(widgets): QT += widgets SOURCES += tst_qicon.cpp -RESOURCES = tst_qicon.qrc +RESOURCES = tst_qicon.qrc tst_qicon.cpp TESTDATA += icons/* second_icons/* *.png *.svg *.svgz diff --git a/tests/auto/gui/image/qicon/tst_qicon.cpp b/tests/auto/gui/image/qicon/tst_qicon.cpp index e031ffec71f..175179699d4 100644 --- a/tests/auto/gui/image/qicon/tst_qicon.cpp +++ b/tests/auto/gui/image/qicon/tst_qicon.cpp @@ -83,7 +83,7 @@ bool tst_QIcon::haveImageFormat(QByteArray const& desiredFormat) tst_QIcon::tst_QIcon() : m_pngImageFileName(QFINDTESTDATA("image.png")) , m_pngRectFileName(QFINDTESTDATA("rect.png")) - , m_sourceFileName(QFINDTESTDATA(__FILE__)) + , m_sourceFileName(":/tst_qicon.cpp") { } From d0706ae3a3996ef6edc196152ad7ae6eaac24dc6 Mon Sep 17 00:00:00 2001 From: James McDonnell Date: Mon, 24 Apr 2017 09:53:57 -0400 Subject: [PATCH 35/54] Enable stack-protector-strong for QNX 7.0.0 This was originally enabled in the mkspecs for 64-bit QNX 7.0.0 but that broke when the qtConfig change was made. It looks like qtConfig shouldn't be used in the platform mkspecs. I suspect the stack-protector changes were left out of the 32-bit mkspecs so that 6.6.0 builds wouldn't be affected. Ignore the stack-protector/stack-protector-all possibility since it isn't possible to access it without a command line option. Specifying both options doesn't even make sense since stack-protector-all encompasses stack-protector. For now, leave out command line control of this feature. Task-number: QTBUG-59644 Change-Id: I99323216be5b592dd2c3bef6d22da195764a6e65 Reviewed-by: Oswald Buddenhagen --- .../unix/stack-protector/stack-protector.cpp | 52 +++++++++++++++++++ .../unix/stack-protector/stack-protector.pro | 2 + configure.json | 6 +-- mkspecs/common/qcc-base.conf | 2 + mkspecs/features/default_post.prf | 5 ++ mkspecs/features/qt_common.prf | 1 + mkspecs/qnx-aarch64le-qcc/qmake.conf | 8 --- mkspecs/qnx-x86-64-qcc/qmake.conf | 8 --- 8 files changed, 65 insertions(+), 19 deletions(-) create mode 100644 config.tests/unix/stack-protector/stack-protector.cpp create mode 100644 config.tests/unix/stack-protector/stack-protector.pro diff --git a/config.tests/unix/stack-protector/stack-protector.cpp b/config.tests/unix/stack-protector/stack-protector.cpp new file mode 100644 index 00000000000..8b3926fe1fc --- /dev/null +++ b/config.tests/unix/stack-protector/stack-protector.cpp @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +#if defined(__QNXNTO__) +#include + +#if _NTO_VERSION < 700 +#error stack-protector not used (by default) before QNX 7.0.0. +#endif + +#endif + +int main() +{ + return 0; +} diff --git a/config.tests/unix/stack-protector/stack-protector.pro b/config.tests/unix/stack-protector/stack-protector.pro new file mode 100644 index 00000000000..ac84d7f148b --- /dev/null +++ b/config.tests/unix/stack-protector/stack-protector.pro @@ -0,0 +1,2 @@ +SOURCES = stack-protector.cpp +QMAKE_CXXFLAGS += -fstack-protector-strong diff --git a/configure.json b/configure.json index 52831f161f8..8b5f07ed546 100644 --- a/configure.json +++ b/configure.json @@ -425,8 +425,8 @@ }, "stack_protector": { "label": "stack protection", - "type": "compilerSupportsFlag", - "test": "-fstack-protector-strong" + "type": "compile", + "test": "unix/stack-protector" }, "incredibuild_xge": { "label": "IncrediBuild", @@ -930,7 +930,7 @@ "stack-protector-strong": { "label": "stack protection", "condition": "config.qnx && tests.stack_protector", - "output": [ "publicQtConfig" ] + "output": [ "privateFeature" ] }, "system-zlib": { "label": "Using system zlib", diff --git a/mkspecs/common/qcc-base.conf b/mkspecs/common/qcc-base.conf index 4ef03d8587b..b48e84ee1da 100644 --- a/mkspecs/common/qcc-base.conf +++ b/mkspecs/common/qcc-base.conf @@ -34,6 +34,8 @@ QMAKE_CFLAGS_SSE4_2 += -msse4.2 QMAKE_CFLAGS_AVX += -mavx QMAKE_CFLAGS_AVX2 += -mavx2 +QMAKE_CFLAGS_STACK_PROTECTOR_STRONG = -fstack-protector-strong + QMAKE_CXXFLAGS += $$QMAKE_CFLAGS -lang-c++ QMAKE_CXXFLAGS_DEPS += $$QMAKE_CFLAGS_DEPS QMAKE_CXXFLAGS_WARN_ON += $$QMAKE_CFLAGS_WARN_ON diff --git a/mkspecs/features/default_post.prf b/mkspecs/features/default_post.prf index d18604e0b80..7e027325bd9 100644 --- a/mkspecs/features/default_post.prf +++ b/mkspecs/features/default_post.prf @@ -71,6 +71,11 @@ debug { QMAKE_LIBFLAGS += $$QMAKE_LIBFLAGS_RELEASE } +stack_protector_strong { + QMAKE_CFLAGS += $$QMAKE_CFLAGS_STACK_PROTECTOR_STRONG + QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_STACK_PROTECTOR_STRONG +} + # disable special linker flags for host builds (no proper test for host support yet) !host_build|!cross_compile { use_gold_linker: QMAKE_LFLAGS += $$QMAKE_LFLAGS_USE_GOLD diff --git a/mkspecs/features/qt_common.prf b/mkspecs/features/qt_common.prf index ea235514b75..1e138730b3f 100644 --- a/mkspecs/features/qt_common.prf +++ b/mkspecs/features/qt_common.prf @@ -17,6 +17,7 @@ DEFINES *= QT_NO_NARROWING_CONVERSIONS_IN_CONNECT qtConfig(c++11): CONFIG += c++11 strict_c++ qtConfig(c++14): CONFIG += c++14 qtConfig(c++1z): CONFIG += c++1z +qtConfig(stack-protector-strong): CONFIG += stack_protector_strong contains(TEMPLATE, .*lib) { # module and plugins if(!host_build|!cross_compile):qtConfig(reduce_exports): CONFIG += hide_symbols diff --git a/mkspecs/qnx-aarch64le-qcc/qmake.conf b/mkspecs/qnx-aarch64le-qcc/qmake.conf index 5e3123bece7..754bc273589 100644 --- a/mkspecs/qnx-aarch64le-qcc/qmake.conf +++ b/mkspecs/qnx-aarch64le-qcc/qmake.conf @@ -7,11 +7,3 @@ DEFINES += _FORTIFY_SOURCE=2 QMAKE_LFLAGS_SHLIB += -Wl,-z,relro -Wl,-z,now include(../common/qcc-base-qnx-aarch64le.conf) - -qtConfig(stack-protector-strong) { - QMAKE_CFLAGS += -fstack-protector-strong - QMAKE_CXXFLAGS += -fstack-protector-strong -} else { - QMAKE_CFLAGS += -fstack-protector -fstack-protector-all - QMAKE_CXXFLAGS += -fstack-protector -fstack-protector-all -} diff --git a/mkspecs/qnx-x86-64-qcc/qmake.conf b/mkspecs/qnx-x86-64-qcc/qmake.conf index 2a01ed14054..c4791813429 100644 --- a/mkspecs/qnx-x86-64-qcc/qmake.conf +++ b/mkspecs/qnx-x86-64-qcc/qmake.conf @@ -5,11 +5,3 @@ QMAKE_LFLAGS_SHLIB += -Wl,-z,relro -Wl,-z,now include(../common/qcc-base-qnx-x86-64.conf) - -qtConfig(stack-protector-strong) { - QMAKE_CFLAGS += -fstack-protector-strong - QMAKE_CXXFLAGS += -fstack-protector-strong -} else { - QMAKE_CFLAGS += -fstack-protector -fstack-protector-all - QMAKE_CXXFLAGS += -fstack-protector -fstack-protector-all -} From 64a3ca56d78071aa328f35445f3564edbf0d1fec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tony=20Saraj=C3=A4rvi?= Date: Tue, 13 Jun 2017 11:14:34 +0300 Subject: [PATCH 36/54] Blacklist flaky tst_QMdiArea test Task-number: QTBUG-61381 Change-Id: I5f47315b32b74245479b73297f64944ac929c2b6 Reviewed-by: Liang Qi --- tests/auto/widgets/widgets/qmdiarea/BLACKLIST | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/auto/widgets/widgets/qmdiarea/BLACKLIST b/tests/auto/widgets/widgets/qmdiarea/BLACKLIST index 63da2e3ae38..b1c8d7dfded 100644 --- a/tests/auto/widgets/widgets/qmdiarea/BLACKLIST +++ b/tests/auto/widgets/widgets/qmdiarea/BLACKLIST @@ -3,3 +3,5 @@ osx [tileSubWindows] osx xcb +[resizeTimer] +osx From 5e3b284345f0f6c0da721a0de8748258965d0841 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 19 May 2017 16:14:57 +0200 Subject: [PATCH 37/54] Follow KDE settings for menu and toolbar fonts Makes pure Qt applications integrate better when those fonts don't match the general fonts. Change-Id: Ic06e8595efc44f0c6649cf364e751c4c714cda93 Reviewed-by: Friedemann Kleint --- .../themes/genericunix/qgenericunixthemes.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp index 8dfae2ca0b7..2b4c6a000fe 100644 --- a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp +++ b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp @@ -366,6 +366,14 @@ void QKdeThemePrivate::refresh() resources.fonts[QPlatformTheme::FixedFont] = fixedFont; } + if (QFont *menuFont = kdeFont(readKdeSetting(QStringLiteral("menuFont"), kdeDirs, kdeVersion, kdeSettings))) { + resources.fonts[QPlatformTheme::MenuFont] = menuFont; + resources.fonts[QPlatformTheme::MenuBarFont] = new QFont(*menuFont); + } + + if (QFont *toolBarFont = kdeFont(readKdeSetting(QStringLiteral("toolBarFont"), kdeDirs, kdeVersion, kdeSettings))) + resources.fonts[QPlatformTheme::ToolButtonFont] = toolBarFont; + qDeleteAll(kdeSettings); } From 79a77f7def676c557792fb871df3f36a86a3fa5f Mon Sep 17 00:00:00 2001 From: Dongmei Wang Date: Mon, 12 Jun 2017 18:56:16 -0700 Subject: [PATCH 38/54] Manual dialog test: fix use custom directory icon option setting In FileDialogPanel::options(), QFileDialog::DontUseCustomDirectoryIcons was set when the "Don't use custom directory icons" box wasn't checked. Change-Id: I6e9d9b41cf91f4abcc98c02bed44675908a8391d Reviewed-by: Friedemann Kleint --- tests/manual/dialogs/filedialogpanel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/manual/dialogs/filedialogpanel.cpp b/tests/manual/dialogs/filedialogpanel.cpp index ff935f52800..9e3c761cfff 100644 --- a/tests/manual/dialogs/filedialogpanel.cpp +++ b/tests/manual/dialogs/filedialogpanel.cpp @@ -300,7 +300,7 @@ QFileDialog::Options FileDialogPanel::options() const result |= QFileDialog::DontConfirmOverwrite; if (!m_native->isChecked()) result |= QFileDialog::DontUseNativeDialog; - if (!m_customDirIcons->isChecked()) + if (m_customDirIcons->isChecked()) result |= QFileDialog::DontUseCustomDirectoryIcons; return result; } From efd9016ea1f11dca78fec7b6c5a4221474436a63 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 5 Jun 2017 14:16:16 -0700 Subject: [PATCH 39/54] Add warning about missing but required CPU features Useful to debug why you're getting SIGILL, like running under Valgrind: Processor features: sse3[required] sse2[required] ssse3[required] fma cmpxchg16b sse4.1[required] sse4.2[required] movbe popcnt[required] aes[required] avx[required] f16c[required] bmi[required] avx2[required] bmi2[required] !!!!!!!!!!!!!!!!!!!! !!! Missing required features: rdrand rdseed !!! Applications will likely crash with "Invalid Instruction" !!!!!!!!!!!!!!!!!!!! Change-Id: Ia3e896da908f42939148fffd14c556557419b091 Reviewed-by: Allan Sandfeld Jensen --- src/corelib/tools/qsimd.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/corelib/tools/qsimd.cpp b/src/corelib/tools/qsimd.cpp index d4edf459de0..4c6f08c7746 100644 --- a/src/corelib/tools/qsimd.cpp +++ b/src/corelib/tools/qsimd.cpp @@ -721,6 +721,14 @@ void qDumpCPUFeatures() printf("%s%s", features_string + features_indices[i], minFeature & (Q_UINT64_C(1) << i) ? "[required]" : ""); } + if ((features = (qCompilerCpuFeatures & ~features))) { + printf("\n!!!!!!!!!!!!!!!!!!!!\n!!! Missing required features:"); + for (int i = 0; i < features_count; ++i) { + if (features & (Q_UINT64_C(1) << i)) + printf("%s", features_string + features_indices[i]); + } + printf("\n!!! Applications will likely crash with \"Invalid Instruction\"\n!!!!!!!!!!!!!!!!!!!!"); + } puts(""); } From 25d9bd4bf4f088441addb044a499179b6063494f Mon Sep 17 00:00:00 2001 From: Maurice Kalinowski Date: Tue, 13 Jun 2017 09:05:14 +0200 Subject: [PATCH 40/54] winrt: doc: Update platform limitations for UWP UWP only allows clipboard access when the app is active and has focus. Task-number: QTBUG-60900 Change-Id: Ia69642740d894106875cef77adf48e934bae9c87 Reviewed-by: Martin Smith Reviewed-by: Nico Vertriest --- src/gui/kernel/qclipboard.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/gui/kernel/qclipboard.cpp b/src/gui/kernel/qclipboard.cpp index f14355bc014..cd8406b8dcb 100644 --- a/src/gui/kernel/qclipboard.cpp +++ b/src/gui/kernel/qclipboard.cpp @@ -137,6 +137,17 @@ QT_BEGIN_NAMESPACE \endlist + \section1 Notes for Universal Windows Platform Users + + \list + + \li The Universal Windows Platform only allows to query the + clipboard in case the application is active and an application + window has focus. Accessing the clipboard data when in background + will fail due to access denial. + + \endlist + \sa QGuiApplication */ From ac7e8cc7f74b511c2ce6577d7d2b6c648b78a87d Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 9 Jun 2017 15:44:00 +0200 Subject: [PATCH 41/54] Direct2D: Fix build with MinGW 7.1 qwindowsdirect2ddevicecontext.cpp:92:105: error: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'HRESULT {aka long int}' [-Werror=format=] qWarning("%s: EndDraw failed: %#x, tag1: %lld, tag2: %lld", __FUNCTION__, hr, tag1, tag2); Change format to long and cast argument to long for extra safety (should some obscure MinGW header define another type). Change-Id: I7e6cb8ea1e5c27ef104b162ced9a696ab252fd8d Reviewed-by: Joerg Bornemann --- .../platforms/direct2d/qwindowsdirect2ddevicecontext.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2ddevicecontext.cpp b/src/plugins/platforms/direct2d/qwindowsdirect2ddevicecontext.cpp index 8a34f6974f3..643ae877d0b 100644 --- a/src/plugins/platforms/direct2d/qwindowsdirect2ddevicecontext.cpp +++ b/src/plugins/platforms/direct2d/qwindowsdirect2ddevicecontext.cpp @@ -89,7 +89,8 @@ public: if (FAILED(hr)) { success = false; - qWarning("%s: EndDraw failed: %#x, tag1: %lld, tag2: %lld", __FUNCTION__, hr, tag1, tag2); + qWarning("%s: EndDraw failed: %#lx, tag1: %lld, tag2: %lld", + __FUNCTION__, long(hr), tag1, tag2); } } From 36f21c5b560c3036e3e74db8669e8eb0fb14b445 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 14 Jun 2017 11:00:29 +0200 Subject: [PATCH 42/54] Blacklist tst_QWidget::restoreVersion1Geometry for XCB FAIL! : tst_QWidget::restoreVersion1Geometry(geometry.dat) Compared values are not the same Actual (((widget.pos()))): QPoint(90,90) Expected (expectedPosition): QPoint(100,100) Loc: [tst_qwidget.cpp(3193)] Remove the previously added QSKIP since this test now passes. Task-number: QTBUG-26421 Task-number: QTBUG-46116 Change-Id: Ieff474a8a69c14a0df231a9a587aee02df4e8ea7 Reviewed-by: Joerg Bornemann --- tests/auto/widgets/kernel/qwidget/BLACKLIST | 2 +- tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/auto/widgets/kernel/qwidget/BLACKLIST b/tests/auto/widgets/kernel/qwidget/BLACKLIST index 46791ff884b..01c8e783add 100644 --- a/tests/auto/widgets/kernel/qwidget/BLACKLIST +++ b/tests/auto/widgets/kernel/qwidget/BLACKLIST @@ -7,7 +7,7 @@ ubuntu-14.04 ubuntu-16.04 b2qt [restoreVersion1Geometry] -ubuntu-14.04 +xcb osx [updateWhileMinimized] ubuntu-14.04 diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index 0933dc991d4..2b6dc5f7e1e 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -3195,9 +3195,6 @@ void tst_QWidget::restoreVersion1Geometry() widget.showNormal(); QTest::qWait(10); - if (m_platform == QStringLiteral("xcb")) - QSKIP("QTBUG-26421"); - if (expectedWindowState != Qt::WindowNoState) { // restoring from maximized or fullscreen, we can only restore to the normal geometry QTRY_COMPARE(widget.geometry(), expectedNormalGeometry); From 78731b434e0e99ad108601249108e12d8a49c350 Mon Sep 17 00:00:00 2001 From: Alexander Volkov Date: Mon, 20 Feb 2017 19:59:38 +0300 Subject: [PATCH 43/54] xcb: Remove XIproto.h include from qxcbxsettings.cpp It indirectly includes X.h with LSBFirst and MSBFirst macros. Use XCB_IMAGE_ORDER_LSB_FIRST and XCB_IMAGE_ORDER_MSB_FIRST macros instead and remove unneeded XCB_USE_XLIB guards. Change-Id: Ic24c9605d0a627253f2793f9feab6c6e19dcda08 Reviewed-by: Gatis Paeglis (cherry picked from commit 538b9f504c0de11c473a40aed66df9900ac1c6c4) Reviewed-by: Oswald Buddenhagen --- src/plugins/platforms/xcb/qxcbxsettings.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/plugins/platforms/xcb/qxcbxsettings.cpp b/src/plugins/platforms/xcb/qxcbxsettings.cpp index 401eb8043c7..88933c6c222 100644 --- a/src/plugins/platforms/xcb/qxcbxsettings.cpp +++ b/src/plugins/platforms/xcb/qxcbxsettings.cpp @@ -45,10 +45,6 @@ #include #include -#ifdef XCB_USE_XLIB -#include -#endif //XCB_USE_XLIB - QT_BEGIN_NAMESPACE /* Implementation of http://standards.freedesktop.org/xsettings-spec/xsettings-0.5.html */ @@ -145,19 +141,18 @@ public: return value + 4 - remainder; } -#ifdef XCB_USE_XLIB void populateSettings(const QByteArray &xSettings) { if (xSettings.length() < 12) return; char byteOrder = xSettings.at(0); - if (byteOrder != LSBFirst && byteOrder != MSBFirst) { + if (byteOrder != XCB_IMAGE_ORDER_LSB_FIRST && byteOrder != XCB_IMAGE_ORDER_MSB_FIRST) { qWarning("ByteOrder byte %d not 0 or 1", byteOrder); return; } #define ADJUST_BO(b, t, x) \ - ((b == LSBFirst) ? \ + ((b == XCB_IMAGE_ORDER_LSB_FIRST) ? \ qFromLittleEndian(x) : \ qFromBigEndian(x)) #define VALIDATE_LENGTH(x) \ @@ -220,7 +215,6 @@ public: } } -#endif //XCB_USE_XLIB QXcbVirtualDesktop *screen; xcb_window_t x_settings_window; @@ -267,10 +261,8 @@ QXcbXSettings::QXcbXSettings(QXcbVirtualDesktop *screen) const uint32_t event_mask[] = { XCB_EVENT_MASK_STRUCTURE_NOTIFY|XCB_EVENT_MASK_PROPERTY_CHANGE }; xcb_change_window_attributes(screen->xcb_connection(),d_ptr->x_settings_window,event,event_mask); -#ifdef XCB_USE_XLIB d_ptr->populateSettings(d_ptr->getSettings()); d_ptr->initialized = true; -#endif //XCB_USE_XLIB } QXcbXSettings::~QXcbXSettings() @@ -290,9 +282,8 @@ void QXcbXSettings::handlePropertyNotifyEvent(const xcb_property_notify_event_t Q_D(QXcbXSettings); if (event->window != d->x_settings_window) return; -#ifdef XCB_USE_XLIB + d->populateSettings(d->getSettings()); -#endif //XCB_USE_XLIB } void QXcbXSettings::registerCallbackForProperty(const QByteArray &property, QXcbXSettings::PropertyChangeFunc func, void *handle) From ed07bdcb5f96d723f9c4c6b689ae95965c57c723 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 10 May 2017 18:55:06 +0200 Subject: [PATCH 44/54] make sql drivers independently configurable our binary packages come without many sql drivers, because they have proprietary dependencies we cannot ship. not every user wants to build all of qt from scratch, so it makes sense to make it possible to "enrich" the existing installation by compiling just the drivers. to enable this, the drivers' configuration must be independent. but note that it's still not possible to configure a single driver - the entire sqldrivers directory is configured at once. a side effect of this is that the availability of the sql plugins cannot be made known with publicFeatures any more, because there is no associated module pri file to put that information into. that should be made inconsequential by making qtHaveModule() work for plugins. Task-number: QTBUG-58372 Change-Id: Ibdebe3199688a57f93cea82dc15623081d1280f5 Reviewed-by: Joerg Bornemann --- configure.json | 4 +-- src/plugins/sqldrivers/.qmake.conf | 19 ++++++++++++++ .../sqldrivers}/configure.json | 26 +++++++++---------- src/{sql => plugins/sqldrivers}/configure.pri | 0 src/plugins/sqldrivers/qsqldriverbase.pri | 3 +++ src/plugins/sqldrivers/sqldrivers.pro | 6 ++++- src/plugins/sqldrivers/sqlite/sqlite.pro | 5 ++-- 7 files changed, 45 insertions(+), 18 deletions(-) create mode 100644 src/plugins/sqldrivers/.qmake.conf rename src/{sql => plugins/sqldrivers}/configure.json (91%) rename src/{sql => plugins/sqldrivers}/configure.pri (100%) diff --git a/configure.json b/configure.json index 8b5f07ed546..b572a3d1f5f 100644 --- a/configure.json +++ b/configure.json @@ -10,11 +10,11 @@ "subconfigs": [ "src/corelib", "src/network", - "src/sql", "src/gui", "src/xml", "src/widgets", - "src/printsupport" + "src/printsupport", + "src/plugins/sqldrivers" ], "commandline": { diff --git a/src/plugins/sqldrivers/.qmake.conf b/src/plugins/sqldrivers/.qmake.conf new file mode 100644 index 00000000000..15ba71a3437 --- /dev/null +++ b/src/plugins/sqldrivers/.qmake.conf @@ -0,0 +1,19 @@ +# This file detaches this sub-tree from the rest of qtbase, +# so it can be configured stand-alone. +# Of course, under normal circumstances, this _is_ part of qtbase, +# so we have to make some contortions to restore normality. + +isEmpty(_QMAKE_CONF_): return() # Pre-scan during spec loading. + +SQLDRV_SRC_TREE = $$dirname(_QMAKE_CONF_) +QTBASE_SRC_TREE = $$section(SQLDRV_SRC_TREE, /, 0, -4) + +QTBASE_BLD_TREE = $$shadowed($$QTBASE_SRC_TREE) +!isEmpty(QTBASE_BLD_TREE):exists($$QTBASE_BLD_TREE/.qmake.cache) { + # This tricks qt_build_config.prf and qt_build_paths.prf + _QMAKE_CONF_ = $$QTBASE_SRC_TREE/.qmake.conf +} else { + CONFIG += sqldrivers_standalone +} + +include($$QTBASE_SRC_TREE/.qmake.conf) diff --git a/src/sql/configure.json b/src/plugins/sqldrivers/configure.json similarity index 91% rename from src/sql/configure.json rename to src/plugins/sqldrivers/configure.json index dc7fffa02d2..5603ceb37bd 100644 --- a/src/sql/configure.json +++ b/src/plugins/sqldrivers/configure.json @@ -1,9 +1,9 @@ { - "module": "sql", + "module": "sqldrivers", "depends": [ "core" ], - "testDir": "../../config.tests", + "testDir": "../../../config.tests", "commandline": { "assignments": { @@ -129,42 +129,42 @@ "sql-db2": { "label": "DB2 (IBM)", "condition": "libs.db2", - "output": [ "publicFeature" ] + "output": [ "privateFeature" ] }, "sql-ibase": { "label": "InterBase", "condition": "libs.ibase", - "output": [ "publicFeature" ] + "output": [ "privateFeature" ] }, "sql-mysql": { "label": "MySql", "condition": "libs.mysql", - "output": [ "publicFeature" ] + "output": [ "privateFeature" ] }, "sql-oci": { "label": "OCI (Oracle)", "condition": "libs.oci", - "output": [ "publicFeature" ] + "output": [ "privateFeature" ] }, "sql-odbc": { "label": "ODBC", - "condition": "libs.odbc && features.datestring", - "output": [ "publicFeature" ] + "condition": "features.datestring && libs.odbc", + "output": [ "privateFeature" ] }, "sql-psql": { "label": "PostgreSQL", "condition": "libs.psql", - "output": [ "publicFeature" ] + "output": [ "privateFeature" ] }, "sql-sqlite2": { "label": "SQLite2", "condition": "libs.sqlite2", - "output": [ "publicFeature" ] + "output": [ "privateFeature" ] }, "sql-sqlite": { "label": "SQLite", "condition": "features.datestring", - "output": [ "publicFeature" ] + "output": [ "privateFeature" ] }, "system-sqlite": { "label": " Using system provided SQLite", @@ -174,8 +174,8 @@ }, "sql-tds": { "label": "TDS (Sybase)", - "condition": "libs.tds && features.datestring", - "output": [ "publicFeature" ] + "condition": "features.datestring && libs.tds", + "output": [ "privateFeature" ] } }, diff --git a/src/sql/configure.pri b/src/plugins/sqldrivers/configure.pri similarity index 100% rename from src/sql/configure.pri rename to src/plugins/sqldrivers/configure.pri diff --git a/src/plugins/sqldrivers/qsqldriverbase.pri b/src/plugins/sqldrivers/qsqldriverbase.pri index 512c046ec19..4b78fa9454e 100644 --- a/src/plugins/sqldrivers/qsqldriverbase.pri +++ b/src/plugins/sqldrivers/qsqldriverbase.pri @@ -1,5 +1,8 @@ QT = core core-private sql-private +# For QMAKE_USE in the parent projects. +include($$shadowed($$PWD)/qtsqldrivers-config.pri) + PLUGIN_TYPE = sqldrivers load(qt_plugin) diff --git a/src/plugins/sqldrivers/sqldrivers.pro b/src/plugins/sqldrivers/sqldrivers.pro index 30fb6019ce4..8a9ae46f826 100644 --- a/src/plugins/sqldrivers/sqldrivers.pro +++ b/src/plugins/sqldrivers/sqldrivers.pro @@ -1,5 +1,9 @@ TEMPLATE = subdirs -QT_FOR_CONFIG += sql + +sqldrivers_standalone { + _QMAKE_CACHE_ = $$shadowed($$SQLDRV_SRC_TREE)/.qmake.conf + load(qt_configure) +} qtConfig(sql-psql) : SUBDIRS += psql qtConfig(sql-mysql) : SUBDIRS += mysql diff --git a/src/plugins/sqldrivers/sqlite/sqlite.pro b/src/plugins/sqldrivers/sqlite/sqlite.pro index 1066bf7f51d..d7e19f97b1e 100644 --- a/src/plugins/sqldrivers/sqlite/sqlite.pro +++ b/src/plugins/sqldrivers/sqlite/sqlite.pro @@ -1,10 +1,11 @@ TARGET = qsqlite -QT_FOR_CONFIG += sql-private - HEADERS += $$PWD/qsql_sqlite_p.h SOURCES += $$PWD/qsql_sqlite.cpp $$PWD/smain.cpp +include($$OUT_PWD/../qtsqldrivers-config.pri) +QT_FOR_CONFIG += sqldrivers-private + qtConfig(system-sqlite) { QMAKE_USE += sqlite } else { From c0e94dd0933c549f35d05318cdcd97572c61fabf Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 6 Jun 2017 20:31:59 +0200 Subject: [PATCH 45/54] don't overwrite pre-existing INSTALL for target while it's mildly insane that we auto-generate install targets to start with, we can at least refrain from doing so if there is one already. as it happens, this removes the need for excluding the qt build explicitly. Task-number: QTBUG-38452 Change-Id: I74d5df447fba525fa79896c9be2c71d82bc2c6ce Reviewed-by: Joerg Bornemann --- mkspecs/features/android/android.prf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mkspecs/features/android/android.prf b/mkspecs/features/android/android.prf index 7d77598e76c..d2a3ee54c10 100644 --- a/mkspecs/features/android/android.prf +++ b/mkspecs/features/android/android.prf @@ -1,3 +1,6 @@ +android_install:contains(INSTALLS, target):!isEmpty(target.path): \ + CONFIG -= android_install + contains(TEMPLATE, ".*app") { !android_app { !contains(TARGET, ".so"): TARGET = lib$${TARGET}.so @@ -8,7 +11,7 @@ contains(TEMPLATE, ".*app") { INSTALLS *= target } } -} else: contains(TEMPLATE, "lib"):!QTDIR_build:android_install { +} else: contains(TEMPLATE, "lib"):android_install { target.path = /libs/$$ANDROID_TARGET_ARCH/ INSTALLS *= target } From 72d4f0750baae1bb296341bde166f020d29c7faa Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 6 Jun 2017 20:37:29 +0200 Subject: [PATCH 46/54] don't auto-create install targets for static libs these are not meant to be deployed, so the install hack should skip them. Task-number: QTBUG-42830 Change-Id: I870499dca2cfea87bf0048f019d651ce9cc5d788 Reviewed-by: Joerg Bornemann --- mkspecs/features/android/android.prf | 2 +- mkspecs/features/android/resolve_target.prf | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/mkspecs/features/android/android.prf b/mkspecs/features/android/android.prf index d2a3ee54c10..45eadc9fdb2 100644 --- a/mkspecs/features/android/android.prf +++ b/mkspecs/features/android/android.prf @@ -11,7 +11,7 @@ contains(TEMPLATE, ".*app") { INSTALLS *= target } } -} else: contains(TEMPLATE, "lib"):android_install { +} else: contains(TEMPLATE, "lib"):!static:android_install { target.path = /libs/$$ANDROID_TARGET_ARCH/ INSTALLS *= target } diff --git a/mkspecs/features/android/resolve_target.prf b/mkspecs/features/android/resolve_target.prf index 2bbeffcfd05..25682cd8948 100644 --- a/mkspecs/features/android/resolve_target.prf +++ b/mkspecs/features/android/resolve_target.prf @@ -1,2 +1,3 @@ +load(resolve_config) load(android) load(resolve_target) From 9d90bbd7b14db17a64e6a664e6f98b58efa97747 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 9 Jun 2017 16:17:34 +0200 Subject: [PATCH 47/54] rework detection and use of clock_gettime()/librt recent versions of glibc include clock_gettime() inside libc itself. Task-number: QTBUG-41009 Change-Id: I7401773be99682a356bf06a69571d11c4b15978b Reviewed-by: Thiago Macieira --- .../unix/clock-gettime/clock-gettime.pri | 2 -- .../unix/clock-gettime/clock-gettime.pro | 1 - .../unix/clock-monotonic/clock-monotonic.pro | 1 - src/corelib/configure.json | 18 +++++++++++------- src/corelib/kernel/kernel.pri | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) delete mode 100644 config.tests/unix/clock-gettime/clock-gettime.pri diff --git a/config.tests/unix/clock-gettime/clock-gettime.pri b/config.tests/unix/clock-gettime/clock-gettime.pri deleted file mode 100644 index 65b49fb8b45..00000000000 --- a/config.tests/unix/clock-gettime/clock-gettime.pri +++ /dev/null @@ -1,2 +0,0 @@ -# clock_gettime() is implemented in librt on these systems -linux-*|hpux-*|solaris-*:LIBS_PRIVATE *= -lrt diff --git a/config.tests/unix/clock-gettime/clock-gettime.pro b/config.tests/unix/clock-gettime/clock-gettime.pro index bdbb1c2a82c..985b94e3fe2 100644 --- a/config.tests/unix/clock-gettime/clock-gettime.pro +++ b/config.tests/unix/clock-gettime/clock-gettime.pro @@ -1,3 +1,2 @@ SOURCES = clock-gettime.cpp CONFIG -= qt dylib -include(clock-gettime.pri) diff --git a/config.tests/unix/clock-monotonic/clock-monotonic.pro b/config.tests/unix/clock-monotonic/clock-monotonic.pro index 253a9f73464..4c421c2413e 100644 --- a/config.tests/unix/clock-monotonic/clock-monotonic.pro +++ b/config.tests/unix/clock-monotonic/clock-monotonic.pro @@ -1,3 +1,2 @@ SOURCES = clock-monotonic.cpp CONFIG -= qt dylib -include(../clock-gettime/clock-gettime.pri) diff --git a/src/corelib/configure.json b/src/corelib/configure.json index c6c5c93ddbe..deb7a544efa 100644 --- a/src/corelib/configure.json +++ b/src/corelib/configure.json @@ -84,6 +84,14 @@ "-ldl" ] }, + "librt": { + "label": "clock_gettime()", + "test": "unix/clock-gettime", + "sources": [ + "", + "-lrt" + ] + }, "pcre2": { "label": "PCRE2", "test": "unix/pcre2", @@ -119,15 +127,11 @@ "type": "compile", "test": "common/atomicfptr" }, - "clock-gettime": { - "label": "clock_gettime()", - "type": "compile", - "test": "unix/clock-gettime" - }, "clock-monotonic": { "label": "POSIX monotonic clock", "type": "compile", - "test": "unix/clock-monotonic" + "test": "unix/clock-monotonic", + "use": "librt" }, "cloexec": { "label": "O_CLOEXEC", @@ -199,7 +203,7 @@ "features": { "clock-gettime": { "label": "clock_gettime()", - "condition": "tests.clock-gettime", + "condition": "config.unix && libs.librt", "output": [ "privateFeature" ] }, "clock-monotonic": { diff --git a/src/corelib/kernel/kernel.pri b/src/corelib/kernel/kernel.pri index 0e6ff17b8fa..29bd5bbc6c1 100644 --- a/src/corelib/kernel/kernel.pri +++ b/src/corelib/kernel/kernel.pri @@ -162,7 +162,7 @@ unix|integrity { QMAKE_USE_PRIVATE += glib } - qtConfig(clock-gettime): include($$QT_SOURCE_TREE/config.tests/unix/clock-gettime/clock-gettime.pri) + qtConfig(clock-gettime): QMAKE_USE_PRIVATE += librt !android { SOURCES += kernel/qsharedmemory_posix.cpp \ From 8b080e59c5019112f5699db5c2c101f76b3da88f Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 11 May 2017 15:39:15 +0200 Subject: [PATCH 48/54] rename qglobalstatic.cpp -> qglobalstatic.qdoc it contains no code. Change-Id: Ie8a43abb2db3d040f7046206adf2bf555960dd9c Reviewed-by: Lars Knoll Reviewed-by: Thiago Macieira --- src/corelib/global/global.pri | 1 - src/corelib/global/{qglobalstatic.cpp => qglobalstatic.qdoc} | 2 -- 2 files changed, 3 deletions(-) rename src/corelib/global/{qglobalstatic.cpp => qglobalstatic.qdoc} (99%) diff --git a/src/corelib/global/global.pri b/src/corelib/global/global.pri index f162dd95dd6..b76d1ef43cf 100644 --- a/src/corelib/global/global.pri +++ b/src/corelib/global/global.pri @@ -27,7 +27,6 @@ HEADERS += \ SOURCES += \ global/archdetect.cpp \ global/qglobal.cpp \ - global/qglobalstatic.cpp \ global/qlibraryinfo.cpp \ global/qmalloc.cpp \ global/qnumeric.cpp \ diff --git a/src/corelib/global/qglobalstatic.cpp b/src/corelib/global/qglobalstatic.qdoc similarity index 99% rename from src/corelib/global/qglobalstatic.cpp rename to src/corelib/global/qglobalstatic.qdoc index d1c522a79a2..8c34739d38b 100644 --- a/src/corelib/global/qglobalstatic.cpp +++ b/src/corelib/global/qglobalstatic.qdoc @@ -37,8 +37,6 @@ ** ****************************************************************************/ -#include "qglobalstatic.h" - /*! \macro Q_GLOBAL_STATIC(Type, VariableName) \since 5.1 From 8875e283720e4c9ac46d63392db9c9b44edf1d62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tony=20Saraj=C3=A4rvi?= Date: Thu, 25 May 2017 22:41:01 +0300 Subject: [PATCH 49/54] Blacklist flaky tst_QTimeLine tests on macOS 10.12 Task-number: QTBUG-61037 Change-Id: I604bbc815c16a5ab436d2ff4936d96d3a2d27dab Reviewed-by: J-P Nurmi --- tests/auto/corelib/tools/qtimeline/BLACKLIST | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/auto/corelib/tools/qtimeline/BLACKLIST b/tests/auto/corelib/tools/qtimeline/BLACKLIST index b5861756d83..74f84a4a6d6 100644 --- a/tests/auto/corelib/tools/qtimeline/BLACKLIST +++ b/tests/auto/corelib/tools/qtimeline/BLACKLIST @@ -1,4 +1,7 @@ [interpolation] windows +osx-10.12 [duration] windows +[frameRate] +osx-10.12 From 603963e07d063e3c31c759007a556740e6bb89a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tony=20Saraj=C3=A4rvi?= Date: Fri, 26 May 2017 10:09:11 +0300 Subject: [PATCH 50/54] Extend blacklisting of tst_QElapsedTimer::elapsed to cover macOS 10.12 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-58713 Change-Id: I0c467c1abcdd1284910e0a61f98646e943eae377 Reviewed-by: Tony Sarajärvi Reviewed-by: J-P Nurmi --- tests/auto/corelib/kernel/qelapsedtimer/BLACKLIST | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/auto/corelib/kernel/qelapsedtimer/BLACKLIST b/tests/auto/corelib/kernel/qelapsedtimer/BLACKLIST index f6a49f032ca..4cd3c2f0c84 100644 --- a/tests/auto/corelib/kernel/qelapsedtimer/BLACKLIST +++ b/tests/auto/corelib/kernel/qelapsedtimer/BLACKLIST @@ -1,2 +1,3 @@ [elapsed] windows +osx-10.12 From da8701ff57c24127a81bf7c8c61bc09e6a214c3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tony=20Saraj=C3=A4rvi?= Date: Wed, 31 May 2017 15:32:47 +0300 Subject: [PATCH 51/54] Blacklist tst_QGuiEventLoop::processEvents in macOS 10.12 Task-number: QTBUG-61131 Change-Id: Ia54d0976f73e733199503e3510daf3d6fa4253a7 Reviewed-by: J-P Nurmi --- tests/auto/gui/kernel/qguieventloop/BLACKLIST | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 tests/auto/gui/kernel/qguieventloop/BLACKLIST diff --git a/tests/auto/gui/kernel/qguieventloop/BLACKLIST b/tests/auto/gui/kernel/qguieventloop/BLACKLIST new file mode 100644 index 00000000000..d55c67998d2 --- /dev/null +++ b/tests/auto/gui/kernel/qguieventloop/BLACKLIST @@ -0,0 +1,2 @@ +[processEvents] +osx-10.12 From f5f98da54e1140cfc340e5077735c63d209edd7d Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 15 Jun 2017 17:40:25 +0200 Subject: [PATCH 52/54] Fix reading qle_signedbitfield as int The type-cast to int for qle_signedbitfield was wrong for all cases where width + pos != 32. The class is currently only used two places though, both where that happen to apply. Change-Id: I108c565b75c9f29dd49b5e2e39f84910d17ead85 Reviewed-by: Lars Knoll --- src/corelib/json/qjson_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/json/qjson_p.h b/src/corelib/json/qjson_p.h index 0c78fadfc73..c012ec2662e 100644 --- a/src/corelib/json/qjson_p.h +++ b/src/corelib/json/qjson_p.h @@ -243,7 +243,7 @@ public: uint i = qFromLittleEndian(val); i <<= 32 - width - pos; int t = (int) i; - t >>= pos; + t >>= 32 - width; return t; } bool operator !() const { From 68bcbe2470f1dec54b7803d847f7aa755b07c058 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 7 Jun 2017 16:20:10 +0200 Subject: [PATCH 53/54] Fix tst_QImageReader::imageFormatBeforeRead The test was never loading images from a valid path, and thus never had any fullfill the base option which meant nothing was tested. Making it work revealed that the Format option on BMP formats doesn't predict semi-transparent files. Change-Id: I7035a0f63ebfbce940ce7a17a6142cf177480798 Reviewed-by: Eirik Aavitsland --- tests/auto/gui/image/qimagereader/tst_qimagereader.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp index 19948edcdf2..574ad805cac 100644 --- a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp +++ b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp @@ -728,13 +728,15 @@ void tst_QImageReader::imageFormatBeforeRead() SKIP_IF_UNSUPPORTED(format); - QImageReader reader(fileName); + QImageReader reader(prefix + fileName); + QVERIFY(reader.canRead()); if (reader.supportsOption(QImageIOHandler::ImageFormat)) { QImage::Format fileFormat = reader.imageFormat(); QCOMPARE(fileFormat, imageFormat); QSize size = reader.size(); QImage image(size, fileFormat); QVERIFY(reader.read(&image)); + QEXPECT_FAIL("bmp-3", "Semi-transparent BMPs not predicted", Continue); QCOMPARE(image.format(), fileFormat); } } From 97eec16e4ff6367c233f8ea6c4a343c286c3a514 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Fri, 9 Jun 2017 14:46:29 +0200 Subject: [PATCH 54/54] Android: fix missing wheel events Change-Id: I65b4f6a8fcbdad537a984064e332a4a1f34a265a Task-number: QTBUG-43669 Reviewed-by: BogDan Vatra --- .../org/qtproject/qt5/android/QtNative.java | 13 ++++++++++++ .../org/qtproject/qt5/android/QtSurface.java | 7 +++++++ .../platforms/android/androidjniinput.cpp | 20 +++++++++++++++++++ 3 files changed, 40 insertions(+) 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 b11883a1052..902e2f68e7b 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java @@ -61,6 +61,7 @@ import android.view.KeyEvent; import android.view.Menu; import android.view.MotionEvent; import android.view.View; +import android.view.InputDevice; import java.lang.reflect.Method; import java.security.KeyStore; @@ -470,6 +471,17 @@ public class QtNative } } + static public void sendGenericMotionEvent(MotionEvent event, int id) + { + if (event.getActionMasked() != MotionEvent.ACTION_SCROLL + || (event.getSource() & InputDevice.SOURCE_CLASS_POINTER) != InputDevice.SOURCE_CLASS_POINTER) { + return; + } + + mouseWheel(id, (int) event.getX(), (int) event.getY(), + event.getAxisValue(MotionEvent.AXIS_HSCROLL), event.getAxisValue(MotionEvent.AXIS_VSCROLL)); + } + public static Context getContext() { if (m_activity != null) return m_activity; @@ -801,6 +813,7 @@ public class QtNative public static native void mouseDown(int winId, int x, int y); public static native void mouseUp(int winId, int x, int y); public static native void mouseMove(int winId, int x, int y); + public static native void mouseWheel(int winId, int x, int y, float hdelta, float vdelta); public static native void touchBegin(int winId); public static native void touchAdd(int winId, int pointerId, int action, boolean primary, int x, int y, float major, float minor, float rotation, float pressure); public static native void touchEnd(int winId, int action); diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtSurface.java b/src/android/jar/src/org/qtproject/qt5/android/QtSurface.java index 4d8abb2117c..e994002dd35 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtSurface.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtSurface.java @@ -112,4 +112,11 @@ public class QtSurface extends SurfaceView implements SurfaceHolder.Callback QtNative.sendTrackballEvent(event, getId()); return true; } + + @Override + public boolean onGenericMotionEvent(MotionEvent event) + { + QtNative.sendGenericMotionEvent(event, getId()); + return true; + } } diff --git a/src/plugins/platforms/android/androidjniinput.cpp b/src/plugins/platforms/android/androidjniinput.cpp index 048be662bed..32630003d13 100644 --- a/src/plugins/platforms/android/androidjniinput.cpp +++ b/src/plugins/platforms/android/androidjniinput.cpp @@ -173,6 +173,25 @@ namespace QtAndroidInput Qt::MouseButtons(Qt::LeftButton)); } + static void mouseWheel(JNIEnv */*env*/, jobject /*thiz*/, jint /*winId*/, jint x, jint y, jfloat hdelta, jfloat vdelta) + { + if (m_ignoreMouseEvents) + return; + + QPoint globalPos(x,y); + QWindow *tlw = m_mouseGrabber.data(); + if (!tlw) + tlw = topLevelWindowAt(globalPos); + QPoint localPos = tlw ? (globalPos-tlw->position()) : globalPos; + QPoint angleDelta(hdelta * 120, vdelta * 120); + + QWindowSystemInterface::handleWheelEvent(tlw, + localPos, + globalPos, + QPoint(), + angleDelta); + } + static void longPress(JNIEnv */*env*/, jobject /*thiz*/, jint /*winId*/, jint x, jint y) { QAndroidInputContext *inputContext = QAndroidInputContext::androidInputContext(); @@ -824,6 +843,7 @@ namespace QtAndroidInput {"mouseDown", "(III)V", (void *)mouseDown}, {"mouseUp", "(III)V", (void *)mouseUp}, {"mouseMove", "(III)V", (void *)mouseMove}, + {"mouseWheel", "(IIIFF)V", (void *)mouseWheel}, {"longPress", "(III)V", (void *)longPress}, {"isTabletEventSupported", "()Z", (void *)isTabletEventSupported}, {"tabletEvent", "(IIJIIIFFF)V", (void *)tabletEvent},