diff --git a/configure.bat b/configure.bat index 6e9a82f2dff..7cadd783ea4 100644 --- a/configure.bat +++ b/configure.bat @@ -157,10 +157,10 @@ rem Determine host spec if "%PLATFORM%" == "" ( if not "%icl.exe%" == "" ( set PLATFORM=win32-icc - ) else if not "%clang-cl.exe%" == "" ( - set PLATFORM=win32-clang-msvc ) else if not "%cl.exe%" == "" ( set PLATFORM=win32-msvc + ) else if not "%clang-cl.exe%" == "" ( + set PLATFORM=win32-clang-msvc ) else if not "%g++.exe%" == "" ( set PLATFORM=win32-g++ ) else ( diff --git a/examples/network/broadcastreceiver/broadcastreceiver.pro b/examples/network/broadcastreceiver/broadcastreceiver.pro index edadf1c28d0..5c58962f3a4 100644 --- a/examples/network/broadcastreceiver/broadcastreceiver.pro +++ b/examples/network/broadcastreceiver/broadcastreceiver.pro @@ -1,4 +1,5 @@ QT += network widgets +requires(qtConfig(udpsocket)) HEADERS = receiver.h SOURCES = receiver.cpp \ diff --git a/examples/network/broadcastsender/broadcastsender.pro b/examples/network/broadcastsender/broadcastsender.pro index 4c5af7f8496..9598a2e4289 100644 --- a/examples/network/broadcastsender/broadcastsender.pro +++ b/examples/network/broadcastsender/broadcastsender.pro @@ -1,4 +1,5 @@ QT += network widgets +requires(qtConfig(udpsocket)) HEADERS = sender.h SOURCES = sender.cpp \ diff --git a/examples/network/multicastreceiver/multicastreceiver.pro b/examples/network/multicastreceiver/multicastreceiver.pro index 6906fc6cb58..e9bcb45a8d7 100644 --- a/examples/network/multicastreceiver/multicastreceiver.pro +++ b/examples/network/multicastreceiver/multicastreceiver.pro @@ -1,4 +1,5 @@ QT += network widgets +requires(qtConfig(udpsocket)) HEADERS = receiver.h SOURCES = receiver.cpp \ diff --git a/examples/network/multicastsender/multicastsender.pro b/examples/network/multicastsender/multicastsender.pro index 4797b194a92..160f37be6dd 100644 --- a/examples/network/multicastsender/multicastsender.pro +++ b/examples/network/multicastsender/multicastsender.pro @@ -2,6 +2,7 @@ HEADERS = sender.h SOURCES = sender.cpp \ main.cpp QT += network widgets +requires(qtConfig(udpsocket)) # install target.path = $$[QT_INSTALL_EXAMPLES]/network/multicastsender diff --git a/examples/network/network-chat/network-chat.pro b/examples/network/network-chat/network-chat.pro index b20e8b2934f..3d525c96ccb 100644 --- a/examples/network/network-chat/network-chat.pro +++ b/examples/network/network-chat/network-chat.pro @@ -11,6 +11,7 @@ SOURCES = chatdialog.cpp \ server.cpp FORMS = chatdialog.ui QT += network widgets +requires(qtConfig(udpsocket)) # install target.path = $$[QT_INSTALL_EXAMPLES]/network/network-chat diff --git a/header.LGPL21 b/header.LGPL21 deleted file mode 100644 index 533390b0780..00000000000 --- a/header.LGPL21 +++ /dev/null @@ -1,33 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the FOO module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf index e645ba58039..50a1ec6764f 100644 --- a/mkspecs/features/mac/default_post.prf +++ b/mkspecs/features/mac/default_post.prf @@ -47,6 +47,29 @@ app_extension_api_only { } macx-xcode { + qmake_pkginfo_typeinfo.name = QMAKE_PKGINFO_TYPEINFO + !isEmpty(QMAKE_PKGINFO_TYPEINFO): \ + qmake_pkginfo_typeinfo.value = $$QMAKE_PKGINFO_TYPEINFO + else: \ + qmake_pkginfo_typeinfo.value = "????" + QMAKE_MAC_XCODE_SETTINGS += qmake_pkginfo_typeinfo + + !isEmpty(VERSION) { + l = $$split(VERSION, '.') 0 0 # make sure there are at least three + VER_MAJ = $$member(l, 0, 0) + VER_MIN = $$member(l, 1, 1) + VER_PAT = $$member(l, 2, 2) + unset(l) + + qmake_full_version.name = QMAKE_FULL_VERSION + qmake_full_version.value = $${VER_MAJ}.$${VER_MIN}.$${VER_PAT} + QMAKE_MAC_XCODE_SETTINGS += qmake_full_version + + qmake_short_version.name = QMAKE_SHORT_VERSION + qmake_short_version.value = $${VER_MAJ}.$${VER_MIN} + QMAKE_MAC_XCODE_SETTINGS += qmake_short_version + } + !isEmpty(QMAKE_XCODE_DEBUG_INFORMATION_FORMAT) { debug_information_format.name = DEBUG_INFORMATION_FORMAT debug_information_format.value = $$QMAKE_XCODE_DEBUG_INFORMATION_FORMAT diff --git a/mkspecs/features/mac/default_pre.prf b/mkspecs/features/mac/default_pre.prf index 44636f22889..e3534561a56 100644 --- a/mkspecs/features/mac/default_pre.prf +++ b/mkspecs/features/mac/default_pre.prf @@ -54,3 +54,7 @@ macx-xcode:qtConfig(static): \ # feature, which allows Xcode to choose the Qt libraries to link to # at build time, depending on the current Xcode SDK and configuration. QMAKE_XCODE_LIBRARY_SUFFIX_SETTING = QT_LIBRARY_SUFFIX + +xcode_copy_phase_strip_setting.name = COPY_PHASE_STRIP +xcode_copy_phase_strip_setting.value = NO +QMAKE_MAC_XCODE_SETTINGS += xcode_copy_phase_strip_setting diff --git a/mkspecs/integrity-armv8-rcar/qplatformdefs.h b/mkspecs/integrity-armv8-rcar/qplatformdefs.h index 55afd0c3c7b..a743326346a 100644 --- a/mkspecs/integrity-armv8-rcar/qplatformdefs.h +++ b/mkspecs/integrity-armv8-rcar/qplatformdefs.h @@ -5,27 +5,33 @@ ** ** This file is part of the qmake spec of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** 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. ** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** 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$ ** diff --git a/mkspecs/macx-clang/Info.plist.app b/mkspecs/macx-clang/Info.plist.app index ebd108dadf6..4d64a77704e 100644 --- a/mkspecs/macx-clang/Info.plist.app +++ b/mkspecs/macx-clang/Info.plist.app @@ -3,17 +3,19 @@ CFBundleExecutable - @EXECUTABLE@ + ${EXECUTABLE_NAME} CFBundleGetInfoString Created by Qt/QMake CFBundleIconFile - @ICON@ + ${ASSETCATALOG_COMPILER_APPICON_NAME} CFBundleIdentifier - @BUNDLEIDENTIFIER@ + ${PRODUCT_BUNDLE_IDENTIFIER} CFBundlePackageType APPL CFBundleSignature - @TYPEINFO@ + ${QMAKE_PKGINFO_TYPEINFO} + LSMinimumSystemVersion + ${MACOSX_DEPLOYMENT_TARGET} NOTE This file was generated by Qt/QMake. NSPrincipalClass diff --git a/mkspecs/macx-clang/Info.plist.lib b/mkspecs/macx-clang/Info.plist.lib index 044cbd33932..ce283655000 100644 --- a/mkspecs/macx-clang/Info.plist.lib +++ b/mkspecs/macx-clang/Info.plist.lib @@ -3,19 +3,19 @@ CFBundleExecutable - @LIBRARY@ + ${EXECUTABLE_NAME} CFBundleGetInfoString Created by Qt/QMake CFBundleIdentifier - @BUNDLEIDENTIFIER@ + ${PRODUCT_BUNDLE_IDENTIFIER} CFBundlePackageType FMWK CFBundleShortVersionString - @SHORT_VERSION@ + ${QMAKE_SHORT_VERSION} CFBundleSignature - @TYPEINFO@ + ${QMAKE_PKGINFO_TYPEINFO} CFBundleVersion - @FULL_VERSION@ + ${QMAKE_FULL_VERSION} NOTE Please, do NOT change this file -- It was generated by Qt/QMake. diff --git a/mkspecs/macx-g++/Info.plist.app b/mkspecs/macx-g++/Info.plist.app index ebd108dadf6..4d64a77704e 100644 --- a/mkspecs/macx-g++/Info.plist.app +++ b/mkspecs/macx-g++/Info.plist.app @@ -3,17 +3,19 @@ CFBundleExecutable - @EXECUTABLE@ + ${EXECUTABLE_NAME} CFBundleGetInfoString Created by Qt/QMake CFBundleIconFile - @ICON@ + ${ASSETCATALOG_COMPILER_APPICON_NAME} CFBundleIdentifier - @BUNDLEIDENTIFIER@ + ${PRODUCT_BUNDLE_IDENTIFIER} CFBundlePackageType APPL CFBundleSignature - @TYPEINFO@ + ${QMAKE_PKGINFO_TYPEINFO} + LSMinimumSystemVersion + ${MACOSX_DEPLOYMENT_TARGET} NOTE This file was generated by Qt/QMake. NSPrincipalClass diff --git a/mkspecs/macx-g++/Info.plist.lib b/mkspecs/macx-g++/Info.plist.lib index 044cbd33932..ce283655000 100644 --- a/mkspecs/macx-g++/Info.plist.lib +++ b/mkspecs/macx-g++/Info.plist.lib @@ -3,19 +3,19 @@ CFBundleExecutable - @LIBRARY@ + ${EXECUTABLE_NAME} CFBundleGetInfoString Created by Qt/QMake CFBundleIdentifier - @BUNDLEIDENTIFIER@ + ${PRODUCT_BUNDLE_IDENTIFIER} CFBundlePackageType FMWK CFBundleShortVersionString - @SHORT_VERSION@ + ${QMAKE_SHORT_VERSION} CFBundleSignature - @TYPEINFO@ + ${QMAKE_PKGINFO_TYPEINFO} CFBundleVersion - @FULL_VERSION@ + ${QMAKE_FULL_VERSION} NOTE Please, do NOT change this file -- It was generated by Qt/QMake. diff --git a/mkspecs/macx-icc/Info.plist.app b/mkspecs/macx-icc/Info.plist.app index ebd108dadf6..4d64a77704e 100644 --- a/mkspecs/macx-icc/Info.plist.app +++ b/mkspecs/macx-icc/Info.plist.app @@ -3,17 +3,19 @@ CFBundleExecutable - @EXECUTABLE@ + ${EXECUTABLE_NAME} CFBundleGetInfoString Created by Qt/QMake CFBundleIconFile - @ICON@ + ${ASSETCATALOG_COMPILER_APPICON_NAME} CFBundleIdentifier - @BUNDLEIDENTIFIER@ + ${PRODUCT_BUNDLE_IDENTIFIER} CFBundlePackageType APPL CFBundleSignature - @TYPEINFO@ + ${QMAKE_PKGINFO_TYPEINFO} + LSMinimumSystemVersion + ${MACOSX_DEPLOYMENT_TARGET} NOTE This file was generated by Qt/QMake. NSPrincipalClass diff --git a/mkspecs/macx-icc/Info.plist.lib b/mkspecs/macx-icc/Info.plist.lib index 044cbd33932..ce283655000 100644 --- a/mkspecs/macx-icc/Info.plist.lib +++ b/mkspecs/macx-icc/Info.plist.lib @@ -3,19 +3,19 @@ CFBundleExecutable - @LIBRARY@ + ${EXECUTABLE_NAME} CFBundleGetInfoString Created by Qt/QMake CFBundleIdentifier - @BUNDLEIDENTIFIER@ + ${PRODUCT_BUNDLE_IDENTIFIER} CFBundlePackageType FMWK CFBundleShortVersionString - @SHORT_VERSION@ + ${QMAKE_SHORT_VERSION} CFBundleSignature - @TYPEINFO@ + ${QMAKE_PKGINFO_TYPEINFO} CFBundleVersion - @FULL_VERSION@ + ${QMAKE_FULL_VERSION} NOTE Please, do NOT change this file -- It was generated by Qt/QMake. diff --git a/mkspecs/macx-ios-clang/Info.plist.app b/mkspecs/macx-ios-clang/Info.plist.app index 4a7c527260b..1acbf9d768b 100644 --- a/mkspecs/macx-ios-clang/Info.plist.app +++ b/mkspecs/macx-ios-clang/Info.plist.app @@ -5,25 +5,27 @@ CFBundleDisplayName ${PRODUCT_NAME} CFBundleExecutable - @EXECUTABLE@ + ${EXECUTABLE_NAME} CFBundleGetInfoString Created by Qt/QMake CFBundleIconFile - @ICON@ + ${ASSETCATALOG_COMPILER_APPICON_NAME} CFBundleIdentifier - @BUNDLEIDENTIFIER@ + ${PRODUCT_BUNDLE_IDENTIFIER} CFBundleName ${PRODUCT_NAME} CFBundlePackageType APPL CFBundleShortVersionString - 1.0 + ${QMAKE_SHORT_VERSION} CFBundleSignature - @TYPEINFO@ + ${QMAKE_PKGINFO_TYPEINFO} CFBundleVersion - 1.0 + ${QMAKE_FULL_VERSION} LSRequiresIPhoneOS + MinimumOSVersion + ${IPHONEOS_DEPLOYMENT_TARGET} NOTE This file was generated by Qt/QMake. UILaunchStoryboardName diff --git a/mkspecs/macx-ios-clang/Info.plist.lib b/mkspecs/macx-ios-clang/Info.plist.lib index 044cbd33932..ce283655000 100644 --- a/mkspecs/macx-ios-clang/Info.plist.lib +++ b/mkspecs/macx-ios-clang/Info.plist.lib @@ -3,19 +3,19 @@ CFBundleExecutable - @LIBRARY@ + ${EXECUTABLE_NAME} CFBundleGetInfoString Created by Qt/QMake CFBundleIdentifier - @BUNDLEIDENTIFIER@ + ${PRODUCT_BUNDLE_IDENTIFIER} CFBundlePackageType FMWK CFBundleShortVersionString - @SHORT_VERSION@ + ${QMAKE_SHORT_VERSION} CFBundleSignature - @TYPEINFO@ + ${QMAKE_PKGINFO_TYPEINFO} CFBundleVersion - @FULL_VERSION@ + ${QMAKE_FULL_VERSION} NOTE Please, do NOT change this file -- It was generated by Qt/QMake. diff --git a/mkspecs/macx-tvos-clang/Info.plist.app b/mkspecs/macx-tvos-clang/Info.plist.app index a0348262078..04aef816c26 100644 --- a/mkspecs/macx-tvos-clang/Info.plist.app +++ b/mkspecs/macx-tvos-clang/Info.plist.app @@ -7,7 +7,7 @@ CFBundleDisplayName ${PRODUCT_NAME} CFBundleExecutable - @EXECUTABLE@ + ${EXECUTABLE_NAME} CFBundleGetInfoString Created by Qt/QMake CFBundleIcons @@ -16,25 +16,25 @@ App Icon - Small CFBundleIdentifier - @BUNDLEIDENTIFIER@ + ${PRODUCT_BUNDLE_IDENTIFIER} CFBundleName ${PRODUCT_NAME} CFBundlePackageType APPL CFBundleShortVersionString - 1.0 + ${QMAKE_SHORT_VERSION} CFBundleSignature - @TYPEINFO@ + ${QMAKE_PKGINFO_TYPEINFO} CFBundleSupportedPlatforms AppleTVOS CFBundleVersion - 1.0 + ${QMAKE_FULL_VERSION} LSRequiresIPhoneOS MinimumOSVersion - 9.1 + ${TVOS_DEPLOYMENT_TARGET} NOTE This file was generated by Qt/QMake. diff --git a/mkspecs/macx-tvos-clang/Info.plist.lib b/mkspecs/macx-tvos-clang/Info.plist.lib index 044cbd33932..ce283655000 100644 --- a/mkspecs/macx-tvos-clang/Info.plist.lib +++ b/mkspecs/macx-tvos-clang/Info.plist.lib @@ -3,19 +3,19 @@ CFBundleExecutable - @LIBRARY@ + ${EXECUTABLE_NAME} CFBundleGetInfoString Created by Qt/QMake CFBundleIdentifier - @BUNDLEIDENTIFIER@ + ${PRODUCT_BUNDLE_IDENTIFIER} CFBundlePackageType FMWK CFBundleShortVersionString - @SHORT_VERSION@ + ${QMAKE_SHORT_VERSION} CFBundleSignature - @TYPEINFO@ + ${QMAKE_PKGINFO_TYPEINFO} CFBundleVersion - @FULL_VERSION@ + ${QMAKE_FULL_VERSION} NOTE Please, do NOT change this file -- It was generated by Qt/QMake. diff --git a/mkspecs/macx-watchos-clang/Info.plist.app b/mkspecs/macx-watchos-clang/Info.plist.app index d918704491e..47f5a58d5e5 100644 --- a/mkspecs/macx-watchos-clang/Info.plist.app +++ b/mkspecs/macx-watchos-clang/Info.plist.app @@ -7,21 +7,23 @@ CFBundleDisplayName ${PRODUCT_NAME} CFBundleExecutable - @EXECUTABLE@ + ${EXECUTABLE_NAME} CFBundleGetInfoString Created by Qt/QMake CFBundleIdentifier - @BUNDLEIDENTIFIER@ + ${PRODUCT_BUNDLE_IDENTIFIER} CFBundleName ${PRODUCT_NAME} CFBundlePackageType APPL CFBundleShortVersionString - 1.0 + ${QMAKE_SHORT_VERSION} CFBundleSignature - @TYPEINFO@ + ${QMAKE_PKGINFO_TYPEINFO} CFBundleVersion - 1.0 + ${QMAKE_FULL_VERSION} + MinimumOSVersion + ${WATCHOS_DEPLOYMENT_TARGET} NOTE This file was generated by Qt/QMake. UISupportedInterfaceOrientations diff --git a/mkspecs/macx-watchos-clang/Info.plist.lib b/mkspecs/macx-watchos-clang/Info.plist.lib index 044cbd33932..ce283655000 100644 --- a/mkspecs/macx-watchos-clang/Info.plist.lib +++ b/mkspecs/macx-watchos-clang/Info.plist.lib @@ -3,19 +3,19 @@ CFBundleExecutable - @LIBRARY@ + ${EXECUTABLE_NAME} CFBundleGetInfoString Created by Qt/QMake CFBundleIdentifier - @BUNDLEIDENTIFIER@ + ${PRODUCT_BUNDLE_IDENTIFIER} CFBundlePackageType FMWK CFBundleShortVersionString - @SHORT_VERSION@ + ${QMAKE_SHORT_VERSION} CFBundleSignature - @TYPEINFO@ + ${QMAKE_PKGINFO_TYPEINFO} CFBundleVersion - @FULL_VERSION@ + ${QMAKE_FULL_VERSION} NOTE Please, do NOT change this file -- It was generated by Qt/QMake. diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc index a4e28b4d0c0..16b498d36e1 100644 --- a/qmake/doc/src/qmake-manual.qdoc +++ b/qmake/doc/src/qmake-manual.qdoc @@ -939,6 +939,8 @@ order in which they are given. \row \li precompile_header \li Enables support for the use of \l{Using Precompiled Headers}{precompiled headers} in projects. + \row \li precompile_header_c (MSVC only) \li Enables support for the use of + \l{Using Precompiled Headers}{precompiled headers} for C files. \row \li warn_on \li The compiler should output as many warnings as possible. If \c warn_off is also specified, the last one takes effect. \row \li warn_off \li The compiler should output as few warnings as possible. @@ -1821,9 +1823,55 @@ Specifies the name of the property list file, \c{.plist}, you would like to include in your \macos, iOS, tvOS, and watchOS application bundle. - In the \c{.plist} file, you can define some variables, e.g., @EXECUTABLE@, - which qmake will replace with the actual executable name. Other variables - include @ICON@, @TYPEINFO@, @LIBRARY@, and @SHORT_VERSION@. + In the \c{.plist} file, you can define some variables which + qmake will replace with the relevant values: + + \table + \header + \li Placeholder(s) + \li Effect + \row + \li \c ${PRODUCT_BUNDLE_IDENTIFIER}, \c @BUNDLEIDENTIFIER@ + \li Expands to the target bundle's bundle identifier string, + for example: \c{com.example.myapp}. Determined by concatenating the + values of QMAKE_TARGET_BUNDLE_PREFIX and QMAKE_BUNDLE, separated + by a full stop (\c{.}). + \row + \li \c ${EXECUTABLE_NAME}, \c @EXECUTABLE@, \c @LIBRARY@ + \li Equivalent to the value of QMAKE_APPLICATION_BUNDLE_NAME, + QMAKE_PLUGIN_BUNDLE_NAME, or QMAKE_FRAMEWORK_BUNDLE_NAME + (depending on the type of target being created), + or TARGET if none of the previous values are set. + \row + \li \c ${ASSETCATALOG_COMPILER_APPICON_NAME}, \c @ICON@ + \li Expands to the value of ICON. + \row + \li \c ${QMAKE_PKGINFO_TYPEINFO}, \c @TYPEINFO@ + \li Expands to the value of QMAKE_PKGINFO_TYPEINFO. + \row + \li \c ${QMAKE_FULL_VERSION}, \c @FULL_VERSION@ + \li Expands to the value of VERSION expressed with three version components. + \row + \li \c ${QMAKE_SHORT_VERSION}, \c @SHORT_VERSION@ + \li Expands to the value of VERSION expressed with two version components. + \row + \li \c ${MACOSX_DEPLOYMENT_TARGET} + \li Expands to the value of QMAKE_MACOSX_DEPLOYMENT_TARGET. + \row + \li \c ${IPHONEOS_DEPLOYMENT_TARGET} + \li Expands to the value of QMAKE_IPHONEOS_DEPLOYMENT_TARGET. + \row + \li \c ${TVOS_DEPLOYMENT_TARGET} + \li Expands to the value of QMAKE_TVOS_DEPLOYMENT_TARGET. + \row + \li \c ${WATCHOS_DEPLOYMENT_TARGET} + \li Expands to the value of QMAKE_WATCHOS_DEPLOYMENT_TARGET. + \endtable + + \note When using the Xcode generator, the above \c{${var}}-style + placeholders are replaced directly by the Xcode build system and are not + handled by qmake. The \c{@var@} style placeholders work only with the qmake + Makefile generators and not with the Xcode generator. If building for iOS, and the \c{.plist} file contains the key \c NSPhotoLibraryUsageDescription, qmake will include an additional plugin @@ -4577,6 +4625,11 @@ \snippet code/doc_src_qmake-manual.pro 106 + To use the precompiled header also for C files on MSVC nmake target, add + \c precompile_header_c to the \l{CONFIG} variable. If the header is + used also for C++ and it contains C++ keywords/includes, enclose them + with \c{#ifdef __cplusplus}). + \section1 Notes on Possible Issues On some platforms, the file name suffix for precompiled header files is diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index 0622ace71b1..db7a1b27145 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -279,7 +279,6 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t) QString configName = (as_release ? "Release" : "Debug"); QMap settings; - settings.insert("COPY_PHASE_STRIP", (as_release ? "YES" : "NO")); if(project->isActiveConfig("sdk") && !project->isEmpty("QMAKE_MAC_SDK")) settings.insert("SDKROOT", project->first("QMAKE_MAC_SDK").toQString()); { @@ -1493,7 +1492,6 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) settings.insert("PROVISIONING_PROFILE_SPECIFIER", project->first("QMAKE_PROVISIONING_PROFILE").toQString()); } - settings.insert("COPY_PHASE_STRIP", (as_release ? "YES" : "NO")); settings.insert("APPLICATION_EXTENSION_API_ONLY", project->isActiveConfig("app_extension_api_only") ? "YES" : "NO"); // required for tvOS (and watchos), optional on iOS (deployment target >= iOS 6.0) settings.insert("ENABLE_BITCODE", project->isActiveConfig("bitcode") ? "YES" : "NO"); diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index f7097e58dc2..8ecfa0bf31a 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -155,6 +155,20 @@ UnixMakefileGenerator::writeSubTargets(QTextStream &t, QList= '0' && c <= '9') || (c >= 'A' && c <= 'Z') + || (c >= 'a' && c <= 'z') || c == '-' || c == '.'; + if (!okChar) + ch = QChar::fromLatin1('-'); + } + return s; +} + void UnixMakefileGenerator::writeMakeParts(QTextStream &t) { @@ -806,14 +820,23 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) t << mkdir_p_asstring(destdir) << "\n\t"; ProStringList commonSedArgs; if (!project->values("VERSION").isEmpty()) { - commonSedArgs << "-e \"s,@SHORT_VERSION@," << project->first("VER_MAJ") << "." - << project->first("VER_MIN") << ",g\" "; - commonSedArgs << "-e \"s,@FULL_VERSION@," << project->first("VER_MAJ") << "." - << project->first("VER_MIN") << "." - << project->first("VER_PAT") << ",g\" "; + const ProString shortVersion = + project->first("VER_MAJ") + "." + + project->first("VER_MIN"); + commonSedArgs << "-e \"s,@SHORT_VERSION@," << shortVersion << ",g\" "; + commonSedArgs << "-e \"s,\\$${QMAKE_SHORT_VERSION}," << shortVersion << ",g\" "; + const ProString fullVersion = + project->first("VER_MAJ") + "." + + project->first("VER_MIN") + "." + + project->first("VER_PAT"); + commonSedArgs << "-e \"s,@FULL_VERSION@," << fullVersion << ",g\" "; + commonSedArgs << "-e \"s,\\$${QMAKE_FULL_VERSION}," << fullVersion << ",g\" "; } - commonSedArgs << "-e \"s,@TYPEINFO@,"<< (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ? - QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) << ",g\" "; + const ProString typeInfo = project->isEmpty("QMAKE_PKGINFO_TYPEINFO") + ? QString::fromLatin1("????") + : project->first("QMAKE_PKGINFO_TYPEINFO").left(4); + commonSedArgs << "-e \"s,@TYPEINFO@," << typeInfo << ",g\" "; + commonSedArgs << "-e \"s,\\$${QMAKE_PKGINFO_TYPEINFO}," << typeInfo << ",g\" "; QString bundlePrefix = project->first("QMAKE_TARGET_BUNDLE_PREFIX").toQString(); if (bundlePrefix.isEmpty()) @@ -826,8 +849,18 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) if (bundleIdentifier.endsWith(".framework")) bundleIdentifier.chop(10); // replace invalid bundle id characters - bundleIdentifier.replace('_', '-'); + bundleIdentifier = rfc1034Identifier(bundleIdentifier); commonSedArgs << "-e \"s,@BUNDLEIDENTIFIER@," << bundleIdentifier << ",g\" "; + commonSedArgs << "-e \"s,\\$${PRODUCT_BUNDLE_IDENTIFIER}," << bundleIdentifier << ",g\" "; + + commonSedArgs << "-e \"s,\\$${MACOSX_DEPLOYMENT_TARGET}," + << project->first("QMAKE_MACOSX_DEPLOYMENT_TARGET").toQString() << ",g\" "; + commonSedArgs << "-e \"s,\\$${IPHONEOS_DEPLOYMENT_TARGET}," + << project->first("QMAKE_IPHONEOS_DEPLOYMENT_TARGET").toQString() << ",g\" "; + commonSedArgs << "-e \"s,\\$${TVOS_DEPLOYMENT_TARGET}," + << project->first("QMAKE_TVOS_DEPLOYMENT_TARGET").toQString() << ",g\" "; + commonSedArgs << "-e \"s,\\$${WATCHOS_DEPLOYMENT_TARGET}," + << project->first("QMAKE_WATCHOS_DEPLOYMENT_TARGET").toQString() << ",g\" "; if (!isFramework) { ProString app_bundle_name = var("QMAKE_APPLICATION_BUNDLE_NAME"); @@ -843,11 +876,14 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) << "@sed "; for (const ProString &arg : qAsConst(commonSedArgs)) t << arg; - t << "-e \"s,@ICON@," << icon.section(Option::dir_sep, -1) << ",g\" " + const QString iconName = icon.section(Option::dir_sep, -1); + t << "-e \"s,@ICON@," << iconName << ",g\" " + << "-e \"s,\\$${ASSETCATALOG_COMPILER_APPICON_NAME}," << iconName << ",g\" " << "-e \"s,@EXECUTABLE@," << app_bundle_name << ",g\" " << "-e \"s,@LIBRARY@," << plugin_bundle_name << ",g\" " - << "-e \"s,@TYPEINFO@,"<< (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ? - QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) << ",g\" " + << "-e \"s,\\$${EXECUTABLE_NAME}," << (app_bundle_name.isEmpty() ? app_bundle_name : plugin_bundle_name) << ",g\" " + << "-e \"s,@TYPEINFO@,"<< typeInfo << ",g\" " + << "-e \"s,\\$${QMAKE_PKGINFO_TYPEINFO},"<< typeInfo << ",g\" " << "" << info_plist << " >" << info_plist_out << endl; //copy the icon if (!project->isEmpty("ICON")) { @@ -873,9 +909,9 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) for (const ProString &arg : qAsConst(commonSedArgs)) t << arg; t << "-e \"s,@LIBRARY@," << lib_bundle_name << ",g\" " - << "-e \"s,@TYPEINFO@," - << (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ? - QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) << ",g\" " + << "-e \"s,\\$${EXECUTABLE_NAME}," << lib_bundle_name << ",g\" " + << "-e \"s,@TYPEINFO@," << typeInfo << ",g\" " + << "-e \"s,\\$${QMAKE_PKGINFO_TYPEINFO}," << typeInfo << ",g\" " << "" << info_plist << " >" << info_plist_out << endl; } break; diff --git a/qmake/generators/win32/mingw_make.cpp b/qmake/generators/win32/mingw_make.cpp index 792ffb1997d..d6d6b04148c 100644 --- a/qmake/generators/win32/mingw_make.cpp +++ b/qmake/generators/win32/mingw_make.cpp @@ -324,7 +324,8 @@ void MingwMakefileGenerator::writeBuildRulesPart(QTextStream &t) t << "\n\t" <isActiveConfig("staticlib") && project->first("TEMPLATE") == "lib") { t << "\n\t-$(DEL_FILE) $(DESTDIR_TARGET) 2>" << var("QMAKE_SHELL_NULL_DEVICE"); - if (project->values("OBJECTS").count() < var("QMAKE_LINK_OBJECT_MAX").toInt()) { + const ProString &objmax = project->first("QMAKE_LINK_OBJECT_MAX"); + if (objmax.isEmpty() || project->values("OBJECTS").count() < objmax.toInt()) { t << "\n\t$(LIB) $(DESTDIR_TARGET) " << objectsLinkLine << " " ; } else { t << "\n\t" << objectsLinkLine << " " ; diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp index b4c2579c5c6..ccc2ea6d2bf 100644 --- a/qmake/generators/win32/msvc_nmake.cpp +++ b/qmake/generators/win32/msvc_nmake.cpp @@ -51,7 +51,7 @@ static QString nmakePathList(const QStringList &list) .replace('#', QLatin1String("^#")).replace('$', QLatin1String("$$")); } -NmakeMakefileGenerator::NmakeMakefileGenerator() : Win32MakefileGenerator(), usePCH(false) +NmakeMakefileGenerator::NmakeMakefileGenerator() : usePCH(false), usePCHC(false) { } @@ -324,6 +324,8 @@ void NmakeMakefileGenerator::writeNmakeParts(QTextStream &t) << escapeDependencyPaths(findDependencies(precompH)).join(" \\\n\t\t") << "\n\t$(CXX) " + precompRule +" $(CXXFLAGS) $(INCPATH) -TP " << escapeFilePath(precompH) << endl << endl; + } + if (usePCHC) { QString precompRuleC = QString("-c -Yc -Fp%1 -Fo%2") .arg(escapeFilePath(precompPchC), escapeFilePath(precompObjC)); t << escapeDependencyPath(precompObjC) << ": " << escapeDependencyPath(precompH) << ' ' @@ -335,14 +337,14 @@ void NmakeMakefileGenerator::writeNmakeParts(QTextStream &t) QString NmakeMakefileGenerator::var(const ProKey &value) const { - if (usePCH) { + if (usePCH || usePCHC) { const bool isRunC = (value == "QMAKE_RUN_CC_IMP_BATCH" || value == "QMAKE_RUN_CC_IMP" || value == "QMAKE_RUN_CC"); - if (isRunC - || value == "QMAKE_RUN_CXX_IMP_BATCH" - || value == "QMAKE_RUN_CXX_IMP" - || value == "QMAKE_RUN_CXX") { + const bool isRunCpp = (value == "QMAKE_RUN_CXX_IMP_BATCH" + || value == "QMAKE_RUN_CXX_IMP" + || value == "QMAKE_RUN_CXX"); + if ((isRunCpp && usePCH) || (isRunC && usePCHC)) { QFileInfo precompHInfo(fileInfo(precompH)); QString precompH_f = escapeFilePath(precompHInfo.fileName()); QString precompRule = QString("-c -FI%1 -Yu%2 -Fp%3") @@ -410,21 +412,24 @@ void NmakeMakefileGenerator::init() // Setup PCH variables precompH = project->first("PRECOMPILED_HEADER").toQString(); usePCH = !precompH.isEmpty() && project->isActiveConfig("precompile_header"); + usePCHC = !precompH.isEmpty() && project->isActiveConfig("precompile_header_c"); if (usePCH) { // Created files precompObj = var("PRECOMPILED_DIR") + project->first("TARGET") + "_pch" + Option::obj_ext; precompPch = var("PRECOMPILED_DIR") + project->first("TARGET") + "_pch.pch"; - precompObjC = var("PRECOMPILED_DIR") + project->first("TARGET") + "_pch_c" + Option::obj_ext; - precompPchC = var("PRECOMPILED_DIR") + project->first("TARGET") + "_pch_c.pch"; // Add linking of precompObj (required for whole precompiled classes) - project->values("OBJECTS") += precompObj; - project->values("OBJECTS") += precompObjC; + project->values("OBJECTS") += precompObj; // Add pch file to cleanup - project->values("QMAKE_CLEAN") += precompPch; - project->values("QMAKE_CLEAN") += precompPchC; + project->values("QMAKE_CLEAN") += precompPch; // Return to variable pool project->values("PRECOMPILED_OBJECT") = ProStringList(precompObj); project->values("PRECOMPILED_PCH") = ProStringList(precompPch); + } + if (usePCHC) { + precompObjC = var("PRECOMPILED_DIR") + project->first("TARGET") + "_pch_c" + Option::obj_ext; + precompPchC = var("PRECOMPILED_DIR") + project->first("TARGET") + "_pch_c.pch"; + project->values("OBJECTS") += precompObjC; + project->values("QMAKE_CLEAN") += precompPchC; project->values("PRECOMPILED_OBJECT_C") = ProStringList(precompObjC); project->values("PRECOMPILED_PCH_C") = ProStringList(precompPchC); } diff --git a/qmake/generators/win32/msvc_nmake.h b/qmake/generators/win32/msvc_nmake.h index 4b0935bb660..67b609d0a62 100644 --- a/qmake/generators/win32/msvc_nmake.h +++ b/qmake/generators/win32/msvc_nmake.h @@ -53,7 +53,7 @@ protected: QString var(const ProKey &value) const; QString precompH, precompObj, precompPch; QString precompObjC, precompPchC; - bool usePCH; + bool usePCH, usePCHC; public: NmakeMakefileGenerator(); diff --git a/src/corelib/Qt5CoreMacros.cmake b/src/corelib/Qt5CoreMacros.cmake index 8b65db95cb2..8d3dbe3ecf4 100644 --- a/src/corelib/Qt5CoreMacros.cmake +++ b/src/corelib/Qt5CoreMacros.cmake @@ -257,7 +257,7 @@ function(QT5_ADD_BINARY_RESOURCES target ) add_custom_command(OUTPUT ${rcc_destination} COMMAND ${Qt5Core_RCC_EXECUTABLE} ARGS ${rcc_options} --binary --name ${target} --output ${rcc_destination} ${infiles} - DEPENDS ${rc_depends} ${out_depends} VERBATIM) + DEPENDS ${rc_depends} ${out_depends} ${infiles} VERBATIM) add_custom_target(${target} ALL DEPENDS ${rcc_destination}) endfunction() diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index c7d5c957ead..6a51ea3ab13 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -544,6 +544,12 @@ using qsizetype = QIntegerForSizeof::Signed; # define Q_ALWAYS_INLINE inline #endif +#ifdef Q_CC_GNU +# define QT_INIT_METAOBJECT __attribute__((init_priority(101))) +#else +# define QT_INIT_METAOBJECT +#endif + //defines the type for the WNDPROC on windows //the alignment needs to be forced for sse2 to not crash with mingw #if defined(Q_OS_WIN) diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index 158b83e087b..e2a7297ca64 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -979,6 +979,7 @@ QWheelEvent::QWheelEvent(const QPointF &pos, const QPointF& globalPos, \li scrolling is about to begin, but the distance did not yet change (Qt::ScrollBegin), \li or scrolling has ended and the distance did not change anymore (Qt::ScrollEnd). \endlist + \note On X11 this value is driver specific and unreliable, use angleDelta() instead */ /*! diff --git a/src/gui/kernel/qpalette.cpp b/src/gui/kernel/qpalette.cpp index 665cc430ccb..4905e51e01b 100644 --- a/src/gui/kernel/qpalette.cpp +++ b/src/gui/kernel/qpalette.cpp @@ -751,21 +751,24 @@ const QBrush &QPalette::brush(ColorGroup gr, ColorRole cr) const void QPalette::setBrush(ColorGroup cg, ColorRole cr, const QBrush &b) { Q_ASSERT(cr < NColorRoles); - detach(); - if(cg >= (int)NColorGroups) { - if(cg == All) { - for(int i = 0; i < (int)NColorGroups; i++) - d->br[i][cr] = b; - data.resolve_mask |= (1<= NColorGroups) { + qWarning("QPalette::setBrush: Unknown ColorGroup: %d", cg); + cg = Active; + } + + if (d->br[cg][cr] != b) { + detach(); + d->br[cg][cr] = b; } - d->br[cg][cr] = b; data.resolve_mask |= (1<fontDatabase()->resolveFontFamilyAlias(family); } +Q_GUI_EXPORT QStringList qt_sort_families_by_writing_system(QChar::Script script, const QStringList &families) +{ + size_t writingSystem = std::find(scriptForWritingSystem, + scriptForWritingSystem + QFontDatabase::WritingSystemsCount, + script) - scriptForWritingSystem; + if (writingSystem == QFontDatabase::Any + || writingSystem >= QFontDatabase::WritingSystemsCount) { + return families; + } + + QFontDatabasePrivate *db = privateDb(); + QMultiMap supported; + for (int i = 0; i < families.size(); ++i) { + const QString &family = families.at(i); + + QtFontFamily *testFamily = nullptr; + for (int x = 0; x < db->count; ++x) { + if (Q_UNLIKELY(matchFamilyName(family, db->families[x]))) { + testFamily = db->families[x]; + testFamily->ensurePopulated(); + break; + } + } + + uint order = i; + if (testFamily == nullptr + || (testFamily->writingSystems[writingSystem] & QtFontFamily::Supported) == 0) { + order |= 1 << 31; + } + + supported.insert(order, family); + } + + return supported.values(); +} QT_END_NAMESPACE diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp index 5be8745b155..a9f411da560 100644 --- a/src/gui/text/qfontengine.cpp +++ b/src/gui/text/qfontengine.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtGui module of the Qt Toolkit. @@ -1845,7 +1845,12 @@ QFontEngine *QFontEngineMulti::loadEngine(int at) request.styleStrategy |= QFont::NoFontMerging; request.family = fallbackFamilyAt(at - 1); - if (QFontEngine *engine = QFontDatabase::findFont(request, m_script)) { + // At this point, the main script of the text has already been considered + // when fetching the list of fallback families from the database, and the + // info about the actual script of the characters may have been discarded, + // so we do not check for writing system support, but instead just load + // the family indiscriminately. + if (QFontEngine *engine = QFontDatabase::findFont(request, QFontDatabase::Any)) { engine->fontDef.weight = request.weight; if (request.style > QFont::StyleNormal) engine->fontDef.style = request.style; @@ -1898,8 +1903,33 @@ bool QFontEngineMulti::stringToCMap(const QChar *str, int len, int glyph_pos = 0; QStringIterator it(str, str + len); + + int lastFallback = -1; while (it.hasNext()) { const uint ucs4 = it.peekNext(); + + // If we applied a fallback font to previous glyph, and the current is either + // ZWJ or ZWNJ, we should also try applying the same fallback font to that, in order + // to get the correct shaping rules applied. + if (lastFallback >= 0 && (ucs4 == QChar(0x200d) || ucs4 == QChar(0x200c))) { + QFontEngine *engine = m_engines.at(lastFallback); + glyph_t glyph = engine->glyphIndex(ucs4); + if (glyph != 0) { + glyphs->glyphs[glyph_pos] = glyph; + if (!(flags & GlyphIndicesOnly)) { + QGlyphLayout g = glyphs->mid(glyph_pos, 1); + engine->recalcAdvances(&g, flags); + } + + // set the high byte to indicate which engine the glyph came from + glyphs->glyphs[glyph_pos] |= (lastFallback << 24); + } else { + lastFallback = -1; + } + } else { + lastFallback = -1; + } + if (glyphs->glyphs[glyph_pos] == 0 && ucs4 != QChar::LineSeparator && ucs4 != QChar::LineFeed @@ -1928,6 +1958,9 @@ bool QFontEngineMulti::stringToCMap(const QChar *str, int len, QGlyphLayout g = glyphs->mid(glyph_pos, 1); engine->recalcAdvances(&g, flags); } + + lastFallback = x; + // set the high byte to indicate which engine the glyph came from glyphs->glyphs[glyph_pos] |= (x << 24); break; diff --git a/src/network/access/qftp.cpp b/src/network/access/qftp.cpp index 762ef002255..719e3536b4d 100644 --- a/src/network/access/qftp.cpp +++ b/src/network/access/qftp.cpp @@ -1702,8 +1702,16 @@ int QFtp::connectToHost(const QString &host, quint16 port) int QFtp::login(const QString &user, const QString &password) { QStringList cmds; - cmds << (QLatin1String("USER ") + (user.isNull() ? QLatin1String("anonymous") : user) + QLatin1String("\r\n")); - cmds << (QLatin1String("PASS ") + (password.isNull() ? QLatin1String("anonymous@") : password) + QLatin1String("\r\n")); + + if (user.isNull() || user.compare(QLatin1String("anonymous"), Qt::CaseInsensitive) == 0) { + cmds << (QLatin1String("USER ") + (user.isNull() ? QLatin1String("anonymous") : user) + QLatin1String("\r\n")); + cmds << (QLatin1String("PASS ") + (password.isNull() ? QLatin1String("anonymous@") : password) + QLatin1String("\r\n")); + } else { + cmds << (QLatin1String("USER ") + user + QLatin1String("\r\n")); + if (!password.isNull()) + cmds << (QLatin1String("PASS ") + password + QLatin1String("\r\n")); + } + return d_func()->addCommand(new QFtpCommand(Login, cmds)); } diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm index 237e8a89a53..73973128207 100644 --- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm +++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm @@ -544,6 +544,9 @@ QStringList QCoreTextFontDatabase::fallbacksForFamily(const QString &family, QFo fallbackList.append(QStringLiteral("Arial Unicode MS")); #endif + extern QStringList qt_sort_families_by_writing_system(QChar::Script, const QStringList &); + fallbackList = qt_sort_families_by_writing_system(script, fallbackList); + return fallbackList; } } diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp index 1efb01d52e9..70ee708b618 100644 --- a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp +++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp @@ -1203,7 +1203,7 @@ void QWindowsNativeFileDialogBase::onSelectionChange() { const QList current = selectedFiles(); m_data.setSelectedFiles(current); - qDebug() << __FUNCTION__ << current << current.size(); + qCDebug(lcQpaDialogs) << __FUNCTION__ << current << current.size(); if (current.size() == 1) emit currentChanged(current.front()); diff --git a/src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp b/src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp index cb2bbafee19..9b319986202 100644 --- a/src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp +++ b/src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp @@ -1,31 +1,37 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** 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. ** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** 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$ ** diff --git a/src/plugins/platforms/xcb/nativepainting/qbackingstore_x11_p.h b/src/plugins/platforms/xcb/nativepainting/qbackingstore_x11_p.h index 5f4c24ec11e..f3653a94388 100644 --- a/src/plugins/platforms/xcb/nativepainting/qbackingstore_x11_p.h +++ b/src/plugins/platforms/xcb/nativepainting/qbackingstore_x11_p.h @@ -1,31 +1,37 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** 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. ** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** 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$ ** diff --git a/src/plugins/platforms/xcb/nativepainting/qcolormap_x11.cpp b/src/plugins/platforms/xcb/nativepainting/qcolormap_x11.cpp index 8554c5445da..fe9d1fcde90 100644 --- a/src/plugins/platforms/xcb/nativepainting/qcolormap_x11.cpp +++ b/src/plugins/platforms/xcb/nativepainting/qcolormap_x11.cpp @@ -1,31 +1,37 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** 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. ** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** 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$ ** diff --git a/src/plugins/platforms/xcb/nativepainting/qcolormap_x11_p.h b/src/plugins/platforms/xcb/nativepainting/qcolormap_x11_p.h index 530e3113e41..573a0f28ea8 100644 --- a/src/plugins/platforms/xcb/nativepainting/qcolormap_x11_p.h +++ b/src/plugins/platforms/xcb/nativepainting/qcolormap_x11_p.h @@ -1,31 +1,37 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** 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. ** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** 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$ ** diff --git a/src/plugins/platforms/xcb/nativepainting/qpaintengine_x11.cpp b/src/plugins/platforms/xcb/nativepainting/qpaintengine_x11.cpp index 3364b07c080..8b63e5431d6 100644 --- a/src/plugins/platforms/xcb/nativepainting/qpaintengine_x11.cpp +++ b/src/plugins/platforms/xcb/nativepainting/qpaintengine_x11.cpp @@ -1,31 +1,37 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** 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. ** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** 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$ ** diff --git a/src/plugins/platforms/xcb/nativepainting/qpaintengine_x11_p.h b/src/plugins/platforms/xcb/nativepainting/qpaintengine_x11_p.h index a0dd6cdf74f..9b01c0a3fc1 100644 --- a/src/plugins/platforms/xcb/nativepainting/qpaintengine_x11_p.h +++ b/src/plugins/platforms/xcb/nativepainting/qpaintengine_x11_p.h @@ -1,31 +1,37 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** 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. ** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** 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$ ** diff --git a/src/plugins/platforms/xcb/nativepainting/qpixmap_x11.cpp b/src/plugins/platforms/xcb/nativepainting/qpixmap_x11.cpp index f791c90346a..86c87e5e302 100644 --- a/src/plugins/platforms/xcb/nativepainting/qpixmap_x11.cpp +++ b/src/plugins/platforms/xcb/nativepainting/qpixmap_x11.cpp @@ -1,31 +1,37 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** 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. ** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** 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$ ** diff --git a/src/plugins/platforms/xcb/nativepainting/qpixmap_x11_p.h b/src/plugins/platforms/xcb/nativepainting/qpixmap_x11_p.h index 79e607c6f86..7392cbfccf9 100644 --- a/src/plugins/platforms/xcb/nativepainting/qpixmap_x11_p.h +++ b/src/plugins/platforms/xcb/nativepainting/qpixmap_x11_p.h @@ -1,31 +1,37 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** 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. ** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** 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$ ** diff --git a/src/plugins/platforms/xcb/nativepainting/qt_x11_p.h b/src/plugins/platforms/xcb/nativepainting/qt_x11_p.h index a0e5131ea77..aa8dfa5af03 100644 --- a/src/plugins/platforms/xcb/nativepainting/qt_x11_p.h +++ b/src/plugins/platforms/xcb/nativepainting/qt_x11_p.h @@ -1,31 +1,37 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** 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. ** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** 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$ ** diff --git a/src/plugins/platforms/xcb/nativepainting/qtessellator.cpp b/src/plugins/platforms/xcb/nativepainting/qtessellator.cpp index 9acb21f95f4..1afa00cfc92 100644 --- a/src/plugins/platforms/xcb/nativepainting/qtessellator.cpp +++ b/src/plugins/platforms/xcb/nativepainting/qtessellator.cpp @@ -1,31 +1,37 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** 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. ** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** 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$ ** diff --git a/src/plugins/platforms/xcb/nativepainting/qtessellator_p.h b/src/plugins/platforms/xcb/nativepainting/qtessellator_p.h index 65ae6bdc416..7181a1ecc93 100644 --- a/src/plugins/platforms/xcb/nativepainting/qtessellator_p.h +++ b/src/plugins/platforms/xcb/nativepainting/qtessellator_p.h @@ -1,31 +1,37 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** 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. ** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** 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$ ** diff --git a/src/plugins/platforms/xcb/nativepainting/qxcbnativepainting.cpp b/src/plugins/platforms/xcb/nativepainting/qxcbnativepainting.cpp index 5ff45ec183d..57b1882e4b4 100644 --- a/src/plugins/platforms/xcb/nativepainting/qxcbnativepainting.cpp +++ b/src/plugins/platforms/xcb/nativepainting/qxcbnativepainting.cpp @@ -1,31 +1,37 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** 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. ** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** 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$ ** diff --git a/src/plugins/platforms/xcb/nativepainting/qxcbnativepainting.h b/src/plugins/platforms/xcb/nativepainting/qxcbnativepainting.h index f3011286c90..b00ccfcdff5 100644 --- a/src/plugins/platforms/xcb/nativepainting/qxcbnativepainting.h +++ b/src/plugins/platforms/xcb/nativepainting/qxcbnativepainting.h @@ -1,31 +1,37 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** 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. ** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** 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$ ** diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp index bfb35348796..ba6481082a3 100644 --- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp @@ -1011,10 +1011,12 @@ void QXcbConnection::xi2HandleScrollEvent(void *event, ScrollingDevice &scrollin double delta = scrollingDevice.lastScrollPosition.y() - value; scrollingDevice.lastScrollPosition.setY(value); angleDelta.setY((delta / scrollingDevice.verticalIncrement) * 120); - // We do not set "pixel" delta if it is only measured in ticks. - if (scrollingDevice.verticalIncrement > 1) + // With most drivers the increment is 1 for wheels. + // For libinput it is hardcoded to a useless 15. + // For a proper touchpad driver it should be in the same order of magnitude as 120 + if (scrollingDevice.verticalIncrement > 15) rawDelta.setY(delta); - else if (scrollingDevice.verticalIncrement < -1) + else if (scrollingDevice.verticalIncrement < -15) rawDelta.setY(-delta); } } @@ -1023,10 +1025,10 @@ void QXcbConnection::xi2HandleScrollEvent(void *event, ScrollingDevice &scrollin double delta = scrollingDevice.lastScrollPosition.x() - value; scrollingDevice.lastScrollPosition.setX(value); angleDelta.setX((delta / scrollingDevice.horizontalIncrement) * 120); - // We do not set "pixel" delta if it is only measured in ticks. - if (scrollingDevice.horizontalIncrement > 1) + // See comment under vertical + if (scrollingDevice.horizontalIncrement > 15) rawDelta.setX(delta); - else if (scrollingDevice.horizontalIncrement < -1) + else if (scrollingDevice.horizontalIncrement < -15) rawDelta.setX(-delta); } } diff --git a/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp b/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp index 39070c32e83..d1a6582c5ad 100644 --- a/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp +++ b/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp @@ -446,7 +446,7 @@ static QString timespecToString(const QDateTime &dateTime) bool QSQLiteResult::exec() { Q_D(QSQLiteResult); - const QVector values = boundValues(); + QVector values = boundValues(); d->skippedStatus = false; d->skipRow = false; @@ -478,6 +478,20 @@ bool QSQLiteResult::exec() countIndexes); paramCountIsValid = bindParamCount == values.count(); + // When using named placeholders, it will reuse the index for duplicated + // placeholders. So we need to ensure the QVector has only one instance of + // each value as SQLite will do the rest for us. + QVector prunedValues; + QList handledIndexes; + for (int i = 0, currentIndex = 0; i < values.size(); ++i) { + if (handledIndexes.contains(i)) + continue; + const auto placeHolder = QString::fromUtf8(sqlite3_bind_parameter_name(d->stmt, currentIndex + 1)); + handledIndexes << d->indexes[placeHolder]; + prunedValues << values.at(d->indexes[placeHolder].first()); + ++currentIndex; + } + values = prunedValues; } #endif diff --git a/src/sql/doc/snippets/code/doc_src_sql-driver.cpp b/src/sql/doc/snippets/code/doc_src_sql-driver.cpp index e7dfbd90d52..2c0e824db3d 100644 --- a/src/sql/doc/snippets/code/doc_src_sql-driver.cpp +++ b/src/sql/doc/snippets/code/doc_src_sql-driver.cpp @@ -127,3 +127,15 @@ while (query1.next()) { } // query1, and cause the loop to quit } //! [37] + + +//! [39] +QSqlDatabase db = QSqlDatabase::addDatabase("QODBC3"); +QString connectString = QStringLiteral( + "DRIVER=/path/to/installation/libodbcHDB.so;" + "SERVERNODE=hostname:port;" + "UID=USER;" + "PWD=PASSWORD;" + "SCROLLABLERESULT=true"); +db.setDatabaseName(connectString); +//! [39] diff --git a/src/sql/doc/src/sql-driver.qdoc b/src/sql/doc/src/sql-driver.qdoc index 70205d5552f..dc8d52b5725 100644 --- a/src/sql/doc/src/sql-driver.qdoc +++ b/src/sql/doc/src/sql-driver.qdoc @@ -299,6 +299,12 @@ e.g., the SQLSTATEs. Before setting this connect option, consult your ODBC documentation about behavior differences you can expect. + When using the SAP HANA database, the connection has to be + established using the option "SCROLLABLERESULT=TRUE", as the + HANA ODBC driver does not provide scrollable results by default, e.g.: + + \snippet code/doc_src_sql-driver.cpp 39 + If you experience very slow access of the ODBC datasource, make sure that ODBC call tracing is turned off in the ODBC datasource manager. diff --git a/src/sql/kernel/qsqlrecord.cpp b/src/sql/kernel/qsqlrecord.cpp index 1c9ad5ec637..ecbe3eacdb0 100644 --- a/src/sql/kernel/qsqlrecord.cpp +++ b/src/sql/kernel/qsqlrecord.cpp @@ -232,18 +232,19 @@ QString QSqlRecord::fieldName(int index) const int QSqlRecord::indexOf(const QString& name) const { - QString tableName; - QString fieldName = name; + QStringRef tableName; + QStringRef fieldName(&name); const int idx = name.indexOf(QLatin1Char('.')); if (idx != -1) { - tableName = name.left(idx); - fieldName = name.mid(idx + 1); + tableName = name.leftRef(idx); + fieldName = name.midRef(idx + 1); } - for (int i = 0; i < count(); ++i) { + const int cnt = count(); + for (int i = 0; i < cnt; ++i) { // Check the passed in name first in case it is an alias using a dot. // Then check if both the table and field match when there is a table name specified. - const auto currentField = d->fields.at(i); - const auto currentFieldName = currentField.name(); + const auto ¤tField = d->fields.at(i); + const auto ¤tFieldName = currentField.name(); if (currentFieldName.compare(name, Qt::CaseInsensitive) == 0 || (idx != -1 && currentFieldName.compare(fieldName, Qt::CaseInsensitive) == 0 && currentField.tableName().compare(tableName, Qt::CaseInsensitive) == 0)) { diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp index 587a91139d6..d299cdad51a 100644 --- a/src/tools/moc/generator.cpp +++ b/src/tools/moc/generator.cpp @@ -523,9 +523,9 @@ void Generator::generateCode() // Finally create and initialize the static meta object // if (isQt) - fprintf(out, "const QMetaObject QObject::staticQtMetaObject = {\n"); + fprintf(out, "QT_INIT_METAOBJECT const QMetaObject QObject::staticQtMetaObject = {\n"); else - fprintf(out, "const QMetaObject %s::staticMetaObject = {\n", cdef->qualified.constData()); + fprintf(out, "QT_INIT_METAOBJECT const QMetaObject %s::staticMetaObject = {\n", cdef->qualified.constData()); if (isQObject) fprintf(out, " { nullptr, "); diff --git a/src/tools/qlalr/qlalr.pro b/src/tools/qlalr/qlalr.pro index ce0f4a4f592..5cfeade1ee6 100644 --- a/src/tools/qlalr/qlalr.pro +++ b/src/tools/qlalr/qlalr.pro @@ -25,5 +25,5 @@ OTHER_FILES += \ DEFINES += \ QT_NO_FOREACH -QMAKE_TARGET_DESCRIPTION = "Qt Look Ahead LR Parser" +QMAKE_TARGET_DESCRIPTION = "Qt Look Ahead LR Parser Generator" load(qt_tool) diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp index 2b79831a74f..14ac6ad31bb 100644 --- a/src/widgets/dialogs/qfilesystemmodel.cpp +++ b/src/widgets/dialogs/qfilesystemmodel.cpp @@ -1086,8 +1086,8 @@ void QFileSystemModelPrivate::sortChildren(int column, const QModelIndex &parent return; QVector values; - QHash::const_iterator iterator; - for(iterator = indexNode->children.constBegin() ; iterator != indexNode->children.constEnd() ; ++iterator) { + + for (auto iterator = indexNode->children.constBegin(), cend = indexNode->children.constEnd(); iterator != cend; ++iterator) { if (filtersAcceptsNode(iterator.value())) { values.append(iterator.value()); } else { @@ -1647,13 +1647,10 @@ void QFileSystemModelPrivate::_q_directoryChanged(const QString &directory, cons QStringList toRemove; QStringList newFiles = files; std::sort(newFiles.begin(), newFiles.end()); - QHash::const_iterator i = parentNode->children.constBegin(); - while (i != parentNode->children.constEnd()) { + for (auto i = parentNode->children.constBegin(), cend = parentNode->children.constEnd(); i != cend; ++i) { QStringList::iterator iterator = std::lower_bound(newFiles.begin(), newFiles.end(), i.value()->fileName); if ((iterator == newFiles.end()) || (i.value()->fileName < *iterator)) toRemove.append(i.value()->fileName); - - ++i; } for (int i = 0 ; i < toRemove.count() ; ++i ) removeNode(parentNode, toRemove[i]); diff --git a/src/widgets/dialogs/qfilesystemmodel_p.h b/src/widgets/dialogs/qfilesystemmodel_p.h index 640225529b8..e8bae4f6599 100644 --- a/src/widgets/dialogs/qfilesystemmodel_p.h +++ b/src/widgets/dialogs/qfilesystemmodel_p.h @@ -72,6 +72,23 @@ class ExtendedInformation; class QFileSystemModelPrivate; class QFileIconProvider; +#if defined(Q_OS_WIN) +class QFileSystemModelNodePathKey : public QString +{ +public: + QFileSystemModelNodePathKey() {} + QFileSystemModelNodePathKey(const QString &other) : QString(other) {} + QFileSystemModelNodePathKey(const QFileSystemModelNodePathKey &other) : QString(other) {} + bool operator==(const QFileSystemModelNodePathKey &other) const { return !compare(other, Qt::CaseInsensitive); } +}; + +Q_DECLARE_TYPEINFO(QFileSystemModelNodePathKey, Q_MOVABLE_TYPE); + +inline uint qHash(const QFileSystemModelNodePathKey &key) { return qHash(key.toCaseFolded()); } +#else // Q_OS_WIN +typedef QString QFileSystemModelNodePathKey; +#endif + class Q_AUTOTEST_EXPORT QFileSystemModelPrivate : public QAbstractItemModelPrivate { Q_DECLARE_PUBLIC(QFileSystemModel) @@ -189,7 +206,7 @@ public: bool populatedChildren; bool isVisible; - QHash children; + QHash children; QList visibleChildren; int dirtyChildrenIndex; QFileSystemNode *parent; diff --git a/src/widgets/itemviews/qlistwidget.cpp b/src/widgets/itemviews/qlistwidget.cpp index c14dcec744e..2cca3cbb3ab 100644 --- a/src/widgets/itemviews/qlistwidget.cpp +++ b/src/widgets/itemviews/qlistwidget.cpp @@ -691,6 +691,9 @@ QListWidgetItem *QListWidgetItem::clone() const Sets the data for a given \a role to the given \a value. Reimplement this function if you need extra roles or special behavior for certain roles. + \note The default implementation treats Qt::EditRole and Qt::DisplayRole as + referring to the same data. + \sa Qt::ItemDataRole, data() */ void QListWidgetItem::setData(int role, const QVariant &value) diff --git a/src/widgets/itemviews/qtablewidget.cpp b/src/widgets/itemviews/qtablewidget.cpp index a0c01e2f255..1cb88cbeeb2 100644 --- a/src/widgets/itemviews/qtablewidget.cpp +++ b/src/widgets/itemviews/qtablewidget.cpp @@ -1365,6 +1365,9 @@ QTableWidgetItem *QTableWidgetItem::clone() const /*! Sets the item's data for the given \a role to the specified \a value. + \note The default implementation treats Qt::EditRole and Qt::DisplayRole as + referring to the same data. + \sa Qt::ItemDataRole, data() */ void QTableWidgetItem::setData(int role, const QVariant &value) diff --git a/src/widgets/itemviews/qtreewidget.cpp b/src/widgets/itemviews/qtreewidget.cpp index d06128d0127..de7f7c0b77c 100644 --- a/src/widgets/itemviews/qtreewidget.cpp +++ b/src/widgets/itemviews/qtreewidget.cpp @@ -1699,6 +1699,9 @@ Qt::ItemFlags QTreeWidgetItem::flags() const The \a role describes the type of data specified by \a value, and is defined by the Qt::ItemDataRole enum. + + \note The default implementation treats Qt::EditRole and Qt::DisplayRole as + referring to the same data. */ void QTreeWidgetItem::setData(int column, int role, const QVariant &value) { diff --git a/src/widgets/styles/qstylehelper.cpp b/src/widgets/styles/qstylehelper.cpp index 4f498efac08..373699a7aa1 100644 --- a/src/widgets/styles/qstylehelper.cpp +++ b/src/widgets/styles/qstylehelper.cpp @@ -51,8 +51,6 @@ #include "qstylehelper_p.h" #include -#include -#include QT_BEGIN_NAMESPACE @@ -66,6 +64,7 @@ QString uniqueName(const QString &key, const QStyleOption *option, const QSize & QString tmp = key % HexString(option->state) % HexString(option->direction) % HexString(complexOption ? uint(complexOption->activeSubControls) : 0u) + % HexString(option->palette.cacheKey()) % HexString(size.width()) % HexString(size.height()); @@ -77,24 +76,6 @@ QString uniqueName(const QString &key, const QStyleOption *option, const QSize & } #endif // QT_CONFIG(spinbox) - // QTBUG-56743, try to create a palette cache key reflecting the value, - // as leaks may occur in conjunction with QStyleSheetStyle/QRenderRule modifying - // palettes when using QPalette::cacheKey() - if (option->palette != QGuiApplication::palette()) { - tmp.append(QLatin1Char('P')); -#ifndef QT_NO_DATASTREAM - QByteArray key; - key.reserve(5120); // Observed 5040B for a serialized palette on 64bit - { - QDataStream str(&key, QIODevice::WriteOnly); - str << option->palette; - } - const QByteArray sha1 = QCryptographicHash::hash(key, QCryptographicHash::Sha1).toHex(); - tmp.append(QString::fromLatin1(sha1)); -#else // QT_NO_DATASTREAM - tmp.append(QString::number(option->palette.cacheKey(), 16)); -#endif // !QT_NO_DATASTREAM - } return tmp; } diff --git a/src/widgets/widgets/qwidgetlinecontrol.cpp b/src/widgets/widgets/qwidgetlinecontrol.cpp index 31fe33ef28d..623ca5b0a17 100644 --- a/src/widgets/widgets/qwidgetlinecontrol.cpp +++ b/src/widgets/widgets/qwidgetlinecontrol.cpp @@ -44,7 +44,9 @@ #endif #include "qclipboard.h" #include +#if QT_CONFIG(completer) #include +#endif #include #include #ifndef QT_NO_ACCESSIBILITY diff --git a/src/winmain/qtmain_winrt.cpp b/src/winmain/qtmain_winrt.cpp index 1f5b98794d7..79ecf30b705 100644 --- a/src/winmain/qtmain_winrt.cpp +++ b/src/winmain/qtmain_winrt.cpp @@ -295,11 +295,15 @@ private: bool develMode = false; bool debugWait = false; - for (const char *arg : args) { - if (strcmp(arg, "-qdevel") == 0) + for (int i = args.count() - 1; i >= 0; --i) { + const char *arg = args.at(i); + if (strcmp(arg, "-qdevel") == 0) { develMode = true; - if (strcmp(arg, "-qdebug") == 0) + args.remove(i); + } else if (strcmp(arg, "-qdebug") == 0) { debugWait = true; + args.remove(i); + } } if (develMode) { // Write a PID file to help runner diff --git a/tests/auto/corelib/itemmodels/qsortfilterproxymodel_recursive/tst_qsortfilterproxymodel_recursive.cpp b/tests/auto/corelib/itemmodels/qsortfilterproxymodel_recursive/tst_qsortfilterproxymodel_recursive.cpp index 9cf005af011..852d9adb46d 100644 --- a/tests/auto/corelib/itemmodels/qsortfilterproxymodel_recursive/tst_qsortfilterproxymodel_recursive.cpp +++ b/tests/auto/corelib/itemmodels/qsortfilterproxymodel_recursive/tst_qsortfilterproxymodel_recursive.cpp @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2016 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, authors Filipe Azevedo and David Faure +** Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, authors Filipe Azevedo and David Faure ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/tests/auto/corelib/tools/qdatetime/BLACKLIST b/tests/auto/corelib/tools/qdatetime/BLACKLIST deleted file mode 100644 index e78f5cfd879..00000000000 --- a/tests/auto/corelib/tools/qdatetime/BLACKLIST +++ /dev/null @@ -1,3 +0,0 @@ -[operator_eqeq] -ubuntu-16.04 -b2qt diff --git a/tests/auto/corelib/tools/qstringview/tst_qstringview.cpp b/tests/auto/corelib/tools/qstringview/tst_qstringview.cpp index 8a8aa8c6e1b..4ae96005d0b 100644 --- a/tests/auto/corelib/tools/qstringview/tst_qstringview.cpp +++ b/tests/auto/corelib/tools/qstringview/tst_qstringview.cpp @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/tests/auto/gui/kernel/qpalette/tst_qpalette.cpp b/tests/auto/gui/kernel/qpalette/tst_qpalette.cpp index f43e8d8ee69..ca6f677ba61 100644 --- a/tests/auto/gui/kernel/qpalette/tst_qpalette.cpp +++ b/tests/auto/gui/kernel/qpalette/tst_qpalette.cpp @@ -39,6 +39,7 @@ private Q_SLOTS: void roleValues(); void copySemantics(); void moveSemantics(); + void setBrush(); }; void tst_QPalette::roleValues_data() @@ -128,5 +129,35 @@ void tst_QPalette::moveSemantics() #endif } +void tst_QPalette::setBrush() +{ + QPalette p(Qt::red); + const QPalette q = p; + QVERIFY(q.isCopyOf(p)); + + // Setting a different brush will detach + p.setBrush(QPalette::Disabled, QPalette::Button, Qt::green); + QVERIFY(!q.isCopyOf(p)); + QVERIFY(q != p); + + // Check we only changed what we said we would + for (int i = 0; i < QPalette::NColorGroups; i++) + for (int j = 0; j < QPalette::NColorRoles; j++) { + const auto g = QPalette::ColorGroup(i); + const auto r = QPalette::ColorRole(j); + const auto b = p.brush(g, r); + if (g == QPalette::Disabled && r == QPalette::Button) + QCOMPARE(b, QBrush(Qt::green)); + else + QCOMPARE(b, q.brush(g, r)); + } + + const QPalette pp = p; + QVERIFY(pp.isCopyOf(p)); + // Setting the same brush won't detach + p.setBrush(QPalette::Disabled, QPalette::Button, Qt::green); + QVERIFY(pp.isCopyOf(p)); +} + QTEST_MAIN(tst_QPalette) #include "tst_qpalette.moc" diff --git a/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp b/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp index 3cf108ed621..37f94d02783 100644 --- a/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp +++ b/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp @@ -90,6 +90,9 @@ private slots: void rawFontFromInvalidData(); void kernedAdvances(); + + void fallbackFontsOrder(); + private: QString testFont; QString testFontBoldItalic; @@ -887,7 +890,7 @@ void tst_QRawFont::unsupportedWritingSystem() QCOMPARE(rawFont.familyName(), QString::fromLatin1("QtBidiTestFont")); QCOMPARE(rawFont.pixelSize(), 12.0); - QString arabicText = QFontDatabase::writingSystemSample(QFontDatabase::Arabic); + QString arabicText = QFontDatabase::writingSystemSample(QFontDatabase::Arabic).simplified().remove(QLatin1Char(' ')); QTextLayout layout; layout.setFont(font); @@ -1009,6 +1012,38 @@ void tst_QRawFont::kernedAdvances() QVERIFY(FUZZY_LTEQ(qAbs(advances.at(0).x() - expectedAdvanceWidth), errorMargin)); } +void tst_QRawFont::fallbackFontsOrder() +{ + QFontDatabase fontDatabase; + int id = fontDatabase.addApplicationFont(testFont); + + QFont font("QtBidiTestFont"); + font.setPixelSize(12.0); + + QString arabicText = QFontDatabase::writingSystemSample(QFontDatabase::Arabic); + + // If this fails, then the writing system sample has changed and we need to create + // a new text containing both a space and Arabic characters. + QVERIFY(arabicText.contains(QLatin1Char(' '))); + + QTextLayout layout; + layout.setFont(font); + layout.setText(arabicText); + layout.setCacheEnabled(true); + layout.beginLayout(); + layout.createLine(); + layout.endLayout(); + + QList glyphRuns = layout.glyphRuns(); + + // Since QtBidiTestFont does not support Arabic nor the space, both should map to + // the same font. If this fails, it is an indication that the list of fallbacks fonts + // is not sorted by writing system support. + QCOMPARE(glyphRuns.size(), 1); + + fontDatabase.removeApplicationFont(id); +} + #endif // QT_NO_RAWFONT QTEST_MAIN(tst_QRawFont) diff --git a/tests/auto/network/access/qftp/tst_qftp.cpp b/tests/auto/network/access/qftp/tst_qftp.cpp index e00459557aa..d42702e1ded 100644 --- a/tests/auto/network/access/qftp/tst_qftp.cpp +++ b/tests/auto/network/access/qftp/tst_qftp.cpp @@ -41,6 +41,8 @@ #include #include #include +#include +#include #include "../../../network-settings.h" @@ -108,6 +110,9 @@ private slots: void qtbug7359Crash(); + void loginURL_data(); + void loginURL(); + protected slots: void stateChanged( int ); void listInfo( const QUrlInfo & ); @@ -397,11 +402,11 @@ void tst_QFtp::login_data() QTest::addColumn("success"); QTest::newRow( "ok01" ) << QtNetworkSettings::serverName() << (uint)21 << QString() << QString() << 1; - QTest::newRow( "ok02" ) << QtNetworkSettings::serverName() << (uint)21 << QString("ftp") << QString() << 1; + QTest::newRow( "ok02" ) << QtNetworkSettings::serverName() << (uint)21 << QString("ftp") << QString("") << 1; QTest::newRow( "ok03" ) << QtNetworkSettings::serverName() << (uint)21 << QString("ftp") << QString("foo") << 1; QTest::newRow( "ok04" ) << QtNetworkSettings::serverName() << (uint)21 << QString("ftptest") << QString("password") << 1; - QTest::newRow( "error01" ) << QtNetworkSettings::serverName() << (uint)21 << QString("foo") << QString() << 0; + QTest::newRow( "error01" ) << QtNetworkSettings::serverName() << (uint)21 << QString("foo") << QString("") << 0; QTest::newRow( "error02" ) << QtNetworkSettings::serverName() << (uint)21 << QString("foo") << QString("bar") << 0; } @@ -2152,6 +2157,206 @@ void tst_QFtp::qtbug7359Crash() QCoreApplication::processEvents(QEventLoop::AllEvents, 2000 - elapsed); } +class FtpLocalServer : public QTcpServer +{ + Q_OBJECT + +public: + explicit FtpLocalServer(QObject *parent = 0) : QTcpServer(parent) {} + virtual ~FtpLocalServer() { delete mSocket; } + void startServer(qint16 port = 0); + void stopServer(); + + enum class ReplyCodes { + ServiceReady = 220, + ServiceClose = 221, + NeedPassword = 331, + LoginFailed = 530, + RequestDeny = 550 + }; + + void sendResponse(ReplyCodes code); + + inline QString getRawUser() { return rawUser; } + inline QString getRawPassword() { return rawPass; } + +signals: + void onStarted(); + void onStopped(); + +public slots: + void socketReadyRead(); + void socketDisconnected(); + +protected: + virtual void incomingConnection(qintptr handle); + +private: + QTcpSocket *mSocket = nullptr; + QString rawUser; + QString rawPass; +}; + +void FtpLocalServer::startServer(qint16 port) +{ + if (listen(QHostAddress::Any, port)) + emit onStarted(); // Notify connected objects + else + qDebug("Could not start FTP server"); +} + +void FtpLocalServer::stopServer() +{ + close(); + emit onStopped(); // Notify connected objects +} + +void FtpLocalServer::sendResponse(ReplyCodes code) +{ + if (mSocket) + { + QString response; + switch (code) { + case ReplyCodes::ServiceReady: + response = QString("220 Service ready for new user.\r\n"); + break; + case ReplyCodes::ServiceClose: + response = QString("221 Service closing control connection.\r\n"); + break; + case ReplyCodes::NeedPassword: + response = QString("331 User name okay, need password.\r\n"); + break; + case ReplyCodes::LoginFailed: + response = QString("530 Not logged in.\r\n"); + break; + case ReplyCodes::RequestDeny: + response = QString("550 Requested action not taken.\r\n"); + break; + default: + qDebug("Unimplemented response code: %u", static_cast(code)); + break; + } + + if (!response.isEmpty()) + mSocket->write(response.toLatin1()); + } +} + +void FtpLocalServer::incomingConnection(qintptr handle) +{ + mSocket = new QTcpSocket(this); + if (mSocket == nullptr || !mSocket->setSocketDescriptor(handle)) + { + delete mSocket; + mSocket = nullptr; + qDebug() << handle << " Error binding socket"; + return; + } + + connect(mSocket, SIGNAL(readyRead()), this, SLOT(socketReadyRead())); + connect(mSocket, SIGNAL(disconnected()), this, SLOT(socketDisconnected())); + + // Accept client connection + sendResponse(ReplyCodes::ServiceReady); +} + +void FtpLocalServer::socketReadyRead() +{ + QString data; + if (mSocket) + data.append(mSocket->readAll()); + + // RFC959 Upper and lower case alphabetic characters are to be treated identically. + if (data.startsWith("USER", Qt::CaseInsensitive)) { + rawUser = data; + sendResponse(ReplyCodes::NeedPassword); + } else if (data.startsWith("PASS", Qt::CaseInsensitive)) { + rawPass = data; + sendResponse(ReplyCodes::LoginFailed); + } else { + sendResponse(ReplyCodes::RequestDeny); + } +} + +void FtpLocalServer::socketDisconnected() +{ + // Cleanup + if (mSocket) + mSocket->deleteLater(); + deleteLater(); +} + +void tst_QFtp::loginURL_data() +{ + QTest::addColumn("user"); + QTest::addColumn("password"); + QTest::addColumn("rawUser"); + QTest::addColumn("rawPass"); + + QTest::newRow("no username, no password") + << QString() << QString() + << QString("USER anonymous\r\n") << QString("PASS anonymous@\r\n"); + + QTest::newRow("username, no password") + << QString("someone") << QString() + << QString("USER someone\r\n") << QString(); + + QTest::newRow("username, empty password") + << QString("someone") << QString("") + << QString("USER someone\r\n") << QString("PASS \r\n"); + + QTest::newRow("username, password") + << QString("someone") << QString("nonsense") + << QString("USER someone\r\n") << QString("PASS nonsense\r\n"); + + QTest::newRow("anonymous, no password") + << QString("anonymous") << QString() + << QString("USER anonymous\r\n") << QString("PASS anonymous@\r\n"); + + QTest::newRow("Anonymous, no password") + << QString("Anonymous") << QString() + << QString("USER Anonymous\r\n") << QString("PASS anonymous@\r\n"); + + QTest::newRow("anonymous, empty password") + << QString("anonymous") << QString("") + << QString("USER anonymous\r\n") << QString("PASS \r\n"); + + QTest::newRow("ANONYMOUS, password") + << QString("ANONYMOUS") << QString("nonsense") + << QString("USER ANONYMOUS\r\n") << QString("PASS nonsense\r\n"); +} + +void tst_QFtp::loginURL() +{ + QFETCH_GLOBAL(bool, setProxy); + if (setProxy) + QSKIP("This test should be verified on the local machine without proxies"); + + QFETCH(QString, user); + QFETCH(QString, password); + QFETCH(QString, rawUser); + QFETCH(QString, rawPass); + + FtpLocalServer server; + server.startServer(); + uint port = server.serverPort(); + + ftp = newFtp(); + addCommand(QFtp::ConnectToHost, + ftp->connectToHost(QHostInfo::localHostName(), port)); + addCommand(QFtp::Login, ftp->login(user, password)); + + QTestEventLoop::instance().enterLoop(5); + delete ftp; + ftp = nullptr; + server.stopServer(); + if (QTestEventLoop::instance().timeout()) + QFAIL(msgTimedOut(QHostInfo::localHostName(), port)); + + QCOMPARE(server.getRawUser(), rawUser); + QCOMPARE(server.getRawPassword(), rawPass); +} + QTEST_MAIN(tst_QFtp) #include "tst_qftp.moc" diff --git a/tests/auto/network/socket/qudpsocket/BLACKLIST b/tests/auto/network/socket/qudpsocket/BLACKLIST index d58a850a1f0..a98c4d5c6b6 100644 --- a/tests/auto/network/socket/qudpsocket/BLACKLIST +++ b/tests/auto/network/socket/qudpsocket/BLACKLIST @@ -18,12 +18,9 @@ osx osx [broadcasting] osx -ubuntu-16.04 [zeroLengthDatagram] osx [linkLocalIPv6] redhatenterpriselinuxworkstation-6.6 -[pendingDatagramSize] -ubuntu-16.04 [readyReadForEmptyDatagram] ubuntu-16.04 diff --git a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp index bbac03b708a..8165ccbc583 100644 --- a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp +++ b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp @@ -126,12 +126,14 @@ protected slots: private: bool shouldSkipIpv6TestsForBrokenSetsockopt(); + bool shouldWorkaroundLinuxKernelBug(); #ifdef SHOULD_CHECK_SYSCALL_SUPPORT bool ipv6SetsockoptionMissing(int level, int optname); #endif QNetworkInterface interfaceForGroup(const QHostAddress &multicastGroup); bool m_skipUnsupportedIPv6Tests; + bool m_workaroundLinuxKernelBug; QList allAddresses; QHostAddress multicastGroup4, multicastGroup6; QVector linklocalMulticastGroups; @@ -207,6 +209,16 @@ QNetworkInterface tst_QUdpSocket::interfaceForGroup(const QHostAddress &multicas return ipv6if; } +bool tst_QUdpSocket::shouldWorkaroundLinuxKernelBug() +{ +#ifdef Q_OS_LINUX + const QVersionNumber version = QVersionNumber::fromString(QSysInfo::kernelVersion()); + return version.majorVersion() == 4 && version.minorVersion() >= 6 && version.minorVersion() < 13; +#else + return false; +#endif +} + static QHostAddress makeNonAny(const QHostAddress &address, QHostAddress::SpecialAddress preferForAny = QHostAddress::LocalHost) { if (address == QHostAddress::Any) @@ -276,6 +288,7 @@ void tst_QUdpSocket::initTestCase() qDebug() << "Will use multicast groups" << multicastGroup4 << multicastGroup6 << linklocalMulticastGroups; + m_workaroundLinuxKernelBug = shouldWorkaroundLinuxKernelBug(); if (EmulationDetector::isRunningArmOnX86()) QSKIP("This test is unreliable due to QEMU emulation shortcomings."); } @@ -360,6 +373,9 @@ void tst_QUdpSocket::unconnectedServerAndClientTest() void tst_QUdpSocket::broadcasting() { + if (m_workaroundLinuxKernelBug) + QSKIP("This test can fail due to linux kernel bug"); + QFETCH_GLOBAL(bool, setProxy); if (setProxy) { #ifndef QT_NO_NETWORKPROXY @@ -805,6 +821,9 @@ void tst_QUdpSocket::bindAndConnectToHost() void tst_QUdpSocket::pendingDatagramSize() { + if (m_workaroundLinuxKernelBug) + QSKIP("This test can fail due to linux kernel bug"); + QUdpSocket server; QVERIFY2(server.bind(), server.errorString().toLatin1().constData()); diff --git a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp index a4a8a647a38..baf2551dfbf 100644 --- a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp +++ b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp @@ -2253,6 +2253,31 @@ void tst_QSqlQuery::prepare_bind_exec() QCOMPARE( q.value(1).toString(), QString("name") ); QCOMPARE( q.value(2).toString(), QString("name") ); + // Test that duplicated named placeholders before the next unique one works correctly - QTBUG-65150 + QVERIFY(q.prepare("insert into " + qtest_prepare + " (id, name, name2) values (:id, :id, :name)")); + for (i = 104; i < 106; ++i) { + q.bindValue(":id", i); + q.bindValue(":name", "name"); + QVERIFY(q.exec()); + } + QVERIFY(q.exec("select * from " + qtest_prepare + " where id > 103 order by id")); + QVERIFY(q.next()); + QCOMPARE(q.value(0).toInt(), 104); + QCOMPARE(q.value(1).toString(), QString("104")); + QCOMPARE(q.value(2).toString(), QString("name")); + + // Test that duplicated named placeholders in any order + QVERIFY(q.prepare("insert into " + qtest_prepare + " (id, name, name2) values (:id, :name, :id)")); + for (i = 107; i < 109; ++i) { + q.bindValue(":id", i); + q.bindValue(":name", "name"); + QVERIFY(q.exec()); + } + QVERIFY(q.exec("select * from " + qtest_prepare + " where id > 106 order by id")); + QVERIFY(q.next()); + QCOMPARE(q.value(0).toInt(), 107); + QCOMPARE(q.value(1).toString(), QString("name")); + QCOMPARE(q.value(2).toString(), QString("107")); } // end of SQLite scope } diff --git a/tests/auto/tools/qmake/testdata/rawString/object2.h b/tests/auto/tools/qmake/testdata/rawString/object2.h index 2ab77cd3bd2..d29f0c72ec0 100644 --- a/tests/auto/tools/qmake/testdata/rawString/object2.h +++ b/tests/auto/tools/qmake/testdata/rawString/object2.h @@ -1,31 +1,37 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** 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. ** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** 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$ ** diff --git a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp index 979d5c632e3..71efe1d59ae 100644 --- a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp +++ b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp @@ -43,6 +43,7 @@ #if defined(Q_OS_WIN) # include // for SetFileAttributes #endif +#include #include @@ -883,6 +884,18 @@ void tst_QFileSystemModel::deleteFile() QVERIFY(!newFile.exists()); } +static QString flipCase(QString s) +{ + for (int i = 0, size = s.size(); i < size; ++i) { + const QChar c = s.at(i); + if (c.isUpper()) + s[i] = c.toLower(); + else if (c.isLower()) + s[i] = c.toUpper(); + } + return s; +} + void tst_QFileSystemModel::caseSensitivity() { QString tmp = flatDirTestPath; @@ -890,9 +903,23 @@ void tst_QFileSystemModel::caseSensitivity() files << "a" << "c" << "C"; QVERIFY(createFiles(tmp, files)); QModelIndex root = model->index(tmp); + QStringList paths; + QModelIndexList indexes; QCOMPARE(model->rowCount(root), 0); for (int i = 0; i < files.count(); ++i) { - QVERIFY(model->index(tmp + '/' + files.at(i)).isValid()); + const QString path = tmp + '/' + files.at(i); + const QModelIndex index = model->index(path); + QVERIFY(index.isValid()); + paths.append(path); + indexes.append(index); + } + + if (!QFileSystemEngine::isCaseSensitive()) { + // QTBUG-31103, QTBUG-64147: Verify that files can be accessed by paths with fLipPeD case. + for (int i = 0; i < paths.count(); ++i) { + const QModelIndex flippedCaseIndex = model->index(flipCase(paths.at(i))); + QCOMPARE(indexes.at(i), flippedCaseIndex); + } } }