summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-08-31 13:10:18 +0200
committerLiang Qi <liang.qi@qt.io>2017-08-31 14:31:31 +0200
commit112a4af10741409b3d8503cb77852a777b607ce0 (patch)
treefa99f0f37fc1505522fe9368e95484c7732ccda8
parent29ef0d2bccd1874e20de94485ee05777c3a95c5d (diff)
parente938150412d22e61926fe16791158805b71268bb (diff)
downloadqtbase-112a4af10741409b3d8503cb77852a777b607ce0.tar.gz
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts: examples/examples.pro qmake/library/qmakebuiltins.cpp src/corelib/global/qglobal.cpp Re-apply b525ec2 to qrandom.cpp(code movement in 030782e) src/corelib/global/qnamespace.qdoc src/corelib/global/qrandom.cpp src/gui/kernel/qwindow.cpp Re-apply a3d59c7 to QWindowPrivate::setVisible() (code movement in d7a9e08) src/network/ssl/qsslkey_openssl.cpp src/plugins/platforms/android/androidjniinput.cpp src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/widgets/widgets/qmenu.cpp tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp Change-Id: If7ab427804408877a93cbe02079fca58e568bfd3
-rw-r--r--configure.pri2
-rw-r--r--doc/global/externalsites/qtcreator.qdoc24
-rw-r--r--doc/global/qt-html-templates-offline-simple.qdocconf10
-rw-r--r--mkspecs/android-clang/qmake.conf28
-rw-r--r--mkspecs/android-g++/qmake.conf21
-rw-r--r--mkspecs/common/android-base-head.conf10
-rw-r--r--mkspecs/common/android-base-tail.conf28
-rw-r--r--mkspecs/common/ghs-base.conf2
-rw-r--r--mkspecs/common/linux.conf1
-rw-r--r--mkspecs/common/msvc-desktop.conf1
-rw-r--r--mkspecs/common/solaris.conf1
-rw-r--r--mkspecs/common/winrt_winphone/qmake.conf1
-rw-r--r--mkspecs/features/android/android_deployment_settings.prf1
-rw-r--r--mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in4
-rw-r--r--mkspecs/features/qt_configure.prf3
-rw-r--r--mkspecs/hurd-g++/qmake.conf1
-rw-r--r--mkspecs/linux-icc/qmake.conf1
-rw-r--r--mkspecs/lynxos-g++/qmake.conf1
-rw-r--r--mkspecs/solaris-cc-64/qmake.conf1
-rw-r--r--mkspecs/solaris-cc/qmake.conf1
-rw-r--r--mkspecs/unsupported/linux-host-g++/qmake.conf1
-rw-r--r--mkspecs/unsupported/vxworks-ppc-dcc/qmake.conf1
-rw-r--r--mkspecs/unsupported/vxworks-simpentium-dcc/qmake.conf1
-rw-r--r--mkspecs/win32-g++/qmake.conf1
-rw-r--r--qmake/generators/mac/pbuilder_pbx.cpp2
-rw-r--r--qmake/generators/makefiledeps.cpp42
-rw-r--r--qmake/generators/win32/msvc_nmake.cpp1
-rw-r--r--qmake/library/proitems.cpp7
-rw-r--r--qmake/library/proitems.h10
-rw-r--r--qmake/library/qmakebuiltins.cpp66
-rw-r--r--qmake/library/qmakeevaluator.cpp31
-rw-r--r--qmake/library/qmakeevaluator.h2
-rw-r--r--qmake/library/qmakeevaluator_p.h2
-rw-r--r--src/3rdparty/libpng/ANNOUNCE83
-rw-r--r--src/3rdparty/libpng/CHANGES202
-rw-r--r--src/3rdparty/libpng/INSTALL71
-rw-r--r--src/3rdparty/libpng/LICENSE6
-rw-r--r--src/3rdparty/libpng/README18
-rwxr-xr-xsrc/3rdparty/libpng/import_from_libpng_tarball.sh113
-rw-r--r--src/3rdparty/libpng/libpng-manual.txt126
-rw-r--r--src/3rdparty/libpng/png.c134
-rw-r--r--src/3rdparty/libpng/png.h54
-rw-r--r--src/3rdparty/libpng/pngconf.h2
-rw-r--r--src/3rdparty/libpng/pngerror.c8
-rw-r--r--src/3rdparty/libpng/pngget.c33
-rw-r--r--src/3rdparty/libpng/pnginfo.h8
-rw-r--r--src/3rdparty/libpng/pnglibconf.h20
-rw-r--r--src/3rdparty/libpng/pngpread.c5
-rw-r--r--src/3rdparty/libpng/pngpriv.h152
-rw-r--r--src/3rdparty/libpng/pngread.c26
-rw-r--r--src/3rdparty/libpng/pngrtran.c21
-rw-r--r--src/3rdparty/libpng/pngrutil.c198
-rw-r--r--src/3rdparty/libpng/pngset.c63
-rw-r--r--src/3rdparty/libpng/pngstruct.h2
-rw-r--r--src/3rdparty/libpng/pngtrans.c38
-rw-r--r--src/3rdparty/libpng/pngwrite.c21
-rw-r--r--src/3rdparty/libpng/pngwutil.c51
-rw-r--r--src/3rdparty/libpng/qt_attribution.json2
-rw-r--r--src/angle/src/common/common.pri2
-rw-r--r--src/corelib/corelib.pro10
-rw-r--r--src/corelib/global/qfloat16.h2
-rw-r--r--src/corelib/global/qglobal.cpp4
-rw-r--r--src/corelib/global/qnamespace.qdoc34
-rw-r--r--src/corelib/global/qoperatingsystemversion.cpp9
-rw-r--r--src/corelib/global/qoperatingsystemversion.h1
-rw-r--r--src/corelib/global/qrandom.cpp73
-rw-r--r--src/corelib/io/qfileinfo.cpp22
-rw-r--r--src/corelib/io/qfilesystemengine_unix.cpp14
-rw-r--r--src/corelib/io/qfilesystemwatcher_inotify.cpp10
-rw-r--r--src/corelib/io/qprocess.cpp10
-rw-r--r--src/corelib/io/qprocess_unix.cpp12
-rw-r--r--src/corelib/kernel/qcore_mac_p.h3
-rw-r--r--src/corelib/thread/qthread_unix.cpp2
-rw-r--r--src/corelib/tools/qhash.cpp2
-rw-r--r--src/corelib/tools/qsimd_p.h3
-rw-r--r--src/corelib/tools/qstring.h2
-rw-r--r--src/gui/image/qmovie.cpp2
-rw-r--r--src/gui/image/qpicture.cpp7
-rw-r--r--src/gui/kernel/qwindow.cpp3
-rw-r--r--src/gui/painting/qdrawhelper.cpp4
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp2
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp14
-rw-r--r--src/network/configure.json3
-rw-r--r--src/network/kernel/kernel.pri2
-rw-r--r--src/network/kernel/qhostinfo_unix.cpp3
-rw-r--r--src/network/kernel/qnetworkinterface_unix.cpp5
-rw-r--r--src/network/kernel/qnetworkproxy_libproxy.cpp143
-rw-r--r--src/network/ssl/qsslkey_openssl.cpp3
-rw-r--r--src/network/ssl/qsslsocket_openssl.cpp2
-rw-r--r--src/platformsupport/fbconvenience/qfbvthandler.cpp1
-rw-r--r--src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm45
-rw-r--r--src/platformsupport/fontdatabases/winrt/winrt.pri2
-rw-r--r--src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp2
-rw-r--r--src/plugins/platforms/android/extract.cpp1
-rw-r--r--src/plugins/platforms/android/qandroidinputcontext.cpp3
-rw-r--r--src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm12
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenu.mm1
-rw-r--r--src/plugins/platforms/cocoa/qcocoaprintersupport.h2
-rw-r--r--src/plugins/platforms/cocoa/qcocoaprintersupport.mm4
-rw-r--r--src/plugins/platforms/cocoa/qnsview.h2
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm4
-rw-r--r--src/plugins/platforms/cocoa/qprintengine_mac.mm8
-rw-r--r--src/plugins/platforms/cocoa/qprintengine_mac_p.h2
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp2
-rw-r--r--src/plugins/platforms/ios/qiosbackingstore.h9
-rw-r--r--src/plugins/platforms/ios/qiosbackingstore.mm139
-rw-r--r--src/plugins/platforms/ios/qiosintegration.mm5
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp4
-rw-r--r--src/plugins/platforms/winrt/winrt.pro2
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp20
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.h1
-rw-r--r--src/plugins/platforms/xcb/qxcbintegration.cpp17
-rw-r--r--src/plugins/printsupport/cups/qcupsprintengine.cpp4
-rw-r--r--src/plugins/printsupport/cups/qcupsprintengine_p.h2
-rw-r--r--src/plugins/printsupport/cups/qcupsprintersupport.cpp4
-rw-r--r--src/plugins/printsupport/cups/qcupsprintersupport_p.h2
-rw-r--r--src/plugins/printsupport/windows/qwindowsprintersupport.cpp4
-rw-r--r--src/plugins/printsupport/windows/qwindowsprintersupport.h2
-rw-r--r--src/plugins/sqldrivers/configure.pri2
-rw-r--r--src/plugins/styles/mac/qmacstyle_mac.mm7
-rw-r--r--src/printsupport/kernel/qplatformprintersupport.cpp2
-rw-r--r--src/printsupport/kernel/qplatformprintersupport.h2
-rw-r--r--src/printsupport/kernel/qprintengine_win.cpp4
-rw-r--r--src/printsupport/kernel/qprintengine_win_p.h2
-rw-r--r--src/printsupport/kernel/qprinter.cpp3
-rw-r--r--src/sql/kernel/qsqldriver.cpp2
-rw-r--r--src/testlib/qtestcase.cpp8
-rw-r--r--src/widgets/kernel/qwidget.cpp14
-rw-r--r--src/widgets/styles/qcommonstyle.cpp9
-rw-r--r--src/widgets/util/qcompleter.cpp4
-rw-r--r--src/widgets/widgets/qmenu.cpp22
-rw-r--r--src/widgets/widgets/qmenu_p.h16
-rw-r--r--tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp7
-rw-r--r--tests/auto/gui/kernel/qwindow/tst_qwindow.cpp42
-rw-r--r--tests/auto/gui/text/qfont/BLACKLIST2
-rw-r--r--tests/auto/network/ssl/qsslcertificate/pkcs12/README21
-rw-r--r--tests/auto/network/ssl/qsslcertificate/pkcs12/leaf-nokey.p12bin0 -> 2216 bytes
-rw-r--r--tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp10
-rw-r--r--tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp193
-rw-r--r--tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp12
-rw-r--r--tests/auto/sql/kernel/qsqlthread/tst_qsqlthread.cpp2
-rw-r--r--tests/auto/tools/qmake/testdata/rawString/main.cpp101
-rw-r--r--tests/auto/tools/qmake/testdata/rawString/object2.h54
-rw-r--r--tests/auto/tools/qmake/testdata/rawString/rawString.pro2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp7
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp6
-rw-r--r--tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp31
-rw-r--r--tests/benchmarks/sql/kernel/qsqlquery/qsqlquery.pro1
-rw-r--r--tests/manual/qtabbar/main.cpp12
-rw-r--r--tests/manual/qtabbar/tabbarform.ui159
150 files changed, 2300 insertions, 939 deletions
diff --git a/configure.pri b/configure.pri
index 76bb27e4ae..83c0dee141 100644
--- a/configure.pri
+++ b/configure.pri
@@ -1041,7 +1041,7 @@ defineTest(qtConfOutput_gccSysroot) {
defineTest(qtConfOutput_qmakeArgs) {
!$${2}: return()
- $${currentConfig}.output.privatePro = "!host_build|!cross_compile {"
+ $${currentConfig}.output.privatePro += "!host_build|!cross_compile {"
for (a, config.input.qmakeArgs) {
$${currentConfig}.output.privatePro += " $$a"
EXTRA_QMAKE_ARGS += $$system_quote($$a)
diff --git a/doc/global/externalsites/qtcreator.qdoc b/doc/global/externalsites/qtcreator.qdoc
index 4b9160cea4..7f2322d041 100644
--- a/doc/global/externalsites/qtcreator.qdoc
+++ b/doc/global/externalsites/qtcreator.qdoc
@@ -118,10 +118,6 @@
\title Qt Creator: Creating Screens
*/
/*!
- \externalpage http://doc.qt.io/qtcreator/creator-qtquick-designer-extensions.html
- \title Qt Creator: Using Qt Quick Designer Extensions
-*/
-/*!
\externalpage http://doc.qt.io/qtcreator/qmldesigner-pathview-editor.html
\title Qt Creator: Editing PathView Properties
*/
@@ -295,7 +291,7 @@
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-connecting-mobile.html
- \title Qt Creator: Connecting Mobile Devices
+ \title Qt Creator: Connecting Devices
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-usability.html
@@ -323,7 +319,7 @@
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-deployment.html
- \title Qt Creator: Deploying to Mobile Devices
+ \title Qt Creator: Deploying to Devices
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-tutorials.html
@@ -405,7 +401,7 @@
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-project-cmake.html
- \title Qt Creator: Setting Up a CMake Project
+ \title Qt Creator: Setting Up CMake
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-targets.html
@@ -417,7 +413,7 @@
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-project-qbs.html
- \title Qt Creator: Setting Up a Qbs Project
+ \title Qt Creator: Setting Up Qbs
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-project-creating.html
@@ -523,22 +519,16 @@
\externalpage http://doc.qt.io/qtcreator/creator-beautifier.html
\title Qt Creator: Beautifying Source Code
*/
-/*!
- \externalpage http://doc.qt.io/qtcreator/creator-developing-winrt.html
- \title Qt Creator: Connecting Windows Runtime Devices
-*/
+
/*!
\externalpage http://doc.qt.io/qtcreator/creator-clang-codemodel.html
- \title Qt Creator: Parsing C++ Files
+ \title Qt Creator: Parsing C++ Files with the Clang Code Model
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-quick-ui-forms.html
\title Qt Creator: Qt Quick UI Forms
*/
-/*!
- \externalpage http://doc.qt.io/qtcreator/qtcreator-uiforms-example.html
- \title Qt Creator: Using Qt Quick UI Forms
-*/
+
/*!
\externalpage http://doc.qt.io/qtcreator/creator-clang-static-analyzer.html
\title Qt Creator: Using Clang Static Analyzer
diff --git a/doc/global/qt-html-templates-offline-simple.qdocconf b/doc/global/qt-html-templates-offline-simple.qdocconf
index 1fea752a16..c3c2d3cca0 100644
--- a/doc/global/qt-html-templates-offline-simple.qdocconf
+++ b/doc/global/qt-html-templates-offline-simple.qdocconf
@@ -7,6 +7,16 @@ HTML.headerstyles = \
" <link rel=\"stylesheet\" type=\"text/css\" href=\"style/offline-simple.css\" />\n" \
" <script type=\"text/javascript\">\n" \
" document.getElementsByTagName(\"link\").item(0).setAttribute(\"href\", \"style/offline.css\");\n" \
+ " // loading style sheet breaks anchors that were jumped to before\n" \
+ " // so force jumping to anchor again\n" \
+ " setTimeout(function() {\n" \
+ " var anchor = location.hash;\n" \
+ " // need to jump to different anchor first (e.g. none)\n" \
+ " location.hash = \"#\";\n" \
+ " setTimeout(function() {\n" \
+ " location.hash = anchor;\n" \
+ " }, 0);\n" \
+ " }, 0);\n" \
" </script>\n"
HTML.postheader = \
diff --git a/mkspecs/android-clang/qmake.conf b/mkspecs/android-clang/qmake.conf
index 3e621c7d77..2f38e100b2 100644
--- a/mkspecs/android-clang/qmake.conf
+++ b/mkspecs/android-clang/qmake.conf
@@ -15,20 +15,34 @@ QMAKE_CC = $$NDK_LLVM_PATH/bin/clang
QMAKE_CXX = $$NDK_LLVM_PATH/bin/clang++
equals(ANDROID_TARGET_ARCH, armeabi-v7a): \
- QMAKE_CFLAGS = -target armv7-none-linux-androideabi
+ QMAKE_CFLAGS += -target armv7-none-linux-androideabi
else: equals(ANDROID_TARGET_ARCH, armeabi): \
- QMAKE_CFLAGS = -target armv5te-none-linux-androideabi
+ QMAKE_CFLAGS += -target armv5te-none-linux-androideabi
else: equals(ANDROID_TARGET_ARCH, arm64-v8a): \
- QMAKE_CFLAGS = -target aarch64-none-linux-android
+ QMAKE_CFLAGS += -target aarch64-none-linux-android
else: equals(ANDROID_TARGET_ARCH, x86): \
- QMAKE_CFLAGS = -target i686-none-linux-android
+ QMAKE_CFLAGS += -target i686-none-linux-android
else: equals(ANDROID_TARGET_ARCH, x86_64): \
- QMAKE_CFLAGS = -target x86_64-none-linux-android
+ QMAKE_CFLAGS += -target x86_64-none-linux-android
else: equals(ANDROID_TARGET_ARCH, mips): \
QMAKE_CFLAGS += -target mipsel-none-linux-android
else: equals(ANDROID_TARGET_ARCH, mips64): \
- QMAKE_CFLAGS = -target mips64el-none-linux-android
+ QMAKE_CFLAGS += -target mips64el-none-linux-android
-QMAKE_LINK = $$QMAKE_CXX $$QMAKE_CFLAGS -gcc-toolchain $$NDK_TOOLCHAIN_PATH
+QMAKE_CFLAGS += -gcc-toolchain $$NDK_TOOLCHAIN_PATH
+QMAKE_LINK = $$QMAKE_CXX $$QMAKE_CFLAGS -Wl,--exclude-libs,libgcc.a
+QMAKE_CFLAGS += -DANDROID_HAS_WSTRING --sysroot=$$NDK_ROOT/sysroot \
+ -isystem $$NDK_ROOT/sysroot/usr/include/$$NDK_TOOLS_PREFIX \
+ -isystem $$NDK_ROOT/sources/cxx-stl/llvm-libc++/include \
+ -isystem $$NDK_ROOT/sources/android/support/include \
+ -isystem $$NDK_ROOT/sources/cxx-stl/llvm-libc++abi/include
+
+ANDROID_SOURCES_CXX_STL_LIBDIR = $$NDK_ROOT/sources/cxx-stl/llvm-libc++/libs/$$ANDROID_TARGET_ARCH
+
+ANDROID_STDCPP_PATH = $$ANDROID_SOURCES_CXX_STL_LIBDIR/libc++_shared.so
+ANDROID_CXX_STL_LIBS = -lc++
+
+QMAKE_ARM_CFLAGS_RELEASE = -Oz
+QMAKE_ARM_CFLAGS_RELEASE_WITH_DEBUGINFO = -g -Oz
include(../common/android-base-tail.conf)
diff --git a/mkspecs/android-g++/qmake.conf b/mkspecs/android-g++/qmake.conf
index 2b81ac58f0..5e8a97c9d7 100644
--- a/mkspecs/android-g++/qmake.conf
+++ b/mkspecs/android-g++/qmake.conf
@@ -10,9 +10,24 @@ include(../common/gcc-base-unix.conf)
include(../common/android-base-head.conf)
QMAKE_CC = $$NDK_TOOLCHAIN_PATH/bin/$$NDK_TOOLS_PREFIX-gcc
-QMAKE_CXX = $$QMAKE_GCC
+QMAKE_CXX = $$NDK_TOOLCHAIN_PATH/bin/$$NDK_TOOLS_PREFIX-g++
+QMAKE_LINK = $$QMAKE_CXX
-QMAKE_CFLAGS =
-QMAKE_LINK = $$QMAKE_GCC
+ANDROID_SOURCES_CXX_STL_LIBDIR = $$NDK_ROOT/sources/cxx-stl/gnu-libstdc++/$$NDK_TOOLCHAIN_VERSION/libs/$$ANDROID_TARGET_ARCH
+ANDROID_STDCPP_PATH = $$ANDROID_SOURCES_CXX_STL_LIBDIR/libgnustl_shared.so
+ANDROID_CXX_STL_LIBS = -lgnustl_shared -lgcc
+
+QMAKE_CFLAGS += --sysroot=$$ANDROID_PLATFORM_ROOT_PATH \
+ -isystem $$NDK_ROOT/sources/cxx-stl/gnu-libstdc++/$$NDK_TOOLCHAIN_VERSION/include \
+ -isystem $$ANDROID_SOURCES_CXX_STL_LIBDIR/include
+
+equals(ANDROID_TARGET_ARCH, armeabi)|equals(ANDROID_TARGET_ARCH, armeabi-v7a): \
+ LIBGCC_PATH_FULL = $$system("$$QMAKE_CXX -mthumb-interwork -print-libgcc-file-name")
+else: \
+ LIBGCC_PATH_FULL = $$system("$$QMAKE_CXX -print-libgcc-file-name")
+ANDROID_SOURCES_CXX_STL_LIBDIR += $$dirname(LIBGCC_PATH_FULL)
+
+QMAKE_ARM_CFLAGS_RELEASE = -Os
+QMAKE_ARM_CFLAGS_RELEASE_WITH_DEBUGINFO = -g -Os
include(../common/android-base-tail.conf)
diff --git a/mkspecs/common/android-base-head.conf b/mkspecs/common/android-base-head.conf
index ae4933c453..90cc71247a 100644
--- a/mkspecs/common/android-base-head.conf
+++ b/mkspecs/common/android-base-head.conf
@@ -66,17 +66,11 @@ isEmpty(ANDROID_SDK_BUILD_TOOLS_REVISION) {
}
CONFIG += $$ANDROID_PLATFORM
+QMAKE_CFLAGS = -D__ANDROID_API__=$$replace(ANDROID_PLATFORM, "android-", "")
+
ANDROID_PLATFORM_ROOT_PATH = $$NDK_ROOT/platforms/$$ANDROID_PLATFORM/arch-$$ANDROID_ARCHITECTURE/
ANDROID_PLATFORM_PATH = $$ANDROID_PLATFORM_ROOT_PATH/usr
-# used to compile platform plugins for android-4 and android-5
-QMAKE_ANDROID_PLATFORM_INCDIR = $$ANDROID_PLATFORM_PATH/include
-QMAKE_ANDROID_PLATFORM_LIBDIR = $$ANDROID_PLATFORM_PATH/lib
-
-ANDROID_SOURCES_CXX_STL_LIBDIR = $$NDK_ROOT/sources/cxx-stl/gnu-libstdc++/$$NDK_TOOLCHAIN_VERSION/libs/$$ANDROID_TARGET_ARCH
-ANDROID_SOURCES_CXX_STL_INCDIR = $$NDK_ROOT/sources/cxx-stl/gnu-libstdc++/$$NDK_TOOLCHAIN_VERSION/include $$ANDROID_SOURCES_CXX_STL_LIBDIR/include
-
equals(ANDROID_TARGET_ARCH, x86_64)|equals(ANDROID_TARGET_ARCH, mips64): \
QMAKE_ANDROID_PLATFORM_LIBDIR = $${QMAKE_ANDROID_PLATFORM_LIBDIR}64
-QMAKE_GCC = $$NDK_TOOLCHAIN_PATH/bin/$$NDK_TOOLS_PREFIX-g++
diff --git a/mkspecs/common/android-base-tail.conf b/mkspecs/common/android-base-tail.conf
index 3f1b414d3f..3472dfdf77 100644
--- a/mkspecs/common/android-base-tail.conf
+++ b/mkspecs/common/android-base-tail.conf
@@ -11,18 +11,11 @@ else: equals(ANDROID_TARGET_ARCH, armeabi): \
QMAKE_CFLAGS += -march=armv5te -mtune=xscale -msoft-float -fno-builtin-memmove
# -fno-builtin-memmove is used to workaround https://code.google.com/p/android/issues/detail?id=81692
-QMAKE_CFLAGS += --sysroot=$$ANDROID_PLATFORM_ROOT_PATH
QMAKE_CFLAGS_WARN_ON = -Wall -W
QMAKE_CFLAGS_WARN_OFF =
equals(ANDROID_TARGET_ARCH, armeabi-v7a) | equals(ANDROID_TARGET_ARCH, armeabi) {
- contains(QMAKE_COMPILER, clang) {
- QMAKE_CFLAGS_RELEASE = -Oz
- QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO = -g -Oz
- } else {
- QMAKE_CFLAGS_RELEASE = -Os
- QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO = -g -Os
- }
-
+ QMAKE_CFLAGS_RELEASE = $$QMAKE_ARM_CFLAGS_RELEASE
+ QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO = $$QMAKE_ARM_CFLAGS_RELEASE_WITH_DEBUGINFO
QMAKE_CFLAGS_DEBUG = -g -marm -O0
equals(ANDROID_TARGET_ARCH, armeabi):if(equals(NDK_TOOLCHAIN_VERSION, 4.8)|equals(NDK_TOOLCHAIN_VERSION, 4.9)) {
DEFINES += QT_OS_ANDROID_GCC_48_WORKAROUND
@@ -73,19 +66,12 @@ QMAKE_STRIP =
QMAKE_RANLIB = $$NDK_TOOLCHAIN_PATH/bin/$$NDK_TOOLS_PREFIX-ranlib
-equals(ANDROID_TARGET_ARCH, armeabi)|equals(ANDROID_TARGET_ARCH, armeabi-v7a): \
- LIBGCC_PATH_FULL = $$system("$$QMAKE_GCC -mthumb-interwork -print-libgcc-file-name")
-else: \
- LIBGCC_PATH_FULL = $$system("$$QMAKE_GCC -print-libgcc-file-name")
-
-LIBGCC_PATH = $$dirname(LIBGCC_PATH_FULL)
-
-QMAKE_INCDIR_POST = $$ANDROID_SOURCES_CXX_STL_INCDIR $$QMAKE_ANDROID_PLATFORM_INCDIR
-QMAKE_LIBDIR_POST = $$ANDROID_SOURCES_CXX_STL_LIBDIR $$QMAKE_ANDROID_PLATFORM_LIBDIR $$LIBGCC_PATH
+QMAKE_INCDIR_POST =
+QMAKE_LIBDIR_POST = $$ANDROID_SOURCES_CXX_STL_LIBDIR
QMAKE_INCDIR_X11 =
QMAKE_LIBDIR_X11 =
-QMAKE_INCDIR_OPENGL = $$QMAKE_ANDROID_PLATFORM_INCDIR
-QMAKE_LIBDIR_OPENGL = $$QMAKE_ANDROID_PLATFORM_LIBDIR
+QMAKE_INCDIR_OPENGL =
+QMAKE_LIBDIR_OPENGL =
QMAKE_LINK_SHLIB = $$QMAKE_LINK
QMAKE_LFLAGS = --sysroot=$$ANDROID_PLATFORM_ROOT_PATH
@@ -97,7 +83,7 @@ QMAKE_LFLAGS_NOUNDEF = -Wl,--no-undefined
QMAKE_LFLAGS_RPATH = -Wl,-rpath=
QMAKE_LFLAGS_RPATHLINK = -Wl,-rpath-link=
-QMAKE_LIBS_PRIVATE = -lgnustl_shared -llog -lz -lm -ldl -lc -lgcc
+QMAKE_LIBS_PRIVATE = $$ANDROID_CXX_STL_LIBS -llog -lz -lm -ldl -lc
QMAKE_LIBS_X11 =
QMAKE_LIBS_THREAD =
QMAKE_LIBS_EGL = -lEGL
diff --git a/mkspecs/common/ghs-base.conf b/mkspecs/common/ghs-base.conf
index addc05241c..a66971578c 100644
--- a/mkspecs/common/ghs-base.conf
+++ b/mkspecs/common/ghs-base.conf
@@ -38,5 +38,3 @@ QMAKE_LFLAGS_RELEASE += -Ospeed -Olink -Omax
QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_LFLAGS_RELEASE -g
QMAKE_LFLAGS_CXX11 += --c++11 --thread_local_storage
QMAKE_LFLAGS_EXCEPTIONS_ON += --exceptions
-
-QMAKE_LIBS_CORE = -lposix -livfs -lsocket -lnet -lshm_client
diff --git a/mkspecs/common/linux.conf b/mkspecs/common/linux.conf
index 5e2b5b59eb..544cc22715 100644
--- a/mkspecs/common/linux.conf
+++ b/mkspecs/common/linux.conf
@@ -29,7 +29,6 @@ QMAKE_LIBDIR_OPENVG =
QMAKE_LIBS =
QMAKE_LIBS_DYNLOAD = -ldl
QMAKE_LIBS_X11 = -lXext -lX11 -lm
-QMAKE_LIBS_NIS = -lnsl
QMAKE_LIBS_EGL = -lEGL
QMAKE_LIBS_OPENGL = -lGL
QMAKE_LIBS_OPENGL_ES2 = -lGLESv2
diff --git a/mkspecs/common/msvc-desktop.conf b/mkspecs/common/msvc-desktop.conf
index bb10113fe7..f7f7e54d26 100644
--- a/mkspecs/common/msvc-desktop.conf
+++ b/mkspecs/common/msvc-desktop.conf
@@ -90,7 +90,6 @@ QMAKE_EXTENSION_SHLIB = dll
QMAKE_PREFIX_STATICLIB =
QMAKE_EXTENSION_STATICLIB = lib
-QMAKE_LIBS_CORE = kernel32.lib user32.lib shell32.lib uuid.lib ole32.lib advapi32.lib ws2_32.lib
QMAKE_LIBS_GUI = gdi32.lib comdlg32.lib oleaut32.lib imm32.lib winmm.lib ws2_32.lib ole32.lib user32.lib advapi32.lib
QMAKE_LIBS_NETWORK = ws2_32.lib
QMAKE_LIBS_OPENGL = glu32.lib opengl32.lib gdi32.lib user32.lib
diff --git a/mkspecs/common/solaris.conf b/mkspecs/common/solaris.conf
index 23e26debff..024b75a9d9 100644
--- a/mkspecs/common/solaris.conf
+++ b/mkspecs/common/solaris.conf
@@ -19,7 +19,6 @@ QMAKE_INCDIR_OPENGL = /usr/X11/include/mesa
QMAKE_LIBS =
QMAKE_LIBS_DYNLOAD = -ldl
QMAKE_LIBS_X11 = -lXext -lX11 -lresolv -lsocket -lnsl
-QMAKE_LIBS_NIS =
QMAKE_LIBS_OPENGL = -lGL
QMAKE_LIBS_THREAD = -lpthread -lrt
QMAKE_LIBS_NETWORK = -lresolv -lsocket -lxnet -lnsl
diff --git a/mkspecs/common/winrt_winphone/qmake.conf b/mkspecs/common/winrt_winphone/qmake.conf
index c440d53867..3c68b91bd8 100644
--- a/mkspecs/common/winrt_winphone/qmake.conf
+++ b/mkspecs/common/winrt_winphone/qmake.conf
@@ -78,7 +78,6 @@ QMAKE_PREFIX_STATICLIB =
QMAKE_EXTENSION_STATICLIB = lib
QMAKE_LIBS += runtimeobject.lib
-QMAKE_LIBS_CORE += ws2_32.lib
QMAKE_LIBS_GUI =
QMAKE_LIBS_NETWORK += ws2_32.lib
diff --git a/mkspecs/features/android/android_deployment_settings.prf b/mkspecs/features/android/android_deployment_settings.prf
index 9fe1e26075..913ab71412 100644
--- a/mkspecs/features/android/android_deployment_settings.prf
+++ b/mkspecs/features/android/android_deployment_settings.prf
@@ -62,6 +62,7 @@ contains(TEMPLATE, ".*app"):!build_pass: {
isEmpty(QML_ROOT_PATH): \
QML_ROOT_PATH = $$_PRO_FILE_PWD_
FILE_CONTENT += " \"qml-root-path\": $$emitString($$QML_ROOT_PATH),"
+ FILE_CONTENT += " \"stdcpp-path\": $$emitString($$ANDROID_STDCPP_PATH),"
FILE_CONTENT += " \"application-binary\": $$emitString($$absolute_path($$DESTDIR, $$OUT_PWD)/$$TARGET)"
FILE_CONTENT += "}"
diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
index 17da8b979e..55c74aad66 100644
--- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
+++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
@@ -156,7 +156,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
set(Qt5$${CMAKE_MODULE_NAME}_INCLUDE_DIRS ${_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS})
set(Qt5$${CMAKE_MODULE_NAME}_DEFINITIONS -D$${MODULE_DEFINE})
- set(Qt5$${CMAKE_MODULE_NAME}_COMPILE_DEFINITIONS $${MODULE_DEFINE})
+ set(Qt5$${CMAKE_MODULE_NAME}_COMPILE_DEFINITIONS $${MODULE_DEFINES})
!!ENDIF // TEMPLATE != aux
set(_Qt5$${CMAKE_MODULE_NAME}_MODULE_DEPENDENCIES \"$${CMAKE_MODULE_DEPS}\")
@@ -243,7 +243,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY
INTERFACE_INCLUDE_DIRECTORIES ${_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS})
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY
- INTERFACE_COMPILE_DEFINITIONS $${MODULE_DEFINE})
+ INTERFACE_COMPILE_DEFINITIONS $${MODULE_DEFINES})
set(_Qt5$${CMAKE_MODULE_NAME}_PRIVATE_DIRS_EXIST TRUE)
foreach (_Qt5$${CMAKE_MODULE_NAME}_PRIVATE_DIR ${Qt5$${CMAKE_MODULE_NAME}_OWN_PRIVATE_INCLUDE_DIRS})
diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf
index afeb4f3d1d..1ba96767be 100644
--- a/mkspecs/features/qt_configure.prf
+++ b/mkspecs/features/qt_configure.prf
@@ -926,6 +926,9 @@ defineTest(qtConfTest_compile) {
use_gold_linker: \
qmake_configs += "use_gold_linker"
+ # disable warnings from the builds, since they're just noise at this point.
+ qmake_configs += "warn_off"
+
# add console to the CONFIG variable when running the tests, so that they
# can work with a regular main() entry point on Windows.
qmake_configs += "console"
diff --git a/mkspecs/hurd-g++/qmake.conf b/mkspecs/hurd-g++/qmake.conf
index fc6ef779fc..f701755fb3 100644
--- a/mkspecs/hurd-g++/qmake.conf
+++ b/mkspecs/hurd-g++/qmake.conf
@@ -29,7 +29,6 @@ QMAKE_LIBDIR_OPENVG =
QMAKE_LIBS =
QMAKE_LIBS_DYNLOAD = -ldl
QMAKE_LIBS_X11 = -lXext -lX11 -lm
-QMAKE_LIBS_NIS = -lnsl
QMAKE_LIBS_EGL = -lEGL
QMAKE_LIBS_OPENGL = -lGL
QMAKE_LIBS_OPENGL_ES2 = -lGLESv2
diff --git a/mkspecs/linux-icc/qmake.conf b/mkspecs/linux-icc/qmake.conf
index 1d94f0c931..ec09afe381 100644
--- a/mkspecs/linux-icc/qmake.conf
+++ b/mkspecs/linux-icc/qmake.conf
@@ -103,7 +103,6 @@ QMAKE_LFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG
QMAKE_LIBS =
QMAKE_LIBS_DYNLOAD = -ldl
QMAKE_LIBS_X11 = -lXext -lX11 -lm
-QMAKE_LIBS_NIS = -lnsl
QMAKE_LIBS_OPENGL = -lGL
QMAKE_LIBS_THREAD = -lpthread
diff --git a/mkspecs/lynxos-g++/qmake.conf b/mkspecs/lynxos-g++/qmake.conf
index 91bcc6b85d..1a44d93275 100644
--- a/mkspecs/lynxos-g++/qmake.conf
+++ b/mkspecs/lynxos-g++/qmake.conf
@@ -64,7 +64,6 @@ QMAKE_LFLAGS_RPATH = -Wl,-rpath,
QMAKE_LIBS =
QMAKE_LIBS_DYNLOAD = -ldl
QMAKE_LIBS_X11 = -lXext -lX11 -lm
-QMAKE_LIBS_NIS = -lnsl
QMAKE_LIBS_OPENGL = -lGL
QMAKE_LIBS_THREAD = -lpthread
diff --git a/mkspecs/solaris-cc-64/qmake.conf b/mkspecs/solaris-cc-64/qmake.conf
index 1c7b43c29c..e2317de3b8 100644
--- a/mkspecs/solaris-cc-64/qmake.conf
+++ b/mkspecs/solaris-cc-64/qmake.conf
@@ -80,7 +80,6 @@ QMAKE_LFLAGS_RPATH = -R
QMAKE_LIBS =
QMAKE_LIBS_DYNLOAD = -ldl
QMAKE_LIBS_X11 = -lXext -lX11 -lresolv -lsocket -lnsl
-QMAKE_LIBS_NIS =
QMAKE_LIBS_OPENGL = -lGL
QMAKE_LIBS_THREAD = -lpthread -lrt
QMAKE_LIBS_NETWORK = -lresolv -lsocket -lxnet -lnsl
diff --git a/mkspecs/solaris-cc/qmake.conf b/mkspecs/solaris-cc/qmake.conf
index 045ab033dd..1a711e753a 100644
--- a/mkspecs/solaris-cc/qmake.conf
+++ b/mkspecs/solaris-cc/qmake.conf
@@ -63,7 +63,6 @@ QMAKE_LFLAGS_RPATH = -R
QMAKE_LIBS =
QMAKE_LIBS_DYNLOAD = -ldl
QMAKE_LIBS_X11 = -lXext -lX11 -lresolv -lsocket -lnsl
-QMAKE_LIBS_NIS =
QMAKE_LIBS_OPENGL = -lGL
QMAKE_LIBS_THREAD = -lpthread -lrt
QMAKE_LIBS_NETWORK = -lresolv -lsocket -lxnet -lnsl
diff --git a/mkspecs/unsupported/linux-host-g++/qmake.conf b/mkspecs/unsupported/linux-host-g++/qmake.conf
index 3aa7520776..7853ade8ce 100644
--- a/mkspecs/unsupported/linux-host-g++/qmake.conf
+++ b/mkspecs/unsupported/linux-host-g++/qmake.conf
@@ -98,7 +98,6 @@ QMAKE_LIBDIR_OPENVG =
QMAKE_LIBS =
QMAKE_LIBS_DYNLOAD = -ldl
QMAKE_LIBS_X11 = -lXext -lX11 -lm
-QMAKE_LIBS_NIS = -lnsl
QMAKE_LIBS_EGL = -lEGL
QMAKE_LIBS_OPENGL = -lGL
QMAKE_LIBS_OPENGL_ES2 = -lGLESv2
diff --git a/mkspecs/unsupported/vxworks-ppc-dcc/qmake.conf b/mkspecs/unsupported/vxworks-ppc-dcc/qmake.conf
index 16e3127803..2fa514854c 100644
--- a/mkspecs/unsupported/vxworks-ppc-dcc/qmake.conf
+++ b/mkspecs/unsupported/vxworks-ppc-dcc/qmake.conf
@@ -76,7 +76,6 @@ QMAKE_LIBDIR_OPENGL = $$QMAKE_LIBDIR_X11
QMAKE_LIBS =
QMAKE_LIBS_DYNLOAD =
QMAKE_LIBS_X11 = -lXext -lX11
-QMAKE_LIBS_NIS = -lnsl
QMAKE_LIBS_OPENGL = -lGL
QMAKE_LIBS_THREAD =
QMAKE_LIBS_NETWORK = # -lnetwrap # only needed if kernel is missing gethostbyname and friends
diff --git a/mkspecs/unsupported/vxworks-simpentium-dcc/qmake.conf b/mkspecs/unsupported/vxworks-simpentium-dcc/qmake.conf
index 44e39a8a8c..5aa96dff78 100644
--- a/mkspecs/unsupported/vxworks-simpentium-dcc/qmake.conf
+++ b/mkspecs/unsupported/vxworks-simpentium-dcc/qmake.conf
@@ -76,7 +76,6 @@ QMAKE_LIBDIR_OPENGL = $$QMAKE_LIBDIR_X11
QMAKE_LIBS =
QMAKE_LIBS_DYNLOAD =
QMAKE_LIBS_X11 = -lXext -lX11
-QMAKE_LIBS_NIS = -lnsl
QMAKE_LIBS_OPENGL = -lGL
QMAKE_LIBS_THREAD =
QMAKE_LIBS_NETWORK = # -lnet # only needed if kernel is missing gethostbyname and friends
diff --git a/mkspecs/win32-g++/qmake.conf b/mkspecs/win32-g++/qmake.conf
index 6529d4118f..884286ea30 100644
--- a/mkspecs/win32-g++/qmake.conf
+++ b/mkspecs/win32-g++/qmake.conf
@@ -63,7 +63,6 @@ QMAKE_EXTENSION_STATICLIB = a
QMAKE_LIB_EXTENSIONS = a dll.a
QMAKE_LIBS =
-QMAKE_LIBS_CORE = -lole32 -luuid -lws2_32 -ladvapi32 -lshell32 -luser32 -lkernel32
QMAKE_LIBS_GUI = -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lws2_32 -lole32 -luuid -luser32 -ladvapi32
QMAKE_LIBS_NETWORK = -lws2_32
QMAKE_LIBS_OPENGL = -lglu32 -lopengl32 -lgdi32 -luser32
diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp
index ab699157ca..63926e7ef0 100644
--- a/qmake/generators/mac/pbuilder_pbx.cpp
+++ b/qmake/generators/mac/pbuilder_pbx.cpp
@@ -1902,7 +1902,7 @@ int
ProjectBuilderMakefileGenerator::pbuilderVersion() const
{
if (!project->isEmpty("QMAKE_PBUILDER_VERSION"))
- return project->first("QMAKE_PBUILDER_VERSION").toQString().toInt();
+ return project->first("QMAKE_PBUILDER_VERSION").toInt();
return 46; // Xcode 3.2-compatible; default format since that version
}
diff --git a/qmake/generators/makefiledeps.cpp b/qmake/generators/makefiledeps.cpp
index 3140b045a1..c68eeb13d6 100644
--- a/qmake/generators/makefiledeps.cpp
+++ b/qmake/generators/makefiledeps.cpp
@@ -422,25 +422,53 @@ static bool matchWhileUnsplitting(const char *buffer, int buffer_len, int start,
/* Advance from an opening quote at buffer[offset] to the matching close quote. */
static int scanPastString(char *buffer, int buffer_len, int offset, int *lines)
{
+ // http://en.cppreference.com/w/cpp/language/string_literal
// It might be a C++11 raw string.
bool israw = false;
if (buffer[offset] == '"' && offset > 0) {
int explore = offset - 1;
- while (explore > 0 && buffer[explore] != 'R') {
- if (buffer[explore] == '8' || buffer[explore] == 'u' || buffer[explore] == 'U') {
- explore--;
- } else if (explore > 1 && qmake_endOfLine(buffer[explore])
- && buffer[explore - 1] == '\\') {
+ bool prefix = false; // One of L, U, u or u8 may appear before R
+ bool saw8 = false; // Partial scan of u8
+ while (explore >= 0) {
+ // Cope with backslash-newline interruptions of the prefix:
+ if (explore > 0
+ && qmake_endOfLine(buffer[explore])
+ && buffer[explore - 1] == '\\') {
explore -= 2;
- } else if (explore > 2 && buffer[explore] == '\n'
+ } else if (explore > 1
+ && buffer[explore] == '\n'
&& buffer[explore - 1] == '\r'
&& buffer[explore - 2] == '\\') {
explore -= 3;
+ // Remaining cases can only decrement explore by one at a time:
+ } else if (saw8 && buffer[explore] == 'u') {
+ explore--;
+ saw8 = false;
+ prefix = true;
+ } else if (saw8 || prefix) {
+ break;
+ } else if (explore > 1 && buffer[explore] == '8') {
+ explore--;
+ saw8 = true;
+ } else if (buffer[explore] == 'L'
+ || buffer[explore] == 'U'
+ || buffer[explore] == 'u') {
+ explore--;
+ prefix = true;
+ } else if (buffer[explore] == 'R') {
+ if (israw)
+ break;
+ explore--;
+ israw = true;
} else {
break;
}
}
- israw = (buffer[explore] == 'R');
+ // Check the R (with possible prefix) isn't just part of an identifier:
+ if (israw && explore >= 0
+ && (isalnum(buffer[explore]) || buffer[explore] == '_')) {
+ israw = false;
+ }
}
if (israw) {
diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp
index a22e4bf48f..b4c2579c5c 100644
--- a/qmake/generators/win32/msvc_nmake.cpp
+++ b/qmake/generators/win32/msvc_nmake.cpp
@@ -634,6 +634,7 @@ void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t)
if (generateManifest) {
manifest = escapeFilePath(manifest);
QString manifest_bak = escapeFilePath(target + "_manifest.bak");
+ project->values("QMAKE_CLEAN") << manifest_bak;
t << "\n\tif not exist $(DESTDIR_TARGET) if exist " << manifest
<< " del " << manifest;
t << "\n\tif exist " << manifest << " copy /Y " << manifest << ' ' << manifest_bak;
diff --git a/qmake/library/proitems.cpp b/qmake/library/proitems.cpp
index 1744304c67..8bbde9f8c0 100644
--- a/qmake/library/proitems.cpp
+++ b/qmake/library/proitems.cpp
@@ -74,6 +74,11 @@ ProString::ProString(const QString &str) :
{
}
+ProString::ProString(const QStringRef &str) :
+ m_string(*str.string()), m_offset(str.position()), m_length(str.size()), m_file(0), m_hash(0x80000000)
+{
+}
+
ProString::ProString(const char *str, DoPreHashing) :
m_string(QString::fromLatin1(str)), m_offset(0), m_length(qstrlen(str)), m_file(0)
{
@@ -336,7 +341,7 @@ ProString ProString::trimmed() const
QTextStream &operator<<(QTextStream &t, const ProString &str)
{
- t << str.toQString(); // XXX optimize ... somehow
+ t << str.toQStringRef();
return t;
}
diff --git a/qmake/library/proitems.h b/qmake/library/proitems.h
index c58b017857..1d7ebed3aa 100644
--- a/qmake/library/proitems.h
+++ b/qmake/library/proitems.h
@@ -68,6 +68,7 @@ public:
ProString();
ProString(const ProString &other);
PROITEM_EXPLICIT ProString(const QString &str);
+ PROITEM_EXPLICIT ProString(const QStringRef &str);
PROITEM_EXPLICIT ProString(const char *str);
ProString(const QString &str, int offset, int length);
void setValue(const QString &str);
@@ -94,6 +95,7 @@ public:
bool operator==(const ProString &other) const { return toQStringRef() == other.toQStringRef(); }
bool operator==(const QString &other) const { return toQStringRef() == other; }
+ bool operator==(const QStringRef &other) const { return toQStringRef() == other; }
bool operator==(QLatin1String other) const { return toQStringRef() == other; }
bool operator==(const char *other) const { return toQStringRef() == QLatin1String(other); }
bool operator!=(const ProString &other) const { return !(*this == other); }
@@ -204,14 +206,14 @@ Q_DECLARE_TYPEINFO(ProKey, Q_MOVABLE_TYPE);
uint qHash(const ProString &str);
QString operator+(const ProString &one, const ProString &two);
inline QString operator+(const ProString &one, const QString &two)
- { return one + ProString(two); }
+ { return one.toQStringRef() + two; }
inline QString operator+(const QString &one, const ProString &two)
- { return ProString(one) + two; }
+ { return one + two.toQStringRef(); }
inline QString operator+(const ProString &one, const char *two)
- { QString ret = one.toQStringRef() + QLatin1String(two); ret.detach(); return ret; }
+ { return one.toQStringRef() + QLatin1String(two); }
inline QString operator+(const char *one, const ProString &two)
- { QString ret = QLatin1String(one) + two.toQStringRef(); ret.detach(); return ret; }
+ { return QLatin1String(one) + two.toQStringRef(); }
inline QString operator+(const ProString &one, QChar two)
{ return one.toQStringRef() + two; }
inline QString operator+(QChar one, const ProString &two)
diff --git a/qmake/library/qmakebuiltins.cpp b/qmake/library/qmakebuiltins.cpp
index 120e96ccc3..759bff314e 100644
--- a/qmake/library/qmakebuiltins.cpp
+++ b/qmake/library/qmakebuiltins.cpp
@@ -589,8 +589,8 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinExpand(
if (regexp) {
QRegExp sepRx(sep);
for (const ProString &str : strings) {
- const QString &rstr = str.toQString(m_tmp1).section(sepRx, beg, end);
- ret << (rstr.isSharedWith(m_tmp1) ? str : ProString(rstr).setSource(str));
+ const QString &rstr = str.toQString(m_tmp[m_toggle ^= 1]).section(sepRx, beg, end);
+ ret << (rstr.isSharedWith(m_tmp[m_toggle]) ? str : ProString(rstr).setSource(str));
}
} else {
for (const ProString &str : strings) {
@@ -735,9 +735,9 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinExpand(
const QString &sep = (args.count() == 2) ? args.at(1).toQString(m_tmp1) : statics.field_sep;
const auto vars = values(map(args.at(0)));
for (const ProString &var : vars) {
- const auto splits = var.toQString(m_tmp2).split(sep);
- for (const QString &splt : splits)
- ret << (splt.isSharedWith(m_tmp2) ? var : ProString(splt).setSource(var));
+ const auto splits = var.toQStringRef().split(sep);
+ for (const auto &splt : splits)
+ ret << ProString(splt).setSource(var);
}
}
break;
@@ -823,7 +823,8 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinExpand(
if (args.count() < 1 || args.count() > 2) {
evalError(fL1S("cat(file, singleline=true) requires one or two arguments."));
} else {
- const QString &file = args.at(0).toQString(m_tmp1);
+ QString fn = resolvePath(m_option->expandEnvVars(args.at(0).toQString(m_tmp1)));
+ fn.detach();
bool blob = false;
bool lines = false;
@@ -837,7 +838,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinExpand(
lines = true;
}
- QFile qfile(resolvePath(m_option->expandEnvVars(file)));
+ QFile qfile(fn);
if (qfile.open(QIODevice::ReadOnly)) {
QTextStream stream(&qfile);
if (blob) {
@@ -888,12 +889,10 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinExpand(
evalError(fL1S("find(var, str) requires two arguments."));
} else {
QRegExp regx(args.at(1).toQString());
- int t = 0;
const auto vals = values(map(args.at(0)));
for (const ProString &val : vals) {
- if (regx.indexIn(val.toQString(m_tmp[t])) != -1)
+ if (regx.indexIn(val.toQString(m_tmp[m_toggle ^= 1])) != -1)
ret += val;
- t ^= 1;
}
}
break;
@@ -914,7 +913,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinExpand(
lines = true;
}
int exitCode;
- QByteArray bytes = getCommandOutput(args.at(0).toQString(m_tmp2), &exitCode);
+ QByteArray bytes = getCommandOutput(args.at(0).toQString(), &exitCode);
if (args.count() > 2 && !args.at(2).isEmpty()) {
m_valuemapStack.top()[args.at(2).toKey()] =
ProStringList(ProString(QString::number(exitCode)));
@@ -1116,7 +1115,11 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinExpand(
QString rstr = val.toQString(m_tmp1);
QString copy = rstr; // Force a detach on modify
rstr.replace(before, after);
- ret << (rstr.isSharedWith(m_tmp1) ? val : ProString(rstr).setSource(val));
+ ret << (rstr.isSharedWith(m_tmp1)
+ ? val
+ : rstr.isSharedWith(m_tmp2)
+ ? args.at(2)
+ : ProString(rstr).setSource(val));
}
}
break;
@@ -1391,12 +1394,10 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
copy.detach();
regx.setPattern(copy);
}
- int t = 0;
const auto strings = vars.value(map(args.at(1)));
for (const ProString &s : strings) {
- if ((!regx.isEmpty() && regx.exactMatch(s.toQString(m_tmp[t]))) || s == qry)
+ if ((!regx.isEmpty() && regx.exactMatch(s.toQString(m_tmp[m_toggle ^= 1]))) || s == qry)
return ReturnTrue;
- t ^= 1;
}
}
return ReturnFalse;
@@ -1461,12 +1462,10 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
}
const ProStringList &l = values(map(args.at(0)));
if (args.count() == 2) {
- int t = 0;
for (int i = 0; i < l.size(); ++i) {
const ProString &val = l[i];
- if ((!regx.isEmpty() && regx.exactMatch(val.toQString(m_tmp[t]))) || val == qry)
+ if ((!regx.isEmpty() && regx.exactMatch(val.toQString(m_tmp[m_toggle ^= 1]))) || val == qry)
return ReturnTrue;
- t ^= 1;
}
} else {
const auto mutuals = args.at(2).toQStringRef().split(QLatin1Char('|'));
@@ -1475,7 +1474,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
for (int mut = 0; mut < mutuals.count(); mut++) {
if (val.toQStringRef() == mutuals[mut].trimmed()) {
return returnBool((!regx.isEmpty()
- && regx.exactMatch(val.toQString(m_tmp2)))
+ && regx.exactMatch(val.toQString(m_tmp[m_toggle ^= 1])))
|| val == qry);
}
}
@@ -1712,7 +1711,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
#if QT_CONFIG(process)
QProcess proc;
proc.setProcessChannelMode(QProcess::ForwardedChannels);
- runProcess(&proc, args.at(0).toQString(m_tmp2));
+ runProcess(&proc, args.at(0).toQString());
return returnBool(proc.exitStatus() == QProcess::NormalExit && proc.exitCode() == 0);
#else
int ec = system((QLatin1String("cd ")
@@ -1749,8 +1748,10 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
return ReturnTrue;
int slsh = file.lastIndexOf(QLatin1Char('/'));
QString fn = file.mid(slsh+1);
+ fn.detach();
if (fn.contains(QLatin1Char('*')) || fn.contains(QLatin1Char('?'))) {
QString dirstr = file.left(slsh+1);
+ dirstr.detach();
if (!QDir(dirstr).entryList(QStringList(fn)).isEmpty())
return ReturnTrue;
}
@@ -1763,7 +1764,8 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
return ReturnFalse;
}
#ifdef PROEVALUATOR_FULL
- const QString &fn = resolvePath(args.at(0).toQString(m_tmp1));
+ QString fn = resolvePath(args.at(0).toQString(m_tmp1));
+ fn.detach();
if (!QDir::current().mkpath(fn)) {
evalError(fL1S("Cannot create directory %1.").arg(QDir::toNativeSeparators(fn)));
return ReturnFalse;
@@ -1786,13 +1788,12 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
if (args.count() >= 3) {
const auto opts = split_value_list(args.at(2).toQStringRef());
for (const ProString &opt : opts) {
- opt.toQString(m_tmp3);
- if (m_tmp3 == QLatin1String("append")) {
+ if (opt == QLatin1String("append")) {
mode = QIODevice::Append;
- } else if (m_tmp3 == QLatin1String("exe")) {
+ } else if (opt == QLatin1String("exe")) {
exe = true;
} else {
- evalError(fL1S("write_file(): invalid flag %1.").arg(m_tmp3));
+ evalError(fL1S("write_file(): invalid flag %1.").arg(opt.toQString(m_tmp3)));
return ReturnFalse;
}
}
@@ -1830,21 +1831,20 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
if (args.count() >= 2) {
const auto opts = split_value_list(args.at(1).toQStringRef());
for (const ProString &opt : opts) {
- opt.toQString(m_tmp3);
- if (m_tmp3 == QLatin1String("transient")) {
+ if (opt == QLatin1String("transient")) {
persist = false;
- } else if (m_tmp3 == QLatin1String("super")) {
+ } else if (opt == QLatin1String("super")) {
target = TargetSuper;
- } else if (m_tmp3 == QLatin1String("stash")) {
+ } else if (opt == QLatin1String("stash")) {
target = TargetStash;
- } else if (m_tmp3 == QLatin1String("set")) {
+ } else if (opt == QLatin1String("set")) {
mode = CacheSet;
- } else if (m_tmp3 == QLatin1String("add")) {
+ } else if (opt == QLatin1String("add")) {
mode = CacheAdd;
- } else if (m_tmp3 == QLatin1String("sub")) {
+ } else if (opt == QLatin1String("sub")) {
mode = CacheSub;
} else {
- evalError(fL1S("cache(): invalid flag %1.").arg(m_tmp3));
+ evalError(fL1S("cache(): invalid flag %1.").arg(opt.toQString(m_tmp3)));
return ReturnFalse;
}
}
diff --git a/qmake/library/qmakeevaluator.cpp b/qmake/library/qmakeevaluator.cpp
index a87155cdef..6e6c72de59 100644
--- a/qmake/library/qmakeevaluator.cpp
+++ b/qmake/library/qmakeevaluator.cpp
@@ -226,6 +226,7 @@ QMakeEvaluator::QMakeEvaluator(QMakeGlobals *option, QMakeParser *parser, QMakeV
m_skipLevel = 0;
#endif
m_listCount = 0;
+ m_toggle = 0;
m_valuemapStack.push(ProValueMap());
m_valuemapInited = false;
}
@@ -775,7 +776,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProLoop(
}
infinite = true;
} else {
- const QString &itl = it_list.toQString(m_tmp1);
+ const QStringRef &itl = it_list.toQStringRef();
int dotdot = itl.indexOf(statics.strDotDot);
if (dotdot != -1) {
bool ok;
@@ -872,13 +873,13 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProVariable(
ProStringList varVal;
if (expandVariableReferences(tokPtr, sizeHint, &varVal, true) == ReturnError)
return ReturnError;
- const QString &val = varVal.at(0).toQString(m_tmp1);
+ const QStringRef &val = varVal.at(0).toQStringRef();
if (val.length() < 4 || val.at(0) != QLatin1Char('s')) {
evalError(fL1S("The ~= operator can handle only the s/// function."));
return ReturnTrue;
}
QChar sep = val.at(1);
- QStringList func = val.split(sep);
+ auto func = val.split(sep);
if (func.count() < 3 || func.count() > 4) {
evalError(fL1S("The s/// function expects 3 or 4 arguments."));
return ReturnTrue;
@@ -890,8 +891,8 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProVariable(
case_sense = func[3].indexOf(QLatin1Char('i')) == -1;
quote = func[3].indexOf(QLatin1Char('q')) != -1;
}
- QString pattern = func[1];
- QString replace = func[2];
+ QString pattern = func[1].toString();
+ QString replace = func[2].toString();
if (quote)
pattern = QRegExp::escape(pattern);
@@ -972,11 +973,9 @@ void QMakeEvaluator::setTemplate()
values.erase(values.begin() + 1, values.end());
}
if (!m_option->user_template_prefix.isEmpty()) {
- QString val = values.first().toQString(m_tmp1);
- if (!val.startsWith(m_option->user_template_prefix)) {
- val.prepend(m_option->user_template_prefix);
- values = ProStringList(ProString(val));
- }
+ ProString val = values.first();
+ if (!val.startsWith(m_option->user_template_prefix))
+ values = ProStringList(ProString(m_option->user_template_prefix + val));
}
}
@@ -1518,7 +1517,7 @@ void QMakeEvaluator::updateFeaturePaths()
feature_roots += m_option->getPathListEnv(QLatin1String("QMAKEFEATURES"));
feature_roots += m_qmakefeatures;
feature_roots += m_option->splitPathList(
- m_option->propertyValue(ProKey("QMAKEFEATURES")).toQString(m_mtmp));
+ m_option->propertyValue(ProKey("QMAKEFEATURES")).toQString());
QStringList feature_bases;
if (!m_buildRoot.isEmpty()) {
@@ -1629,21 +1628,17 @@ bool QMakeEvaluator::isActiveConfig(const QStringRef &config, bool regex)
return m_hostBuild;
if (regex && (config.contains(QLatin1Char('*')) || config.contains(QLatin1Char('?')))) {
- QString cfg = config.toString();
- cfg.detach(); // Keep m_tmp out of QRegExp's cache
- QRegExp re(cfg, Qt::CaseSensitive, QRegExp::Wildcard);
+ QRegExp re(config.toString(), Qt::CaseSensitive, QRegExp::Wildcard);
// mkspecs
if (re.exactMatch(m_qmakespecName))
return true;
// CONFIG variable
- int t = 0;
const auto configValues = values(statics.strCONFIG);
for (const ProString &configValue : configValues) {
- if (re.exactMatch(configValue.toQString(m_tmp[t])))
+ if (re.exactMatch(configValue.toQString(m_tmp[m_toggle ^= 1])))
return true;
- t ^= 1;
}
} else {
// mkspecs
@@ -1746,7 +1741,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBoolFunction(
if (ret.at(0) == statics.strtrue)
return ReturnTrue;
bool ok;
- int val = ret.at(0).toQString(m_tmp1).toInt(&ok);
+ int val = ret.at(0).toInt(&ok);
if (ok) {
if (val)
return ReturnTrue;
diff --git a/qmake/library/qmakeevaluator.h b/qmake/library/qmakeevaluator.h
index fcac0388c7..7318664d46 100644
--- a/qmake/library/qmakeevaluator.h
+++ b/qmake/library/qmakeevaluator.h
@@ -286,6 +286,7 @@ public:
QString m_outputDir;
int m_listCount;
+ int m_toggle;
bool m_valuemapInited;
bool m_hostBuild;
QString m_qmakespec;
@@ -305,7 +306,6 @@ public:
ProStringList m_returnValue;
ProValueMapStack m_valuemapStack; // VariableName must be us-ascii, the content however can be non-us-ascii.
QString m_tmp1, m_tmp2, m_tmp3, m_tmp[2]; // Temporaries for efficient toQString
- mutable QString m_mtmp;
QMakeGlobals *m_option;
QMakeParser *m_parser;
diff --git a/qmake/library/qmakeevaluator_p.h b/qmake/library/qmakeevaluator_p.h
index 42aaef70c3..f386a49108 100644
--- a/qmake/library/qmakeevaluator_p.h
+++ b/qmake/library/qmakeevaluator_p.h
@@ -43,7 +43,7 @@
r == ReturnNext ? "next" : \
r == ReturnReturn ? "return" : \
"<invalid>")
-# define dbgKey(s) qPrintable(s.toString().toQString())
+# define dbgKey(s) s.toString().toQStringRef().toLocal8Bit().constData()
# define dbgStr(s) qPrintable(formatValue(s, true))
# define dbgStrList(s) qPrintable(formatValueList(s))
# define dbgSepStrList(s) qPrintable(formatValueList(s, true))
diff --git a/src/3rdparty/libpng/ANNOUNCE b/src/3rdparty/libpng/ANNOUNCE
index 70a71e3b0e..3cbe5a926e 100644
--- a/src/3rdparty/libpng/ANNOUNCE
+++ b/src/3rdparty/libpng/ANNOUNCE
@@ -1,4 +1,4 @@
-Libpng 1.6.28 - January 5, 2017
+Libpng 1.6.32 - August 24, 2017
This is a public release of libpng, intended for use in production codes.
@@ -7,28 +7,79 @@ Files available for download:
Source files with LF line endings (for Unix/Linux) and with a
"configure" script
- libpng-1.6.28.tar.xz (LZMA-compressed, recommended)
- libpng-1.6.28.tar.gz
+ libpng-1.6.32.tar.xz (LZMA-compressed, recommended)
+ libpng-1.6.32.tar.gz
Source files with CRLF line endings (for Windows), without the
"configure" script
- lpng1628.7z (LZMA-compressed, recommended)
- lpng1628.zip
+ lpng1632.7z (LZMA-compressed, recommended)
+ lpng1632.zip
Other information:
- libpng-1.6.28-README.txt
- libpng-1.6.28-LICENSE.txt
- libpng-1.6.28-*.asc (armored detached GPG signatures)
-
-Changes since the last public release (1.6.27):
- Fixed arm/aarch64 detection in CMakeLists.txt (Gianfranco Costamagna).
- Added option to Cmake build allowing a custom location of zlib to be
- specified in a scenario where libpng is being built as a subproject
- alongside zlib by another project (Sam Serrels).
- Changed png_ptr->options from a png_byte to png_uint_32, to accomodate
- up to 16 options.
+ libpng-1.6.32-README.txt
+ libpng-1.6.32-LICENSE.txt
+ libpng-1.6.32-*.asc (armored detached GPG signatures)
+
+Changes since the last public release (1.6.31):
+ Avoid possible NULL dereference in png_handle_eXIf when benign_errors
+ are allowed. Avoid leaking the input buffer "eXIf_buf".
+ Eliminated png_ptr->num_exif member from pngstruct.h and added num_exif
+ to arguments for png_get_eXIf() and png_set_eXIf().
+ Added calls to png_handle_eXIf(() in pngread.c and png_write_eXIf() in
+ pngwrite.c, and made various other fixes to png_write_eXIf().
+ Changed name of png_get_eXIF and png_set_eXIf() to png_get_eXIf_1() and
+ png_set_eXIf_1(), respectively, to avoid breaking API compatibility
+ with libpng-1.6.31.
+ Updated contrib/libtests/pngunknown.c with eXIf chunk.
+ Initialized btoa[] in pngstest.c
+ Stop memory leak when returning from png_handle_eXIf() with an error
+ (Bug report from the OSS-fuzz project).
+ Replaced local eXIf_buf with info_ptr-eXIf_buf in png_handle_eXIf().
+ Update libpng.3 and libpng-manual.txt about eXIf functions.
+ Restored png_get_eXIf() and png_set_eXIf() to maintain API compatability.
+ Removed png_get_eXIf_1() and png_set_eXIf_1().
+ Check length of all chunks except IDAT against user limit to fix an
+ OSS-fuzz issue.
+ Check length of IDAT against maximum possible IDAT size, accounting
+ for height, rowbytes, interlacing and zlib/deflate overhead.
+ Restored png_get_eXIf_1() and png_set_eXIf_1(), because strlen(eXIf_buf)
+ does not work (the eXIf chunk data can contain zeroes).
+ Require cmake-2.8.8 in CMakeLists.txt. Revised symlink creation,
+ no longer using deprecated cmake LOCATION feature (Clifford Yapp).
+ Fixed five-byte error in the calculation of IDAT maximum possible size.
+ Moved chunk-length check into a png_check_chunk_length() private
+ function (Suggested by Max Stepin).
+ Moved bad pngs from tests to contrib/libtests/crashers
+ Moved testing of bad pngs into a separate tests/pngtest-badpngs script
+ Added the --xfail (expected FAIL) option to pngtest.c. It writes XFAIL
+ in the output but PASS for the libpng test.
+ Require cmake-3.0.2 in CMakeLists.txt (Clifford Yapp).
+ Fix "const" declaration info_ptr argument to png_get_eXIf_1() and the
+ num_exif argument to png_get_eXIf_1() (Github Issue 171).
+ Added "eXIf" to "chunks_to_ignore[]" in png_set_keep_unknown_chunks().
+ Added huge_IDAT.png and empty_ancillary_chunks.png to testpngs/crashers.
+ Make pngtest --strict, --relax, --xfail options imply -m (multiple).
+ Removed unused chunk_name parameter from png_check_chunk_length().
+ Relocated setting free_me for eXIf data, to stop an OSS-fuzz leak.
+ Initialize profile_header[] in png_handle_iCCP() to fix OSS-fuzz issue.
+ Initialize png_ptr->row_buf[0] to 255 in png_read_row() to fix OSS-fuzz UMR.
+ Attempt to fix a UMR in png_set_text_2() to fix OSS-fuzz issue.
+ Increase minimum zlib stream from 9 to 14 in png_handle_iCCP(), to account
+ for the minimum 'deflate' stream, and relocate the test to a point
+ after the keyword has been read.
+ Check that the eXIf chunk has at least 2 bytes and begins with "II" or "MM".
+ Added a set of "huge_xxxx_chunk.png" files to contrib/testpngs/crashers,
+ one for each known chunk type, with length = 2GB-1.
+ Check for 0 return from png_get_rowbytes() and added some (size_t) typecasts
+ in contrib/pngminus/*.c to stop some Coverity issues (162705, 162706,
+ and 162707).
+ Renamed chunks in contrib/testpngs/crashers to avoid having files whose
+ names differ only in case; this causes problems with some platforms
+ (github issue #172).
+ Added contrib/oss-fuzz directory which contains files used by the oss-fuzz
+ project (https://github.com/google/oss-fuzz/tree/master/projects/libpng).
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit
diff --git a/src/3rdparty/libpng/CHANGES b/src/3rdparty/libpng/CHANGES
index 0b5e944ee3..14e60dd269 100644
--- a/src/3rdparty/libpng/CHANGES
+++ b/src/3rdparty/libpng/CHANGES
@@ -5761,7 +5761,9 @@ Version 1.6.27beta01 [November 2, 2016]
if built with zlib-1.2.8.1.
Version 1.6.27rc01 [December 27, 2016]
- Control ADLER32 checking with new PNG_IGNORE_ADLER32 option.
+ Control ADLER32 checking with new PNG_IGNORE_ADLER32 option. Fixes
+ an endless loop when handling erroneous ADLER32 checksums; bug
+ introduced in libpng-1.6.26.
Removed the use of a macro containing the pre-processor 'defined'
operator. It is unclear whether this is valid; a macro that
"generates" 'defined' is not permitted, but the use of the word
@@ -5794,6 +5796,204 @@ Version 1.6.28rc03 [January 4, 2017]
Version 1.6.28 [January 5, 2017]
No changes.
+Version 1.6.29beta01 [January 12, 2017]
+ Readded "include(GNUInstallDirs)" to CMakeLists.txt (Gianfranco Costamagna).
+ Moved SSE2 optimization code into the main libpng source directory.
+ Configure libpng with "configure --enable-intel-sse" or compile
+ libpng with "-DPNG_INTEL_SSE" in CPPFLAGS to enable it.
+ Simplified conditional compilation in pngvalid.c, for AIX (Michael Felt).
+
+Version 1.6.29beta02 [February 22, 2017]
+ Avoid conditional directives that break statements in pngrutil.c (Romero
+ Malaquias)
+ The contrib/examples/pngtopng.c recovery code was in the wrong "if"
+ branches; the comments were correct.
+ Added code for PowerPC VSX optimisation (Vadim Barkov).
+
+Version 1.6.29beta03 [March 1, 2017]
+ Avoid potential overflow of shift operations in png_do_expand() (Aaron Boxer).
+ Change test ZLIB_VERNUM >= 0x1281 to ZLIB_VERNUM >= 0x1290 in pngrutil.c
+ because Solaris 11 distributes zlib-1.2.8.f that is older than 1.2.8.1,
+ as suggested in zlib FAQ, item 24.
+ Suppress clang warnings about implicit sign changes in png.c
+
+Version 1.6.29 [March 16, 2017]
+ No changes.
+
+Version 1.6.30beta01 [April 1, 2017]
+ Added missing "$(CPPFLAGS)" to the compile line for c.pic.o in
+ makefile.linux and makefile.solaris-x86 (Cosmin).
+ Revised documentation of png_get_error_ptr() in the libpng manual.
+ Silence clang -Wcomma and const drop warnings (Viktor Szakats).
+ Update Sourceforge URLs in documentation (https instead of http).
+
+Version 1.6.30beta02 [April 22, 2017]
+ Document need to check for integer overflow when allocating a pixel
+ buffer for multiple rows in contrib/gregbook, contrib/pngminus,
+ example.c, and in the manual (suggested by Jaeseung Choi). This
+ is similar to the bug reported against pngquant in CVE-2016-5735.
+ Removed reference to the obsolete PNG_SAFE_LIMITS macro in the documentation.
+
+Version 1.6.30beta03 [May 22, 2017]
+ Check for integer overflow in contrib/visupng and contrib/tools/genpng.
+ Do not double evaluate CMAKE_SYSTEM_PROCESSOR in CMakeLists.txt.
+ Test CMAKE_HOST_WIN32 instead of WIN32 in CMakeLists.txt.
+ Fix some URL in documentation.
+
+Version 1.6.30beta04 [June 7, 2017]
+ Avoid writing an empty IDAT when the last IDAT exactly fills the
+ compression buffer (bug report by Brian Baird). This bug was
+ introduced in libpng-1.6.0.
+
+Version 1.6.30rc01 [June 14, 2017]
+ No changes.
+
+Version 1.6.30rc02 [June 25, 2017]
+ Update copyright year in pnglibconf.h, make ltmain.sh executable.
+ Add a reference to the libpng.download site in README.
+
+Version 1.6.30 [June 28, 2017]
+ No changes.
+
+Version 1.6.31beta01 [July 5, 2017]
+ Guard the definition of _POSIX_SOURCE in pngpriv.h (AIX already defines it;
+ bug report by Michael Felt).
+ Revised pngpriv.h to work around failure to compile arm/filter_neon.S
+ ("typedef" directive is unrecognized by the assembler). The problem
+ was introduced in libpng-1.6.30beta01.
+ Added "Requires: zlib" to libpng.pc.in (Pieter Neerincx).
+ Added special case for FreeBSD in arm/filter_neon.S (Maya Rashish).
+
+Version 1.6.31beta02 [July 8, 2017]
+ Added instructions for disabling hardware optimizations in INSTALL.
+ Added "--enable-hardware-optimizations" configuration flag to enable
+ or disable all hardware optimizations with one flag.
+
+Version 1.6.31beta03 [July 9, 2017]
+ Updated CMakeLists.txt to add INTEL_SSE and MIPS_MSA platforms.
+ Changed "int" to "png_size_t" in intel/filter_sse2.c to prevent
+ possible integer overflow (Bug report by John Bowler).
+ Quieted "declaration after statement" warnings in intel/filter_sse2.c.
+ Added scripts/makefile-linux-opt, which has hardware optimizations enabled.
+
+Version 1.6.31beta04 [July 11, 2017]
+ Removed one of the GCC-7.1.0 'strict-overflow' warnings that result when
+ integers appear on both sides of a compare. Worked around the others by
+ forcing the strict-overflow setting in the relevant functions to a level
+ where they are not reported (John Bowler).
+ Changed "FALL THROUGH" comments to "FALLTHROUGH" because GCC doesn't like
+ the space.
+ Worked around some C-style casts from (void*) because g++ 5.4.0 objects
+ to them.
+ Increased the buffer size for 'sprint' to pass the gcc 7.1.0 'sprint
+ overflow' check that is on by default with -Wall -Wextra.
+
+Version 1.6.31beta05 [July 13, 2017]
+ Added eXIf chunk support.
+
+Version 1.6.31beta06 [July 17, 2017]
+ Added a minimal eXIf chunk (with Orientation and FocalLengthIn35mmFilm
+ tags) to pngtest.png.
+
+Version 1.6.31beta07 [July 18, 2017]
+ Revised the eXIf chunk in pngtest.png to fix "Bad IFD1 Directory" warning.
+
+Version 1.6.31rc01 [July 19, 2017]
+ No changes.
+
+Version 1.6.31rc02 [July 25, 2017]
+ Fixed typo in example.c (png_free_image should be png_image_free) (Bug
+ report by John Smith)
+
+Version 1.6.31 [July 27, 2017]
+ No changes.
+
+Version 1.6.32beta01 [July 31, 2017]
+ Avoid possible NULL dereference in png_handle_eXIf when benign_errors
+ are allowed. Avoid leaking the input buffer "eXIf_buf".
+ Eliminated png_ptr->num_exif member from pngstruct.h and added num_exif
+ to arguments for png_get_eXIf() and png_set_eXIf().
+ Added calls to png_handle_eXIf(() in pngread.c and png_write_eXIf() in
+ pngwrite.c, and made various other fixes to png_write_eXIf().
+ Changed name of png_get_eXIF and png_set_eXIf() to png_get_eXIf_1() and
+ png_set_eXIf_1(), respectively, to avoid breaking API compatibility
+ with libpng-1.6.31.
+
+Version 1.6.32beta02 [August 1, 2017]
+ Updated contrib/libtests/pngunknown.c with eXIf chunk.
+
+Version 1.6.32beta03 [August 2, 2017]
+ Initialized btoa[] in pngstest.c
+ Stop memory leak when returning from png_handle_eXIf() with an error
+ (Bug report from the OSS-fuzz project).
+
+Version 1.6.32beta04 [August 2, 2017]
+ Replaced local eXIf_buf with info_ptr-eXIf_buf in png_handle_eXIf().
+ Update libpng.3 and libpng-manual.txt about eXIf functions.
+
+Version 1.6.32beta05 [August 2, 2017]
+ Restored png_get_eXIf() and png_set_eXIf() to maintain API compatability.
+
+Version 1.6.32beta06 [August 2, 2017]
+ Removed png_get_eXIf_1() and png_set_eXIf_1().
+
+Version 1.6.32beta07 [August 3, 2017]
+ Check length of all chunks except IDAT against user limit to fix an
+ OSS-fuzz issue.
+
+Version 1.6.32beta08 [August 3, 2017]
+ Check length of IDAT against maximum possible IDAT size, accounting
+ for height, rowbytes, interlacing and zlib/deflate overhead.
+ Restored png_get_eXIf_1() and png_set_eXIf_1(), because strlen(eXIf_buf)
+ does not work (the eXIf chunk data can contain zeroes).
+
+Version 1.6.32beta09 [August 3, 2017]
+ Require cmake-2.8.8 in CMakeLists.txt. Revised symlink creation,
+ no longer using deprecated cmake LOCATION feature (Clifford Yapp).
+ Fixed five-byte error in the calculation of IDAT maximum possible size.
+
+Version 1.6.32beta10 [August 5, 2017]
+ Moved chunk-length check into a png_check_chunk_length() private
+ function (Suggested by Max Stepin).
+ Moved bad pngs from tests to contrib/libtests/crashers
+ Moved testing of bad pngs into a separate tests/pngtest-badpngs script
+ Added the --xfail (expected FAIL) option to pngtest.c. It writes XFAIL
+ in the output but PASS for the libpng test.
+ Require cmake-3.0.2 in CMakeLists.txt (Clifford Yapp).
+ Fix "const" declaration info_ptr argument to png_get_eXIf_1() and the
+ num_exif argument to png_get_eXIf_1() (Github Issue 171).
+
+Version 1.6.32beta11 [August 7, 2017]
+ Added "eXIf" to "chunks_to_ignore[]" in png_set_keep_unknown_chunks().
+ Added huge_IDAT.png and empty_ancillary_chunks.png to testpngs/crashers.
+ Make pngtest --strict, --relax, --xfail options imply -m (multiple).
+ Removed unused chunk_name parameter from png_check_chunk_length().
+ Relocated setting free_me for eXIf data, to stop an OSS-fuzz leak.
+ Initialize profile_header[] in png_handle_iCCP() to fix OSS-fuzz issue.
+ Initialize png_ptr->row_buf[0] to 255 in png_read_row() to fix OSS-fuzz UMR.
+ Attempt to fix a UMR in png_set_text_2() to fix OSS-fuzz issue.
+ Increase minimum zlib stream from 9 to 14 in png_handle_iCCP(), to account
+ for the minimum 'deflate' stream, and relocate the test to a point
+ after the keyword has been read.
+ Check that the eXIf chunk has at least 2 bytes and begins with "II" or "MM".
+
+Version 1.6.32rc01 [August 18, 2017]
+ Added a set of "huge_xxxx_chunk.png" files to contrib/testpngs/crashers,
+ one for each known chunk type, with length = 2GB-1.
+ Check for 0 return from png_get_rowbytes() and added some (size_t) typecasts
+ in contrib/pngminus/*.c to stop some Coverity issues (162705, 162706,
+ and 162707).
+ Renamed chunks in contrib/testpngs/crashers to avoid having files whose
+ names differ only in case; this causes problems with some platforms
+ (github issue #172).
+
+Version 1.6.32rc02 [August 22, 2017]
+ Added contrib/oss-fuzz directory which contains files used by the oss-fuzz
+ project (https://github.com/google/oss-fuzz/tree/master/projects/libpng).
+
+Version 1.6.32 [August 24, 2017]
+ No changes.
+
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
diff --git a/src/3rdparty/libpng/INSTALL b/src/3rdparty/libpng/INSTALL
index 58ec0b60a7..e8edb7240f 100644
--- a/src/3rdparty/libpng/INSTALL
+++ b/src/3rdparty/libpng/INSTALL
@@ -16,10 +16,11 @@ Contents
XI. Prepending a prefix to exported symbols
XII. Configuring for compiler xxx:
XIII. Removing unwanted object code
- XIV. Changes to the build and configuration of libpng in libpng-1.5.x
- XV. Setjmp/longjmp issues
- XVI. Common linking failures
- XVII. Other sources of information about libpng
+ XIV. Enabling or disabling hardware optimizations
+ XV. Changes to the build and configuration of libpng in libpng-1.5.x
+ XVI. Setjmp/longjmp issues
+ XVII. Common linking failures
+ XVIII. Other sources of information about libpng
I. Simple installation
@@ -78,8 +79,8 @@ Or you can use one of the "projects" in the "projects" directory.
Before installing libpng, you must first install zlib, if it
is not already on your system. zlib can usually be found
-wherever you got libpng; otherwise go to http://zlib.net. You can place
-zlib in the same directory as libpng or in another directory.
+wherever you got libpng; otherwise go to https://zlib.net/. You can
+place zlib in the same directory as libpng or in another directory.
If your system already has a preinstalled zlib you will still need
to have access to the zlib.h and zconf.h include files that
@@ -281,7 +282,57 @@ library to fail if they call functions not available in your library.
The size of the library itself should not be an issue, because only
those sections that are actually used will be loaded into memory.
-XIV. Changes to the build and configuration of libpng in libpng-1.5.x
+XIV. Enabling or disabling hardware optimizations
+
+Certain hardware capabilites, such as the Intel SSE instructions,
+are normally detected at run time. Enable them with configure options
+such as one of
+
+ --enable-arm-neon=yes
+ --enable-mips-msa=yes
+ --enable-intel-sse=yes
+ --enable-powerpc-vsx=yes
+
+or enable them all at once with
+
+ --enable-hardware-optimizations=yes
+
+or, if you are not using "configure", you can use one
+or more of
+
+ CPPFLAGS += "-DPNG_ARM_NEON"
+ CPPFLAGS += "-DPNG_MIPS_MSA"
+ CPPFLAGS += "-DPNG_INTEL_SSE"
+ CPPFLAGS += "-DPNG_POWERPC_VSX"
+
+See for example scripts/makefile.linux-opt
+
+If you wish to avoid using them,
+you can disable them via the configure option
+
+ --disable-hardware-optimizations
+
+to disable them all, or
+
+ --enable-intel-sse=no
+
+to disable a particular one,
+or via compiler-command options such as
+
+ CPPFLAGS += "-DPNG_ARM_NEON_OPT=0, -DPNG_MIPS_MSA_OPT=0,
+ -DPNG_INTEL_SSE_OPT=0, -DPNG_POWERPC_VSX_OPT=0"
+
+If you are using cmake, hardware optimizations are "on"
+by default. To disable them, use
+
+ cmake . -DPNG_ARM_NEON=no -DPNG_INTEL_SSE=no \
+ -DPNG_MIPS_MSA=no -DPNG_POWERPC_VSX=no
+
+or disable them all at once with
+
+ cmake . -DPNG_HARDWARE_OPTIMIZATIONS=no
+
+XV. Changes to the build and configuration of libpng in libpng-1.5.x
Details of internal changes to the library code can be found in the CHANGES
file and in the GIT repository logs. These will be of no concern to the vast
@@ -372,7 +423,7 @@ $PREFIX/include directory). Do not edit pnglibconf.h after you have built
libpng, because than the settings would not accurately reflect the settings
that were used to build libpng.
-XV. Setjmp/longjmp issues
+XVI. Setjmp/longjmp issues
Libpng uses setjmp()/longjmp() for error handling. Unfortunately setjmp()
is known to be not thread-safe on some platforms and we don't know of
@@ -390,7 +441,7 @@ This requires setjmp/longjmp, so you must either build the library
with PNG_SETJMP_SUPPORTED defined, or with PNG_SIMPLIFIED_READ_SUPPORTED
and PNG_SIMPLIFIED_WRITE_SUPPORTED undefined.
-XVI. Common linking failures
+XVII. Common linking failures
If your application fails to find libpng or zlib entries while linking:
@@ -402,7 +453,7 @@ If your application fails to find libpng or zlib entries while linking:
If you are using the vstudio project, observe the WARNING in
project/vstudio/README.txt.
-XVII. Other sources of information about libpng:
+XVIII. Other sources of information about libpng:
Further information can be found in the README and libpng-manual.txt
files, in the individual makefiles, in png.h, and the manual pages
diff --git a/src/3rdparty/libpng/LICENSE b/src/3rdparty/libpng/LICENSE
index 912552e2af..e803911d37 100644
--- a/src/3rdparty/libpng/LICENSE
+++ b/src/3rdparty/libpng/LICENSE
@@ -10,7 +10,7 @@ this sentence.
This code is released under the libpng license.
-libpng versions 1.0.7, July 1, 2000 through 1.6.28, January 5, 2017 are
+libpng versions 1.0.7, July 1, 2000 through 1.6.32, August 24, 2017 are
Copyright (c) 2000-2002, 2004, 2006-2017 Glenn Randers-Pehrson, are
derived from libpng-1.0.6, and are distributed according to the same
disclaimer and license as libpng-1.0.6 with the following individuals
@@ -23,6 +23,8 @@ added to the list of Contributing Authors:
Gilles Vollant
James Yu
Mandar Sahastrabuddhe
+ Google Inc.
+ Vadim Barkov
and with the following additions to the disclaimer:
@@ -128,4 +130,4 @@ any encryption software. See the EAR, paragraphs 734.3(b)(3) and
Glenn Randers-Pehrson
glennrp at users.sourceforge.net
-January 5, 2017
+April 1, 2017
diff --git a/src/3rdparty/libpng/README b/src/3rdparty/libpng/README
index 67b579d13c..71292715eb 100644
--- a/src/3rdparty/libpng/README
+++ b/src/3rdparty/libpng/README
@@ -1,4 +1,4 @@
-README for libpng version 1.6.28 - January 5, 2017 (shared library 16.0)
+README for libpng version 1.6.32 - August 24, 2017 (shared library 16.0)
See the note about version numbers near the top of png.h
See INSTALL for instructions on how to install libpng.
@@ -23,7 +23,7 @@ earlier versions if you are using a shared library. The type of the
png_uint_32, which will affect shared-library applications that use
this function.
-To avoid problems with changes to the internals of png info_struct,
+To avoid problems with changes to the internals of the png info_struct,
new APIs have been made available in 0.95 to avoid direct application
access to info_ptr. These functions are the png_set_<chunk> and
png_get_<chunk> functions. These functions should be used when
@@ -88,11 +88,11 @@ zlib should be available at the same place that libpng is, or at zlib.net.
You may also want a copy of the PNG specification. It is available
as an RFC, a W3C Recommendation, and an ISO/IEC Standard. You can find
-these at http://www.libpng.org/pub/png/documents/
+these at http://www.libpng.org/pub/png/pngdocs.html .
-This code is currently being archived at libpng.sf.net in the
-[DOWNLOAD] area, and at ftp://ftp.simplesystems.org. If you can't find it
-in any of those places, e-mail me, and I'll help you find it.
+This code is currently being archived at libpng.sourceforge.io in the
+[DOWNLOAD] area, and at http://libpng.download/src . If you
+can't find it in any of those places, e-mail me, and I'll help you find it.
I am not a lawyer, but I believe that the Export Control Classification
Number (ECCN) for libpng is EAR99, which means not subject to export
@@ -179,14 +179,16 @@ Files in this distribution:
pngwtran.c => Write data transformations
pngwutil.c => Write utility functions
arm => Contains optimized code for the ARM platform
+ powerpc => Contains optimized code for the PowerPC platform
contrib => Contributions
arm-neon => Optimized code for ARM-NEON platform
+ powerpc-vsx => Optimized code for POWERPC-VSX platform
examples => Example programs
gregbook => source code for PNG reading and writing, from
Greg Roelofs' "PNG: The Definitive Guide",
O'Reilly, 1999
- intel => Optimized code for INTEL-SSE2 platform
libtests => Test programs
+ mips-msa => Optimized code for MIPS-MSA platform
pngminim => Minimal decoder, encoder, and progressive decoder
programs demonstrating use of pngusr.dfa
pngminus => Simple pnm2png and png2pnm programs
@@ -194,6 +196,8 @@ Files in this distribution:
testpngs
tools => Various tools
visupng => Contains a MSVC workspace for VisualPng
+ intel => Optimized code for INTEL-SSE2 platform
+ mips => Optimized code for MIPS platform
projects => Contains project files and workspaces for
building a DLL
owatcom => Contains a WATCOM project for building libpng
diff --git a/src/3rdparty/libpng/import_from_libpng_tarball.sh b/src/3rdparty/libpng/import_from_libpng_tarball.sh
new file mode 100755
index 0000000000..d67b7903a6
--- /dev/null
+++ b/src/3rdparty/libpng/import_from_libpng_tarball.sh
@@ -0,0 +1,113 @@
+#! /bin/sh
+#############################################################################
+##
+## Copyright (C) 2017 André Klitzing
+## Contact: https://www.qt.io/licensing/
+##
+## This file is the build configuration utility of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:LGPL$
+## Commercial License Usage
+## Licensees holding valid commercial Qt licenses may use this file in
+## accordance with the commercial license agreement provided with the
+## Software or, alternatively, in accordance with the terms contained in
+## a written agreement between you and The Qt Company. For licensing terms
+## and conditions see https://www.qt.io/terms-conditions. For further
+## information use the contact form at https://www.qt.io/contact-us.
+##
+## GNU Lesser General Public License Usage
+## Alternatively, this file may be used under the terms of the GNU Lesser
+## General Public License version 3 as published by the Free Software
+## Foundation and appearing in the file LICENSE.LGPL3 included in the
+## packaging of this file. Please review the following information to
+## ensure the GNU Lesser General Public License version 3 requirements
+## will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+##
+## GNU General Public License Usage
+## Alternatively, this file may be used under the terms of the GNU
+## General Public License version 2.0 or (at your option) the GNU General
+## Public license version 3 or any later version approved by the KDE Free
+## Qt Foundation. The licenses are as published by the Free Software
+## Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+## included in the packaging of this file. Please review the following
+## information to ensure the GNU General Public License requirements will
+## be met: https://www.gnu.org/licenses/gpl-2.0.html and
+## https://www.gnu.org/licenses/gpl-3.0.html.
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+# This is a small script to copy the required files from a libpng tarball
+# into 3rdparty/libpng/
+
+if [ $# -ne 2 ]; then
+ echo "Usage: $0 libpng_tarball_dir/ \$QTDIR/src/3rdparty/libpng/"
+ exit 1
+fi
+
+LIBPNG_DIR=$1
+TARGET_DIR=$2
+
+if [ ! -d "$LIBPNG_DIR" -o ! -r "$LIBPNG_DIR" -o ! -d "$TARGET_DIR" -o ! -w "$TARGET_DIR" ]; then
+ echo "Either the libpng source dir or the target dir do not exist,"
+ echo "are not directories or have the wrong permissions."
+ exit 2
+fi
+
+# with 1 argument, copies LIBPNG_DIR/$1 to TARGET_DIR/$1
+# with 2 arguments, copies LIBPNG_DIR/$1 to TARGET_DIR/$2
+copy_file() {
+ if [ $# -lt 1 -o $# -gt 2 ]; then
+ echo "Wrong number of arguments to copy_file"
+ exit 3
+ fi
+
+ SOURCE_FILE=$1
+ if [ -n "$2" ]; then
+ DEST_FILE=$2
+ else
+ DEST_FILE=$1
+ fi
+
+ mkdir -p "$TARGET_DIR/$(dirname "$SOURCE_FILE")"
+ cp "$LIBPNG_DIR/$SOURCE_FILE" "$TARGET_DIR/$DEST_FILE"
+}
+
+copy_file "scripts/pnglibconf.h.prebuilt" "pnglibconf.h"
+
+FILES="
+ ANNOUNCE
+ README
+ CHANGES
+ LICENSE
+ INSTALL
+ libpng-manual.txt
+
+ png.c
+ pngerror.c
+ pngget.c
+ pngmem.c
+ pngpread.c
+ pngread.c
+ pngrio.c
+ pngrtran.c
+ pngrutil.c
+ pngset.c
+ pngtrans.c
+ pngwio.c
+ pngwrite.c
+ pngwtran.c
+ pngwutil.c
+
+ png.h
+ pngpriv.h
+ pngstruct.h
+ pnginfo.h
+ pngconf.h
+ pngdebug.h
+"
+
+for i in $FILES; do
+ copy_file "$i" "$i"
+done
diff --git a/src/3rdparty/libpng/libpng-manual.txt b/src/3rdparty/libpng/libpng-manual.txt
index 048ba31c06..e34b1436f5 100644
--- a/src/3rdparty/libpng/libpng-manual.txt
+++ b/src/3rdparty/libpng/libpng-manual.txt
@@ -1,9 +1,9 @@
libpng-manual.txt - A description on how to use and modify libpng
- libpng version 1.6.28 - January 5, 2017
+ libpng version 1.6.32 - August 24, 2017
Updated and distributed by Glenn Randers-Pehrson
<glennrp at users.sourceforge.net>
- Copyright (c) 1998-2016 Glenn Randers-Pehrson
+ Copyright (c) 1998-2017 Glenn Randers-Pehrson
This document is released under the libpng license.
For conditions of distribution and use, see the disclaimer
@@ -11,9 +11,9 @@ libpng-manual.txt - A description on how to use and modify libpng
Based on:
- libpng versions 0.97, January 1998, through 1.6.28 - January 5, 2017
+ libpng versions 0.97, January 1998, through 1.6.32 - August 24, 2017
Updated and distributed by Glenn Randers-Pehrson
- Copyright (c) 1998-2016 Glenn Randers-Pehrson
+ Copyright (c) 1998-2017 Glenn Randers-Pehrson
libpng 1.0 beta 6 - version 0.96 - May 28, 1997
Updated and distributed by Andreas Dilger
@@ -66,17 +66,17 @@ file format in application programs.
The PNG specification (second edition), November 2003, is available as
a W3C Recommendation and as an ISO Standard (ISO/IEC 15948:2004 (E)) at
-<http://www.w3.org/TR/2003/REC-PNG-20031110/
+<https://www.w3.org/TR/2003/REC-PNG-20031110/
The W3C and ISO documents have identical technical content.
The PNG-1.2 specification is available at
-<http://png-mng.sourceforge.net/pub/png/spec/1.2/>.
+<https://png-mng.sourceforge.io/pub/png/spec/1.2/>.
It is technically equivalent
to the PNG specification (second edition) but has some additional material.
-The PNG-1.0 specification is available as RFC 2083
-<http://png-mng.sourceforge.net/pub/png/spec/1.0/> and as a
-W3C Recommendation <http://www.w3.org/TR/REC-png-961001>.
+The PNG-1.0 specification is available as RFC 2083
+<https://png-mng.sourceforge.io/pub/png/spec/1.0/> and as a
+W3C Recommendation <https://www.w3.org/TR/REC-png-961001>.
Some additional chunks are described in the special-purpose public chunks
documents at <http://www.libpng.org/pub/png/spec/register/>
@@ -101,7 +101,7 @@ majority of the needs of its users.
Libpng uses zlib for its compression and decompression of PNG files.
Further information about zlib, and the latest version of zlib, can
-be found at the zlib home page, <http://zlib.net/>.
+be found at the zlib home page, <https://zlib.net/>.
The zlib compression utility is a general purpose utility that is
useful for more than PNG files, and can be used without libpng.
See the documentation delivered with zlib for more details.
@@ -688,8 +688,9 @@ where 0x7fffffffL means unlimited. You can retrieve this limit with
chunk_cache_max = png_get_chunk_cache_max(png_ptr);
Libpng imposes a limit of 8 Megabytes (8,000,000 bytes) on the amount of
-memory that a compressed chunk other than IDAT can occupy, when decompressed.
-You can change this limit with
+memory that any chunk other than IDAT can occupy, originally or when
+decompressed (prior to libpng-1.6.32 the limit was only applied to compressed
+chunks after decompression). You can change this limit with
png_set_chunk_malloc_max(png_ptr, user_chunk_malloc_max);
@@ -1190,7 +1191,20 @@ row_pointers prior to calling png_read_png() with
png_set_rows(png_ptr, info_ptr, &row_pointers);
Alternatively you could allocate your image in one big block and define
-row_pointers[i] to point into the proper places in your block.
+row_pointers[i] to point into the proper places in your block, but first
+be sure that your platform is able to allocate such a large buffer:
+
+ /* Guard against integer overflow */
+ if (height > PNG_SIZE_MAX/(width*pixel_size)) {
+ png_error(png_ptr,"image_data buffer would be too large");
+ }
+
+ png_bytep buffer=png_malloc(png_ptr,height*width*pixel_size);
+
+ for (int i=0; i<height, i++)
+ row_pointers[i]=buffer+i*width*pixel_size;
+
+ png_set_rows(png_ptr, info_ptr, &row_pointers);
If you use png_set_rows(), the application is responsible for freeing
row_pointers (and row_pointers[i], if they were separately allocated).
@@ -1317,6 +1331,11 @@ in until png_read_end() has read the chunk data following the image.
rowbytes = png_get_rowbytes(png_ptr, info_ptr);
rowbytes - number of bytes needed to hold a row
+ This value, the bit_depth, color_type,
+ and the number of channels can change
+ if you use transforms such as
+ png_set_expand(). See
+ png_read_update_info(), below.
signature = png_get_signature(png_ptr, info_ptr);
@@ -1435,6 +1454,11 @@ png_set_rgb_to_gray()).
the single transparent color for
non-paletted images (PNG_INFO_tRNS)
+ png_get_eXIf_1(png_ptr, info_ptr, &num_exif, &exif);
+ (PNG_INFO_eXIf)
+
+ exif - Exif profile (array of png_byte)
+
png_get_hIST(png_ptr, info_ptr, &hist);
(PNG_INFO_hIST)
@@ -2146,6 +2170,16 @@ are allocating one large chunk, you will need to build an
array of pointers to each row, as it will be needed for some
of the functions below.
+Be sure that your platform can allocate the buffer that you'll need.
+libpng internally checks for oversize width, but you'll need to
+do your own check for number_of_rows*width*pixel_size if you are using
+a multiple-row buffer:
+
+ /* Guard against integer overflow */
+ if (number_of_rows > PNG_SIZE_MAX/(width*pixel_size)) {
+ png_error(png_ptr,"image_data buffer would be too large");
+ }
+
Remember: Before you call png_read_update_info(), the png_get_*()
functions return the values corresponding to the original PNG image.
After you call png_read_update_info the values refer to the image
@@ -2470,6 +2504,7 @@ your application instead of by libpng, you can use
PNG_INFO_gAMA, PNG_INFO_sBIT,
PNG_INFO_cHRM, PNG_INFO_PLTE,
PNG_INFO_tRNS, PNG_INFO_bKGD,
+ PNG_INFO_eXIf,
PNG_INFO_hIST, PNG_INFO_pHYs,
PNG_INFO_oFFs, PNG_INFO_tIME,
PNG_INFO_pCAL, PNG_INFO_sRGB,
@@ -3069,6 +3104,11 @@ width, height, bit_depth, and color_type must be the same in each call.
single transparent color for
non-paletted images (PNG_INFO_tRNS)
+ png_set_eXIf_1(png_ptr, info_ptr, num_exif, exif);
+
+ exif - Exif profile (array of
+ png_byte) (PNG_INFO_eXIf)
+
png_set_hIST(png_ptr, info_ptr, hist);
hist - histogram of palette (array of
@@ -3824,7 +3864,7 @@ PNG_FORMAT_FLAG_LINEAR flag below.
When the simplified API needs to convert between sRGB and linear colorspaces,
the actual sRGB transfer curve defined in the sRGB specification (see the
-article at http://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2
+article at https://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2
approximation used elsewhere in libpng.
When an alpha channel is present it is expected to denote pixel coverage
@@ -4088,7 +4128,7 @@ READ APIs
When the simplified API needs to convert between sRGB and linear colorspaces,
the actual sRGB transfer curve defined in the sRGB specification (see the
-article at http://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2
+article at https://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2
approximation used elsewhere in libpng.
WRITE APIS
@@ -4246,8 +4286,6 @@ functions after png_create_*_struct() has been called by calling:
png_voidp error_ptr, png_error_ptr error_fn,
png_error_ptr warning_fn);
- png_voidp error_ptr = png_get_error_ptr(png_ptr);
-
If NULL is supplied for either error_fn or warning_fn, then the libpng
default function will be used, calling fprintf() and/or longjmp() if a
problem is encountered. The replacement error functions should have
@@ -4259,6 +4297,11 @@ parameters as follows:
void user_warning_fn(png_structp png_ptr,
png_const_charp warning_msg);
+Then, within your user_error_fn or user_warning_fn, you can retrieve
+the error_ptr if you need it, by calling
+
+ png_voidp error_ptr = png_get_error_ptr(png_ptr);
+
The motivation behind using setjmp() and longjmp() is the C++ throw and
catch exception handling methods. This makes the code much easier to write,
as there is no need to check every return code of every function call.
@@ -4266,7 +4309,7 @@ However, there are some uncertainties about the status of local variables
after a longjmp, so the user may want to be careful about doing anything
after setjmp returns non-zero besides returning itself. Consult your
compiler documentation for more details. For an alternative approach, you
-may wish to use the "cexcept" facility (see http://cexcept.sourceforge.net),
+may wish to use the "cexcept" facility (see https://cexcept.sourceforge.io/),
which is illustrated in pngvalid.c and in contrib/visupng.
Beginning in libpng-1.4.0, the png_set_benign_errors() API became available.
@@ -4494,7 +4537,7 @@ in a MNG datastream. As a minimum, it must have the MNG 8-byte signature
and the MHDR and MEND chunks. Libpng does not provide support for these
or any other MNG chunks; your application must provide its own support for
them. You may wish to consider using libmng (available at
-http://www.libmng.com) instead.
+https://www.libmng.com/) instead.
VIII. Changes to Libpng from version 0.88
@@ -4917,18 +4960,14 @@ PNG_USER_WIDTH_MAX and PNG_USER_HEIGHT_MAX, although this document said
that it could be used to override them. Now this function will reduce or
increase the limits.
-Starting in libpng-1.5.10, the user limits can be set en masse with the
-configuration option PNG_SAFE_LIMITS_SUPPORTED. If this option is enabled,
-a set of "safe" limits is applied in pngpriv.h. These can be overridden by
-application calls to png_set_user_limits(), png_set_user_chunk_cache_max(),
-and/or png_set_user_malloc_max() that increase or decrease the limits. Also,
-in libpng-1.5.10 the default width and height limits were increased
-from 1,000,000 to 0x7fffffff (i.e., made unlimited). Therefore, the
-limits are now
- default safe
+Starting in libpng-1.5.22, default user limits were established. These
+can be overridden by application calls to png_set_user_limits(),
+png_set_user_chunk_cache_max(), and/or png_set_user_malloc_max().
+The limits are now
+ max possible default
png_user_width_max 0x7fffffff 1,000,000
png_user_height_max 0x7fffffff 1,000,000
- png_user_chunk_cache_max 0 (unlimited) 128
+ png_user_chunk_cache_max 0 (unlimited) 1000
png_user_chunk_malloc_max 0 (unlimited) 8,000,000
The png_set_option() function (and the "options" member of the png struct) was
@@ -5178,6 +5217,11 @@ is an error. Previously this requirement of the PNG specification was not
enforced, and the palette was always limited to 256 entries. An over-length
PLTE chunk found in an input PNG is silently truncated.
+Starting with libpng-1.6.31, the eXIf chunk is supported. Libpng does not
+attempt to decode the Exif profile; it simply returns a byte array
+containing the profile to the calling application which must do its own
+decoding.
+
XIII. Detecting libpng
The png_get_io_ptr() function has been present since libpng-0.88, has never
@@ -5194,27 +5238,33 @@ control. The git repository was built from old libpng-x.y.z.tar.gz files
going back to version 0.70. You can access the git repository (read only)
at
- git://git.code.sf.net/p/libpng/code
+ https://github.com/glennrp/libpng or
+ https://git.code.sf.net/p/libpng/code.git
-or you can browse it with a web browser by selecting the "code" button at
+or you can browse it with a web browser at
- https://sourceforge.net/projects/libpng
+ https://github.com/glennrp/libpng or
+ https://sourceforge.net/p/libpng/code/ci/libpng16/tree/
Patches can be sent to glennrp at users.sourceforge.net or to
png-mng-implement at lists.sourceforge.net or you can upload them to
the libpng bug tracker at
- http://libpng.sourceforge.net
+ https://libpng.sourceforge.io/
+
+or as a "pull request" to
+
+ https://github.com/glennrp/libpng/pulls
We also accept patches built from the tar or zip distributions, and
simple verbal discriptions of bug fixes, reported either to the
SourceForge bug tracker, to the png-mng-implement at lists.sf.net
-mailing list, or directly to glennrp.
+mailing list, as github issues, or directly to glennrp.
XV. Coding style
Our coding style is similar to the "Allman" style
-(See http://en.wikipedia.org/wiki/Indent_style#Allman_style), with curly
+(See https://en.wikipedia.org/wiki/Indent_style#Allman_style), with curly
braces on separate lines:
if (condition)
@@ -5315,7 +5365,7 @@ Prior to libpng-1.6.0 we used a "png_sizeof()" macro, formatted as
though it were a function.
Control keywords if, for, while, and switch are always followed by a space
-to distinguish them from function calls, which have no trailing space.
+to distinguish them from function calls, which have no trailing space.
We put a space after each comma and after each semicolon
in "for" statements, and we put spaces before and after each
@@ -5341,7 +5391,7 @@ for a few type names that we inherit from zlib.h.
We prefer "if (something != 0)" and "if (something == 0)" over
"if (something)" and if "(!something)", respectively, and for pointers
-we prefer "if (some_pointer != NULL)" or "if (some_pointer == NULL)".
+we prefer "if (some_pointer != NULL)" or "if (some_pointer == NULL)".
We do not use the TAB character for indentation in the C sources.
@@ -5355,7 +5405,7 @@ Since the PNG Development group is an ad-hoc body, we can't make
an official declaration.
This is your unofficial assurance that libpng from version 0.71 and
-upward through 1.6.28 are Y2K compliant. It is my belief that earlier
+upward through 1.6.32 are Y2K compliant. It is my belief that earlier
versions were also Y2K compliant.
Libpng only has two year fields. One is a 2-byte unsigned integer
diff --git a/src/3rdparty/libpng/png.c b/src/3rdparty/libpng/png.c
index 78ce39f46d..2352df13cb 100644
--- a/src/3rdparty/libpng/png.c
+++ b/src/3rdparty/libpng/png.c
@@ -1,7 +1,7 @@
/* png.c - location for general purpose libpng functions
*
- * Last changed in libpng 1.6.28 [January 5, 2017]
+ * Last changed in libpng 1.6.32 [August 24, 2017]
* Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@@ -14,7 +14,27 @@
#include "pngpriv.h"
/* Generate a compiler error if there is an old png.h in the search path. */
-typedef png_libpng_version_1_6_28 Your_png_h_is_not_version_1_6_28;
+typedef png_libpng_version_1_6_32 Your_png_h_is_not_version_1_6_32;
+
+#ifdef __GNUC__
+/* The version tests may need to be added to, but the problem warning has
+ * consistently been fixed in GCC versions which obtain wide-spread release.
+ * The problem is that many versions of GCC rearrange comparison expressions in
+ * the optimizer in such a way that the results of the comparison will change
+ * if signed integer overflow occurs. Such comparisons are not permitted in
+ * ANSI C90, however GCC isn't clever enough to work out that that do not occur
+ * below in png_ascii_from_fp and png_muldiv, so it produces a warning with
+ * -Wextra. Unfortunately this is highly dependent on the optimizer and the
+ * machine architecture so the warning comes and goes unpredictably and is
+ * impossible to "fix", even were that a good idea.
+ */
+#if __GNUC__ == 7 && __GNUC_MINOR__ == 1
+#define GCC_STRICT_OVERFLOW 1
+#endif /* GNU 7.1.x */
+#endif /* GNU */
+#ifndef GCC_STRICT_OVERFLOW
+#define GCC_STRICT_OVERFLOW 0
+#endif
/* Tells libpng that we have already handled the first "num_bytes" bytes
* of the PNG file signature. If the PNG data is embedded into another
@@ -595,6 +615,26 @@ png_free_data(png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 mask,
}
#endif
+#ifdef PNG_eXIf_SUPPORTED
+ /* Free any eXIf entry */
+ if (((mask & PNG_FREE_EXIF) & info_ptr->free_me) != 0)
+ {
+# ifdef PNG_READ_eXIf_SUPPORTED
+ if (info_ptr->eXIf_buf)
+ {
+ png_free(png_ptr, info_ptr->eXIf_buf);
+ info_ptr->eXIf_buf = NULL;
+ }
+# endif
+ if (info_ptr->exif)
+ {
+ png_free(png_ptr, info_ptr->exif);
+ info_ptr->exif = NULL;
+ }
+ info_ptr->valid &= ~PNG_INFO_eXIf;
+ }
+#endif
+
#ifdef PNG_hIST_SUPPORTED
/* Free any hIST entry */
if (((mask & PNG_FREE_HIST) & info_ptr->free_me) != 0)
@@ -776,14 +816,14 @@ png_get_copyright(png_const_structrp png_ptr)
#else
# ifdef __STDC__
return PNG_STRING_NEWLINE \
- "libpng version 1.6.28 - January 5, 2017" PNG_STRING_NEWLINE \
+ "libpng version 1.6.32 - August 24, 2017" PNG_STRING_NEWLINE \
"Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson" \
PNG_STRING_NEWLINE \
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
PNG_STRING_NEWLINE;
# else
- return "libpng version 1.6.28 - January 5, 2017\
+ return "libpng version 1.6.32 - August 24, 2017\
Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson\
Copyright (c) 1996-1997 Andreas Dilger\
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.";
@@ -2832,7 +2872,7 @@ png_pow10(int power)
if (power < 0)
{
if (power < DBL_MIN_10_EXP) return 0;
- recip = 1, power = -power;
+ recip = 1; power = -power;
}
if (power > 0)
@@ -2857,6 +2897,14 @@ png_pow10(int power)
/* Function to format a floating point value in ASCII with a given
* precision.
*/
+#if GCC_STRICT_OVERFLOW
+#pragma GCC diagnostic push
+/* The problem arises below with exp_b10, which can never overflow because it
+ * comes, originally, from frexp and is therefore limited to a range which is
+ * typically +/-710 (log2(DBL_MAX)/log2(DBL_MIN)).
+ */
+#pragma GCC diagnostic warning "-Wstrict-overflow=2"
+#endif /* GCC_STRICT_OVERFLOW */
void /* PRIVATE */
png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
double fp, unsigned int precision)
@@ -2910,7 +2958,9 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
double test = png_pow10(exp_b10+1);
if (test <= DBL_MAX)
- ++exp_b10, base = test;
+ {
+ ++exp_b10; base = test;
+ }
else
break;
@@ -2924,7 +2974,10 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
* test on DBL_MAX above.
*/
fp /= base;
- while (fp >= 1) fp /= 10, ++exp_b10;
+ while (fp >= 1)
+ {
+ fp /= 10; ++exp_b10;
+ }
/* Because of the code above fp may, at this point, be
* less than .1, this is ok because the code below can
@@ -2941,7 +2994,7 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
*/
if (exp_b10 < 0 && exp_b10 > -3) /* PLUS 3 TOTAL 4 */
{
- czero = (unsigned int)(-exp_b10); /* PLUS 2 digits: TOTAL 3 */
+ czero = 0U-exp_b10; /* PLUS 2 digits: TOTAL 3 */
exp_b10 = 0; /* Dot added below before first output. */
}
else
@@ -2975,7 +3028,7 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
/* Rounding up to 10, handle that here. */
if (czero > 0)
{
- --czero, d = 1;
+ --czero; d = 1;
if (cdigits == 0) --clead;
}
else
@@ -2989,7 +3042,7 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
else if (ch == 46)
{
- ch = *--ascii, ++size;
+ ch = *--ascii; ++size;
/* Advance exp_b10 to '1', so that the
* decimal point happens after the
* previous digit.
@@ -3016,7 +3069,9 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
int ch = *--ascii;
if (ch == 46)
- ++size, exp_b10 = 1;
+ {
+ ++size; exp_b10 = 1;
+ }
/* Else lost a leading zero, so 'exp_b10' is
* still ok at (-1)
@@ -3052,21 +3107,26 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
*/
if (exp_b10 != (-1))
{
- if (exp_b10 == 0) *ascii++ = 46, --size;
+ if (exp_b10 == 0)
+ {
+ *ascii++ = 46; --size;
+ }
/* PLUS 1: TOTAL 4 */
--exp_b10;
}
- *ascii++ = 48, --czero;
+ *ascii++ = 48; --czero;
}
if (exp_b10 != (-1))
{
if (exp_b10 == 0)
- *ascii++ = 46, --size; /* counted above */
+ {
+ *ascii++ = 46; --size; /* counted above */
+ }
--exp_b10;
}
- *ascii++ = (char)(48 + (int)d), ++cdigits;
+ *ascii++ = (char)(48 + (int)d); ++cdigits;
}
}
while (cdigits+czero < precision+clead && fp > DBL_MIN);
@@ -3075,7 +3135,7 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
/* Check for an exponent, if we don't need one we are
* done and just need to terminate the string. At
- * this point exp_b10==(-1) is effectively if flag - it got
+ * this point exp_b10==(-1) is effectively a flag - it got
* to '-1' because of the decrement after outputting
* the decimal point above (the exponent required is
* *not* -1!)
@@ -3089,7 +3149,7 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
* zeros were *not* output, so this doesn't increase
* the output count.
*/
- while (--exp_b10 >= 0) *ascii++ = 48;
+ while (exp_b10-- > 0) *ascii++ = 48;
*ascii = 0;
@@ -3107,7 +3167,7 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
*/
size -= cdigits;
- *ascii++ = 69, --size; /* 'E': PLUS 1 TOTAL 2+precision */
+ *ascii++ = 69; --size; /* 'E': PLUS 1 TOTAL 2+precision */
/* The following use of an unsigned temporary avoids ambiguities in
* the signed arithmetic on exp_b10 and permits GCC at least to do
@@ -3118,12 +3178,12 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
if (exp_b10 < 0)
{
- *ascii++ = 45, --size; /* '-': PLUS 1 TOTAL 3+precision */
- uexp_b10 = (unsigned int)(-exp_b10);
+ *ascii++ = 45; --size; /* '-': PLUS 1 TOTAL 3+precision */
+ uexp_b10 = 0U-exp_b10;
}
else
- uexp_b10 = (unsigned int)exp_b10;
+ uexp_b10 = 0U+exp_b10;
cdigits = 0;
@@ -3166,6 +3226,9 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
/* Here on buffer too small. */
png_error(png_ptr, "ASCII conversion buffer too small");
}
+#if GCC_STRICT_OVERFLOW
+#pragma GCC diagnostic pop
+#endif /* GCC_STRICT_OVERFLOW */
# endif /* FLOATING_POINT */
@@ -3185,7 +3248,9 @@ png_ascii_from_fixed(png_const_structrp png_ptr, png_charp ascii,
/* Avoid overflow here on the minimum integer. */
if (fp < 0)
- *ascii++ = 45, num = (png_uint_32)(-fp);
+ {
+ *ascii++ = 45; num = (png_uint_32)(-fp);
+ }
else
num = (png_uint_32)fp;
@@ -3223,7 +3288,10 @@ png_ascii_from_fixed(png_const_structrp png_ptr, png_charp ascii,
* then ndigits digits to first:
*/
i = 5;
- while (ndigits < i) *ascii++ = 48, --i;
+ while (ndigits < i)
+ {
+ *ascii++ = 48; --i;
+ }
while (ndigits >= first) *ascii++ = digits[--ndigits];
/* Don't output the trailing zeros! */
}
@@ -3274,6 +3342,15 @@ png_fixed(png_const_structrp png_ptr, double fp, png_const_charp text)
* the nearest .00001). Overflow and divide by zero are signalled in
* the result, a boolean - true on success, false on overflow.
*/
+#if GCC_STRICT_OVERFLOW /* from above */
+/* It is not obvious which comparison below gets optimized in such a way that
+ * signed overflow would change the result; looking through the code does not
+ * reveal any tests which have the form GCC complains about, so presumably the
+ * optimizer is moving an add or subtract into the 'if' somewhere.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic warning "-Wstrict-overflow=2"
+#endif /* GCC_STRICT_OVERFLOW */
int
png_muldiv(png_fixed_point_p res, png_fixed_point a, png_int_32 times,
png_int_32 divisor)
@@ -3388,6 +3465,9 @@ png_muldiv(png_fixed_point_p res, png_fixed_point a, png_int_32 times,
return 0;
}
+#if GCC_STRICT_OVERFLOW
+#pragma GCC diagnostic pop
+#endif /* GCC_STRICT_OVERFLOW */
#endif /* READ_GAMMA || INCH_CONVERSIONS */
#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_INCH_CONVERSIONS_SUPPORTED)
@@ -4260,13 +4340,13 @@ png_set_option(png_structrp png_ptr, int option, int onoff)
if (png_ptr != NULL && option >= 0 && option < PNG_OPTION_NEXT &&
(option & 1) == 0)
{
- png_uint_32 mask = 3 << option;
- png_uint_32 setting = (2 + (onoff != 0)) << option;
+ png_uint_32 mask = 3U << option;
+ png_uint_32 setting = (2U + (onoff != 0)) << option;
png_uint_32 current = png_ptr->options;
png_ptr->options = (png_uint_32)(((current & ~mask) | setting) & 0xff);
- return (current & mask) >> option;
+ return (int)(current & mask) >> option;
}
return PNG_OPTION_INVALID;
@@ -4278,7 +4358,7 @@ png_set_option(png_structrp png_ptr, int option, int onoff)
defined(PNG_SIMPLIFIED_WRITE_SUPPORTED)
/* sRGB conversion tables; these are machine generated with the code in
* contrib/tools/makesRGB.c. The actual sRGB transfer curve defined in the
- * specification (see the article at http://en.wikipedia.org/wiki/SRGB)
+ * specification (see the article at https://en.wikipedia.org/wiki/SRGB)
* is used, not the gamma=1/2.2 approximation use elsewhere in libpng.
* The sRGB to linear table is exact (to the nearest 16-bit linear fraction).
* The inverse (linear to sRGB) table has accuracies as follows:
diff --git a/src/3rdparty/libpng/png.h b/src/3rdparty/libpng/png.h
index e4cf032816..51ac8abe74 100644
--- a/src/3rdparty/libpng/png.h
+++ b/src/3rdparty/libpng/png.h
@@ -1,7 +1,7 @@
/* png.h - header file for PNG reference library
*
- * libpng version 1.6.28, January 5, 2017
+ * libpng version 1.6.32, August 24, 2017
*
* Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@@ -12,7 +12,7 @@
* Authors and maintainers:
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
* libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger
- * libpng versions 0.97, January 1998, through 1.6.28, January 5, 2017:
+ * libpng versions 0.97, January 1998, through 1.6.32, August 24, 2017:
* Glenn Randers-Pehrson.
* See also "Contributing Authors", below.
*/
@@ -25,7 +25,7 @@
*
* This code is released under the libpng license.
*
- * libpng versions 1.0.7, July 1, 2000 through 1.6.28, January 5, 2017 are
+ * libpng versions 1.0.7, July 1, 2000 through 1.6.32, August 24, 2017 are
* Copyright (c) 2000-2002, 2004, 2006-2017 Glenn Randers-Pehrson, are
* derived from libpng-1.0.6, and are distributed according to the same
* disclaimer and license as libpng-1.0.6 with the following individuals
@@ -38,6 +38,8 @@
* Gilles Vollant
* James Yu
* Mandar Sahastrabuddhe
+ * Google Inc.
+ * Vadim Barkov
*
* and with the following additions to the disclaimer:
*
@@ -211,7 +213,7 @@
* ...
* 1.5.28 15 10527 15.so.15.28[.0]
* ...
- * 1.6.28 16 10628 16.so.16.28[.0]
+ * 1.6.32 16 10632 16.so.16.32[.0]
*
* Henceforth the source version will match the shared-library major
* and minor numbers; the shared-library major version number will be
@@ -232,20 +234,20 @@
*
* See libpng.txt or libpng.3 for more information. The PNG specification
* is available as a W3C Recommendation and as an ISO Specification,
- * <http://www.w3.org/TR/2003/REC-PNG-20031110/
+ * <https://www.w3.org/TR/2003/REC-PNG-20031110/
*/
/*
* Y2K compliance in libpng:
* =========================
*
- * January 5, 2017
+ * August 24, 2017
*
* Since the PNG Development group is an ad-hoc body, we can't make
* an official declaration.
*
* This is your unofficial assurance that libpng from version 0.71 and
- * upward through 1.6.28 are Y2K compliant. It is my belief that
+ * upward through 1.6.32 are Y2K compliant. It is my belief that
* earlier versions were also Y2K compliant.
*
* Libpng only has two year fields. One is a 2-byte unsigned integer
@@ -307,8 +309,8 @@
*/
/* Version information for png.h - this should match the version in png.c */
-#define PNG_LIBPNG_VER_STRING "1.6.28"
-#define PNG_HEADER_VERSION_STRING " libpng version 1.6.28 - January 5, 2017\n"
+#define PNG_LIBPNG_VER_STRING "1.6.32"
+#define PNG_HEADER_VERSION_STRING " libpng version 1.6.32 - August 24, 2017\n"
#define PNG_LIBPNG_VER_SONUM 16
#define PNG_LIBPNG_VER_DLLNUM 16
@@ -316,7 +318,7 @@
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
#define PNG_LIBPNG_VER_MAJOR 1
#define PNG_LIBPNG_VER_MINOR 6
-#define PNG_LIBPNG_VER_RELEASE 28
+#define PNG_LIBPNG_VER_RELEASE 32
/* This should match the numeric part of the final component of
* PNG_LIBPNG_VER_STRING, omitting any leading zero:
@@ -347,7 +349,7 @@
* version 1.0.0 was mis-numbered 100 instead of 10000). From
* version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release
*/
-#define PNG_LIBPNG_VER 10628 /* 1.6.28 */
+#define PNG_LIBPNG_VER 10632 /* 1.6.32 */
/* Library configuration: these options cannot be changed after
* the library has been built.
@@ -457,7 +459,7 @@ extern "C" {
/* This triggers a compiler error in png.c, if png.c and png.h
* do not agree upon the version number.
*/
-typedef char* png_libpng_version_1_6_28;
+typedef char* png_libpng_version_1_6_32;
/* Basic control structions. Read libpng-manual.txt or libpng.3 for more info.
*
@@ -774,6 +776,7 @@ typedef png_unknown_chunk * * png_unknown_chunkpp;
#define PNG_INFO_sPLT 0x2000U /* ESR, 1.0.6 */
#define PNG_INFO_sCAL 0x4000U /* ESR, 1.0.6 */
#define PNG_INFO_IDAT 0x8000U /* ESR, 1.0.6 */
+#define PNG_INFO_eXIf 0x10000U /* GR-P, 1.6.31 */
/* This is used for the transformation routines, as some of them
* change these values for the row. It also should enable using
@@ -1786,7 +1789,8 @@ PNG_EXPORT(99, void, png_data_freer, (png_const_structrp png_ptr,
#define PNG_FREE_PLTE 0x1000U
#define PNG_FREE_TRNS 0x2000U
#define PNG_FREE_TEXT 0x4000U
-#define PNG_FREE_ALL 0x7fffU
+#define PNG_FREE_EXIF 0x8000U /* Added at libpng-1.6.31 */
+#define PNG_FREE_ALL 0xffffU
#define PNG_FREE_MUL 0x4220U /* PNG_FREE_SPLT|PNG_FREE_TEXT|PNG_FREE_UNKN */
#ifdef PNG_USER_MEM_SUPPORTED
@@ -2005,6 +2009,18 @@ PNG_FIXED_EXPORT(233, void, png_set_cHRM_XYZ_fixed, (png_const_structrp png_ptr,
png_fixed_point int_blue_Z))
#endif
+#ifdef PNG_eXIf_SUPPORTED
+PNG_EXPORT(246, png_uint_32, png_get_eXIf, (png_const_structrp png_ptr,
+ png_inforp info_ptr, png_bytep *exif));
+PNG_EXPORT(247, void, png_set_eXIf, (png_const_structrp png_ptr,
+ png_inforp info_ptr, const png_bytep exif));
+
+PNG_EXPORT(248, png_uint_32, png_get_eXIf_1, (png_const_structrp png_ptr,
+ png_const_inforp info_ptr, png_uint_32 *num_exif, png_bytep *exif));
+PNG_EXPORT(249, void, png_set_eXIf_1, (png_const_structrp png_ptr,
+ png_inforp info_ptr, const png_uint_32 num_exif, const png_bytep exif));
+#endif
+
#ifdef PNG_gAMA_SUPPORTED
PNG_FP_EXPORT(137, png_uint_32, png_get_gAMA, (png_const_structrp png_ptr,
png_const_inforp info_ptr, double *file_gamma))
@@ -2023,9 +2039,6 @@ PNG_FIXED_EXPORT(140, void, png_set_gAMA_fixed, (png_const_structrp png_ptr,
#ifdef PNG_hIST_SUPPORTED
PNG_EXPORT(141, png_uint_32, png_get_hIST, (png_const_structrp png_ptr,
png_inforp info_ptr, png_uint_16p *hist));
-#endif
-
-#ifdef PNG_hIST_SUPPORTED
PNG_EXPORT(142, void, png_set_hIST, (png_const_structrp png_ptr,
png_inforp info_ptr, png_const_uint_16p hist));
#endif
@@ -2751,7 +2764,7 @@ typedef struct
*
* When the simplified API needs to convert between sRGB and linear colorspaces,
* the actual sRGB transfer curve defined in the sRGB specification (see the
- * article at http://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2
+ * article at https://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2
* approximation used elsewhere in libpng.
*
* When an alpha channel is present it is expected to denote pixel coverage
@@ -3224,7 +3237,10 @@ PNG_EXPORT(245, int, png_image_write_to_memory, (png_imagep image, void *memory,
# define PNG_MIPS_MSA 6 /* HARDWARE: MIPS Msa SIMD instructions supported */
#endif
#define PNG_IGNORE_ADLER32 8
-#define PNG_OPTION_NEXT 10 /* Next option - numbers must be even */
+#ifdef PNG_POWERPC_VSX_API_SUPPORTED
+# define PNG_POWERPC_VSX 10 /* HARDWARE: PowerPC VSX SIMD instructions supported */
+#endif
+#define PNG_OPTION_NEXT 12 /* Next option - numbers must be even */
/* Return values: NOTE: there are four values and 'off' is *not* zero */
#define PNG_OPTION_UNSET 0 /* Unset - defaults to off */
@@ -3248,7 +3264,7 @@ PNG_EXPORT(244, int, png_set_option, (png_structrp png_ptr, int option,
* one to use is one more than this.)
*/
#ifdef PNG_EXPORT_LAST_ORDINAL
- PNG_EXPORT_LAST_ORDINAL(245);
+ PNG_EXPORT_LAST_ORDINAL(249);
#endif
#ifdef __cplusplus
diff --git a/src/3rdparty/libpng/pngconf.h b/src/3rdparty/libpng/pngconf.h
index 5e8b40bcfb..c0f15547be 100644
--- a/src/3rdparty/libpng/pngconf.h
+++ b/src/3rdparty/libpng/pngconf.h
@@ -1,7 +1,7 @@
/* pngconf.h - machine configurable file for libpng
*
- * libpng version 1.6.28, January 5, 2017
+ * libpng version 1.6.32, August 24, 2017
*
* Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
diff --git a/src/3rdparty/libpng/pngerror.c b/src/3rdparty/libpng/pngerror.c
index 00d76f7c05..ad48bfb986 100644
--- a/src/3rdparty/libpng/pngerror.c
+++ b/src/3rdparty/libpng/pngerror.c
@@ -1,8 +1,8 @@
/* pngerror.c - stub functions for i/o and memory allocation
*
- * Last changed in libpng 1.6.26 [October 20, 2016]
- * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.31 [July 27, 2017]
+ * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -163,7 +163,7 @@ png_format_number(png_const_charp start, png_charp end, int format,
case PNG_NUMBER_FORMAT_02u:
/* Expects at least 2 digits. */
mincount = 2;
- /* FALL THROUGH */
+ /* FALLTHROUGH */
case PNG_NUMBER_FORMAT_u:
*--end = digits[number % 10];
@@ -173,7 +173,7 @@ png_format_number(png_const_charp start, png_charp end, int format,
case PNG_NUMBER_FORMAT_02x:
/* This format expects at least two digits */
mincount = 2;
- /* FALL THROUGH */
+ /* FALLTHROUGH */
case PNG_NUMBER_FORMAT_x:
*--end = digits[number & 0xf];
diff --git a/src/3rdparty/libpng/pngget.c b/src/3rdparty/libpng/pngget.c
index 141c393330..26e9fb1c35 100644
--- a/src/3rdparty/libpng/pngget.c
+++ b/src/3rdparty/libpng/pngget.c
@@ -1,8 +1,8 @@
/* pngget.c - retrieval of values from info struct
*
- * Last changed in libpng 1.6.26 [October 20, 2016]
- * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.32 [August 24, 2017]
+ * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -773,6 +773,35 @@ png_get_sPLT(png_const_structrp png_ptr, png_inforp info_ptr,
}
#endif
+#ifdef PNG_eXIf_SUPPORTED
+png_uint_32 PNGAPI
+png_get_eXIf(png_const_structrp png_ptr, png_inforp info_ptr,
+ png_bytep *exif)
+{
+ png_warning(png_ptr, "png_get_eXIf does not work; use png_get_eXIf_1");
+ PNG_UNUSED(info_ptr)
+ PNG_UNUSED(exif)
+ return 0;
+}
+
+png_uint_32 PNGAPI
+png_get_eXIf_1(png_const_structrp png_ptr, png_const_inforp info_ptr,
+ png_uint_32 *num_exif, png_bytep *exif)
+{
+ png_debug1(1, "in %s retrieval function", "eXIf");
+
+ if (png_ptr != NULL && info_ptr != NULL &&
+ (info_ptr->valid & PNG_INFO_eXIf) != 0 && exif != NULL)
+ {
+ *num_exif = info_ptr->num_exif;
+ *exif = info_ptr->exif;
+ return (PNG_INFO_eXIf);
+ }
+
+ return (0);
+}
+#endif
+
#ifdef PNG_hIST_SUPPORTED
png_uint_32 PNGAPI
png_get_hIST(png_const_structrp png_ptr, png_inforp info_ptr,
diff --git a/src/3rdparty/libpng/pnginfo.h b/src/3rdparty/libpng/pnginfo.h
index 361ed8be70..d5f6149dbd 100644
--- a/src/3rdparty/libpng/pnginfo.h
+++ b/src/3rdparty/libpng/pnginfo.h
@@ -185,6 +185,14 @@ defined(PNG_READ_BACKGROUND_SUPPORTED)
png_byte phys_unit_type; /* resolution type (see PNG_RESOLUTION_ below) */
#endif
+#ifdef PNG_eXIf_SUPPORTED
+ int num_exif; /* Added at libpng-1.6.31 */
+ png_bytep exif;
+# ifdef PNG_READ_eXIf_SUPPORTED
+ png_bytep eXIf_buf; /* Added at libpng-1.6.32 */
+# endif
+#endif
+
#ifdef PNG_hIST_SUPPORTED
/* The hIST chunk contains the relative frequency or importance of the
* various palette entries, so that a viewer can intelligently select a
diff --git a/src/3rdparty/libpng/pnglibconf.h b/src/3rdparty/libpng/pnglibconf.h
index 0dba5055f7..9e45f73129 100644
--- a/src/3rdparty/libpng/pnglibconf.h
+++ b/src/3rdparty/libpng/pnglibconf.h
@@ -1,8 +1,10 @@
+/* libpng 1.6.32 STANDARD API DEFINITION */
+
/* pnglibconf.h - library build configuration */
-/* libpng version 1.6.20 - December 3, 2015 */
+/* Libpng version 1.6.32 - August 24, 2017 */
-/* Copyright (c) 1998-2014 Glenn Randers-Pehrson */
+/* Copyright (c) 1998-2017 Glenn Randers-Pehrson */
/* This code is released under the libpng license. */
/* For conditions of distribution and use, see the disclaimer */
@@ -18,6 +20,8 @@
#define PNG_ALIGNED_MEMORY_SUPPORTED
/*#undef PNG_ARM_NEON_API_SUPPORTED*/
/*#undef PNG_ARM_NEON_CHECK_SUPPORTED*/
+/*#undef PNG_POWERPC_VSX_API_SUPPORTED*/
+/*#undef PNG_POWERPC_VSX_CHECK_SUPPORTED*/
#define PNG_BENIGN_ERRORS_SUPPORTED
#define PNG_BENIGN_READ_ERRORS_SUPPORTED
/*#undef PNG_BENIGN_WRITE_ERRORS_SUPPORTED*/
@@ -25,9 +29,7 @@
#define PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED
#define PNG_COLORSPACE_SUPPORTED
#define PNG_CONSOLE_IO_SUPPORTED
-#ifndef _WIN32_WCE
#define PNG_CONVERT_tIME_SUPPORTED
-#endif
#define PNG_EASY_ACCESS_SUPPORTED
/*#undef PNG_ERROR_NUMBERS_SUPPORTED*/
#define PNG_ERROR_TEXT_SUPPORTED
@@ -82,6 +84,7 @@
#define PNG_READ_USER_TRANSFORM_SUPPORTED
#define PNG_READ_bKGD_SUPPORTED
#define PNG_READ_cHRM_SUPPORTED
+#define PNG_READ_eXIf_SUPPORTED
#define PNG_READ_gAMA_SUPPORTED
#define PNG_READ_hIST_SUPPORTED
#define PNG_READ_iCCP_SUPPORTED
@@ -101,19 +104,16 @@
#define PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED
#define PNG_SEQUENTIAL_READ_SUPPORTED
#define PNG_SETJMP_SUPPORTED
-#define PNG_SET_CHUNK_CACHE_LIMIT_SUPPORTED
-#define PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED
#define PNG_SET_OPTION_SUPPORTED
#define PNG_SET_UNKNOWN_CHUNKS_SUPPORTED
#define PNG_SET_USER_LIMITS_SUPPORTED
-#ifndef _WIN32_WCE
#define PNG_SIMPLIFIED_READ_AFIRST_SUPPORTED
#define PNG_SIMPLIFIED_READ_BGR_SUPPORTED
#define PNG_SIMPLIFIED_READ_SUPPORTED
#define PNG_SIMPLIFIED_WRITE_AFIRST_SUPPORTED
#define PNG_SIMPLIFIED_WRITE_BGR_SUPPORTED
+#define PNG_SIMPLIFIED_WRITE_STDIO_SUPPORTED
#define PNG_SIMPLIFIED_WRITE_SUPPORTED
-#endif
#define PNG_STDIO_SUPPORTED
#define PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED
#define PNG_TEXT_SUPPORTED
@@ -154,6 +154,7 @@
#define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
#define PNG_WRITE_bKGD_SUPPORTED
#define PNG_WRITE_cHRM_SUPPORTED
+#define PNG_WRITE_eXIf_SUPPORTED
#define PNG_WRITE_gAMA_SUPPORTED
#define PNG_WRITE_hIST_SUPPORTED
#define PNG_WRITE_iCCP_SUPPORTED
@@ -171,6 +172,7 @@
#define PNG_WRITE_zTXt_SUPPORTED
#define PNG_bKGD_SUPPORTED
#define PNG_cHRM_SUPPORTED
+#define PNG_eXIf_SUPPORTED
#define PNG_gAMA_SUPPORTED
#define PNG_hIST_SUPPORTED
#define PNG_iCCP_SUPPORTED
@@ -189,7 +191,6 @@
/* end of options */
/* settings */
#define PNG_API_RULE 0
-#define PNG_COST_SHIFT 3
#define PNG_DEFAULT_READ_MACROS 1
#define PNG_GAMMA_THRESHOLD_FIXED 5000
#define PNG_IDAT_READ_SIZE PNG_ZBUF_SIZE
@@ -208,7 +209,6 @@
#define PNG_USER_CHUNK_MALLOC_MAX 8000000
#define PNG_USER_HEIGHT_MAX 1000000
#define PNG_USER_WIDTH_MAX 1000000
-#define PNG_WEIGHT_SHIFT 8
#define PNG_ZBUF_SIZE 8192
#define PNG_ZLIB_VERNUM 0 /* unknown */
#define PNG_Z_DEFAULT_COMPRESSION (-1)
diff --git a/src/3rdparty/libpng/pngpread.c b/src/3rdparty/libpng/pngpread.c
index 650ba1e232..fbe361dc34 100644
--- a/src/3rdparty/libpng/pngpread.c
+++ b/src/3rdparty/libpng/pngpread.c
@@ -1,8 +1,8 @@
/* pngpread.c - read a png file in push mode
*
- * Last changed in libpng 1.6.24 [August 4, 2016]
- * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.32 [August 24, 2017]
+ * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -189,6 +189,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
png_crc_read(png_ptr, chunk_tag, 4);
png_ptr->chunk_name = PNG_CHUNK_FROM_STRING(chunk_tag);
png_check_chunk_name(png_ptr, png_ptr->chunk_name);
+ png_check_chunk_length(png_ptr, png_ptr->push_length);
png_ptr->mode |= PNG_HAVE_CHUNK_HEADER;
}
diff --git a/src/3rdparty/libpng/pngpriv.h b/src/3rdparty/libpng/pngpriv.h
index 0a12fb67bd..922fe80c29 100644
--- a/src/3rdparty/libpng/pngpriv.h
+++ b/src/3rdparty/libpng/pngpriv.h
@@ -1,8 +1,8 @@
/* pngpriv.h - private declarations for use inside libpng
*
- * Last changed in libpng 1.6.26 [October 20, 2016]
- * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.32 [August 24, 2017]
+ * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -41,7 +41,9 @@
* Windows/Visual Studio) there is no effect; the OS specific tests below are
* still required (as of 2011-05-02.)
*/
-#define _POSIX_SOURCE 1 /* Just the POSIX 1003.1 and C89 APIs */
+#ifndef _POSIX_SOURCE
+# define _POSIX_SOURCE 1 /* Just the POSIX 1003.1 and C89 APIs */
+#endif
#ifndef PNG_VERSION_INFO_ONLY
/* Standard library headers not required by png.h: */
@@ -196,6 +198,50 @@
# endif
#endif
+#ifndef PNG_POWERPC_VSX_OPT
+# if defined(__PPC64__) && defined(__ALTIVEC__) && defined(__VSX__)
+# define PNG_POWERPC_VSX_OPT 2
+# else
+# define PNG_POWERPC_VSX_OPT 0
+# endif
+#endif
+
+#ifndef PNG_INTEL_SSE_OPT
+# ifdef PNG_INTEL_SSE
+ /* Only check for SSE if the build configuration has been modified to
+ * enable SSE optimizations. This means that these optimizations will
+ * be off by default. See contrib/intel for more details.
+ */
+# if defined(__SSE4_1__) || defined(__AVX__) || defined(__SSSE3__) || \
+ defined(__SSE2__) || defined(_M_X64) || defined(_M_AMD64) || \
+ (defined(_M_IX86_FP) && _M_IX86_FP >= 2)
+# define PNG_INTEL_SSE_OPT 1
+# endif
+# endif
+#endif
+
+#if PNG_INTEL_SSE_OPT > 0
+# ifndef PNG_INTEL_SSE_IMPLEMENTATION
+# if defined(__SSE4_1__) || defined(__AVX__)
+ /* We are not actually using AVX, but checking for AVX is the best
+ way we can detect SSE4.1 and SSSE3 on MSVC.
+ */
+# define PNG_INTEL_SSE_IMPLEMENTATION 3
+# elif defined(__SSSE3__)
+# define PNG_INTEL_SSE_IMPLEMENTATION 2
+# elif defined(__SSE2__) || defined(_M_X64) || defined(_M_AMD64) || \
+ (defined(_M_IX86_FP) && _M_IX86_FP >= 2)
+# define PNG_INTEL_SSE_IMPLEMENTATION 1
+# else
+# define PNG_INTEL_SSE_IMPLEMENTATION 0
+# endif
+# endif
+
+# if PNG_INTEL_SSE_IMPLEMENTATION > 0
+# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_sse2
+# endif
+#endif
+
#if PNG_MIPS_MSA_OPT > 0
# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_msa
# ifndef PNG_MIPS_MSA_IMPLEMENTATION
@@ -216,6 +262,11 @@
# endif
#endif /* PNG_MIPS_MSA_OPT > 0 */
+#if PNG_POWERPC_VSX_OPT > 0
+# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_vsx
+# define PNG_POWERPC_VSX_IMPLEMENTATION 1
+#endif
+
/* Is this a build of a DLL where compilation of the object modules requires
* different preprocessor settings to those required for a simple library? If
@@ -414,6 +465,21 @@
# define png_fixed_error(s1,s2) png_err(s1)
#endif
+/* Some fixed point APIs are still required even if not exported because
+ * they get used by the corresponding floating point APIs. This magic
+ * deals with this:
+ */
+#ifdef PNG_FIXED_POINT_SUPPORTED
+# define PNGFAPI PNGAPI
+#else
+# define PNGFAPI /* PRIVATE */
+#endif
+
+#ifndef PNG_VERSION_INFO_ONLY
+/* Other defines specific to compilers can go here. Try to keep
+ * them inside an appropriate ifdef/endif pair for portability.
+ */
+
/* C allows up-casts from (void*) to any pointer and (const void*) to any
* pointer to a const object. C++ regards this as a type error and requires an
* explicit, static, cast and provides the static_cast<> rune to ensure that
@@ -428,25 +494,20 @@
static_cast<type>(static_cast<const void*>(value))
#else
# define png_voidcast(type, value) (value)
-# define png_constcast(type, value) ((type)(value))
+# ifdef _WIN64
+# ifdef __GNUC__
+ typedef unsigned long long png_ptruint;
+# else
+ typedef unsigned __int64 png_ptruint;
+# endif
+# else
+ typedef unsigned long png_ptruint;
+# endif
+# define png_constcast(type, value) ((type)(png_ptruint)(const void*)(value))
# define png_aligncast(type, value) ((void*)(value))
# define png_aligncastconst(type, value) ((const void*)(value))
#endif /* __cplusplus */
-/* Some fixed point APIs are still required even if not exported because
- * they get used by the corresponding floating point APIs. This magic
- * deals with this:
- */
-#ifdef PNG_FIXED_POINT_SUPPORTED
-# define PNGFAPI PNGAPI
-#else
-# define PNGFAPI /* PRIVATE */
-#endif
-
-#ifndef PNG_VERSION_INFO_ONLY
-/* Other defines specific to compilers can go here. Try to keep
- * them inside an appropriate ifdef/endif pair for portability.
- */
#if defined(PNG_FLOATING_POINT_SUPPORTED) ||\
defined(PNG_FLOATING_ARITHMETIC_SUPPORTED)
/* png.c requires the following ANSI-C constants if the conversion of
@@ -795,6 +856,7 @@
#define png_PLTE PNG_U32( 80, 76, 84, 69)
#define png_bKGD PNG_U32( 98, 75, 71, 68)
#define png_cHRM PNG_U32( 99, 72, 82, 77)
+#define png_eXIf PNG_U32(101, 88, 73, 102) /* registered July 2017 */
#define png_fRAc PNG_U32(102, 82, 65, 99) /* registered, not defined */
#define png_gAMA PNG_U32(103, 65, 77, 65)
#define png_gIFg PNG_U32(103, 73, 70, 103)
@@ -1095,6 +1157,11 @@ PNG_INTERNAL_FUNCTION(void,png_write_sRGB,(png_structrp png_ptr,
int intent),PNG_EMPTY);
#endif
+#ifdef PNG_WRITE_eXIf_SUPPORTED
+PNG_INTERNAL_FUNCTION(void,png_write_eXIf,(png_structrp png_ptr,
+ png_bytep exif, int num_exif),PNG_EMPTY);
+#endif
+
#ifdef PNG_WRITE_iCCP_SUPPORTED
PNG_INTERNAL_FUNCTION(void,png_write_iCCP,(png_structrp png_ptr,
png_const_charp name, png_const_bytep profile), PNG_EMPTY);
@@ -1270,6 +1337,38 @@ PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_msa,(png_row_infop
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
#endif
+#if PNG_POWERPC_VSX_OPT > 0
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_up_vsx,(png_row_infop row_info,
+ png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_vsx,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_vsx,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg3_vsx,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg4_vsx,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_vsx,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_vsx,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+#endif
+
+#if PNG_INTEL_SSE_IMPLEMENTATION > 0
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_sse2,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_sse2,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg3_sse2,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg4_sse2,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_sse2,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_sse2,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+#endif
+
/* Choose the best filter to use and filter the row data */
PNG_INTERNAL_FUNCTION(void,png_write_find_filter,(png_structrp png_ptr,
png_row_infop row_info),PNG_EMPTY);
@@ -1362,6 +1461,11 @@ PNG_INTERNAL_FUNCTION(void,png_handle_cHRM,(png_structrp png_ptr,
png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
#endif
+#ifdef PNG_READ_eXIf_SUPPORTED
+PNG_INTERNAL_FUNCTION(void,png_handle_eXIf,(png_structrp png_ptr,
+ png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
+#endif
+
#ifdef PNG_READ_gAMA_SUPPORTED
PNG_INTERNAL_FUNCTION(void,png_handle_gAMA,(png_structrp png_ptr,
png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
@@ -1437,8 +1541,11 @@ PNG_INTERNAL_FUNCTION(void,png_handle_zTXt,(png_structrp png_ptr,
png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
#endif
-PNG_INTERNAL_FUNCTION(void,png_check_chunk_name,(png_structrp png_ptr,
- png_uint_32 chunk_name),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_check_chunk_name,(png_const_structrp png_ptr,
+ const png_uint_32 chunk_name),PNG_EMPTY);
+
+PNG_INTERNAL_FUNCTION(void,png_check_chunk_length,(png_const_structrp png_ptr,
+ const png_uint_32 chunk_length),PNG_EMPTY);
PNG_INTERNAL_FUNCTION(void,png_handle_unknown,(png_structrp png_ptr,
png_inforp info_ptr, png_uint_32 length, int keep),PNG_EMPTY);
@@ -2005,6 +2112,11 @@ PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_neon,
PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_msa,
(png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
#endif
+
+# if PNG_INTEL_SSE_IMPLEMENTATION > 0
+PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_sse2,
+ (png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
+# endif
#endif
PNG_INTERNAL_FUNCTION(png_uint_32, png_check_keyword, (png_structrp png_ptr,
diff --git a/src/3rdparty/libpng/pngread.c b/src/3rdparty/libpng/pngread.c
index 106a80588c..e34ddd99a0 100644
--- a/src/3rdparty/libpng/pngread.c
+++ b/src/3rdparty/libpng/pngread.c
@@ -1,8 +1,8 @@
/* pngread.c - read a PNG file
*
- * Last changed in libpng 1.6.26 [October 20, 2016]
- * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.32 [August 24, 2017]
+ * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -175,6 +175,11 @@ png_read_info(png_structrp png_ptr, png_inforp info_ptr)
png_handle_cHRM(png_ptr, info_ptr, length);
#endif
+#ifdef PNG_READ_eXIf_SUPPORTED
+ else if (chunk_name == png_eXIf)
+ png_handle_eXIf(png_ptr, info_ptr, length);
+#endif
+
#ifdef PNG_READ_gAMA_SUPPORTED
else if (chunk_name == png_gAMA)
png_handle_gAMA(png_ptr, info_ptr, length);
@@ -534,6 +539,7 @@ png_read_row(png_structrp png_ptr, png_bytep row, png_bytep dsp_row)
png_error(png_ptr, "Invalid attempt to read row data");
/* Fill the row with IDAT data: */
+ png_ptr->row_buf[0]=255; /* to force error if no data was found */
png_read_IDAT_data(png_ptr, png_ptr->row_buf, row_info.rowbytes + 1);
if (png_ptr->row_buf[0] > PNG_FILTER_VALUE_NONE)
@@ -842,6 +848,11 @@ png_read_end(png_structrp png_ptr, png_inforp info_ptr)
png_handle_cHRM(png_ptr, info_ptr, length);
#endif
+#ifdef PNG_READ_eXIf_SUPPORTED
+ else if (chunk_name == png_eXIf)
+ png_handle_eXIf(png_ptr, info_ptr, length);
+#endif
+
#ifdef PNG_READ_gAMA_SUPPORTED
else if (chunk_name == png_gAMA)
png_handle_gAMA(png_ptr, info_ptr, length);
@@ -1883,7 +1894,7 @@ png_create_colormap_entry(png_image_read_control *display,
{
case 4:
entry[afirst ? 0 : 3] = (png_uint_16)alpha;
- /* FALL THROUGH */
+ /* FALLTHROUGH */
case 3:
if (alpha < 65535)
@@ -1905,7 +1916,7 @@ png_create_colormap_entry(png_image_read_control *display,
case 2:
entry[1 ^ afirst] = (png_uint_16)alpha;
- /* FALL THROUGH */
+ /* FALLTHROUGH */
case 1:
if (alpha < 65535)
@@ -1934,6 +1945,7 @@ png_create_colormap_entry(png_image_read_control *display,
{
case 4:
entry[afirst ? 0 : 3] = (png_byte)alpha;
+ /* FALLTHROUGH */
case 3:
entry[afirst + (2 ^ bgr)] = (png_byte)blue;
entry[afirst + 1] = (png_byte)green;
@@ -1942,6 +1954,7 @@ png_create_colormap_entry(png_image_read_control *display,
case 2:
entry[1 ^ afirst] = (png_byte)alpha;
+ /* FALLTHROUGH */
case 1:
entry[afirst] = (png_byte)green;
break;
@@ -2861,7 +2874,7 @@ png_image_read_colormap(png_voidp argument)
case P_sRGB:
/* Change to 8-bit sRGB */
png_set_alpha_mode_fixed(png_ptr, PNG_ALPHA_PNG, PNG_GAMMA_sRGB);
- /* FALL THROUGH */
+ /* FALLTHROUGH */
case P_FILE:
if (png_ptr->bit_depth > 8)
@@ -3179,8 +3192,7 @@ png_image_read_colormapped(png_voidp argument)
image->colormap_entries == 244 /* 216 + 1 + 27 */)
break;
- /* goto bad_output; */
- /* FALL THROUGH */
+ goto bad_output;
default:
bad_output:
diff --git a/src/3rdparty/libpng/pngrtran.c b/src/3rdparty/libpng/pngrtran.c
index 0b4f4f9068..9a30ddf22b 100644
--- a/src/3rdparty/libpng/pngrtran.c
+++ b/src/3rdparty/libpng/pngrtran.c
@@ -1,8 +1,8 @@
/* pngrtran.c - transforms the data in a row for PNG readers
*
- * Last changed in libpng 1.6.24 [August 4, 2016]
- * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.31 [July 27, 2017]
+ * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -49,6 +49,7 @@ png_set_crc_action(png_structrp png_ptr, int crit_action, int ancil_action)
case PNG_CRC_WARN_DISCARD: /* Not a valid action for critical data */
png_warning(png_ptr,
"Can't discard critical data on CRC error");
+ /* FALLTHROUGH */
case PNG_CRC_ERROR_QUIT: /* Error/quit */
case PNG_CRC_DEFAULT:
@@ -1253,7 +1254,7 @@ png_init_rgb_transformations(png_structrp png_ptr)
default:
case 8:
- /* FALL THROUGH (Already 8 bits) */
+ /* FALLTHROUGH */ /* (Already 8 bits) */
case 16:
/* Already a full 16 bits */
@@ -2934,7 +2935,7 @@ png_do_gray_to_rgb(png_row_infop row_info, png_bytep row)
* using the equation given in Poynton's ColorFAQ of 1998-01-04 at
* <http://www.inforamp.net/~poynton/> (THIS LINK IS DEAD June 2008 but
* versions dated 1998 through November 2002 have been archived at
- * http://web.archive.org/web/20000816232553/http://www.inforamp.net/
+ * https://web.archive.org/web/20000816232553/www.inforamp.net/
* ~poynton/notes/colour_and_gamma/ColorFAQ.txt )
* Charles Poynton poynton at poynton.com
*
@@ -4302,7 +4303,7 @@ png_do_expand_palette(png_row_infop row_info, png_bytep row,
if (num_trans > 0)
{
sp = row + (png_size_t)row_width - 1;
- dp = row + (png_size_t)(row_width << 2) - 1;
+ dp = row + ((png_size_t)row_width << 2) - 1;
for (i = 0; i < row_width; i++)
{
@@ -4463,7 +4464,7 @@ png_do_expand(png_row_infop row_info, png_bytep row,
{
gray = gray & 0xff;
sp = row + (png_size_t)row_width - 1;
- dp = row + (png_size_t)(row_width << 1) - 1;
+ dp = row + ((png_size_t)row_width << 1) - 1;
for (i = 0; i < row_width; i++)
{
@@ -4519,7 +4520,7 @@ png_do_expand(png_row_infop row_info, png_bytep row,
png_byte green = (png_byte)(trans_color->green & 0xff);
png_byte blue = (png_byte)(trans_color->blue & 0xff);
sp = row + (png_size_t)row_info->rowbytes - 1;
- dp = row + (png_size_t)(row_width << 2) - 1;
+ dp = row + ((png_size_t)row_width << 2) - 1;
for (i = 0; i < row_width; i++)
{
if (*(sp - 2) == red && *(sp - 1) == green && *(sp) == blue)
@@ -4542,7 +4543,7 @@ png_do_expand(png_row_infop row_info, png_bytep row,
png_byte green_low = (png_byte)(trans_color->green & 0xff);
png_byte blue_low = (png_byte)(trans_color->blue & 0xff);
sp = row + row_info->rowbytes - 1;
- dp = row + (png_size_t)(row_width << 3) - 1;
+ dp = row + ((png_size_t)row_width << 3) - 1;
for (i = 0; i < row_width; i++)
{
if (*(sp - 5) == red_high &&
@@ -4601,7 +4602,9 @@ png_do_expand_16(png_row_infop row_info, png_bytep row)
png_byte *sp = row + row_info->rowbytes; /* source, last byte + 1 */
png_byte *dp = sp + row_info->rowbytes; /* destination, end + 1 */
while (dp > sp)
- dp[-2] = dp[-1] = *--sp, dp -= 2;
+ {
+ dp[-2] = dp[-1] = *--sp; dp -= 2;
+ }
row_info->rowbytes *= 2;
row_info->bit_depth = 16;
diff --git a/src/3rdparty/libpng/pngrutil.c b/src/3rdparty/libpng/pngrutil.c
index bee0ea1158..a4fa71457b 100644
--- a/src/3rdparty/libpng/pngrutil.c
+++ b/src/3rdparty/libpng/pngrutil.c
@@ -1,8 +1,8 @@
/* pngrutil.c - utilities to read a PNG file
*
- * Last changed in libpng 1.6.27 [January 5, 2017]
- * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.32 [August 24, 2017]
+ * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -181,6 +181,9 @@ png_read_chunk_header(png_structrp png_ptr)
/* Check to see if chunk name is valid. */
png_check_chunk_name(png_ptr, png_ptr->chunk_name);
+ /* Check for too-large chunk length */
+ png_check_chunk_length(png_ptr, length);
+
#ifdef PNG_IO_STATE_SUPPORTED
png_ptr->io_state = PNG_IO_READING | PNG_IO_CHUNK_DATA;
#endif
@@ -418,7 +421,7 @@ png_inflate_claim(png_structrp png_ptr, png_uint_32 owner)
png_ptr->flags |= PNG_FLAG_ZSTREAM_INITIALIZED;
}
-#if ZLIB_VERNUM >= 0x1281 && \
+#if ZLIB_VERNUM >= 0x1290 && \
defined(PNG_SET_OPTION_SUPPORTED) && defined(PNG_IGNORE_ADLER32)
if (((png_ptr->options >> PNG_IGNORE_ADLER32) & 3) == PNG_OPTION_ON)
/* Turn off validation of the ADLER32 checksum in IDAT chunks */
@@ -1377,11 +1380,13 @@ png_handle_iCCP(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
* chunk is just ignored, so does not invalidate the color space. An
* alternative is to set the 'invalid' flags at the start of this routine
* and only clear them in they were not set before and all the tests pass.
- * The minimum 'deflate' stream is assumed to be just the 2 byte header and
- * 4 byte checksum. The keyword must be at least one character and there is
- * a terminator (0) byte and the compression method.
*/
- if (length < 9)
+
+ /* The keyword must be at least one character and there is a
+ * terminator (0) byte and the compression method byte, and the
+ * 'zlib' datastream is at least 11 bytes.
+ */
+ if (length < 14)
{
png_crc_finish(png_ptr, length);
png_chunk_benign_error(png_ptr, "too short");
@@ -1413,6 +1418,16 @@ png_handle_iCCP(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
png_crc_read(png_ptr, (png_bytep)keyword, read_length);
length -= read_length;
+ /* The minimum 'zlib' stream is assumed to be just the 2 byte header,
+ * 5 bytes minimum 'deflate' stream, and the 4 byte checksum.
+ */
+ if (length < 11)
+ {
+ png_crc_finish(png_ptr, length);
+ png_chunk_benign_error(png_ptr, "too short");
+ return;
+ }
+
keyword_length = 0;
while (keyword_length < 80 && keyword_length < read_length &&
keyword[keyword_length] != 0)
@@ -1431,7 +1446,7 @@ png_handle_iCCP(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
if (png_inflate_claim(png_ptr, png_iCCP) == Z_OK)
{
- Byte profile_header[132];
+ Byte profile_header[132]={0};
Byte local_buffer[PNG_INFLATE_BUF_SIZE];
png_alloc_size_t size = (sizeof profile_header);
@@ -2009,6 +2024,69 @@ png_handle_bKGD(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
}
#endif
+#ifdef PNG_READ_eXIf_SUPPORTED
+void /* PRIVATE */
+png_handle_eXIf(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
+{
+ unsigned int i;
+
+ png_debug(1, "in png_handle_eXIf");
+
+ if ((png_ptr->mode & PNG_HAVE_IHDR) == 0)
+ png_chunk_error(png_ptr, "missing IHDR");
+
+ if (length < 2)
+ {
+ png_crc_finish(png_ptr, length);
+ png_chunk_benign_error(png_ptr, "too short");
+ return;
+ }
+
+ else if (info_ptr == NULL || (info_ptr->valid & PNG_INFO_eXIf) != 0)
+ {
+ png_crc_finish(png_ptr, length);
+ png_chunk_benign_error(png_ptr, "duplicate");
+ return;
+ }
+
+ info_ptr->free_me |= PNG_FREE_EXIF;
+
+ info_ptr->eXIf_buf = png_voidcast(png_bytep,
+ png_malloc_warn(png_ptr, length));
+
+ if (info_ptr->eXIf_buf == NULL)
+ {
+ png_crc_finish(png_ptr, length);
+ png_chunk_benign_error(png_ptr, "out of memory");
+ return;
+ }
+
+ for (i = 0; i < length; i++)
+ {
+ png_byte buf[1];
+ png_crc_read(png_ptr, buf, 1);
+ info_ptr->eXIf_buf[i] = buf[0];
+ if (i == 1 && buf[0] != 'M' && buf[0] != 'I'
+ && info_ptr->eXIf_buf[0] != buf[0])
+ {
+ png_crc_finish(png_ptr, length);
+ png_chunk_benign_error(png_ptr, "incorrect byte-order specifier");
+ png_free(png_ptr, info_ptr->eXIf_buf);
+ info_ptr->eXIf_buf = NULL;
+ return;
+ }
+ }
+
+ if (png_crc_finish(png_ptr, 0) != 0)
+ return;
+
+ png_set_eXIf_1(png_ptr, info_ptr, length, info_ptr->eXIf_buf);
+
+ png_free(png_ptr, info_ptr->eXIf_buf);
+ info_ptr->eXIf_buf = NULL;
+}
+#endif
+
#ifdef PNG_READ_hIST_SUPPORTED
void /* PRIVATE */
png_handle_hIST(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
@@ -2537,6 +2615,9 @@ png_handle_zTXt(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
if ((png_ptr->mode & PNG_HAVE_IDAT) != 0)
png_ptr->mode |= PNG_AFTER_IDAT;
+ /* Note, "length" is sufficient here; we won't be adding
+ * a null terminator later.
+ */
buffer = png_read_buffer(png_ptr, length, 2/*silent*/);
if (buffer == NULL)
@@ -2583,23 +2664,28 @@ png_handle_zTXt(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
{
png_text text;
- /* It worked; png_ptr->read_buffer now looks like a tEXt chunk except
- * for the extra compression type byte and the fact that it isn't
- * necessarily '\0' terminated.
- */
- buffer = png_ptr->read_buffer;
- buffer[uncompressed_length+(keyword_length+2)] = 0;
-
- text.compression = PNG_TEXT_COMPRESSION_zTXt;
- text.key = (png_charp)buffer;
- text.text = (png_charp)(buffer + keyword_length+2);
- text.text_length = uncompressed_length;
- text.itxt_length = 0;
- text.lang = NULL;
- text.lang_key = NULL;
-
- if (png_set_text_2(png_ptr, info_ptr, &text, 1) != 0)
- errmsg = "insufficient memory";
+ if (png_ptr->read_buffer == NULL)
+ errmsg="Read failure in png_handle_zTXt";
+ else
+ {
+ /* It worked; png_ptr->read_buffer now looks like a tEXt chunk
+ * except for the extra compression type byte and the fact that
+ * it isn't necessarily '\0' terminated.
+ */
+ buffer = png_ptr->read_buffer;
+ buffer[uncompressed_length+(keyword_length+2)] = 0;
+
+ text.compression = PNG_TEXT_COMPRESSION_zTXt;
+ text.key = (png_charp)buffer;
+ text.text = (png_charp)(buffer + keyword_length+2);
+ text.text_length = uncompressed_length;
+ text.itxt_length = 0;
+ text.lang = NULL;
+ text.lang_key = NULL;
+
+ if (png_set_text_2(png_ptr, info_ptr, &text, 1) != 0)
+ errmsg = "insufficient memory";
+ }
}
else
@@ -2975,7 +3061,7 @@ png_handle_unknown(png_structrp png_ptr, png_inforp info_ptr,
case 2:
png_ptr->user_chunk_cache_max = 1;
png_chunk_benign_error(png_ptr, "no space in chunk cache");
- /* FALL THROUGH */
+ /* FALLTHROUGH */
case 1:
/* NOTE: prior to 1.6.0 this case resulted in an unknown critical
* chunk being skipped, now there will be a hard error below.
@@ -2984,7 +3070,7 @@ png_handle_unknown(png_structrp png_ptr, png_inforp info_ptr,
default: /* not at limit */
--(png_ptr->user_chunk_cache_max);
- /* FALL THROUGH */
+ /* FALLTHROUGH */
case 0: /* no limit */
# endif /* USER_LIMITS */
/* Here when the limit isn't reached or when limits are compiled
@@ -3035,20 +3121,58 @@ png_handle_unknown(png_structrp png_ptr, png_inforp info_ptr,
*/
void /* PRIVATE */
-png_check_chunk_name(png_structrp png_ptr, png_uint_32 chunk_name)
+png_check_chunk_name(png_const_structrp png_ptr, const png_uint_32 chunk_name)
{
int i;
+ png_uint_32 cn=chunk_name;
png_debug(1, "in png_check_chunk_name");
for (i=1; i<=4; ++i)
{
- int c = chunk_name & 0xff;
+ int c = cn & 0xff;
if (c < 65 || c > 122 || (c > 90 && c < 97))
png_chunk_error(png_ptr, "invalid chunk type");
- chunk_name >>= 8;
+ cn >>= 8;
+ }
+}
+
+void /* PRIVATE */
+png_check_chunk_length(png_const_structrp png_ptr, const png_uint_32 length)
+{
+ png_alloc_size_t limit = PNG_UINT_31_MAX;
+
+ if (png_ptr->chunk_name != png_IDAT)
+ {
+# ifdef PNG_SET_USER_LIMITS_SUPPORTED
+ if (png_ptr->user_chunk_malloc_max > 0 &&
+ png_ptr->user_chunk_malloc_max < limit)
+ limit = png_ptr->user_chunk_malloc_max;
+# elif PNG_USER_CHUNK_MALLOC_MAX > 0
+ if (PNG_USER_CHUNK_MALLOC_MAX < limit)
+ limit = PNG_USER_CHUNK_MALLOC_MAX;
+# endif
+ }
+ else
+ {
+ size_t row_factor =
+ (png_ptr->width * png_ptr->channels * (png_ptr->bit_depth > 8? 2: 1)
+ + 1 + (png_ptr->interlaced? 6: 0));
+ if (png_ptr->height > PNG_UINT_32_MAX/row_factor)
+ limit=PNG_UINT_31_MAX;
+ else
+ limit = png_ptr->height * row_factor;
+ limit += 6 + 5*(limit/32566+1); /* zlib+deflate overhead */
+ limit=limit < PNG_UINT_31_MAX? limit : PNG_UINT_31_MAX;
+ }
+
+ if (length > limit)
+ {
+ png_debug2(0," length = %lu, limit = %lu",
+ (unsigned long)length,(unsigned long)limit);
+ png_chunk_error(png_ptr, "chunk data is too large");
}
}
@@ -3377,7 +3501,7 @@ png_combine_row(png_const_structrp png_ptr, png_bytep dp, int display)
*/
do
{
- dp[0] = sp[0], dp[1] = sp[1];
+ dp[0] = sp[0]; dp[1] = sp[1];
if (row_width <= bytes_to_jump)
return;
@@ -3398,7 +3522,7 @@ png_combine_row(png_const_structrp png_ptr, png_bytep dp, int display)
*/
for (;;)
{
- dp[0] = sp[0], dp[1] = sp[1], dp[2] = sp[2];
+ dp[0] = sp[0]; dp[1] = sp[1]; dp[2] = sp[2];
if (row_width <= bytes_to_jump)
return;
@@ -3887,7 +4011,10 @@ png_read_filter_row_paeth_1byte_pixel(png_row_infop row_info, png_bytep row,
/* Find the best predictor, the least of pa, pb, pc favoring the earlier
* ones in the case of a tie.
*/
- if (pb < pa) pa = pb, a = b;
+ if (pb < pa)
+ {
+ pa = pb; a = b;
+ }
if (pc < pa) a = c;
/* Calculate the current pixel in a, and move the previous row pixel to c
@@ -3939,7 +4066,10 @@ png_read_filter_row_paeth_multibyte_pixel(png_row_infop row_info, png_bytep row,
pc = (p + pc) < 0 ? -(p + pc) : p + pc;
#endif
- if (pb < pa) pa = pb, a = b;
+ if (pb < pa)
+ {
+ pa = pb; a = b;
+ }
if (pc < pa) a = c;
a += *row;
diff --git a/src/3rdparty/libpng/pngset.c b/src/3rdparty/libpng/pngset.c
index 28ff3a064d..6f3a1ee11e 100644
--- a/src/3rdparty/libpng/pngset.c
+++ b/src/3rdparty/libpng/pngset.c
@@ -1,8 +1,8 @@
/* pngset.c - storage of image information into info struct
*
- * Last changed in libpng 1.6.26 [October 20, 2016]
- * Copyright (c) 1998-2016 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.32 [August 24, 2017]
+ * Copyright (c) 1998-2017 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -134,6 +134,53 @@ png_set_cHRM_XYZ(png_const_structrp png_ptr, png_inforp info_ptr, double red_X,
#endif /* cHRM */
+#ifdef PNG_eXIf_SUPPORTED
+void PNGAPI
+png_set_eXIf(png_const_structrp png_ptr, png_inforp info_ptr,
+ const png_bytep eXIf_buf)
+{
+ png_warning(png_ptr, "png_set_eXIf does not work; use png_set_eXIf_1");
+ PNG_UNUSED(info_ptr)
+ PNG_UNUSED(eXIf_buf)
+}
+
+void PNGAPI
+png_set_eXIf_1(png_const_structrp png_ptr, png_inforp info_ptr,
+ const png_uint_32 num_exif, const png_bytep eXIf_buf)
+{
+ int i;
+
+ png_debug1(1, "in %s storage function", "eXIf");
+
+ if (png_ptr == NULL || info_ptr == NULL)
+ return;
+
+ if (info_ptr->exif)
+ {
+ png_free(png_ptr, info_ptr->exif);
+ info_ptr->exif = NULL;
+ }
+
+ info_ptr->num_exif = num_exif;
+
+ info_ptr->exif = png_voidcast(png_bytep, png_malloc_warn(png_ptr,
+ info_ptr->num_exif));
+
+ if (info_ptr->exif == NULL)
+ {
+ png_warning(png_ptr, "Insufficient memory for eXIf chunk data");
+ return;
+ }
+
+ info_ptr->free_me |= PNG_FREE_EXIF;
+
+ for (i = 0; i < (int) info_ptr->num_exif; i++)
+ info_ptr->exif[i] = eXIf_buf[i];
+
+ info_ptr->valid |= PNG_INFO_eXIf;
+}
+#endif /* eXIf */
+
#ifdef PNG_gAMA_SUPPORTED
void PNGFAPI
png_set_gAMA_fixed(png_const_structrp png_ptr, png_inforp info_ptr,
@@ -1102,8 +1149,9 @@ png_set_sPLT(png_const_structrp png_ptr,
info_ptr->valid |= PNG_INFO_sPLT;
++(info_ptr->splt_palettes_num);
++np;
+ ++entries;
}
- while (++entries, --nentries);
+ while (--nentries);
if (nentries > 0)
png_chunk_report(png_ptr, "sPLT out of memory", PNG_CHUNK_WRITE_ERROR);
@@ -1354,6 +1402,7 @@ png_set_keep_unknown_chunks(png_structrp png_ptr, int keep,
static PNG_CONST png_byte chunks_to_ignore[] = {
98, 75, 71, 68, '\0', /* bKGD */
99, 72, 82, 77, '\0', /* cHRM */
+ 101, 88, 73, 102, '\0', /* eXIf */
103, 65, 77, 65, '\0', /* gAMA */
104, 73, 83, 84, '\0', /* hIST */
105, 67, 67, 80, '\0', /* iCCP */
@@ -1696,14 +1745,16 @@ png_check_keyword(png_structrp png_ptr, png_const_charp key, png_bytep new_key)
png_byte ch = (png_byte)*key++;
if ((ch > 32 && ch <= 126) || (ch >= 161 /*&& ch <= 255*/))
- *new_key++ = ch, ++key_len, space = 0;
+ {
+ *new_key++ = ch; ++key_len; space = 0;
+ }
else if (space == 0)
{
/* A space or an invalid character when one wasn't seen immediately
* before; output just a space.
*/
- *new_key++ = 32, ++key_len, space = 1;
+ *new_key++ = 32; ++key_len; space = 1;
/* If the character was not a space then it is invalid. */
if (ch != 32)
@@ -1716,7 +1767,7 @@ png_check_keyword(png_structrp png_ptr, png_const_charp key, png_bytep new_key)
if (key_len > 0 && space != 0) /* trailing space */
{
- --key_len, --new_key;
+ --key_len; --new_key;
if (bad_character == 0)
bad_character = 32;
}
diff --git a/src/3rdparty/libpng/pngstruct.h b/src/3rdparty/libpng/pngstruct.h
index 749d7e35b1..d83f971253 100644
--- a/src/3rdparty/libpng/pngstruct.h
+++ b/src/3rdparty/libpng/pngstruct.h
@@ -1,7 +1,7 @@
/* pngstruct.h - header file for PNG reference library
*
- * Last changed in libpng 1.6.28 [January 5, 2017]
+ * Last changed in libpng 1.6.32 [August 24, 2017]
* Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
diff --git a/src/3rdparty/libpng/pngtrans.c b/src/3rdparty/libpng/pngtrans.c
index da7413fb80..326ac33f0e 100644
--- a/src/3rdparty/libpng/pngtrans.c
+++ b/src/3rdparty/libpng/pngtrans.c
@@ -1,8 +1,8 @@
/* pngtrans.c - transforms the data in a row (used by both readers and writers)
*
- * Last changed in libpng 1.6.26 [October 20, 2016]
- * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.30 [June 28, 2017]
+ * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -514,11 +514,15 @@ png_do_strip_channel(png_row_infop row_info, png_bytep row, int at_start)
if (at_start != 0) /* Skip initial filler */
++sp;
else /* Skip initial channel and, for sp, the filler */
- sp += 2, ++dp;
+ {
+ sp += 2; ++dp;
+ }
/* For a 1 pixel wide image there is nothing to do */
while (sp < ep)
- *dp++ = *sp, sp += 2;
+ {
+ *dp++ = *sp; sp += 2;
+ }
row_info->pixel_depth = 8;
}
@@ -528,10 +532,14 @@ png_do_strip_channel(png_row_infop row_info, png_bytep row, int at_start)
if (at_start != 0) /* Skip initial filler */
sp += 2;
else /* Skip initial channel and, for sp, the filler */
- sp += 4, dp += 2;
+ {
+ sp += 4; dp += 2;
+ }
while (sp < ep)
- *dp++ = *sp++, *dp++ = *sp, sp += 3;
+ {
+ *dp++ = *sp++; *dp++ = *sp; sp += 3;
+ }
row_info->pixel_depth = 16;
}
@@ -554,11 +562,15 @@ png_do_strip_channel(png_row_infop row_info, png_bytep row, int at_start)
if (at_start != 0) /* Skip initial filler */
++sp;
else /* Skip initial channels and, for sp, the filler */
- sp += 4, dp += 3;
+ {
+ sp += 4; dp += 3;
+ }
/* Note that the loop adds 3 to dp and 4 to sp each time. */
while (sp < ep)
- *dp++ = *sp++, *dp++ = *sp++, *dp++ = *sp, sp += 2;
+ {
+ *dp++ = *sp++; *dp++ = *sp++; *dp++ = *sp; sp += 2;
+ }
row_info->pixel_depth = 24;
}
@@ -568,14 +580,16 @@ png_do_strip_channel(png_row_infop row_info, png_bytep row, int at_start)
if (at_start != 0) /* Skip initial filler */
sp += 2;
else /* Skip initial channels and, for sp, the filler */
- sp += 8, dp += 6;
+ {
+ sp += 8; dp += 6;
+ }
while (sp < ep)
{
/* Copy 6 bytes, skip 2 */
- *dp++ = *sp++, *dp++ = *sp++;
- *dp++ = *sp++, *dp++ = *sp++;
- *dp++ = *sp++, *dp++ = *sp, sp += 3;
+ *dp++ = *sp++; *dp++ = *sp++;
+ *dp++ = *sp++; *dp++ = *sp++;
+ *dp++ = *sp++; *dp++ = *sp; sp += 3;
}
row_info->pixel_depth = 48;
diff --git a/src/3rdparty/libpng/pngwrite.c b/src/3rdparty/libpng/pngwrite.c
index 07088ee75e..a7662acb71 100644
--- a/src/3rdparty/libpng/pngwrite.c
+++ b/src/3rdparty/libpng/pngwrite.c
@@ -1,8 +1,8 @@
/* pngwrite.c - general routines to write a PNG file
*
- * Last changed in libpng 1.6.26 [October 20, 2016]
- * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.32 [August 24, 2017]
+ * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -237,6 +237,11 @@ png_write_info(png_structrp png_ptr, png_const_inforp info_ptr)
png_write_bKGD(png_ptr, &(info_ptr->background), info_ptr->color_type);
#endif
+#ifdef PNG_WRITE_eXIf_SUPPORTED
+ if ((info_ptr->valid & PNG_INFO_eXIf) != 0)
+ png_write_eXIf(png_ptr, info_ptr->exif, info_ptr->num_exif);
+#endif
+
#ifdef PNG_WRITE_hIST_SUPPORTED
if ((info_ptr->valid & PNG_INFO_hIST) != 0)
png_write_hIST(png_ptr, info_ptr->hist, info_ptr->num_palette);
@@ -432,6 +437,12 @@ png_write_end(png_structrp png_ptr, png_inforp info_ptr)
}
}
#endif
+
+#ifdef PNG_WRITE_eXIf_SUPPORTED
+ if ((info_ptr->valid & PNG_INFO_eXIf) != 0)
+ png_write_eXIf(png_ptr, info_ptr->exif, info_ptr->num_exif);
+#endif
+
#ifdef PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED
write_unknown_chunks(png_ptr, info_ptr, PNG_AFTER_IDAT);
#endif
@@ -1007,8 +1018,8 @@ png_set_filter(png_structrp png_ptr, int method, int filters)
case 5:
case 6:
case 7: png_app_error(png_ptr, "Unknown row filter for method 0");
- /* FALL THROUGH */
#endif /* WRITE_FILTER */
+ /* FALLTHROUGH */
case PNG_FILTER_VALUE_NONE:
png_ptr->do_filter = PNG_FILTER_NONE; break;
@@ -1875,7 +1886,7 @@ png_image_set_PLTE(png_image_write_control *display)
tRNS[i] = entry[afirst ? 0 : 3];
if (tRNS[i] < 255)
num_trans = i+1;
- /* FALL THROUGH */
+ /* FALLTHROUGH */
case 3:
palette[i].blue = entry[afirst + (2 ^ bgr)];
palette[i].green = entry[afirst + 1];
@@ -1886,7 +1897,7 @@ png_image_set_PLTE(png_image_write_control *display)
tRNS[i] = entry[1 ^ afirst];
if (tRNS[i] < 255)
num_trans = i+1;
- /* FALL THROUGH */
+ /* FALLTHROUGH */
case 1:
palette[i].blue = palette[i].red = palette[i].green =
entry[afirst];
diff --git a/src/3rdparty/libpng/pngwutil.c b/src/3rdparty/libpng/pngwutil.c
index d1a82d45e1..0d4fb1336c 100644
--- a/src/3rdparty/libpng/pngwutil.c
+++ b/src/3rdparty/libpng/pngwutil.c
@@ -1,8 +1,8 @@
/* pngwutil.c - utilities to write a PNG file
*
- * Last changed in libpng 1.6.26 [October 20, 2016]
- * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.32 [August 24, 2017]
+ * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -675,6 +675,7 @@ png_write_IHDR(png_structrp png_ptr, png_uint_32 width, png_uint_32 height,
int interlace_type)
{
png_byte buf[13]; /* Buffer to store the IHDR info */
+ int is_invalid_depth;
png_debug(1, "in png_write_IHDR");
@@ -700,11 +701,11 @@ png_write_IHDR(png_structrp png_ptr, png_uint_32 width, png_uint_32 height,
break;
case PNG_COLOR_TYPE_RGB:
+ is_invalid_depth = (bit_depth != 8);
#ifdef PNG_WRITE_16BIT_SUPPORTED
- if (bit_depth != 8 && bit_depth != 16)
-#else
- if (bit_depth != 8)
+ is_invalid_depth = (is_invalid_depth && bit_depth != 16);
#endif
+ if (is_invalid_depth)
png_error(png_ptr, "Invalid bit depth for RGB image");
png_ptr->channels = 3;
@@ -726,18 +727,22 @@ png_write_IHDR(png_structrp png_ptr, png_uint_32 width, png_uint_32 height,
break;
case PNG_COLOR_TYPE_GRAY_ALPHA:
- if (bit_depth != 8 && bit_depth != 16)
+ is_invalid_depth = (bit_depth != 8);
+#ifdef PNG_WRITE_16BIT_SUPPORTED
+ is_invalid_depth = (is_invalid_depth && bit_depth != 16);
+#endif
+ if (is_invalid_depth)
png_error(png_ptr, "Invalid bit depth for grayscale+alpha image");
png_ptr->channels = 2;
break;
case PNG_COLOR_TYPE_RGB_ALPHA:
+ is_invalid_depth = (bit_depth != 8);
#ifdef PNG_WRITE_16BIT_SUPPORTED
- if (bit_depth != 8 && bit_depth != 16)
-#else
- if (bit_depth != 8)
+ is_invalid_depth = (is_invalid_depth && bit_depth != 16);
#endif
+ if (is_invalid_depth)
png_error(png_ptr, "Invalid bit depth for RGBA image");
png_ptr->channels = 4;
@@ -998,7 +1003,8 @@ png_compress_IDAT(png_structrp png_ptr, png_const_bytep input,
optimize_cmf(data, png_image_size(png_ptr));
#endif
- png_write_complete_chunk(png_ptr, png_IDAT, data, size);
+ if (size > 0)
+ png_write_complete_chunk(png_ptr, png_IDAT, data, size);
png_ptr->mode |= PNG_HAVE_IDAT;
png_ptr->zstream.next_out = data;
@@ -1044,7 +1050,8 @@ png_compress_IDAT(png_structrp png_ptr, png_const_bytep input,
optimize_cmf(data, png_image_size(png_ptr));
#endif
- png_write_complete_chunk(png_ptr, png_IDAT, data, size);
+ if (size > 0)
+ png_write_complete_chunk(png_ptr, png_IDAT, data, size);
png_ptr->zstream.avail_out = 0;
png_ptr->zstream.next_out = NULL;
png_ptr->mode |= PNG_HAVE_IDAT | PNG_AFTER_IDAT;
@@ -1466,6 +1473,28 @@ png_write_bKGD(png_structrp png_ptr, png_const_color_16p back, int color_type)
}
#endif
+#ifdef PNG_WRITE_eXIf_SUPPORTED
+/* Write the Exif data */
+void /* PRIVATE */
+png_write_eXIf(png_structrp png_ptr, png_bytep exif, int num_exif)
+{
+ int i;
+ png_byte buf[1];
+
+ png_debug(1, "in png_write_eXIf");
+
+ png_write_chunk_header(png_ptr, png_eXIf, (png_uint_32)(num_exif));
+
+ for (i = 0; i < num_exif; i++)
+ {
+ buf[0] = exif[i];
+ png_write_chunk_data(png_ptr, buf, (png_size_t)1);
+ }
+
+ png_write_chunk_end(png_ptr);
+}
+#endif
+
#ifdef PNG_WRITE_hIST_SUPPORTED
/* Write the histogram */
void /* PRIVATE */
diff --git a/src/3rdparty/libpng/qt_attribution.json b/src/3rdparty/libpng/qt_attribution.json
index 5affffd298..7b2d776978 100644
--- a/src/3rdparty/libpng/qt_attribution.json
+++ b/src/3rdparty/libpng/qt_attribution.json
@@ -6,7 +6,7 @@
"Description": "libpng is the official PNG reference library.",
"Homepage": "http://www.libpng.org/pub/png/libpng.html",
- "Version": "1.6.28",
+ "Version": "1.6.32",
"License": "libpng License",
"LicenseId": "Libpng",
"LicenseFile": "LICENSE",
diff --git a/src/angle/src/common/common.pri b/src/angle/src/common/common.pri
index 7305362d86..c1fad14951 100644
--- a/src/angle/src/common/common.pri
+++ b/src/angle/src/common/common.pri
@@ -12,7 +12,7 @@ INCLUDEPATH += \
$$ANGLE_DIR/src \
$$ANGLE_DIR/include
-LIBS_PRIVATE = $$QMAKE_LIBS_CORE $$QMAKE_LIBS_GUI
+LIBS_PRIVATE = $$QMAKE_LIBS_GUI
TR_EXCLUDE += $$ANGLE_DIR/src/*
diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro
index 376ef872ee..7f018bdb94 100644
--- a/src/corelib/corelib.pro
+++ b/src/corelib/corelib.pro
@@ -53,8 +53,10 @@ win32 {
# Override MinGW's definition in _mingw.h
DEFINES += WINVER=0x600 _WIN32_WINNT=0x0600
}
-
- !winrt: LIBS_PRIVATE += -lwinmm
+ LIBS_PRIVATE += -lws2_32
+ !winrt {
+ LIBS_PRIVATE += -lkernel32 -luser32 -lshell32 -luuid -lole32 -ladvapi32 -lwinmm
+ }
}
darwin {
@@ -66,7 +68,9 @@ darwin {
LIBS_PRIVATE += -framework Foundation
}
-QMAKE_LIBS += $$QMAKE_LIBS_CORE
+integrity {
+ LIBS_PRIVATE += -lposix -livfs -lsocket -lnet -lshm_client
+}
QMAKE_DYNAMIC_LIST_FILE = $$PWD/QtCore.dynlist
diff --git a/src/corelib/global/qfloat16.h b/src/corelib/global/qfloat16.h
index 054d503249..89a62a93db 100644
--- a/src/corelib/global/qfloat16.h
+++ b/src/corelib/global/qfloat16.h
@@ -141,7 +141,7 @@ inline qfloat16::operator float() const Q_DECL_NOTHROW
#elif defined (__ARM_FP16_FORMAT_IEEE)
__fp16 f16;
memcpy(&f16, &b16, sizeof(quint16));
- return f16;
+ return float(f16);
#else
quint32 u = mantissatable[offsettable[b16 >> 10] + (b16 & 0x3ff)]
+ exponenttable[b16 >> 10];
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 33d7d58df4..f2f807e1d9 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -2385,6 +2385,7 @@ Lollipop
Marshmallow
Nougat
Nougat
+Oreo
*/
static const char versions_string[] =
"\0"
@@ -2400,13 +2401,14 @@ Nougat
"Lollipop\0"
"Marshmallow\0"
"Nougat\0"
+ "Oreo\0"
"\0";
static const int versions_indices[] = {
0, 0, 0, 1, 9, 15, 15, 15,
22, 28, 28, 40, 40, 40, 50, 50,
69, 69, 69, 80, 80, 87, 87, 96,
- 108, 108, -1
+ 108, 108, 115, -1
};
static const int versions_count = (sizeof versions_indices) / (sizeof versions_indices[0]);
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 93f468f64b..e74ba4026a 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -128,15 +128,13 @@
\value AA_PluginApplication Indicates that Qt is used to author a plugin. Depending
on the operating system, it suppresses specific initializations that do not
necessarily make sense in the plugin case.
- For example on OS X, this includes avoiding loading our nib for the main
+ For example on \macos, this includes avoiding loading our nib for the main
menu and not taking possession of the native menu bar. Setting this
attribute to true will also set the AA_DontUseNativeMenuBar attribute
to true. It also disables native event filters.
This attribute has been added in Qt 5.7. It must be set before
- \l {QGuiApplication}{Q(Gui)Application} is constructed.
+ \l {QGuiApplication}{Q\(Gui\)Application} is constructed.
- \value AA_MacPluginApplication This attribute has been deprecated.
- Use AA_PluginApplication instead.
\value AA_DontUseNativeMenuBar All menubars created while this attribute is
set to true won't be used as a native menubar (e.g, the menubar at
@@ -155,8 +153,6 @@
to be consistent in pixels-per-point across devices rather than
defining 1 point as 1/72 inch.
- \value AA_X11InitThreads This value is obsolete and has no effect.
-
\value AA_SynthesizeTouchForUnhandledMouseEvents All mouse events
that are not accepted by the application will be translated
to touch events instead.
@@ -179,12 +175,13 @@
\value AA_UseDesktopOpenGL Forces the usage of desktop OpenGL (for example,
\e opengl32.dll or \e libGL.so) on platforms that use dynamic loading
of the OpenGL implementation. This value has been added in Qt 5.3.
- This attribute must be set before Q(Gui)Application is constructed.
+ This attribute must be set before \l {QGuiApplication}
+ {Q\(Gui\)Application} is constructed.
\value AA_UseOpenGLES Forces the usage of OpenGL ES 2.0 or higher on
platforms that use dynamic loading of the OpenGL implementation.
This value has been added in Qt 5.3. This attribute must be set
- before Q(Gui)Application is constructed.
+ before \l {QGuiApplication}{Q\(Gui\)Application} is constructed.
\value AA_UseSoftwareOpenGL Forces the usage of a software based OpenGL
implementation on platforms that use dynamic loading of the OpenGL
@@ -196,24 +193,25 @@
variable \e QT_OPENGL_DLL. See the platform-specific pages, for
instance \l{Qt for Windows}, for more information. This value has
been added in Qt 5.4. This attribute must be set before
- Q(Gui)Application is constructed.
+ \l {QGuiApplication}{Q\(Gui\)Application} is constructed.
\value AA_ShareOpenGLContexts Enables resource sharing between the OpenGL
contexts used by classes like QOpenGLWidget and QQuickWidget. This
allows sharing OpenGL resources, like textures, between QOpenGLWidget
instances that belong to different top-level windows. This value has
been added in Qt 5.4. This attribute must be set before
- Q(Gui)Application is constructed.
+ \l {QGuiApplication}{Q\(Gui\)Application} is constructed.
\value AA_SetPalette Indicates whether a palette was explicitly set on the
- QApplication/QGuiApplication. This value has been added in Qt 5.5.
+ \l {QGuiApplication}{Q\(Gui\)Application}. This value has been added
+ in Qt 5.5.
\value AA_EnableHighDpiScaling Enables high-DPI scaling in Qt on supported
platforms (see also \l{High DPI Displays}). Supported platforms are
X11, Windows and Android. Enabling makes Qt scale the main (device
independent) coordinate system according to display scale factors
provided by the operating system. This corresponds to setting the
- QT_AUTO_SCREEN_SCALE_FACTOR environment variable to 1. This value
+ QT_AUTO_SCREEN\unicode{0x200b}_SCALE_FACTOR environment variable to 1. This value
has been added in Qt 5.6. This attribute must be set before
Q(Gui)Application is constructed.
@@ -221,8 +219,9 @@
system coordinates. Note that the window system may do its own scaling,
so this does not guarantee that QPaintDevice::devicePixelRatio() will
be equal to 1. In addition, scale factors set by QT_SCALE_FACTOR will not
- be affected. This corresponds to setting the QT_AUTO_SCREEN_SCALE_FACTOR
- environment variable to 0. This value has been added in Qt 5.6. This
+ be affected. This corresponds to setting the
+ QT_AUTO_SCREEN\unicode{0x200b}_SCALE_FACTOR environment variable to 0.
+ This value has been added in Qt 5.6. This
attribute must be set before Q(Gui)Application is constructed.
\value AA_UseStyleSheetPropagationInWidgetStyles By default, Qt Style Sheets
@@ -281,7 +280,7 @@
This value has been added in Qt 5.10. For Qt 6, WindowContextHelpButtonHint
will not be set by default.
- The following values are obsolete:
+ The following values are deprecated or obsolete:
\value AA_ImmediateWidgetCreation This attribute is no longer fully
supported in Qt 5. It ensures that widgets are created
@@ -293,9 +292,14 @@
Therefore, if it is important to minimize resource
consumption, do not set this attribute.
+ \value AA_MacPluginApplication This attribute has been deprecated.
+ Use AA_PluginApplication instead.
+
\value AA_MSWindowsUseDirect3DByDefault This value is obsolete and
has no effect.
+ \value AA_X11InitThreads This value is obsolete and has no effect.
+
\omitvalue AA_AttributeCount
*/
diff --git a/src/corelib/global/qoperatingsystemversion.cpp b/src/corelib/global/qoperatingsystemversion.cpp
index 83ba6e69ee..594dc6bc17 100644
--- a/src/corelib/global/qoperatingsystemversion.cpp
+++ b/src/corelib/global/qoperatingsystemversion.cpp
@@ -204,6 +204,7 @@ QOperatingSystemVersion QOperatingSystemVersion::current()
{ 6, 0 }, // API level 23
{ 7, 0 }, // API level 24
{ 7, 1 }, // API level 25
+ { 8, 0 }, // API level 26
};
// This will give us at least the first 2 version components
@@ -501,4 +502,12 @@ const QOperatingSystemVersion QOperatingSystemVersion::AndroidNougat =
const QOperatingSystemVersion QOperatingSystemVersion::AndroidNougat_MR1 =
QOperatingSystemVersion(QOperatingSystemVersion::Android, 7, 1);
+/*!
+ \variable QOperatingSystemVersion::AndroidOreo
+ \brief a version corresponding to Android Oreo (version 8.0, API level 26).
+ \since 5.9.2
+ */
+const QOperatingSystemVersion QOperatingSystemVersion::AndroidOreo =
+ QOperatingSystemVersion(QOperatingSystemVersion::Android, 8, 0);
+
QT_END_NAMESPACE
diff --git a/src/corelib/global/qoperatingsystemversion.h b/src/corelib/global/qoperatingsystemversion.h
index 2e319e66d5..1f3ff8e1ab 100644
--- a/src/corelib/global/qoperatingsystemversion.h
+++ b/src/corelib/global/qoperatingsystemversion.h
@@ -80,6 +80,7 @@ public:
static const QOperatingSystemVersion AndroidMarshmallow;
static const QOperatingSystemVersion AndroidNougat;
static const QOperatingSystemVersion AndroidNougat_MR1;
+ static const QOperatingSystemVersion AndroidOreo;
Q_DECL_CONSTEXPR QOperatingSystemVersion(OSType osType,
int vmajor, int vminor = -1, int vmicro = -1)
diff --git a/src/corelib/global/qrandom.cpp b/src/corelib/global/qrandom.cpp
index fb20f459b5..395bf0b0cb 100644
--- a/src/corelib/global/qrandom.cpp
+++ b/src/corelib/global/qrandom.cpp
@@ -918,15 +918,16 @@ void QRandomGenerator::fillRange_helper(void *buffer, void *bufferEnd)
fill(buffer, bufferEnd);
}
-#if defined(Q_OS_UNIX) && !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && (_POSIX_THREAD_SAFE_FUNCTIONS - 0 > 0)
+#if defined(Q_OS_ANDROID) && (__ANDROID_API__ < 21)
+typedef QThreadStorage<QJNIObjectPrivate> AndroidRandomStorage;
+Q_GLOBAL_STATIC(AndroidRandomStorage, randomTLS)
+
+#elif defined(Q_OS_UNIX) && !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && (_POSIX_THREAD_SAFE_FUNCTIONS - 0 > 0)
using SeedStorageType = QtPrivate::FunctionPointer<decltype(&srand)>::Arguments::Car;
typedef QThreadStorage<SeedStorageType *> SeedStorage;
Q_GLOBAL_STATIC(SeedStorage, randTLS) // Thread Local Storage for seed value
-#elif defined(Q_OS_ANDROID)
-typedef QThreadStorage<QJNIObjectPrivate> AndroidRandomStorage;
-Q_GLOBAL_STATIC(AndroidRandomStorage, randomTLS)
#endif
/*!
@@ -946,21 +947,7 @@ Q_GLOBAL_STATIC(AndroidRandomStorage, randomTLS)
*/
void qsrand(uint seed)
{
-#if defined(Q_OS_UNIX) && !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && (_POSIX_THREAD_SAFE_FUNCTIONS - 0 > 0)
- SeedStorage *seedStorage = randTLS();
- if (seedStorage) {
- SeedStorageType *pseed = seedStorage->localData();
- if (!pseed)
- seedStorage->setLocalData(pseed = new SeedStorageType);
- *pseed = seed;
- } else {
- //global static seed storage should always exist,
- //except after being deleted by QGlobalStaticDeleter.
- //But since it still can be called from destructor of another
- //global static object, fallback to srand(seed)
- srand(seed);
- }
-#elif defined(Q_OS_ANDROID)
+#if defined(Q_OS_ANDROID) && (__ANDROID_API__ < 21)
if (randomTLS->hasLocalData()) {
randomTLS->localData().callMethod<void>("setSeed", "(J)V", jlong(seed));
return;
@@ -975,6 +962,20 @@ void qsrand(uint seed)
}
randomTLS->setLocalData(random);
+#elif defined(Q_OS_UNIX) && !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && (_POSIX_THREAD_SAFE_FUNCTIONS - 0 > 0)
+ SeedStorage *seedStorage = randTLS();
+ if (seedStorage) {
+ SeedStorageType *pseed = seedStorage->localData();
+ if (!pseed)
+ seedStorage->setLocalData(pseed = new SeedStorageType);
+ *pseed = seed;
+ } else {
+ //global static seed storage should always exist,
+ //except after being deleted by QGlobalStaticDeleter.
+ //But since it still can be called from destructor of another
+ //global static object, fallback to srand(seed)
+ srand(seed);
+ }
#else
// On Windows srand() and rand() already use Thread-Local-Storage
// to store the seed between calls
@@ -1002,23 +1003,7 @@ void qsrand(uint seed)
*/
int qrand()
{
-#if defined(Q_OS_UNIX) && !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && (_POSIX_THREAD_SAFE_FUNCTIONS - 0 > 0)
- SeedStorage *seedStorage = randTLS();
- if (seedStorage) {
- SeedStorageType *pseed = seedStorage->localData();
- if (!pseed) {
- seedStorage->setLocalData(pseed = new SeedStorageType);
- *pseed = 1;
- }
- return rand_r(pseed);
- } else {
- //global static seed storage should always exist,
- //except after being deleted by QGlobalStaticDeleter.
- //But since it still can be called from destructor of another
- //global static object, fallback to rand()
- return rand();
- }
-#elif defined(Q_OS_ANDROID)
+#if defined(Q_OS_ANDROID) && (__ANDROID_API__ < 21)
AndroidRandomStorage *randomStorage = randomTLS();
if (!randomStorage)
return rand();
@@ -1038,6 +1023,22 @@ int qrand()
randomStorage->setLocalData(random);
return random.callMethod<jint>("nextInt", "(I)I", RAND_MAX);
+#elif defined(Q_OS_UNIX) && !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && (_POSIX_THREAD_SAFE_FUNCTIONS - 0 > 0)
+ SeedStorage *seedStorage = randTLS();
+ if (seedStorage) {
+ SeedStorageType *pseed = seedStorage->localData();
+ if (!pseed) {
+ seedStorage->setLocalData(pseed = new SeedStorageType);
+ *pseed = 1;
+ }
+ return rand_r(pseed);
+ } else {
+ //global static seed storage should always exist,
+ //except after being deleted by QGlobalStaticDeleter.
+ //But since it still can be called from destructor of another
+ //global static object, fallback to rand()
+ return rand();
+ }
#else
// On Windows srand() and rand() already use Thread-Local-Storage
// to store the seed between calls
diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp
index 235e391aa0..26078a6c71 100644
--- a/src/corelib/io/qfileinfo.cpp
+++ b/src/corelib/io/qfileinfo.cpp
@@ -870,12 +870,12 @@ QString QFileInfo::suffix() const
\b{Note:} The QDir returned always corresponds to the object's
parent directory, even if the QFileInfo represents a directory.
- For each of the following, dir() returns a QDir for
+ For each of the following, dir() returns the QDir
\c{"~/examples/191697"}.
\snippet fileinfo/main.cpp 0
- For each of the following, dir() returns a QDir for
+ For each of the following, dir() returns the QDir
\c{"."}.
\snippet fileinfo/main.cpp 1
@@ -1034,12 +1034,16 @@ bool QFileInfo::isBundle() const
}
/*!
- Returns \c true if this object points to a symbolic link (or to a
- shortcut on Windows); otherwise returns \c false.
+ Returns \c true if this object points to a symbolic link;
+ otherwise returns \c false.
- On Unix (including \macos and iOS), opening a symlink effectively opens
- the \l{symLinkTarget()}{link's target}. On Windows, it opens the \c
- .lnk file itself.
+ Symbolic links exist on Unix (including \macos and iOS) and Windows
+ and are typically created by the \c{ln -s} or \c{mklink} commands,
+ respectively. Opening a symbolic link effectively opens
+ the \l{symLinkTarget()}{link's target}.
+
+ In addition, true will be returned for shortcuts (\c *.lnk files) on
+ Windows. Opening those will open the \c .lnk file itself.
Example:
@@ -1090,8 +1094,8 @@ bool QFileInfo::isRoot() const
\fn QString QFileInfo::symLinkTarget() const
\since 4.2
- Returns the absolute path to the file or directory a symlink (or shortcut
- on Windows) points to, or a an empty string if the object isn't a symbolic
+ Returns the absolute path to the file or directory a symbolic link
+ points to, or an empty string if the object isn't a symbolic
link.
This name may not represent an existing file; it is only a string.
diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp
index 3f2bc04b9c..2828c85048 100644
--- a/src/corelib/io/qfilesystemengine_unix.cpp
+++ b/src/corelib/io/qfilesystemengine_unix.cpp
@@ -635,13 +635,11 @@ QFileSystemEntry QFileSystemEngine::getLinkTarget(const QFileSystemEntry &link,
ret += QFile::decodeName(s);
if (!ret.startsWith(QLatin1Char('/'))) {
- const QString linkFilePath = link.filePath();
- if (linkFilePath.startsWith(QLatin1Char('/'))) {
- ret.prepend(linkFilePath.leftRef(linkFilePath.lastIndexOf(QLatin1Char('/')))
- + QLatin1Char('/'));
- } else {
- ret.prepend(QDir::currentPath() + QLatin1Char('/'));
- }
+ const QString linkPath = link.path();
+ if (linkPath.startsWith(QLatin1Char('/')))
+ ret.prepend(linkPath + QLatin1Char('/'));
+ else
+ ret.prepend(QDir::currentPath() + QLatin1Char('/') + linkPath + QLatin1Char('/'));
}
ret = QDir::cleanPath(ret);
if (ret.size() > 1 && ret.endsWith(QLatin1Char('/')))
@@ -853,7 +851,7 @@ QString QFileSystemEngine::resolveGroupName(uint groupId)
#if !defined(Q_OS_INTEGRITY)
struct group *gr = 0;
-#if !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_OPENBSD) && !defined(Q_OS_VXWORKS)
+#if !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_OPENBSD) && !defined(Q_OS_VXWORKS) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID) && (__ANDROID_API__ >= 24))
size_max = sysconf(_SC_GETGR_R_SIZE_MAX);
if (size_max == -1)
size_max = 1024;
diff --git a/src/corelib/io/qfilesystemwatcher_inotify.cpp b/src/corelib/io/qfilesystemwatcher_inotify.cpp
index 3cfc6a254f..048669b92f 100644
--- a/src/corelib/io/qfilesystemwatcher_inotify.cpp
+++ b/src/corelib/io/qfilesystemwatcher_inotify.cpp
@@ -222,6 +222,14 @@ QT_END_NAMESPACE
#include <sys/inotify.h>
+// see https://github.com/android-ndk/ndk/issues/394
+# if defined(Q_OS_ANDROID) && (__ANDROID_API__ < 21)
+static inline int inotify_init1(int flags)
+{
+ return syscall(__NR_inotify_init1, flags);
+}
+# endif
+
#endif
QT_BEGIN_NAMESPACE
@@ -229,7 +237,7 @@ QT_BEGIN_NAMESPACE
QInotifyFileSystemWatcherEngine *QInotifyFileSystemWatcherEngine::create(QObject *parent)
{
int fd = -1;
-#ifdef IN_CLOEXEC
+#if defined(IN_CLOEXEC)
fd = inotify_init1(IN_CLOEXEC);
#endif
if (fd == -1) {
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index 1bb3362d5e..7ed319f5f1 100644
--- a/src/corelib/io/qprocess.cpp
+++ b/src/corelib/io/qprocess.cpp
@@ -1024,7 +1024,8 @@ bool QProcessPrivate::tryReadFromChannel(Channel *channel)
if (readBytes == -1) {
setErrorAndEmit(QProcess::ReadError);
#if defined QPROCESS_DEBUG
- qDebug("QProcessPrivate::tryReadFromChannel(%d), failed to read from the process", channel - &stdinChannel);
+ qDebug("QProcessPrivate::tryReadFromChannel(%d), failed to read from the process",
+ int(channel - &stdinChannel));
#endif
return false;
}
@@ -1034,13 +1035,14 @@ bool QProcessPrivate::tryReadFromChannel(Channel *channel)
channel->notifier->setEnabled(false);
closeChannel(channel);
#if defined QPROCESS_DEBUG
- qDebug("QProcessPrivate::tryReadFromChannel(%d), 0 bytes available", channel - &stdinChannel);
+ qDebug("QProcessPrivate::tryReadFromChannel(%d), 0 bytes available",
+ int(channel - &stdinChannel));
#endif
return false;
}
#if defined QPROCESS_DEBUG
- qDebug("QProcessPrivate::tryReadFromChannel(%d), read %d bytes from the process' output", channel - &stdinChannel
- int(readBytes));
+ qDebug("QProcessPrivate::tryReadFromChannel(%d), read %d bytes from the process' output",
+ int(channel - &stdinChannel), int(readBytes));
#endif
if (channel->closed) {
diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp
index cf9d38097a..15752f84b2 100644
--- a/src/corelib/io/qprocess_unix.cpp
+++ b/src/corelib/io/qprocess_unix.cpp
@@ -762,6 +762,10 @@ bool QProcessPrivate::waitForReadyRead(int msecs)
if (qt_pollfd_check(poller.stdinPipe(), POLLOUT))
_q_canWrite();
+ // Signals triggered by I/O may have stopped this process:
+ if (processState == QProcess::NotRunning)
+ return false;
+
if (qt_pollfd_check(poller.forkfd(), POLLIN)) {
if (_q_processDied())
return false;
@@ -808,6 +812,10 @@ bool QProcessPrivate::waitForBytesWritten(int msecs)
if (qt_pollfd_check(poller.stderrPipe(), POLLIN))
_q_canReadStandardError();
+ // Signals triggered by I/O may have stopped this process:
+ if (processState == QProcess::NotRunning)
+ return false;
+
if (qt_pollfd_check(poller.forkfd(), POLLIN)) {
if (_q_processDied())
return false;
@@ -853,6 +861,10 @@ bool QProcessPrivate::waitForFinished(int msecs)
if (qt_pollfd_check(poller.stderrPipe(), POLLIN))
_q_canReadStandardError();
+ // Signals triggered by I/O may have stopped this process:
+ if (processState == QProcess::NotRunning)
+ return true;
+
if (qt_pollfd_check(poller.forkfd(), POLLIN)) {
if (_q_processDied())
return true;
diff --git a/src/corelib/kernel/qcore_mac_p.h b/src/corelib/kernel/qcore_mac_p.h
index 5be8df1a48..5522a617b3 100644
--- a/src/corelib/kernel/qcore_mac_p.h
+++ b/src/corelib/kernel/qcore_mac_p.h
@@ -129,7 +129,8 @@ public:
template <typename X> X as() const { return reinterpret_cast<X>(this->value); }
static QCFType constructFromGet(const T &t)
{
- CFRetain(t);
+ if (t)
+ CFRetain(t);
return QCFType<T>(t);
}
};
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp
index cddc4053b1..6540f02f34 100644
--- a/src/corelib/thread/qthread_unix.cpp
+++ b/src/corelib/thread/qthread_unix.cpp
@@ -105,7 +105,7 @@
# define SCHED_IDLE 5
#endif
-#if defined(Q_OS_DARWIN) || !defined(Q_OS_OPENBSD) && defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING-0 >= 0)
+#if defined(Q_OS_DARWIN) || !defined(Q_OS_ANDROID) && !defined(Q_OS_OPENBSD) && defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING-0 >= 0)
#define QT_HAS_THREAD_PRIORITY_SCHEDULING
#endif
diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp
index 9d8c276cff..e336b7e618 100644
--- a/src/corelib/tools/qhash.cpp
+++ b/src/corelib/tools/qhash.cpp
@@ -140,7 +140,9 @@ static inline bool hasFastCrc32()
}
template <typename Char>
+#if defined(Q_PROCESSOR_ARM_64)
QT_FUNCTION_TARGET(CRC32)
+#endif
static uint crc32(const Char *ptr, size_t len, uint h)
{
// The crc32[whbd] instructions on Aarch64/Aarch32 calculate a 32-bit CRC32 checksum
diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h
index 3ef29f4823..181da4f7de 100644
--- a/src/corelib/tools/qsimd_p.h
+++ b/src/corelib/tools/qsimd_p.h
@@ -326,7 +326,10 @@
#endif
// AArch64/ARM64
#if defined(Q_PROCESSOR_ARM_V8) && defined(__ARM_FEATURE_CRC32)
+#if defined(Q_PROCESSOR_ARM_64)
+// only available on aarch64
#define QT_FUNCTION_TARGET_STRING_CRC32 "+crc"
+#endif
# include <arm_acle.h>
#endif
diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h
index a3e100c568..16472ff6b9 100644
--- a/src/corelib/tools/qstring.h
+++ b/src/corelib/tools/qstring.h
@@ -56,7 +56,7 @@
#include <string>
#include <iterator>
-#if defined(Q_OS_ANDROID)
+#if defined(Q_OS_ANDROID) && !defined(ANDROID_HAS_WSTRING)
// std::wstring is disabled on android's glibc, as bionic lacks certain features
// that libstdc++ checks for (like mbcslen).
namespace std
diff --git a/src/gui/image/qmovie.cpp b/src/gui/image/qmovie.cpp
index 2ff9fb4e36..d5e8b1b974 100644
--- a/src/gui/image/qmovie.cpp
+++ b/src/gui/image/qmovie.cpp
@@ -1017,7 +1017,7 @@ QList<QByteArray> QMovie::supportedFormats()
const auto doesntSupportAnimation =
[&buffer](const QByteArray &format) {
- return !QImageReader(&buffer, format).supportsAnimation();
+ return !QImageReader(&buffer, format).supportsOption(QImageIOHandler::Animation);
};
list.erase(std::remove_if(list.begin(), list.end(), doesntSupportAnimation), list.end());
diff --git a/src/gui/image/qpicture.cpp b/src/gui/image/qpicture.cpp
index f2c5e250e1..bf628e7571 100644
--- a/src/gui/image/qpicture.cpp
+++ b/src/gui/image/qpicture.cpp
@@ -1207,7 +1207,12 @@ QT_END_INCLUDE_NAMESPACE
const char* QPicture::pictureFormat(const QString &fileName)
{
- return QPictureIO::pictureFormat(fileName);
+ const QByteArray format = QPictureIO::pictureFormat(fileName);
+ // This function returns a const char * from a QByteArray.
+ // Double check that the QByteArray is not detached, otherwise
+ // we would return a dangling pointer.
+ Q_ASSERT(!format.isDetached());
+ return format;
}
/*!
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 1d8d6dfc95..5b5c1bd0e3 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -378,6 +378,8 @@ void QWindowPrivate::setVisible(bool visible)
QGuiApplicationPrivate::showModalWindow(q);
else
QGuiApplicationPrivate::hideModalWindow(q);
+ } else if (visible && QGuiApplication::modalWindow()) {
+ QGuiApplicationPrivate::updateBlockedStatus(q);
}
#ifndef QT_NO_CURSOR
@@ -1807,6 +1809,7 @@ void QWindow::resize(int w, int h)
void QWindow::resize(const QSize &newSize)
{
Q_D(QWindow);
+ d->positionPolicy = QWindowPrivate::WindowFrameExclusive;
if (d->platformWindow) {
d->platformWindow->setGeometry(QHighDpi::toNativePixels(QRect(position(), newSize), this));
} else {
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index b161e4c2a9..5207e861e6 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -5572,7 +5572,7 @@ static void qt_alphamapblit_generic(QRasterBuffer *rasterBuffer,
int start = qMax<int>(x, clip.x);
int end = qMin<int>(x + mapWidth, clip.x + clip.len);
- Q_ASSERT(clip.len <= buffer_size);
+ Q_ASSERT(end - start <= buffer_size);
QRgba64 *dest = destFetch64((QRgba64*)buffer, rasterBuffer, start, clip.y, end - start);
for (int xp=start; xp<end; ++xp) {
@@ -5845,7 +5845,7 @@ static void qt_alphargbblit_generic(QRasterBuffer *rasterBuffer,
int start = qMax<int>(x, clip.x);
int end = qMin<int>(x + mapWidth, clip.x + clip.len);
- Q_ASSERT(clip.len <= buffer_size);
+ Q_ASSERT(end - start <= buffer_size);
QRgba64 *dest = destFetch64((QRgba64*)buffer, rasterBuffer, start, clip.y, end - start);
for (int xp=start; xp<end; ++xp) {
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 5db4e5a919..b4f717678d 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -3207,7 +3207,7 @@ void QRasterPaintEnginePrivate::rasterizeLine_dashed(QLineF line,
QLineF l = line;
if (dash >= length) {
- dash = length;
+ dash = line.length(); // Avoid accumulated precision error in 'length'
*dashOffset += dash / width;
length = 0;
} else {
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp
index eeee82a87c..15a0359391 100644
--- a/src/network/access/qnetworkaccessmanager.cpp
+++ b/src/network/access/qnetworkaccessmanager.cpp
@@ -71,6 +71,8 @@
#include "qthread.h"
+#include <QHostInfo>
+
QT_BEGIN_NAMESPACE
Q_GLOBAL_STATIC(QNetworkAccessFileBackendFactory, fileBackend)
@@ -689,7 +691,7 @@ void QNetworkAccessManager::setCookieJar(QNetworkCookieJar *cookieJar)
if (d->cookieJar && d->cookieJar->parent() == this)
delete d->cookieJar;
d->cookieJar = cookieJar;
- if (thread() == cookieJar->thread())
+ if (cookieJar && thread() == cookieJar->thread())
d->cookieJar->setParent(this);
}
}
@@ -1366,10 +1368,16 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera
}
#ifndef QT_NO_BEARERMANAGEMENT
+
// Return a disabled network reply if network access is disabled.
- // Except if the scheme is empty or file://.
+ // Except if the scheme is empty or file:// or if the host resolves to a loopback address.
if (d->networkAccessible == NotAccessible && !isLocalFile) {
- return new QDisabledNetworkReply(this, req, op);
+ QHostAddress dest;
+ QString host = req.url().host().toLower();
+ if (!(dest.setAddress(host) && dest.isLoopback()) && host != QLatin1String("localhost")
+ && host != QHostInfo::localHostName().toLower()) {
+ return new QDisabledNetworkReply(this, req, op);
+ }
}
if (!d->networkSessionStrongRef && (d->initializeSession || !d->networkConfiguration.identifier().isEmpty())) {
diff --git a/src/network/configure.json b/src/network/configure.json
index de40872e16..b1c943de6f 100644
--- a/src/network/configure.json
+++ b/src/network/configure.json
@@ -135,7 +135,8 @@
"main": [
"char buf[IFNAMSIZ];",
"if_nametoindex(\"eth0\");",
- "if_indextoname(1, buf);"
+ "if_indextoname(1, buf);",
+ "if_freenameindex(if_nameindex());"
]
},
"use": "network"
diff --git a/src/network/kernel/kernel.pri b/src/network/kernel/kernel.pri
index c3fcf25233..ac6bebbfae 100644
--- a/src/network/kernel/kernel.pri
+++ b/src/network/kernel/kernel.pri
@@ -63,6 +63,6 @@ osx:SOURCES += kernel/qnetworkproxy_mac.cpp
else:win32:!winrt: SOURCES += kernel/qnetworkproxy_win.cpp
else: qtConfig(libproxy) {
SOURCES += kernel/qnetworkproxy_libproxy.cpp
- QMAKE_USE_PRIVATE += libproxy
+ QMAKE_USE_PRIVATE += libproxy libdl
}
else:SOURCES += kernel/qnetworkproxy_generic.cpp
diff --git a/src/network/kernel/qhostinfo_unix.cpp b/src/network/kernel/qhostinfo_unix.cpp
index cf08a15f96..9a24938284 100644
--- a/src/network/kernel/qhostinfo_unix.cpp
+++ b/src/network/kernel/qhostinfo_unix.cpp
@@ -150,8 +150,7 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName)
QHostAddress address;
if (address.setAddress(hostName)) {
// Reverse lookup
-// Reverse lookups using getnameinfo are broken on darwin, use gethostbyaddr instead.
-#if !defined (QT_NO_GETADDRINFO) && !defined (Q_OS_DARWIN)
+#if !defined (QT_NO_GETADDRINFO)
sockaddr_in sa4;
sockaddr_in6 sa6;
sockaddr *sa = 0;
diff --git a/src/network/kernel/qnetworkinterface_unix.cpp b/src/network/kernel/qnetworkinterface_unix.cpp
index 4f4615d4d0..afa6b4296e 100644
--- a/src/network/kernel/qnetworkinterface_unix.cpp
+++ b/src/network/kernel/qnetworkinterface_unix.cpp
@@ -60,11 +60,6 @@
# define QT_NO_GETIFADDRS
#endif
-#ifdef Q_OS_ANDROID
-// android lacks if_nameindex
-# define QT_NO_IPV6IFNAME
-#endif
-
#ifdef Q_OS_HAIKU
# include <sys/sockio.h>
# define IFF_RUNNING 0x0001
diff --git a/src/network/kernel/qnetworkproxy_libproxy.cpp b/src/network/kernel/qnetworkproxy_libproxy.cpp
index 184dc6469d..29d2a0bd3b 100644
--- a/src/network/kernel/qnetworkproxy_libproxy.cpp
+++ b/src/network/kernel/qnetworkproxy_libproxy.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2017 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtNetwork module of the Qt Toolkit.
@@ -42,57 +43,149 @@
#ifndef QT_NO_NETWORKPROXY
#include <QtCore/QByteArray>
+#include <QtCore/QMutex>
+#include <QtCore/QSemaphore>
#include <QtCore/QUrl>
+#include <QtCore/private/qeventdispatcher_unix_p.h>
+#include <QtCore/private/qthread_p.h>
#include <proxy.h>
+#include <dlfcn.h>
QT_BEGIN_NAMESPACE
-class QLibProxyWrapper
+static bool isThreadingNeeded()
{
-public:
- QLibProxyWrapper()
- : factory(px_proxy_factory_new())
- {
- if (!factory)
- qWarning("libproxy initialization failed.");
- }
+ // Try to guess if the libproxy we linked to is from the libproxy project
+ // or if it is from pacrunner. Neither library is thread-safe, but the one
+ // from libproxy is worse, since it may launch JS engines that don't take
+ // kindly to being executed from multiple threads (even if at different
+ // times). The pacrunner implementation doesn't suffer from this because
+ // the JS execution is out of process, in the pacrunner daemon.
- ~QLibProxyWrapper()
- {
- px_proxy_factory_free(factory);
- }
+ void *sym;
+
+#ifdef Q_CC_GNU
+ // Search for the mangled name of the virtual table of the pacrunner
+ // extension. Even if libproxy begins using -fvisibility=hidden, this
+ // symbol can't be hidden.
+ sym = dlsym(RTLD_DEFAULT, "_ZTVN8libproxy19pacrunner_extensionE");
+#else
+ // The default libproxy one uses libmodman for its module management and
+ // leaks symbols because it doesn't use -fvisibility=hidden (as of
+ // v0.4.15).
+ sym = dlsym(RTLD_DEFAULT, "mm_info_ignore_hostname");
+#endif
+
+ return sym != nullptr;
+}
+
+class QLibProxyWrapper : public QDaemonThread
+{
+ Q_OBJECT
+public:
+ QLibProxyWrapper();
+ ~QLibProxyWrapper();
QList<QUrl> getProxies(const QUrl &url);
private:
- pxProxyFactory *factory;
+ struct Data {
+ // we leave the conversion to/from QUrl to the calling thread
+ const char *url;
+ char **proxies;
+ QSemaphore replyReady;
+ };
+
+ void run() override;
+
+ pxProxyFactory *factory; // not subject to the mutex
+
+ QMutex mutex;
+ QSemaphore requestReady;
+ Data *request;
};
Q_GLOBAL_STATIC(QLibProxyWrapper, libProxyWrapper);
+QLibProxyWrapper::QLibProxyWrapper()
+{
+ if (isThreadingNeeded()) {
+ setEventDispatcher(new QEventDispatcherUNIX); // don't allow the Glib one
+ start();
+ } else {
+ factory = px_proxy_factory_new();
+ Q_CHECK_PTR(factory);
+ }
+}
+
+QLibProxyWrapper::~QLibProxyWrapper()
+{
+ if (isRunning()) {
+ requestInterruption();
+ requestReady.release();
+ wait();
+ } else {
+ px_proxy_factory_free(factory);
+ }
+}
+
/*
- Gets the list of proxies from libproxy, converted to QUrl list.
- Thread safe, according to libproxy documentation.
+ Gets the list of proxies from libproxy, converted to QUrl list. Apply
+ thread-safety, though its documentation says otherwise, libproxy isn't
+ thread-safe.
*/
QList<QUrl> QLibProxyWrapper::getProxies(const QUrl &url)
{
- QList<QUrl> ret;
+ QByteArray encodedUrl = url.toEncoded();
+ Data data;
+ data.url = encodedUrl.constData();
+
+ {
+ QMutexLocker locker(&mutex);
+ if (isRunning()) {
+ // threaded mode
+ // it's safe to write to request because we hold the mutex:
+ // our aux thread is blocked waiting for work and no other thread
+ // could have got here
+ request = &data;
+ requestReady.release();
- if (factory) {
- char **proxies = px_proxy_factory_get_proxies(factory, url.toEncoded());
- if (proxies) {
- for (int i = 0; proxies[i]; i++) {
- ret.append(QUrl::fromEncoded(proxies[i]));
- free(proxies[i]);
- }
- free(proxies);
+ // wait for the reply
+ data.replyReady.acquire();
+ } else {
+ // non-threaded mode
+ data.proxies = px_proxy_factory_get_proxies(factory, data.url);
}
}
+ QList<QUrl> ret;
+ if (data.proxies) {
+ for (int i = 0; data.proxies[i]; i++) {
+ ret.append(QUrl::fromEncoded(data.proxies[i]));
+ free(data.proxies[i]);
+ }
+ free(data.proxies);
+ }
return ret;
}
+void QLibProxyWrapper::run()
+{
+ factory = px_proxy_factory_new();
+ Q_CHECK_PTR(factory);
+
+ forever {
+ requestReady.acquire();
+ if (isInterruptionRequested())
+ break;
+ request->proxies = px_proxy_factory_get_proxies(factory, request->url);
+ request->replyReady.release();
+ }
+
+ px_proxy_factory_free(factory);
+}
+
QList<QNetworkProxy> QNetworkProxyFactory::systemProxyForQuery(const QNetworkProxyQuery &query)
{
QList<QNetworkProxy> proxyList;
@@ -161,4 +254,6 @@ QList<QNetworkProxy> QNetworkProxyFactory::systemProxyForQuery(const QNetworkPro
QT_END_NAMESPACE
+#include "qnetworkproxy_libproxy.moc"
+
#endif
diff --git a/src/network/ssl/qsslkey_openssl.cpp b/src/network/ssl/qsslkey_openssl.cpp
index be7033c8aa..aa81b735b9 100644
--- a/src/network/ssl/qsslkey_openssl.cpp
+++ b/src/network/ssl/qsslkey_openssl.cpp
@@ -85,6 +85,9 @@ void QSslKeyPrivate::clear(bool deep)
bool QSslKeyPrivate::fromEVP_PKEY(EVP_PKEY *pkey)
{
+ if (pkey == nullptr)
+ return false;
+
#if QT_CONFIG(opensslv11)
const int keyType = q_EVP_PKEY_type(q_EVP_PKEY_base_id(pkey));
#else
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index fbfeb00017..23a63ed063 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -1499,7 +1499,7 @@ bool QSslSocketBackendPrivate::importPkcs12(QIODevice *device,
}
// Extract the data
- EVP_PKEY *pkey;
+ EVP_PKEY *pkey = nullptr;
X509 *x509;
STACK_OF(X509) *ca = 0;
diff --git a/src/platformsupport/fbconvenience/qfbvthandler.cpp b/src/platformsupport/fbconvenience/qfbvthandler.cpp
index 102bc91647..7bb9e28ac2 100644
--- a/src/platformsupport/fbconvenience/qfbvthandler.cpp
+++ b/src/platformsupport/fbconvenience/qfbvthandler.cpp
@@ -50,7 +50,6 @@
#include <signal.h>
#include <errno.h>
#include <fcntl.h>
-#include <sys/signalfd.h>
#include <sys/ioctl.h>
#include <linux/kd.h>
diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
index 49a6049c4b..66baf162d9 100644
--- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
+++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
@@ -112,25 +112,32 @@ bool QCoreTextFontEngine::ct_getSfntTable(void *user_data, uint tag, uchar *buff
QFont::Weight QCoreTextFontEngine::qtWeightFromCFWeight(float value)
{
- if (value >= kCTFontWeightBlack)
- return QFont::Black;
- if (value >= kCTFontWeightHeavy)
- return QFont::ExtraBold;
- if (value >= kCTFontWeightBold)
- return QFont::Bold;
- if (value >= kCTFontWeightSemibold)
- return QFont::DemiBold;
- if (value >= kCTFontWeightMedium)
- return QFont::Medium;
- if (value == kCTFontWeightRegular)
- return QFont::Normal;
- if (value <= kCTFontWeightUltraLight)
- return QFont::Thin;
- if (value <= kCTFontWeightThin)
- return QFont::ExtraLight;
- if (value <= kCTFontWeightLight)
- return QFont::Light;
- return QFont::Normal;
+#define COMPARE_WEIGHT_DISTANCE(ct_weight, qt_weight) \
+ { \
+ float d; \
+ if ((d = qAbs(value - ct_weight)) < distance) { \
+ distance = d; \
+ ret = qt_weight; \
+ } \
+ }
+
+ float distance = qAbs(value - kCTFontWeightBlack);
+ QFont::Weight ret = QFont::Black;
+
+ // Compare distance to system weight to find the closest match.
+ // (Note: Must go from high to low, so that midpoints are rounded up)
+ COMPARE_WEIGHT_DISTANCE(kCTFontWeightHeavy, QFont::ExtraBold);
+ COMPARE_WEIGHT_DISTANCE(kCTFontWeightBold, QFont::Bold);
+ COMPARE_WEIGHT_DISTANCE(kCTFontWeightSemibold, QFont::DemiBold);
+ COMPARE_WEIGHT_DISTANCE(kCTFontWeightMedium, QFont::Medium);
+ COMPARE_WEIGHT_DISTANCE(kCTFontWeightRegular, QFont::Normal);
+ COMPARE_WEIGHT_DISTANCE(kCTFontWeightLight, QFont::Light);
+ COMPARE_WEIGHT_DISTANCE(kCTFontWeightThin, QFont::ExtraLight);
+ COMPARE_WEIGHT_DISTANCE(kCTFontWeightUltraLight, QFont::Thin);
+
+#undef COMPARE_WEIGHT_DISTANCE
+
+ return ret;
}
static void loadAdvancesForGlyphs(CTFontRef ctfont,
diff --git a/src/platformsupport/fontdatabases/winrt/winrt.pri b/src/platformsupport/fontdatabases/winrt/winrt.pri
index 4875338182..291ada220f 100644
--- a/src/platformsupport/fontdatabases/winrt/winrt.pri
+++ b/src/platformsupport/fontdatabases/winrt/winrt.pri
@@ -8,4 +8,4 @@ HEADERS += \
DEFINES += __WRL_NO_DEFAULT_LIB__
-LIBS += $$QMAKE_LIBS_CORE -ldwrite
+LIBS += -lws2_32 -ldwrite
diff --git a/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp b/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp
index ca9f7af127..809aa68365 100644
--- a/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp
+++ b/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp
@@ -520,7 +520,7 @@ static inline int fromBase8(const char *s, const char *end)
{
int result = 0;
while (*s && s != end) {
- if (*s <= '0' && *s >= '7')
+ if (*s <= '0' || *s >= '7')
return 0;
result *= 8;
result += *s - '0';
diff --git a/src/plugins/platforms/android/extract.cpp b/src/plugins/platforms/android/extract.cpp
index e6636e37d4..2f2ffa7126 100644
--- a/src/plugins/platforms/android/extract.cpp
+++ b/src/plugins/platforms/android/extract.cpp
@@ -43,6 +43,7 @@
#include <android/log.h>
#include <extract.h>
#include <alloca.h>
+#include <stdlib.h>
#define LOG_TAG "extractSyleInfo"
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__)
diff --git a/src/plugins/platforms/android/qandroidinputcontext.cpp b/src/plugins/platforms/android/qandroidinputcontext.cpp
index 279cb338f4..7fa809f3f8 100644
--- a/src/plugins/platforms/android/qandroidinputcontext.cpp
+++ b/src/plugins/platforms/android/qandroidinputcontext.cpp
@@ -303,7 +303,7 @@ static jboolean paste(JNIEnv */*env*/, jobject /*thiz*/)
return JNI_FALSE;
#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL
- qDebug("@@@");
+ qDebug("@@@ PASTE");
#endif
return m_androidInputContext->paste();
}
@@ -1138,6 +1138,7 @@ jboolean QAndroidInputContext::copyURL()
jboolean QAndroidInputContext::paste()
{
+ finishComposingText();
m_cursorHandleShown = CursorHandleNotShown;
sendShortcut(QKeySequence::Paste);
return JNI_TRUE;
diff --git a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
index 874d3fc24b..bf9ba4eccf 100644
--- a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
+++ b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
@@ -400,8 +400,18 @@ bool QCocoaEventDispatcher::processEvents(QEventLoop::ProcessEventsFlags flags)
// [NSApp run], which is the normal code path for cocoa applications.
if (NSModalSession session = d->currentModalSession()) {
QBoolBlocker execGuard(d->currentExecIsNSAppRun, false);
- while ([NSApp runModalSession:session] == NSModalResponseContinue && !d->interrupt)
+ while ([NSApp runModalSession:session] == NSModalResponseContinue && !d->interrupt) {
qt_mac_waitForMoreEvents(NSModalPanelRunLoopMode);
+ if (session != d->currentModalSessionCached) {
+ // It's possible to release the current modal session
+ // while we are in this loop, for example, by closing all
+ // windows from a slot via QApplication::closeAllWindows.
+ // In this case we cannot use 'session' anymore. A warning
+ // from Cocoa is: "Use of freed session detected. Do not
+ // call runModalSession: after calling endModalSesion:."
+ break;
+ }
+ }
if (!d->interrupt && session == d->currentModalSessionCached) {
// Someone called [NSApp stopModal:] from outside the event
diff --git a/src/plugins/platforms/cocoa/qcocoamenu.mm b/src/plugins/platforms/cocoa/qcocoamenu.mm
index 77a531f25d..eeb4c01791 100644
--- a/src/plugins/platforms/cocoa/qcocoamenu.mm
+++ b/src/plugins/platforms/cocoa/qcocoamenu.mm
@@ -426,6 +426,7 @@ void QCocoaMenu::scheduleUpdate()
void QCocoaMenu::timerEvent(QTimerEvent *e)
{
if (e->timerId() == m_updateTimer) {
+ killTimer(m_updateTimer);
m_updateTimer = 0;
[m_nativeMenu update];
}
diff --git a/src/plugins/platforms/cocoa/qcocoaprintersupport.h b/src/plugins/platforms/cocoa/qcocoaprintersupport.h
index 371212dae2..a07bf0ec1b 100644
--- a/src/plugins/platforms/cocoa/qcocoaprintersupport.h
+++ b/src/plugins/platforms/cocoa/qcocoaprintersupport.h
@@ -53,7 +53,7 @@ public:
QCocoaPrinterSupport();
~QCocoaPrinterSupport();
- QPrintEngine *createNativePrintEngine(QPrinter::PrinterMode printerMode) Q_DECL_OVERRIDE;
+ QPrintEngine *createNativePrintEngine(QPrinter::PrinterMode printerMode, const QString &deviceId = QString()) Q_DECL_OVERRIDE;
QPaintEngine *createPaintEngine(QPrintEngine *, QPrinter::PrinterMode printerMode) Q_DECL_OVERRIDE;
QPrintDevice createPrintDevice(const QString &id) Q_DECL_OVERRIDE;
diff --git a/src/plugins/platforms/cocoa/qcocoaprintersupport.mm b/src/plugins/platforms/cocoa/qcocoaprintersupport.mm
index c2f7d5b022..d7eaa469fb 100644
--- a/src/plugins/platforms/cocoa/qcocoaprintersupport.mm
+++ b/src/plugins/platforms/cocoa/qcocoaprintersupport.mm
@@ -54,9 +54,9 @@ QCocoaPrinterSupport::QCocoaPrinterSupport()
QCocoaPrinterSupport::~QCocoaPrinterSupport()
{ }
-QPrintEngine *QCocoaPrinterSupport::createNativePrintEngine(QPrinter::PrinterMode printerMode)
+QPrintEngine *QCocoaPrinterSupport::createNativePrintEngine(QPrinter::PrinterMode printerMode, const QString &deviceId)
{
- return new QMacPrintEngine(printerMode);
+ return new QMacPrintEngine(printerMode, deviceId);
}
QPaintEngine *QCocoaPrinterSupport::createPaintEngine(QPrintEngine *printEngine, QPrinter::PrinterMode printerMode)
diff --git a/src/plugins/platforms/cocoa/qnsview.h b/src/plugins/platforms/cocoa/qnsview.h
index 414c6b7fe7..dcf8cf677a 100644
--- a/src/plugins/platforms/cocoa/qnsview.h
+++ b/src/plugins/platforms/cocoa/qnsview.h
@@ -126,9 +126,11 @@ Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper));
- (void)otherMouseUp:(NSEvent *)theEvent;
- (void)handleFrameStrutMouseEvent:(NSEvent *)theEvent;
+#ifndef QT_NO_TABLETEVENT
- (bool)handleTabletEvent: (NSEvent *)theEvent;
- (void)tabletPoint: (NSEvent *)theEvent;
- (void)tabletProximity: (NSEvent *)theEvent;
+#endif
- (int) convertKeyCode : (QChar)keyCode;
+ (Qt::KeyboardModifiers) convertKeyModifiers : (ulong)modifierFlags;
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index 8d3cb6cc05..924173b4c5 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -511,10 +511,12 @@ static QTouchDevice *touchDevice = 0;
if (!m_platformWindow)
return;
+#ifndef QT_NO_TABLETEVENT
// Tablet events may come in via the mouse event handlers,
// check if this is a valid tablet event first.
if ([self handleTabletEvent: theEvent])
return;
+#endif
QPointF qtWindowPoint;
QPointF qtScreenPoint;
@@ -902,6 +904,7 @@ static QTouchDevice *touchDevice = 0;
m_platformWindow->m_enterLeaveTargetWindow = 0;
}
+#ifndef QT_NO_TABLETEVENT
struct QCocoaTabletDeviceData
{
QTabletEvent::TabletDevice device;
@@ -1072,6 +1075,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
QWindowSystemInterface::handleTabletLeaveProximityEvent(timestamp, deviceData.device, deviceData.pointerType, deviceData.uid);
}
}
+#endif
- (bool)shouldSendSingleTouch
{
diff --git a/src/plugins/platforms/cocoa/qprintengine_mac.mm b/src/plugins/platforms/cocoa/qprintengine_mac.mm
index 8098c5e829..c39af870d4 100644
--- a/src/plugins/platforms/cocoa/qprintengine_mac.mm
+++ b/src/plugins/platforms/cocoa/qprintengine_mac.mm
@@ -51,11 +51,15 @@ QT_BEGIN_NAMESPACE
extern QMarginsF qt_convertMargins(const QMarginsF &margins, QPageLayout::Unit fromUnits, QPageLayout::Unit toUnits);
-QMacPrintEngine::QMacPrintEngine(QPrinter::PrinterMode mode) : QPaintEngine(*(new QMacPrintEnginePrivate))
+QMacPrintEngine::QMacPrintEngine(QPrinter::PrinterMode mode, const QString &deviceId)
+ : QPaintEngine(*(new QMacPrintEnginePrivate))
{
Q_D(QMacPrintEngine);
d->mode = mode;
- d->m_printDevice.reset(new QCocoaPrintDevice(QCocoaPrinterSupport().defaultPrintDeviceId()));
+ QString id = deviceId;
+ if (id.isEmpty())
+ id = QCocoaPrinterSupport().defaultPrintDeviceId();
+ d->m_printDevice.reset(new QCocoaPrintDevice(id));
d->m_pageLayout.setPageSize(d->m_printDevice->defaultPageSize());
d->initialize();
}
diff --git a/src/plugins/platforms/cocoa/qprintengine_mac_p.h b/src/plugins/platforms/cocoa/qprintengine_mac_p.h
index ee98275b63..2d46a250d5 100644
--- a/src/plugins/platforms/cocoa/qprintengine_mac_p.h
+++ b/src/plugins/platforms/cocoa/qprintengine_mac_p.h
@@ -78,7 +78,7 @@ class QMacPrintEngine : public QPaintEngine, public QPrintEngine
{
Q_DECLARE_PRIVATE(QMacPrintEngine)
public:
- QMacPrintEngine(QPrinter::PrinterMode mode);
+ QMacPrintEngine(QPrinter::PrinterMode mode, const QString &deviceId);
Qt::HANDLE handle() const;
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp
index a3868fdb1d..800118362d 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp
@@ -240,6 +240,8 @@ void QEglFSKmsGbmCursor::setPos(const QPoint &pos)
m_pos = pos;
else
qWarning("Failed to move cursor on screen %s: %d", kmsScreen->name().toLatin1().constData(), ret);
+
+ kmsScreen->handleCursorMove(pos);
}
}
diff --git a/src/plugins/platforms/ios/qiosbackingstore.h b/src/plugins/platforms/ios/qiosbackingstore.h
index 1c072c0935..3954347471 100644
--- a/src/plugins/platforms/ios/qiosbackingstore.h
+++ b/src/plugins/platforms/ios/qiosbackingstore.h
@@ -54,19 +54,10 @@ public:
QIOSBackingStore(QWindow *window);
~QIOSBackingStore();
- QPaintDevice *paintDevice() Q_DECL_OVERRIDE;
-
- void beginPaint(const QRegion &) Q_DECL_OVERRIDE;
- void endPaint() Q_DECL_OVERRIDE;
-
void flush(QWindow *window, const QRegion &region, const QPoint &offset) Q_DECL_OVERRIDE;
- void resize(const QSize &size, const QRegion &staticContents) Q_DECL_OVERRIDE;
-
- void makeCurrent();
private:
QOpenGLContext *m_context;
- QOpenGLPaintDevice *m_glDevice;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/ios/qiosbackingstore.mm b/src/plugins/platforms/ios/qiosbackingstore.mm
index 96be28af81..74229684e3 100644
--- a/src/plugins/platforms/ios/qiosbackingstore.mm
+++ b/src/plugins/platforms/ios/qiosbackingstore.mm
@@ -41,79 +41,31 @@
#include "qioswindow.h"
#include <QtGui/QOpenGLContext>
-#include <QtGui/QOpenGLPaintDevice>
-#include <QtGui/QOpenGLFramebufferObject>
-#include <QtGui/QOffscreenSurface>
-#include <QtGui/qpainter.h>
#include <QtGui/private/qwindow_p.h>
#include <QtDebug>
QT_BEGIN_NAMESPACE
-class QIOSPaintDevice : public QOpenGLPaintDevice
-{
-public:
- QIOSPaintDevice(QIOSBackingStore *backingStore) : m_backingStore(backingStore) { }
- void ensureActiveTarget() Q_DECL_OVERRIDE;
-
-private:
- QIOSBackingStore *m_backingStore;
-};
-
-void QIOSPaintDevice::ensureActiveTarget()
-{
- m_backingStore->makeCurrent();
-}
-
/*!
\class QIOSBackingStore
- \brief The QPlatformBackingStore on iOS.
-
QBackingStore enables the use of QPainter to paint on a QWindow, as opposed
to rendering to a QWindow through the use of OpenGL with QOpenGLContext.
-
- Historically, the iOS port initially implemented the backing store by using
- an QOpenGLPaintDevice as its paint device, triggering the use of the OpenGL
- paint engine for QPainter based drawing. This was due to raster drawing
- operations being too slow when not being NEON-optimized, and got the port
- up and running quickly.
-
- As of 3e892e4a97, released in Qt 5.7, the backing store now uses a QImage,
- for its paint device, giving normal raster-based QPainter operations, and
- enabling features such as antialiased drawing.
-
- To account for regressions in performance, the old code path is still
- available by setting the surface type of the QWindow to OpenGLSurface.
- This surface type is normally used when rendering though QOpenGLContext,
- but will in the case of QIOSBackingStore trigger the old OpenGL based
- painter.
-
- This fallback path is not too intrusive, as the QImage based path still
- uses OpenGL to composite the image at flush() time using composeAndFlush.
*/
QIOSBackingStore::QIOSBackingStore(QWindow *window)
: QRasterBackingStore(window)
, m_context(new QOpenGLContext)
- , m_glDevice(nullptr)
{
- QSurfaceFormat fmt = window->requestedFormat();
-
- // Due to sharing QIOSContext redirects our makeCurrent on window() attempts to
- // the global share context. Hence it is essential to have a compatible format.
- fmt.setDepthBufferSize(QSurfaceFormat::defaultFormat().depthBufferSize());
- fmt.setStencilBufferSize(QSurfaceFormat::defaultFormat().stencilBufferSize());
-
- if (fmt.depthBufferSize() == 0)
- qWarning("No depth in default format, expect rendering errors");
-
// We use the surface both for raster operations and for GL drawing (when
// we blit the raster image), so the type needs to cover both use cases.
if (window->surfaceType() == QSurface::RasterSurface)
window->setSurfaceType(QSurface::RasterGLSurface);
- m_context->setFormat(fmt);
+ Q_ASSERT_X(window->surfaceType() != QSurface::OpenGLSurface, "QIOSBackingStore",
+ "QBackingStore on iOS can only be used with raster-enabled surfaces.");
+
+ m_context->setFormat(window->requestedFormat());
m_context->setScreen(window->screen());
Q_ASSERT(QOpenGLContext::globalShareContext());
m_context->setShareContext(QOpenGLContext::globalShareContext());
@@ -122,54 +74,12 @@ QIOSBackingStore::QIOSBackingStore(QWindow *window)
QIOSBackingStore::~QIOSBackingStore()
{
- if (window()->surfaceType() == QSurface::RasterGLSurface) {
- // We're using composeAndFlush from QPlatformBackingStore, which
- // need to clean up any textures in its destructor, so make the
- // context current and keep it alive until QPlatformBackingStore
- // has cleaned up everything.
- makeCurrent();
- m_context->deleteLater();
- } else {
- delete m_context;
- }
-
- delete m_glDevice;
-}
-
-void QIOSBackingStore::makeCurrent()
-{
- if (!m_context->makeCurrent(window()))
- qWarning("QIOSBackingStore: makeCurrent() failed");
-}
-
-void QIOSBackingStore::beginPaint(const QRegion &region)
-{
- makeCurrent();
-
- if (!m_glDevice)
- m_glDevice = new QIOSPaintDevice(this);
-
- if (window()->surfaceType() == QSurface::RasterGLSurface)
- QRasterBackingStore::beginPaint(region);
-}
-
-void QIOSBackingStore::endPaint()
-{
-}
-
-QPaintDevice *QIOSBackingStore::paintDevice()
-{
- Q_ASSERT(m_glDevice);
-
- // Keep paint device size and device pixel ratio in sync with window
- qreal devicePixelRatio = window()->devicePixelRatio();
- m_glDevice->setSize(window()->size() * devicePixelRatio);
- m_glDevice->setDevicePixelRatio(devicePixelRatio);
-
- if (window()->surfaceType() == QSurface::RasterGLSurface)
- return QRasterBackingStore::paintDevice();
- else
- return m_glDevice;
+ // We're using composeAndFlush from QPlatformBackingStore, which
+ // need to clean up any textures in its destructor, so make the
+ // context current and keep it alive until QPlatformBackingStore
+ // has cleaned up everything.
+ m_context->makeCurrent(window());
+ m_context->deleteLater();
}
void QIOSBackingStore::flush(QWindow *window, const QRegion &region, const QPoint &offset)
@@ -187,33 +97,8 @@ void QIOSBackingStore::flush(QWindow *window, const QRegion &region, const QPoin
return;
}
- if (window->surfaceType() == QSurface::RasterGLSurface) {
- static QPlatformTextureList emptyTextureList;
- composeAndFlush(window, region, offset, &emptyTextureList, m_context, false);
- } else {
- m_context->makeCurrent(window);
- m_context->swapBuffers(window);
- }
-}
-
-void QIOSBackingStore::resize(const QSize &size, const QRegion &staticContents)
-{
- Q_UNUSED(staticContents);
-
- if (window()->surfaceType() == QSurface::OpenGLSurface) {
- // Resizing the backing store would in this case mean resizing the QWindow,
- // as we use an QOpenGLPaintDevice that we target at the window. That's
- // probably not what the user intended, so we ignore resizes of the backing
- // store and always keep the paint device's size in sync with the window
- // size in beginPaint().
-
- if (size != window()->size() && !window()->inherits("QWidgetWindow"))
- qWarning("QIOSBackingStore needs to have the same size as its window");
-
- return;
- }
-
- QRasterBackingStore::resize(size, staticContents);
+ static QPlatformTextureList emptyTextureList;
+ composeAndFlush(window, region, offset, &emptyTextureList, m_context, false);
}
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/ios/qiosintegration.mm b/src/plugins/platforms/ios/qiosintegration.mm
index 5c42828885..482f996943 100644
--- a/src/plugins/platforms/ios/qiosintegration.mm
+++ b/src/plugins/platforms/ios/qiosintegration.mm
@@ -97,11 +97,6 @@ QIOSIntegration::QIOSIntegration()
// The backingstore needs a global share context in order to support composition in
// QPlatformBackingStore.
qApp->setAttribute(Qt::AA_ShareOpenGLContexts, true);
- // And that context must match the format used for the backingstore's context.
- QSurfaceFormat fmt = QSurfaceFormat::defaultFormat();
- fmt.setDepthBufferSize(16);
- fmt.setStencilBufferSize(8);
- QSurfaceFormat::setDefaultFormat(fmt);
// Set current directory to app bundle folder
QDir::setCurrent(QString::fromUtf8([[[NSBundle mainBundle] bundlePath] UTF8String]));
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 3e445f0f7f..3f417fde27 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -896,8 +896,10 @@ void QWindowsBaseWindow::hide_sys() // Normal hide, do not activate other window
void QWindowsBaseWindow::raise_sys()
{
qCDebug(lcQpaWindows) << __FUNCTION__ << this << window();
- if ((window()->flags() & (Qt::WindowStaysOnTopHint | Qt::WindowStaysOnBottomHint)) == 0)
+ if (window()->type() == Qt::Popup
+ || (window()->flags() & (Qt::WindowStaysOnTopHint | Qt::WindowStaysOnBottomHint)) == 0) {
SetWindowPos(handle(), HWND_TOP, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
+ }
}
void QWindowsBaseWindow::lower_sys()
diff --git a/src/plugins/platforms/winrt/winrt.pro b/src/plugins/platforms/winrt/winrt.pro
index 02a848b03f..042b270cff 100644
--- a/src/plugins/platforms/winrt/winrt.pro
+++ b/src/plugins/platforms/winrt/winrt.pro
@@ -8,7 +8,7 @@ QT += \
DEFINES *= QT_NO_CAST_FROM_ASCII __WRL_NO_DEFAULT_LIB__
-LIBS += $$QMAKE_LIBS_CORE -ld3d11
+LIBS += -lws2_32 -ld3d11
SOURCES = \
main.cpp \
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp
index 23bb5c6410..536c709dbe 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp
@@ -556,9 +556,10 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGra
m_connection = xcb_connect(m_displayName.constData(), &m_primaryScreenNumber);
#endif // QT_CONFIG(xcb_xlib)
- if (Q_UNLIKELY(!m_connection || xcb_connection_has_error(m_connection)))
- qFatal("QXcbConnection: Could not connect to display %s", m_displayName.constData());
-
+ if (Q_UNLIKELY(!m_connection || xcb_connection_has_error(m_connection))) {
+ qCWarning(lcQpaScreen, "QXcbConnection: Could not connect to display %s", m_displayName.constData());
+ return;
+ }
m_reader = new QXcbEventReader(this);
m_reader->start();
@@ -648,7 +649,7 @@ QXcbConnection::~QXcbConnection()
#ifndef QT_NO_DRAGANDDROP
delete m_drag;
#endif
- if (m_reader->isRunning()) {
+ if (m_reader && m_reader->isRunning()) {
sendConnectionEvent(QXcbAtom::_QT_CLOSE_CONNECTION);
m_reader->wait();
}
@@ -665,15 +666,22 @@ QXcbConnection::~QXcbConnection()
delete m_glIntegration;
+ if (isConnected()) {
#if QT_CONFIG(xcb_xlib)
- XCloseDisplay(static_cast<Display *>(m_xlib_display));
+ XCloseDisplay(static_cast<Display *>(m_xlib_display));
#else
- xcb_disconnect(xcb_connection());
+ xcb_disconnect(xcb_connection());
#endif
+ }
delete m_keyboard;
}
+bool QXcbConnection::isConnected() const
+{
+ return m_connection && !xcb_connection_has_error(m_connection);
+}
+
QXcbScreen *QXcbConnection::primaryScreen() const
{
if (!m_screens.isEmpty()) {
diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h
index a37ce5f5a6..999dc0630c 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.h
+++ b/src/plugins/platforms/xcb/qxcbconnection.h
@@ -391,6 +391,7 @@ public:
~QXcbConnection();
QXcbConnection *connection() const { return const_cast<QXcbConnection *>(this); }
+ bool isConnected() const;
const QList<QXcbVirtualDesktop *> &virtualDesktops() const { return m_virtualDesktops; }
const QList<QXcbScreen *> &screens() const { return m_screens; }
diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp
index c8efe2fce8..72d31060db 100644
--- a/src/plugins/platforms/xcb/qxcbintegration.cpp
+++ b/src/plugins/platforms/xcb/qxcbintegration.cpp
@@ -188,12 +188,25 @@ QXcbIntegration::QXcbIntegration(const QStringList &parameters, int &argc, char
const int numParameters = parameters.size();
m_connections.reserve(1 + numParameters / 2);
- m_connections << new QXcbConnection(m_nativeInterface.data(), m_canGrab, m_defaultVisualId, displayName);
+ auto conn = new QXcbConnection(m_nativeInterface.data(), m_canGrab, m_defaultVisualId, displayName);
+ if (conn->isConnected())
+ m_connections << conn;
+ else
+ delete conn;
for (int i = 0; i < numParameters - 1; i += 2) {
qCDebug(lcQpaScreen) << "connecting to additional display: " << parameters.at(i) << parameters.at(i+1);
QString display = parameters.at(i) + QLatin1Char(':') + parameters.at(i+1);
- m_connections << new QXcbConnection(m_nativeInterface.data(), m_canGrab, m_defaultVisualId, display.toLatin1().constData());
+ conn = new QXcbConnection(m_nativeInterface.data(), m_canGrab, m_defaultVisualId, display.toLatin1().constData());
+ if (conn->isConnected())
+ m_connections << conn;
+ else
+ delete conn;
+ }
+
+ if (m_connections.isEmpty()) {
+ qCritical("Could not connect to any X display.");
+ exit(1);
}
m_fontDatabase.reset(new QGenericUnixFontDatabase());
diff --git a/src/plugins/printsupport/cups/qcupsprintengine.cpp b/src/plugins/printsupport/cups/qcupsprintengine.cpp
index a16eb3abb5..e7949d3a0b 100644
--- a/src/plugins/printsupport/cups/qcupsprintengine.cpp
+++ b/src/plugins/printsupport/cups/qcupsprintengine.cpp
@@ -57,11 +57,11 @@ QT_BEGIN_NAMESPACE
extern QMarginsF qt_convertMargins(const QMarginsF &margins, QPageLayout::Unit fromUnits, QPageLayout::Unit toUnits);
-QCupsPrintEngine::QCupsPrintEngine(QPrinter::PrinterMode m)
+QCupsPrintEngine::QCupsPrintEngine(QPrinter::PrinterMode m, const QString &deviceId)
: QPdfPrintEngine(*new QCupsPrintEnginePrivate(m))
{
Q_D(QCupsPrintEngine);
- d->setupDefaultPrinter();
+ d->changePrinter(deviceId);
state = QPrinter::Idle;
}
diff --git a/src/plugins/printsupport/cups/qcupsprintengine_p.h b/src/plugins/printsupport/cups/qcupsprintengine_p.h
index 5956c86551..0ebf6e7a0f 100644
--- a/src/plugins/printsupport/cups/qcupsprintengine_p.h
+++ b/src/plugins/printsupport/cups/qcupsprintengine_p.h
@@ -68,7 +68,7 @@ class QCupsPrintEngine : public QPdfPrintEngine
{
Q_DECLARE_PRIVATE(QCupsPrintEngine)
public:
- QCupsPrintEngine(QPrinter::PrinterMode m);
+ QCupsPrintEngine(QPrinter::PrinterMode m, const QString &deviceId);
virtual ~QCupsPrintEngine();
// reimplementations QPdfPrintEngine
diff --git a/src/plugins/printsupport/cups/qcupsprintersupport.cpp b/src/plugins/printsupport/cups/qcupsprintersupport.cpp
index 1887625406..a9c992a2e1 100644
--- a/src/plugins/printsupport/cups/qcupsprintersupport.cpp
+++ b/src/plugins/printsupport/cups/qcupsprintersupport.cpp
@@ -63,9 +63,9 @@ QCupsPrinterSupport::~QCupsPrinterSupport()
{
}
-QPrintEngine *QCupsPrinterSupport::createNativePrintEngine(QPrinter::PrinterMode printerMode)
+QPrintEngine *QCupsPrinterSupport::createNativePrintEngine(QPrinter::PrinterMode printerMode, const QString &deviceId)
{
- return new QCupsPrintEngine(printerMode);
+ return new QCupsPrintEngine(printerMode, (deviceId.isEmpty() ? defaultPrintDeviceId() : deviceId));
}
QPaintEngine *QCupsPrinterSupport::createPaintEngine(QPrintEngine *engine, QPrinter::PrinterMode printerMode)
diff --git a/src/plugins/printsupport/cups/qcupsprintersupport_p.h b/src/plugins/printsupport/cups/qcupsprintersupport_p.h
index 13f64b5e69..df6507d324 100644
--- a/src/plugins/printsupport/cups/qcupsprintersupport_p.h
+++ b/src/plugins/printsupport/cups/qcupsprintersupport_p.h
@@ -64,7 +64,7 @@ public:
QCupsPrinterSupport();
~QCupsPrinterSupport();
- QPrintEngine *createNativePrintEngine(QPrinter::PrinterMode printerMode) Q_DECL_OVERRIDE;
+ QPrintEngine *createNativePrintEngine(QPrinter::PrinterMode printerMode, const QString &deviceId = QString()) Q_DECL_OVERRIDE;
QPaintEngine *createPaintEngine(QPrintEngine *printEngine, QPrinter::PrinterMode) Q_DECL_OVERRIDE;
QPrintDevice createPrintDevice(const QString &id) Q_DECL_OVERRIDE;
diff --git a/src/plugins/printsupport/windows/qwindowsprintersupport.cpp b/src/plugins/printsupport/windows/qwindowsprintersupport.cpp
index 875ee589c7..a7eabc2622 100644
--- a/src/plugins/printsupport/windows/qwindowsprintersupport.cpp
+++ b/src/plugins/printsupport/windows/qwindowsprintersupport.cpp
@@ -55,9 +55,9 @@ QWindowsPrinterSupport::~QWindowsPrinterSupport()
{
}
-QPrintEngine *QWindowsPrinterSupport::createNativePrintEngine(QPrinter::PrinterMode printerMode)
+QPrintEngine *QWindowsPrinterSupport::createNativePrintEngine(QPrinter::PrinterMode printerMode, const QString &deviceId)
{
- return new QWin32PrintEngine(printerMode);
+ return new QWin32PrintEngine(printerMode, deviceId);
}
QPaintEngine *QWindowsPrinterSupport::createPaintEngine(QPrintEngine *engine, QPrinter::PrinterMode printerMode)
diff --git a/src/plugins/printsupport/windows/qwindowsprintersupport.h b/src/plugins/printsupport/windows/qwindowsprintersupport.h
index 50db810f34..84b60a8207 100644
--- a/src/plugins/printsupport/windows/qwindowsprintersupport.h
+++ b/src/plugins/printsupport/windows/qwindowsprintersupport.h
@@ -50,7 +50,7 @@ public:
QWindowsPrinterSupport();
~QWindowsPrinterSupport();
- QPrintEngine *createNativePrintEngine(QPrinter::PrinterMode printerMode) Q_DECL_OVERRIDE;
+ QPrintEngine *createNativePrintEngine(QPrinter::PrinterMode printerMode, const QString &deviceId = QString()) Q_DECL_OVERRIDE;
QPaintEngine *createPaintEngine(QPrintEngine *printEngine, QPrinter::PrinterMode) Q_DECL_OVERRIDE;
QPrintDevice createPrintDevice(const QString &id) Q_DECL_OVERRIDE;
diff --git a/src/plugins/sqldrivers/configure.pri b/src/plugins/sqldrivers/configure.pri
index 9fb957291f..b69b51b679 100644
--- a/src/plugins/sqldrivers/configure.pri
+++ b/src/plugins/sqldrivers/configure.pri
@@ -37,7 +37,7 @@ defineTest(qtConfLibrary_psqlEnv) {
$${1}.libs = $$PSQL_LIBS
export($${1}.libs)
} else {
- !qtConfLibrary_inline($$1): \
+ !qtConfLibrary_inline($$1, $$2): \
return(false)
}
return(true)
diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm
index 4bcfa75f36..16762cf6d6 100644
--- a/src/plugins/styles/mac/qmacstyle_mac.mm
+++ b/src/plugins/styles/mac/qmacstyle_mac.mm
@@ -1269,7 +1269,12 @@ void QMacStylePrivate::tabLayout(const QStyleOptionTab *opt, const QWidget *widg
tabIconSize.width(), tabIconSize.height());
if (!verticalTabs)
*iconRect = proxyStyle->visualRect(opt->direction, opt->rect, *iconRect);
- tr.setLeft(tr.left() + tabIconSize.width() + 4);
+
+ int stylePadding = proxyStyle->pixelMetric(QStyle::PM_TabBarTabHSpace, opt, widget) / 2;
+ stylePadding -= hpadding;
+
+ tr.setLeft(tr.left() + stylePadding + tabIconSize.width() + 4);
+ tr.setRight(tr.right() - stylePadding - tabIconSize.width() - 4);
}
if (!verticalTabs)
diff --git a/src/printsupport/kernel/qplatformprintersupport.cpp b/src/printsupport/kernel/qplatformprintersupport.cpp
index 5397c43b33..388dd5ff8e 100644
--- a/src/printsupport/kernel/qplatformprintersupport.cpp
+++ b/src/printsupport/kernel/qplatformprintersupport.cpp
@@ -68,7 +68,7 @@ QPlatformPrinterSupport::~QPlatformPrinterSupport()
{
}
-QPrintEngine *QPlatformPrinterSupport::createNativePrintEngine(QPrinter::PrinterMode)
+QPrintEngine *QPlatformPrinterSupport::createNativePrintEngine(QPrinter::PrinterMode, const QString &)
{
return 0;
}
diff --git a/src/printsupport/kernel/qplatformprintersupport.h b/src/printsupport/kernel/qplatformprintersupport.h
index d3da4295a1..6a4246adc0 100644
--- a/src/printsupport/kernel/qplatformprintersupport.h
+++ b/src/printsupport/kernel/qplatformprintersupport.h
@@ -72,7 +72,7 @@ public:
QPlatformPrinterSupport();
virtual ~QPlatformPrinterSupport();
- virtual QPrintEngine *createNativePrintEngine(QPrinter::PrinterMode printerMode);
+ virtual QPrintEngine *createNativePrintEngine(QPrinter::PrinterMode printerMode, const QString &deviceId = QString());
virtual QPaintEngine *createPaintEngine(QPrintEngine *, QPrinter::PrinterMode printerMode);
virtual QPrintDevice createPrintDevice(const QString &id);
diff --git a/src/printsupport/kernel/qprintengine_win.cpp b/src/printsupport/kernel/qprintengine_win.cpp
index 37f2290d94..e399118cc9 100644
--- a/src/printsupport/kernel/qprintengine_win.cpp
+++ b/src/printsupport/kernel/qprintengine_win.cpp
@@ -79,7 +79,7 @@ extern QMarginsF qt_convertMargins(const QMarginsF &margins, QPageLayout::Unit f
static void draw_text_item_win(const QPointF &_pos, const QTextItemInt &ti, HDC hdc,
const QTransform &xform, const QPointF &topLeft);
-QWin32PrintEngine::QWin32PrintEngine(QPrinter::PrinterMode mode)
+QWin32PrintEngine::QWin32PrintEngine(QPrinter::PrinterMode mode, const QString &deviceId)
: QAlphaPaintEngine(*(new QWin32PrintEnginePrivate),
PaintEngineFeatures(PrimitiveTransform
| PixmapTransform
@@ -92,7 +92,7 @@ QWin32PrintEngine::QWin32PrintEngine(QPrinter::PrinterMode mode)
d->mode = mode;
QPlatformPrinterSupport *ps = QPlatformPrinterSupportPlugin::get();
if (ps)
- d->m_printDevice = ps->createDefaultPrintDevice();
+ d->m_printDevice = ps->createPrintDevice(deviceId.isEmpty() ? ps->defaultPrintDeviceId() : deviceId);
d->m_pageLayout.setPageSize(d->m_printDevice.defaultPageSize());
d->initialize();
}
diff --git a/src/printsupport/kernel/qprintengine_win_p.h b/src/printsupport/kernel/qprintengine_win_p.h
index 196263df74..876155a3a5 100644
--- a/src/printsupport/kernel/qprintengine_win_p.h
+++ b/src/printsupport/kernel/qprintengine_win_p.h
@@ -73,7 +73,7 @@ class Q_PRINTSUPPORT_EXPORT QWin32PrintEngine : public QAlphaPaintEngine, public
{
Q_DECLARE_PRIVATE(QWin32PrintEngine)
public:
- QWin32PrintEngine(QPrinter::PrinterMode mode);
+ QWin32PrintEngine(QPrinter::PrinterMode mode, const QString &deviceId);
// override QWin32PaintEngine
bool begin(QPaintDevice *dev);
diff --git a/src/printsupport/kernel/qprinter.cpp b/src/printsupport/kernel/qprinter.cpp
index d59db444e4..3135836ce7 100644
--- a/src/printsupport/kernel/qprinter.cpp
+++ b/src/printsupport/kernel/qprinter.cpp
@@ -146,7 +146,7 @@ void QPrinterPrivate::initEngines(QPrinter::OutputFormat format, const QPrinterI
}
if (outputFormat == QPrinter::NativeFormat) {
- printEngine = ps->createNativePrintEngine(printerMode);
+ printEngine = ps->createNativePrintEngine(printerMode, printerName);
paintEngine = ps->createPaintEngine(printEngine, printerMode);
} else {
const auto pdfEngineVersion = (pdfVersion == QPrinter::PdfVersion_1_4 ? QPdfEngine::Version_1_4 : QPdfEngine::Version_A1b);
@@ -157,7 +157,6 @@ void QPrinterPrivate::initEngines(QPrinter::OutputFormat format, const QPrinterI
use_default_engine = true;
had_default_engines = true;
- setProperty(QPrintEngine::PPK_PrinterName, printerName);
validPrinter = true;
}
diff --git a/src/sql/kernel/qsqldriver.cpp b/src/sql/kernel/qsqldriver.cpp
index bf98f82087..6fe5b351dc 100644
--- a/src/sql/kernel/qsqldriver.cpp
+++ b/src/sql/kernel/qsqldriver.cpp
@@ -246,6 +246,7 @@ bool QSqlDriver::isOpenError() const
/*!
\enum QSqlDriver::DbmsType
+ \internal
This enum contains DBMS types.
@@ -807,6 +808,7 @@ QSql::NumericalPrecisionPolicy QSqlDriver::numericalPrecisionPolicy() const
/*!
\since 5.4
+ \internal
Returns the current DBMS type for the database connection.
*/
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index cbd38d0788..fd68bbe461 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -1664,9 +1664,15 @@ static LONG WINAPI windowsFaultHandler(struct _EXCEPTION_POINTERS *exInfo)
}
#endif // Q_OS_WIN) && !Q_OS_WINRT
+static void qputenvIfEmpty(const char *name, const QByteArray &value)
+{
+ if (qEnvironmentVariableIsEmpty(name))
+ qputenv(name, value);
+}
+
static void initEnvironment()
{
- qputenv("QT_LOGGING_TO_CONSOLE", "1");
+ qputenvIfEmpty("QT_LOGGING_TO_CONSOLE", "1");
qputenv("QT_QTESTLIB_RUNNING", "1");
}
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 7b9ccf3837..b38f046c21 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -7243,7 +7243,8 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove)
QRect r(x, y, w, h);
bool isResize = olds != r.size();
- isMove = oldp != r.topLeft(); //### why do we have isMove as a parameter?
+ if (!isMove)
+ isMove = oldp != r.topLeft();
// We only care about stuff that changes the geometry, or may
@@ -7277,12 +7278,17 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove)
if (q->isVisible()) {
if (!q->testAttribute(Qt::WA_DontShowOnScreen) && !q->testAttribute(Qt::WA_OutsideWSRange)) {
- if (q->windowHandle()) {
+ if (QWindow *win = q->windowHandle()) {
if (q->isWindow()) {
- q->windowHandle()->setGeometry(q->geometry());
+ if (isResize && !isMove)
+ win->resize(w, h);
+ else if (isMove && !isResize)
+ win->setPosition(x, y);
+ else
+ win->setGeometry(q->geometry());
} else {
QPoint posInNativeParent = q->mapTo(q->nativeParentWidget(),QPoint());
- q->windowHandle()->setGeometry(QRect(posInNativeParent,r.size()));
+ win->setGeometry(QRect(posInNativeParent,r.size()));
}
if (needsShow)
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index 5167e59019..d5b8d2b32b 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -572,13 +572,8 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q
break; }
#endif // QT_NO_SPINBOX
case PE_PanelTipLabel: {
- QBrush oldBrush = p->brush();
- QPen oldPen = p->pen();
- p->setPen(QPen(opt->palette.toolTipText(), 0));
- p->setBrush(opt->palette.toolTipBase());
- p->drawRect(opt->rect.adjusted(0, 0, -1, -1));
- p->setPen(oldPen);
- p->setBrush(oldBrush);
+ const QBrush brush(opt->palette.toolTipBase());
+ qDrawPlainRect(p, opt->rect, opt->palette.toolTipText().color(), 1, &brush);
break;
}
#if QT_CONFIG(tabbar)
diff --git a/src/widgets/util/qcompleter.cpp b/src/widgets/util/qcompleter.cpp
index 8b5aa3f2e4..25e08c3921 100644
--- a/src/widgets/util/qcompleter.cpp
+++ b/src/widgets/util/qcompleter.cpp
@@ -1031,11 +1031,15 @@ QCompleter::~QCompleter()
void QCompleter::setWidget(QWidget *widget)
{
Q_D(QCompleter);
+ if (widget == d->widget)
+ return;
+
if (d->widget)
d->widget->removeEventFilter(this);
d->widget = widget;
if (d->widget)
d->widget->installEventFilter(this);
+
if (d->popup) {
d->popup->hide();
d->popup->setFocusProxy(d->widget);
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp
index ab89b8a415..0355bb44f7 100644
--- a/src/widgets/widgets/qmenu.cpp
+++ b/src/widgets/widgets/qmenu.cpp
@@ -264,20 +264,23 @@ int QMenuPrivate::scrollerHeight() const
}
//Windows and KDE allow menus to cover the taskbar, while GNOME and Mac don't
-QRect QMenuPrivate::popupGeometry(const QWidget *widget) const
+QRect QMenuPrivate::popupGeometry() const
{
- if (QGuiApplicationPrivate::platformTheme() &&
+ Q_Q(const QMenu);
+ if (!tornoff && // Torn-off menus are different
+ QGuiApplicationPrivate::platformTheme() &&
QGuiApplicationPrivate::platformTheme()->themeHint(QPlatformTheme::UseFullScreenForPopupMenu).toBool()) {
- return QDesktopWidgetPrivate::screenGeometry(widget);
+ return QDesktopWidgetPrivate::screenGeometry(q);
} else {
- return QDesktopWidgetPrivate::availableGeometry(widget);
+ return QDesktopWidgetPrivate::availableGeometry(q);
}
}
//Windows and KDE allow menus to cover the taskbar, while GNOME and Mac don't
QRect QMenuPrivate::popupGeometry(int screen) const
{
- if (QGuiApplicationPrivate::platformTheme() &&
+ if (!tornoff && // Torn-off menus are different
+ QGuiApplicationPrivate::platformTheme() &&
QGuiApplicationPrivate::platformTheme()->themeHint(QPlatformTheme::UseFullScreenForPopupMenu).toBool()) {
return QDesktopWidgetPrivate::screenGeometry(screen);
} else {
@@ -307,8 +310,7 @@ bool QMenuPrivate::isContextMenu() const
void QMenuPrivate::updateActionRects() const
{
- Q_Q(const QMenu);
- updateActionRects(popupGeometry(q));
+ updateActionRects(popupGeometry());
}
void QMenuPrivate::updateActionRects(const QRect &screen) const
@@ -1076,7 +1078,7 @@ void QMenuPrivate::scrollMenu(QAction *action, QMenuScroller::ScrollLocation loc
if (newScrollFlags & QMenuScroller::ScrollUp)
newOffset -= vmargin;
- QRect screen = popupGeometry(q);
+ QRect screen = popupGeometry();
const int desktopFrame = q->style()->pixelMetric(QStyle::PM_MenuDesktopFrameWidth, 0, q);
if (q->height() < screen.height()-(desktopFrame*2)-1) {
QRect geom = q->geometry();
@@ -2330,7 +2332,7 @@ void QMenu::popup(const QPoint &p, QAction *atAction)
#if QT_CONFIG(graphicsview)
bool isEmbedded = !bypassGraphicsProxyWidget(this) && d->nearestGraphicsProxyWidget(this);
if (isEmbedded)
- screen = d->popupGeometry(this);
+ screen = d->popupGeometry();
else
#endif
screen = d->popupGeometry(QDesktopWidgetPrivate::screenNumber(p));
@@ -3599,7 +3601,7 @@ void QMenu::internalDelayedPopup()
#if QT_CONFIG(graphicsview)
bool isEmbedded = !bypassGraphicsProxyWidget(this) && d->nearestGraphicsProxyWidget(this);
if (isEmbedded)
- screen = d->popupGeometry(this);
+ screen = d->popupGeometry();
else
#endif
screen = d->popupGeometry(QDesktopWidgetPrivate::screenNumber(pos()));
diff --git a/src/widgets/widgets/qmenu_p.h b/src/widgets/widgets/qmenu_p.h
index a48d41c140..574c71c31e 100644
--- a/src/widgets/widgets/qmenu_p.h
+++ b/src/widgets/widgets/qmenu_p.h
@@ -110,9 +110,9 @@ public:
{
m_menu = menu;
m_uni_directional = menu->style()->styleHint(QStyle::SH_Menu_SubMenuUniDirection, 0, menu);
- m_uni_dir_fail_at_count = menu->style()->styleHint(QStyle::SH_Menu_SubMenuUniDirectionFailCount, 0, menu);
+ m_uni_dir_fail_at_count = short(menu->style()->styleHint(QStyle::SH_Menu_SubMenuUniDirectionFailCount, 0, menu));
m_select_other_actions = menu->style()->styleHint(QStyle::SH_Menu_SubMenuSloppySelectOtherActions, 0 , menu);
- m_timeout = menu->style()->styleHint(QStyle::SH_Menu_SubMenuSloppyCloseTimeout);
+ m_timeout = short(menu->style()->styleHint(QStyle::SH_Menu_SubMenuSloppyCloseTimeout));
m_discard_state_when_entering_parent = menu->style()->styleHint(QStyle::SH_Menu_SubMenuResetWhenReenteringParent);
m_dont_start_time_on_leave = menu->style()->styleHint(QStyle::SH_Menu_SubMenuDontStartSloppyOnLeave);
reset();
@@ -150,12 +150,12 @@ public:
void leave();
void childLeave();
- static float slope(const QPointF &p1, const QPointF &p2)
+ static qreal slope(const QPointF &p1, const QPointF &p2)
{
const QPointF slope = p2 - p1;
- if (slope.x()== 0)
+ if (qFuzzyIsNull(slope.x()))
return 9999;
- return slope.y()/slope.x();
+ return slope.y() / slope.x();
}
bool checkSlope(qreal oldS, qreal newS, bool wantSteeper)
@@ -218,7 +218,7 @@ public:
bool slopeTop = checkSlope(prev_slope_top, current_slope_top, sub_menu_top.y() < mousePos.y());
bool slopeBottom = checkSlope(prev_slope_bottom, current_slope_bottom, sub_menu_bottom.y() > mousePos.y());
bool rightDirection = false;
- int mouseDir = m_previous_point.y() - mousePos.y();
+ int mouseDir = int(m_previous_point.y() - mousePos.y());
if (mouseDir >= 0) {
rightDirection = rightDirection || slopeTop;
}
@@ -318,8 +318,8 @@ public:
mutable QHash<QAction *, QWidget *> widgetItems;
void updateActionRects() const;
void updateActionRects(const QRect &screen) const;
- QRect popupGeometry(const QWidget *widget) const;
- QRect popupGeometry(int screen = -1) const;
+ QRect popupGeometry() const;
+ QRect popupGeometry(int screen) const;
mutable uint ncols : 4; //4 bits is probably plenty
uint collapsibleSeparators : 1;
uint toolTipsVisible : 1;
diff --git a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
index 3fa765e2fa..a7dc869805 100644
--- a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
+++ b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
@@ -1243,6 +1243,7 @@ void tst_QFileInfo::isSymLink_data()
QFile::remove("link.lnk");
QFile::remove("brokenlink.lnk");
QFile::remove("dummyfile");
+ QFile::remove("relative/link.lnk");
QFile file1(m_sourceFile);
QVERIFY(file1.link("link.lnk"));
@@ -1259,6 +1260,12 @@ void tst_QFileInfo::isSymLink_data()
QTest::newRow("existent file") << m_sourceFile << false << "";
QTest::newRow("link") << "link.lnk" << true << QFileInfo(m_sourceFile).absoluteFilePath();
QTest::newRow("broken link") << "brokenlink.lnk" << true << QFileInfo("dummyfile").absoluteFilePath();
+
+#ifndef Q_OS_WIN
+ QDir::current().mkdir("relative");
+ QFile::link("../dummyfile", "relative/link.lnk");
+ QTest::newRow("relative link") << "relative/link.lnk" << true << QFileInfo("dummyfile").absoluteFilePath();
+#endif
#endif
}
diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
index ff8ee3d168..fc9f50b15c 100644
--- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
+++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
@@ -105,6 +105,7 @@ private slots:
void stateChange();
void flags();
void cleanup();
+ void testBlockingWindowShownAfterModalDialog();
private:
QPoint m_availableTopLeft;
@@ -2270,6 +2271,47 @@ void tst_QWindow::flags()
QCOMPARE(window.flags(), baseFlags | Qt::WindowStaysOnTopHint);
}
+class EventWindow : public QWindow
+{
+public:
+ EventWindow() : QWindow(), gotBlocked(false) {}
+ bool gotBlocked;
+protected:
+ bool event(QEvent *e)
+ {
+ if (e->type() == QEvent::WindowBlocked)
+ gotBlocked = true;
+ return QWindow::event(e);
+ }
+};
+
+void tst_QWindow::testBlockingWindowShownAfterModalDialog()
+{
+ EventWindow normalWindow;
+ normalWindow.setFramePosition(m_availableTopLeft + QPoint(80, 80));
+ normalWindow.resize(m_testWindowSize);
+ normalWindow.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&normalWindow));
+ QVERIFY(!normalWindow.gotBlocked);
+
+ QWindow dialog;
+ dialog.setFramePosition(m_availableTopLeft + QPoint(200, 200));
+ dialog.resize(m_testWindowSize);
+ dialog.setModality(Qt::ApplicationModal);
+ dialog.setFlags(Qt::Dialog);
+ dialog.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&dialog));
+ QVERIFY(normalWindow.gotBlocked);
+
+ EventWindow normalWindowAfter;
+ normalWindowAfter.setFramePosition(m_availableTopLeft + QPoint(80, 80));
+ normalWindowAfter.resize(m_testWindowSize);
+ QVERIFY(!normalWindowAfter.gotBlocked);
+ normalWindowAfter.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&normalWindowAfter));
+ QVERIFY(normalWindowAfter.gotBlocked);
+}
+
#include <tst_qwindow.moc>
QTEST_MAIN(tst_QWindow)
diff --git a/tests/auto/gui/text/qfont/BLACKLIST b/tests/auto/gui/text/qfont/BLACKLIST
index 8890ec1ef3..295c61ff12 100644
--- a/tests/auto/gui/text/qfont/BLACKLIST
+++ b/tests/auto/gui/text/qfont/BLACKLIST
@@ -2,3 +2,5 @@
# QTBUG-46054
opensuse-13.1
opensuse-42.1
+[defaultFamily]
+b2qt
diff --git a/tests/auto/network/ssl/qsslcertificate/pkcs12/README b/tests/auto/network/ssl/qsslcertificate/pkcs12/README
index 1828d089c1..231567f586 100644
--- a/tests/auto/network/ssl/qsslcertificate/pkcs12/README
+++ b/tests/auto/network/ssl/qsslcertificate/pkcs12/README
@@ -1,8 +1,19 @@
-The PKCS#12 bundle was created by running the following on
-in the qsslsocket/certs directory:
+The PKCS#12 bundle was created by running the following in an
+interactive shell in ../../qsslsocket/certs/:
-openssl pkcs12 -export -in leaf.crt -inkey leaf.key \
- -out leaf.p12 \
+openssl pkcs12 -export -in leaf.crt \
+ -inkey leaf.key -out leaf.p12 \
-certfile inter.crt -CAfile ca.crt
-No password was provided.
+An empty password was provided (twice). The pkcs.crt and pkcs.key
+files were then copied here and leaf.p12 was moved here.
+
+
+The test-case with no private key (in a valid PKCS12 file) was created
+similarly but with the command adjusted to:
+
+openssl pkcs12 -export -in leaf.crt \
+ -nokeys -out leaf-nokey.p12 \
+ -certfile inter.crt -CAfile ca.crt
+
+The file leaf-nokey.p12 was then moved here.
diff --git a/tests/auto/network/ssl/qsslcertificate/pkcs12/leaf-nokey.p12 b/tests/auto/network/ssl/qsslcertificate/pkcs12/leaf-nokey.p12
new file mode 100644
index 0000000000..032bf97b1b
--- /dev/null
+++ b/tests/auto/network/ssl/qsslcertificate/pkcs12/leaf-nokey.p12
Binary files differ
diff --git a/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp b/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp
index fced638ecb..064efc120b 100644
--- a/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp
+++ b/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp
@@ -1308,6 +1308,7 @@ void tst_QSslCertificate::version()
void tst_QSslCertificate::pkcs12()
{
+ // See pkcs12/README for how to generate the PKCS12 files used here.
if (!QSslSocket::supportsSsl()) {
qWarning("SSL not supported, skipping test");
return;
@@ -1349,6 +1350,15 @@ void tst_QSslCertificate::pkcs12()
QVERIFY(!caCerts.isEmpty());
QCOMPARE(caCerts.first(), caCert.first());
QCOMPARE(caCerts, caCert);
+
+ // QTBUG-62335 - Fail (found no private key) but don't crash:
+ QFile nocert(testDataDir + QLatin1String("/pkcs12/leaf-nokey.p12"));
+ ok = nocert.open(QIODevice::ReadOnly);
+ QVERIFY(ok);
+ QTest::ignoreMessage(QtWarningMsg, "Unable to convert private key");
+ ok = QSslCertificate::importPkcs12(&nocert, &key, &cert, &caCerts);
+ QVERIFY(!ok);
+ nocert.close();
}
#endif // QT_NO_SSL
diff --git a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp
index 16bb0b7c3e..cc32e73b9c 100644
--- a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp
+++ b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp
@@ -39,6 +39,7 @@
#include <qpainter.h>
#include <qprintengine.h>
#include <qpagelayout.h>
+#include <qsharedpointer.h>
#include <qtemporarydir.h>
#include <math.h>
@@ -47,25 +48,15 @@
#include <windows.h>
#endif
+#if QT_CONFIG(printer)
+typedef QSharedPointer<QPrinter> PrinterPtr;
-QT_FORWARD_DECLARE_CLASS(QPrinter)
+Q_DECLARE_METATYPE(PrinterPtr)
+Q_DECLARE_METATYPE(QPrinter::Orientation)
+Q_DECLARE_METATYPE(QPrinter::PageSize)
+#endif // printer
-// Helper class to make sure temp files are cleaned up after test complete
-class TempFileCleanup
-{
-public:
- TempFileCleanup(const QString &file)
- : m_file(file)
- {
- }
-
- ~TempFileCleanup()
- {
- QFile::remove(m_file);
- }
-private:
- QString m_file;
-};
+static int fileNumber = 0;
class tst_QPrinter : public QObject
{
@@ -133,6 +124,9 @@ private slots:
void testPageMetrics();
#endif
private:
+ QString testFileName(const QString &prefix, const QString &suffix);
+ QString testPdfFileName(const QString &prefix) { return testFileName(prefix, QStringLiteral("pdf")); }
+
QTemporaryDir m_tempDir;
};
@@ -202,72 +196,72 @@ void tst_QPrinter::testPrintPreviewDialog()
void tst_QPrinter::testPageRectAndPaperRect_data()
{
- QTest::addColumn<int>("orientation");
+ QTest::addColumn<PrinterPtr>("printer");
+ QTest::addColumn<QPrinter::Orientation>("orientation");
QTest::addColumn<bool>("withPainter");
QTest::addColumn<int>("resolution");
QTest::addColumn<bool>("doPaperRect");
+ const PrinterPtr printer(new QPrinter(QPrinter::HighResolution));
// paperrect
- QTest::newRow("paperRect0") << int(QPrinter::Portrait) << true << 300 << true;
- QTest::newRow("paperRect1") << int(QPrinter::Portrait) << false << 300 << true;
- QTest::newRow("paperRect2") << int(QPrinter::Landscape) << true << 300 << true;
- QTest::newRow("paperRect3") << int(QPrinter::Landscape) << false << 300 << true;
- QTest::newRow("paperRect4") << int(QPrinter::Portrait) << true << 600 << true;
- QTest::newRow("paperRect5") << int(QPrinter::Portrait) << false << 600 << true;
- QTest::newRow("paperRect6") << int(QPrinter::Landscape) << true << 600 << true;
- QTest::newRow("paperRect7") << int(QPrinter::Landscape) << false << 600 << true;
- QTest::newRow("paperRect8") << int(QPrinter::Portrait) << true << 1200 << true;
- QTest::newRow("paperRect9") << int(QPrinter::Portrait) << false << 1200 << true;
- QTest::newRow("paperRect10") << int(QPrinter::Landscape) << true << 1200 << true;
- QTest::newRow("paperRect11") << int(QPrinter::Landscape) << false << 1200 << true;
+ QTest::newRow("paperRect0") << printer << QPrinter::Portrait << true << 300 << true;
+ QTest::newRow("paperRect1") << printer << QPrinter::Portrait << false << 300 << true;
+ QTest::newRow("paperRect2") << printer << QPrinter::Landscape << true << 300 << true;
+ QTest::newRow("paperRect3") << printer << QPrinter::Landscape << false << 300 << true;
+ QTest::newRow("paperRect4") << printer << QPrinter::Portrait << true << 600 << true;
+ QTest::newRow("paperRect5") << printer << QPrinter::Portrait << false << 600 << true;
+ QTest::newRow("paperRect6") << printer << QPrinter::Landscape << true << 600 << true;
+ QTest::newRow("paperRect7") << printer << QPrinter::Landscape << false << 600 << true;
+ QTest::newRow("paperRect8") << printer << QPrinter::Portrait << true << 1200 << true;
+ QTest::newRow("paperRect9") << printer << QPrinter::Portrait << false << 1200 << true;
+ QTest::newRow("paperRect10") << printer << QPrinter::Landscape << true << 1200 << true;
+ QTest::newRow("paperRect11") << printer << QPrinter::Landscape << false << 1200 << true;
// page rect
- QTest::newRow("pageRect0") << int(QPrinter::Portrait) << true << 300 << false;
- QTest::newRow("pageRect1") << int(QPrinter::Portrait) << false << 300 << false;
- QTest::newRow("pageRect2") << int(QPrinter::Landscape) << true << 300 << false;
- QTest::newRow("pageRect3") << int(QPrinter::Landscape) << false << 300 << false;
- QTest::newRow("pageRect4") << int(QPrinter::Portrait) << true << 600 << false;
- QTest::newRow("pageRect5") << int(QPrinter::Portrait) << false << 600 << false;
- QTest::newRow("pageRect6") << int(QPrinter::Landscape) << true << 600 << false;
- QTest::newRow("pageRect7") << int(QPrinter::Landscape) << false << 600 << false;
- QTest::newRow("pageRect8") << int(QPrinter::Portrait) << true << 1200 << false;
- QTest::newRow("pageRect9") << int(QPrinter::Portrait) << false << 1200 << false;
- QTest::newRow("pageRect10") << int(QPrinter::Landscape) << true << 1200 << false;
- QTest::newRow("pageRect11") << int(QPrinter::Landscape) << false << 1200 << false;
+ QTest::newRow("pageRect0") << printer << QPrinter::Portrait << true << 300 << false;
+ QTest::newRow("pageRect1") << printer << QPrinter::Portrait << false << 300 << false;
+ QTest::newRow("pageRect2") << printer << QPrinter::Landscape << true << 300 << false;
+ QTest::newRow("pageRect3") << printer << QPrinter::Landscape << false << 300 << false;
+ QTest::newRow("pageRect4") << printer << QPrinter::Portrait << true << 600 << false;
+ QTest::newRow("pageRect5") << printer << QPrinter::Portrait << false << 600 << false;
+ QTest::newRow("pageRect6") << printer << QPrinter::Landscape << true << 600 << false;
+ QTest::newRow("pageRect7") << printer << QPrinter::Landscape << false << 600 << false;
+ QTest::newRow("pageRect8") << printer << QPrinter::Portrait << true << 1200 << false;
+ QTest::newRow("pageRect9") << printer << QPrinter::Portrait << false << 1200 << false;
+ QTest::newRow("pageRect10") << printer << QPrinter::Landscape << true << 1200 << false;
+ QTest::newRow("pageRect11") << printer << QPrinter::Landscape << false << 1200 << false;
}
void tst_QPrinter::testPageRectAndPaperRect()
{
+ QFETCH(PrinterPtr, printer);
QFETCH(bool, withPainter);
- QFETCH(int, orientation);
+ QFETCH(QPrinter::Orientation, orientation);
QFETCH(int, resolution);
QFETCH(bool, doPaperRect);
QPainter *painter = 0;
- QPrinter printer(QPrinter::HighResolution);
- printer.setOrientation(QPrinter::Orientation(orientation));
- const QString fileName = m_tempDir.path() + QLatin1String("/silly");
- printer.setOutputFileName(fileName);
- TempFileCleanup tmpFile(fileName);
-
- QRect pageRect = doPaperRect ? printer.paperRect() : printer.pageRect();
- float inchesX = float(pageRect.width()) / float(printer.resolution());
- float inchesY = float(pageRect.height()) / float(printer.resolution());
- printer.setResolution(resolution);
+ printer->setOrientation(orientation);
+ printer->setOutputFileName(testFileName(QLatin1String("silly"), QString()));
+
+ QRect pageRect = doPaperRect ? printer->paperRect() : printer->pageRect();
+ float inchesX = float(pageRect.width()) / float(printer->resolution());
+ float inchesY = float(pageRect.height()) / float(printer->resolution());
+ printer->setResolution(resolution);
if (withPainter)
- painter = new QPainter(&printer);
+ painter = new QPainter(printer.data());
- QRect otherRect = doPaperRect ? printer.paperRect() : printer.pageRect();
- float otherInchesX = float(otherRect.width()) / float(printer.resolution());
- float otherInchesY = float(otherRect.height()) / float(printer.resolution());
+ QRect otherRect = doPaperRect ? printer->paperRect() : printer->pageRect();
+ float otherInchesX = float(otherRect.width()) / float(printer->resolution());
+ float otherInchesY = float(otherRect.height()) / float(printer->resolution());
if (painter != 0)
delete painter;
QVERIFY(qAbs(otherInchesX - inchesX) < 0.01);
QVERIFY(qAbs(otherInchesY - inchesY) < 0.01);
- QVERIFY(printer.orientation() == QPrinter::Portrait || pageRect.width() > pageRect.height());
- QVERIFY(printer.orientation() != QPrinter::Portrait || pageRect.width() < pageRect.height());
+ QVERIFY(printer->orientation() == QPrinter::Portrait || pageRect.width() > pageRect.height());
+ QVERIFY(printer->orientation() != QPrinter::Portrait || pageRect.width() < pageRect.height());
}
void tst_QPrinter::testSetOptions()
@@ -299,45 +293,40 @@ void tst_QPrinter::testSetOptions()
void tst_QPrinter::testMargins_data()
{
- QTest::addColumn<int>("orientation");
+ QTest::addColumn<PrinterPtr>("printer");
+ QTest::addColumn<QPrinter::Orientation>("orientation");
QTest::addColumn<bool>("fullpage");
- QTest::addColumn<int>("pagesize");
- QTest::addColumn<int>("width");
- QTest::addColumn<int>("height");
+ QTest::addColumn<QPrinter::PageSize>("pagesize");
QTest::addColumn<bool>("withPainter");
- QTest::newRow("data0") << int(QPrinter::Portrait) << true << int(QPrinter::A4) << 210 << 297 << false;
- QTest::newRow("data1") << int(QPrinter::Landscape) << true << int(QPrinter::A4) << 297 << 210 << false;
- QTest::newRow("data2") << int(QPrinter::Landscape) << false << int(QPrinter::A4) << 297 << 210 << false;
- QTest::newRow("data3") << int(QPrinter::Portrait) << false << int(QPrinter::A4) << 210 << 297 << false;
- QTest::newRow("data4") << int(QPrinter::Portrait) << true << int(QPrinter::A4) << 210 << 297 << true;
- QTest::newRow("data5") << int(QPrinter::Landscape) << true << int(QPrinter::A4) << 297 << 210 << true;
- QTest::newRow("data6") << int(QPrinter::Landscape) << false << int(QPrinter::A4) << 297 << 210 << true;
- QTest::newRow("data7") << int(QPrinter::Portrait) << false << int(QPrinter::A4) << 210 << 297 << true;
+ const PrinterPtr printer(new QPrinter);
+ QTest::newRow("data0") << printer << QPrinter::Portrait << true << QPrinter::A4 << false;
+ QTest::newRow("data1") << printer << QPrinter::Landscape << true << QPrinter::A4 << false;
+ QTest::newRow("data2") << printer << QPrinter::Landscape << false << QPrinter::A4 << false;
+ QTest::newRow("data3") << printer << QPrinter::Portrait << false << QPrinter::A4 << false;
+ QTest::newRow("data4") << printer << QPrinter::Portrait << true << QPrinter::A4 << true;
+ QTest::newRow("data5") << printer << QPrinter::Landscape << true << QPrinter::A4 << true;
+ QTest::newRow("data6") << printer << QPrinter::Landscape << false << QPrinter::A4 << true;
+ QTest::newRow("data7") << printer << QPrinter::Portrait << false << QPrinter::A4 << true;
}
void tst_QPrinter::testMargins()
{
+ QFETCH(PrinterPtr, printer);
QFETCH(bool, withPainter);
- QFETCH(int, orientation);
- QFETCH(int, pagesize);
- QFETCH(int, width);
- QFETCH(int, height);
+ QFETCH(QPrinter::Orientation, orientation);
+ QFETCH(QPrinter::PageSize, pagesize);
QFETCH(bool, fullpage);
- Q_UNUSED(width);
- Q_UNUSED(height);
- QPrinter printer;
QPainter *painter = 0;
- printer.setOutputFileName("silly");
- printer.setOrientation((QPrinter::Orientation)orientation);
- printer.setFullPage(fullpage);
- printer.setPageSize((QPrinter::PageSize)pagesize);
+ printer->setOutputFileName(testFileName(QLatin1String("silly"), QString()));
+ printer->setOrientation(orientation);
+ printer->setFullPage(fullpage);
+ printer->setPageSize(pagesize);
if (withPainter)
- painter = new QPainter(&printer);
+ painter = new QPainter(printer.data());
if (painter)
delete painter;
- QFile::remove("silly");
}
void tst_QPrinter::testMulitpleSets_data()
@@ -420,9 +409,7 @@ void tst_QPrinter::outputFormatFromSuffix()
QSKIP("No printers available.");
QPrinter p;
QCOMPARE(p.outputFormat(), QPrinter::NativeFormat);
- const QString fileName = m_tempDir.path() + QLatin1String("/test.pdf");
- p.setOutputFileName(fileName);
- TempFileCleanup tmpFile(fileName);
+ p.setOutputFileName(testPdfFileName(QLatin1String("test")));
QCOMPARE(p.outputFormat(), QPrinter::PdfFormat);
p.setOutputFileName(QString());
QCOMPARE(p.outputFormat(), QPrinter::NativeFormat);
@@ -510,9 +497,7 @@ void tst_QPrinter::errorReporting()
p.setOutputFileName("/foobar/nonwritable.pdf");
QCOMPARE(painter.begin(&p), false); // it should check the output file is writable
#endif
- const QString fileName = m_tempDir.path() + QLatin1String("/test.pdf");
- p.setOutputFileName(fileName);
- TempFileCleanup tmpFile(fileName);
+ p.setOutputFileName(testPdfFileName(QLatin1String("test")));
QCOMPARE(painter.begin(&p), true); // it should check the output
QCOMPARE(p.isValid(), true);
painter.end();
@@ -606,8 +591,7 @@ void tst_QPrinter::customPaperSizeAndMargins()
void tst_QPrinter::printDialogCompleter()
{
QPrintDialog dialog;
- dialog.printer()->setOutputFileName("file.pdf");
- TempFileCleanup tmpFile("file.pdf");
+ dialog.printer()->setOutputFileName(testPdfFileName(QLatin1String("file")));
dialog.setEnabledOptions(QAbstractPrintDialog::PrintToFile);
dialog.show();
@@ -627,10 +611,8 @@ static void printPage(QPainter *painter)
void tst_QPrinter::taskQTBUG4497_reusePrinterOnDifferentFiles()
{
- const QString fileName1 = m_tempDir.path() + QLatin1String("/out1.pdf");
- const QString fileName2 = m_tempDir.path() + QLatin1String("/out2.pdf");
- TempFileCleanup tmpFile1(fileName1);
- TempFileCleanup tmpFile2(fileName2);
+ const QString fileName1 = testPdfFileName(QLatin1String("out1_"));
+ const QString fileName2 = testPdfFileName(QLatin1String("out2_"));
QPrinter printer;
{
@@ -689,7 +671,7 @@ void tst_QPrinter::testCurrentPage()
void tst_QPrinter::testPdfTitle()
{
- const QString fileName = m_tempDir.path() + QLatin1String("/file.pdf");
+ const QString fileName = testPdfFileName(QLatin1String("file"));
// Check the document name is represented correctly in produced pdf
{
@@ -703,7 +685,6 @@ void tst_QPrinter::testPdfTitle()
painter.begin(&printer);
painter.end();
}
- TempFileCleanup tmpFile(fileName);
QFile file(fileName);
QVERIFY(file.open(QIODevice::ReadOnly));
// The we expect the title to appear in the PDF as:
@@ -1244,8 +1225,9 @@ void tst_QPrinter::outputFileName()
QPrinter pdf;
pdf.setOutputFormat(QPrinter::PdfFormat);
QCOMPARE(pdf.outputFileName(), QString());
- pdf.setOutputFileName(QStringLiteral("Test File"));
- QCOMPARE(pdf.outputFileName(), QString("Test File"));
+ const QString fileName = testFileName(QStringLiteral("Test File"), QString());
+ pdf.setOutputFileName(fileName);
+ QCOMPARE(pdf.outputFileName(), fileName);
QPrinter native;
if (native.outputFormat() == QPrinter::NativeFormat) {
@@ -1253,7 +1235,7 @@ void tst_QPrinter::outputFileName()
QCOMPARE(native.outputFileName(), QString());
// Test set/get
- QString expected = QStringLiteral("Test File");
+ QString expected = fileName;
native.setOutputFileName(expected);
QCOMPARE(native.outputFileName(), expected);
@@ -1960,6 +1942,15 @@ void tst_QPrinter::testPageMetrics()
QCOMPARE(printer.pageRect(QPrinter::Millimeter), QRectF(leftMMf, topMMf, heightMMf - leftMMf - rightMMf, widthMMf - topMMf - bottomMMf));
}
+QString tst_QPrinter::testFileName(const QString &prefix, const QString &suffix)
+{
+ QString result = m_tempDir.path() + QLatin1Char('/') + prefix
+ + QString::number(fileNumber++);
+ if (!suffix.isEmpty())
+ result += QLatin1Char('.') + suffix;
+ return result;
+}
+
#endif // QT_CONFIG(printer)
QTEST_MAIN(tst_QPrinter)
diff --git a/tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp b/tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp
index c20fafe158..92a06cda00 100644
--- a/tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp
+++ b/tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp
@@ -136,7 +136,7 @@ QStringList tst_QPrinterInfo::getPrintersFromSystem()
#ifdef Q_OS_UNIX
// This function does roughly the same as the `command substitution` in
// the shell.
-QString tst_QPrinterInfo::getOutputFromCommand(const QStringList& command)
+QString getOutputFromCommandInternal(const QStringList &command)
{
// The command execution does nothing on non-unix systems.
int pid;
@@ -194,6 +194,16 @@ QString tst_QPrinterInfo::getOutputFromCommand(const QStringList& command)
return QString(array);
}
}
+
+QString tst_QPrinterInfo::getOutputFromCommand(const QStringList &command)
+{
+ // Forces the ouptut from the command to be in English
+ const QByteArray origSoftwareEnv = qgetenv("SOFTWARE");
+ qputenv("SOFTWARE", QByteArray());
+ QString output = getOutputFromCommandInternal(command);
+ qputenv("SOFTWARE", origSoftwareEnv);
+ return output;
+}
#endif
// Windows test support not yet implemented
diff --git a/tests/auto/sql/kernel/qsqlthread/tst_qsqlthread.cpp b/tests/auto/sql/kernel/qsqlthread/tst_qsqlthread.cpp
index c21223886a..5482dc393b 100644
--- a/tests/auto/sql/kernel/qsqlthread/tst_qsqlthread.cpp
+++ b/tests/auto/sql/kernel/qsqlthread/tst_qsqlthread.cpp
@@ -177,7 +177,7 @@ public:
for (int i = 0; i < ProdConIterations; ++i) {
QVERIFY_SQL(q1, exec("select max(id) from " + qtest));
q1.first();
- q2.bindValue("id", q1.value(0));
+ q2.bindValue(":id", q1.value(0));
q1.clear();
QVERIFY_SQL(q2, exec());
QThread::yieldCurrentThread();
diff --git a/tests/auto/tools/qmake/testdata/rawString/main.cpp b/tests/auto/tools/qmake/testdata/rawString/main.cpp
index 53a28f7bc0..bc557f39f8 100644
--- a/tests/auto/tools/qmake/testdata/rawString/main.cpp
+++ b/tests/auto/tools/qmake/testdata/rawString/main.cpp
@@ -26,8 +26,107 @@
**
****************************************************************************/
+// macro names that *aren't* string-literal-prefixes:
+#define Ru8 "rue-it"
+#define RL "real life"
+#define Ru "are you ?"
+#define RU "Are You ?"
+#define LLR "double-hockey-sticks"
+#define LUR "Tricky"
+#define LuR "tricky"
+#define Lu8R "l'uber"
+#define UUR "Double-Yew"
+#define ULR "Eweler"
+#define UuR "You ... you-are"
+#define Uu8R "You ... you *ate* our ..."
+#define uuR "water"
+#define uLR "eweler"
+#define uUR "double-Your"
+#define uu8R "totally uber"
+#define u8u8R "rubber-you"
+#define u8LR "Uber left-to-right"
+#define u8UR "Uber Upper-Right"
+#define u8uR "Uber upper-right"
+#define Ru8R "bouncy"
+#define RLR "Marching"
+#define RuR "Rossum's general-purpose workers"
+#define RUR "Rossum's Universal Robots"
+
+static const char monstrosity[] =
+ Ru8"Ru8("
+ RL"RL("
+ Ru"Ru("
+ RU"RU("
+ LLR"LLR("
+ LUR"LUR("
+ LuR"LuR("
+ Lu8R"Lu8R("
+ UUR"UUR("
+ ULR"ULR("
+ UuR"UuR("
+ Uu8R"Uu8R("
+ uuR"uuR("
+ uLR"uLR("
+ uUR"uUR("
+ uu8R"uu8R("
+ u8u8R"u8u8R("
+ u8LR"u8LR("
+ u8UR"u8UR("
+ u8uR"u8uR("
+ Ru8R"Ru8R("
+ RLR"RLR("
+ RuR"RuR("
+ RUR"RUR("
+ "Finally, some content";
+
+#include <moc_object2.cpp>
+
+static const char closure[] =
+ ")RUR"
+ ")RuR"
+ ")RLR"
+ ")Ru8R"
+ ")u8uR"
+ ")u8UR"
+ ")u8LR"
+ ")u8u8R"
+ ")uu8R"
+ ")uUR"
+ ")uLR"
+ ")uuR"
+ ")Uu8R"
+ ")UuR"
+ ")ULR"
+ ")UUR"
+ ")Lu8R"
+ ")LuR"
+ ")LUR"
+ ")LLR"
+ ")RU"
+ ")Ru"
+ ")RL"
+ ")Ru8";
+// If moc got confused, the confusion should now be over
+
+// Real raw strings, not actually leaving us inside any comments:
static const char raw[] = R"blah(lorem " ipsum /*)blah"\
;
+static const wchar_t wider[] = LR"blah(lorem " ipsum /*)blah"\
+;
+static const char32_t UCS4[] = UR"blah(lorem " ipsum /*)blah"\
+;
+static const char16_t UCS2[] = uR"blah(lorem " ipsum /*)blah"\
+;
+static const char utf8[] = u8R"blah(lorem " ipsum /*)blah"\
+;
#include <moc_object1.cpp>
-int main () { return 0; }
+/* Avoid unused variable warnings by silly uses of arrays: */
+#define final(x) x[sizeof(x) - 1] // 0, of course
+int main () {
+ return final(raw)
+ * (final(wider) - final(UCS4))
+ * (final(UCS2) - final(utf8))
+ * (final(monstrosity) - final(closure));
+}
+#undef final
diff --git a/tests/auto/tools/qmake/testdata/rawString/object2.h b/tests/auto/tools/qmake/testdata/rawString/object2.h
new file mode 100644
index 0000000000..2ab77cd3bd
--- /dev/null
+++ b/tests/auto/tools/qmake/testdata/rawString/object2.h
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite 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$
+**
+****************************************************************************/
+#ifndef TEST_QMAKE_RAWSTRING_OBJECT2_H
+#define TEST_QMAKE_RAWSTRING_OBJECT2_H
+
+#define Lu8UR "land"
+inline char opener(int i) {
+ const char text[] = Lu8UR"blah( not a raw string; just juxtaposed";
+ return text[i];
+}
+
+#include <QObject>
+
+class Object2 : public QObject
+{
+ Q_OBJECT
+};
+
+inline char closer(int i) {
+ const char text[] = "pretend to close it, all the same )blah";
+ return text[i];
+}
+
+#endif // TEST_QMAKE_RAWSTRING_OBJECT2_H
diff --git a/tests/auto/tools/qmake/testdata/rawString/rawString.pro b/tests/auto/tools/qmake/testdata/rawString/rawString.pro
index d2d8132ceb..19c81dfe97 100644
--- a/tests/auto/tools/qmake/testdata/rawString/rawString.pro
+++ b/tests/auto/tools/qmake/testdata/rawString/rawString.pro
@@ -1,4 +1,4 @@
DESTDIR = ./
-HEADERS += object1.h
+HEADERS += object1.h object2.h
SOURCES += main.cpp
diff --git a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
index 5e3cb66aae..1be17b552e 100644
--- a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
@@ -41,7 +41,6 @@
#include <qcommonstyle.h>
#include <qstylefactory.h>
#include <qscreen.h>
-#include <QSysInfo>
typedef QList<QGraphicsItem *> QGraphicsItemList;
@@ -1777,16 +1776,10 @@ void tst_QGraphicsWidget::updateFocusChainWhenChildDie()
#ifdef Q_OS_MAC
QEXPECT_FAIL("", "QTBUG-23699", Continue);
#endif
-#ifdef Q_OS_WIN
- if (QSysInfo::kernelVersion() == "10.0.15063") {
- QEXPECT_FAIL("", "This fails on Windows 10 Creators Update (10.0.15063)", Continue);
- }
-#endif
QTRY_COMPARE(qApp->activeWindow(), static_cast<QWidget *>(&view));
QTRY_COMPARE(scene.focusItem(), static_cast<QGraphicsItem *>(w));
}
-
void tst_QGraphicsWidget::sizeHint_data()
{
QTest::addColumn<bool>("layout");
diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
index d328163a05..096beedf63 100644
--- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
+++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
@@ -1774,12 +1774,6 @@ void tst_QWidget::activation()
QCOMPARE(QApplication::activeWindow(), &widget2);
widget2.hide();
QTest::qWait(waitTime);
-#ifdef Q_OS_WIN
- if (QSysInfo::kernelVersion() == "10.0.15063") {
- QEXPECT_FAIL("", "This fails on Windows 10 Creators Update (10.0.15063)", Continue);
- // This happens in automated Windows 10 Creators Update (10.0.15063) CI builds!
- }
-#endif
QCOMPARE(QApplication::activeWindow(), &widget1);
}
#endif // Q_OS_WIN
diff --git a/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp b/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
index a6855a417e..9dc513c115 100644
--- a/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
+++ b/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
@@ -104,6 +104,8 @@ private slots:
void setWindowState();
void nativeShow();
+
+ void QTBUG_56277_resize_on_showEvent();
};
void tst_QWidget_window::initTestCase()
@@ -931,5 +933,34 @@ void tst_QWidget_window::nativeShow()
QTRY_VERIFY(!w.isVisible());
}
+class ResizedOnShowEventWidget : public QWidget
+{
+public:
+ void showEvent(QShowEvent *) override
+ {
+ const auto *primaryScreen = QApplication::primaryScreen();
+ auto newSize = primaryScreen->availableGeometry().size() / 4;
+ if (newSize == geometry().size())
+ newSize -= QSize(10, 10);
+ resize(newSize);
+ }
+};
+
+void tst_QWidget_window::QTBUG_56277_resize_on_showEvent()
+{
+ const auto platformName = QGuiApplication::platformName().toLower();
+ if (platformName != "cocoa" && platformName != "windows")
+ QSKIP("This can only be consistently tested on desktop platforms with well-known behavior.");
+
+ ResizedOnShowEventWidget w;
+ w.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&w));
+ const auto *screen = w.windowHandle()->screen();
+ const auto geometry = w.geometry();
+ const int frameHeight = geometry.top() - w.frameGeometry().top();
+ const int topmostY = screen->availableGeometry().top() + frameHeight;
+ QVERIFY(geometry.top() > topmostY || geometry.left() > screen->availableGeometry().left());
+}
+
QTEST_MAIN(tst_QWidget_window)
#include "tst_qwidget_window.moc"
diff --git a/tests/benchmarks/sql/kernel/qsqlquery/qsqlquery.pro b/tests/benchmarks/sql/kernel/qsqlquery/qsqlquery.pro
index 18425f4a25..0b710ab89c 100644
--- a/tests/benchmarks/sql/kernel/qsqlquery/qsqlquery.pro
+++ b/tests/benchmarks/sql/kernel/qsqlquery/qsqlquery.pro
@@ -3,4 +3,3 @@ TARGET = tst_bench_qsqlquery
SOURCES += main.cpp
QT = core sql testlib core-private sql-private
-LIBS += $$QMAKE_LIBS_NETWORK
diff --git a/tests/manual/qtabbar/main.cpp b/tests/manual/qtabbar/main.cpp
index 466a7e20fc..82bcd838e6 100644
--- a/tests/manual/qtabbar/main.cpp
+++ b/tests/manual/qtabbar/main.cpp
@@ -103,6 +103,9 @@ int main(int argc, char *argv[])
// right
// tabBar.setShape(QTabBar::RoundedEast);
+ const auto shortLabel = QStringLiteral("Tab %1");
+ const auto longLabel = QStringLiteral("An Extremely Long Tab Label %1");
+
QMap<int, QWidget*> tabs;
for (int i = 0; i < TabCount; i++) {
QString tabNumberString = QString::number(i);
@@ -110,7 +113,7 @@ int main(int argc, char *argv[])
tabs[i] = label;
label->setAlignment(Qt::AlignCenter);
stackedWidget.addWidget(label);
- tabBar.addTab(QStringLiteral("Tab %1").arg(tabNumberString));
+ tabBar.addTab(shortLabel.arg(tabNumberString));
}
QObject::connect(&tabBar, &QTabBar::tabMoved, [&tabs](int from, int to) {
@@ -205,6 +208,13 @@ int main(int argc, char *argv[])
tabBar.setTabIcon(i, icon);
});
+ form.ui->longLabelButton->setChecked(false);
+ QObject::connect(form.ui->longLabelButton, &QCheckBox::toggled, [&] {
+ const auto &label = form.ui->longLabelButton->isChecked() ? longLabel : shortLabel;
+ for (int i = 0; i < tabBar.count(); i++)
+ tabBar.setTabText(i, label.arg(i));
+ });
+
QObject::connect(form.ui->shapeComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), [&](int index) {
Q_UNUSED(index);
// TODO
diff --git a/tests/manual/qtabbar/tabbarform.ui b/tests/manual/qtabbar/tabbarform.ui
index 17100b3b62..f8766f22f2 100644
--- a/tests/manual/qtabbar/tabbarform.ui
+++ b/tests/manual/qtabbar/tabbarform.ui
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>308</width>
- <height>260</height>
+ <height>308</height>
</rect>
</property>
<property name="sizePolicy">
@@ -22,24 +22,61 @@
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout">
- <item row="10" column="1">
- <widget class="QRadioButton" name="rightAlignedButton">
+ <item row="7" column="1">
+ <widget class="QComboBox" name="shapeComboBox">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <item>
+ <property name="text">
+ <string>North</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>South</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>West</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>East</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item row="8" column="0">
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>12</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_2">
<property name="text">
- <string>Right aligned</string>
+ <string>Tab bar options:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
- <attribute name="buttonGroup">
- <string notr="true">textAlignmentGroup</string>
- </attribute>
</widget>
</item>
- <item row="8" column="1">
- <widget class="QRadioButton" name="leftAlignedButton">
+ <item row="0" column="1">
+ <widget class="QCheckBox" name="documentModeButton">
<property name="text">
- <string>Left aligned</string>
+ <string>Document mode</string>
</property>
- <attribute name="buttonGroup">
- <string notr="true">textAlignmentGroup</string>
- </attribute>
</widget>
</item>
<item row="2" column="1">
@@ -49,14 +86,14 @@
</property>
</widget>
</item>
- <item row="8" column="0">
- <widget class="QLabel" name="label">
+ <item row="9" column="1">
+ <widget class="QRadioButton" name="leftAlignedButton">
<property name="text">
- <string>Tabs alignment:</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ <string>Left aligned</string>
</property>
+ <attribute name="buttonGroup">
+ <string notr="true">textAlignmentGroup</string>
+ </attribute>
</widget>
</item>
<item row="1" column="1">
@@ -66,10 +103,13 @@
</property>
</widget>
</item>
- <item row="0" column="1">
- <widget class="QCheckBox" name="documentModeButton">
+ <item row="7" column="0">
+ <widget class="QLabel" name="label_3">
<property name="text">
- <string>Document mode</string>
+ <string>Tab shape (TODO):</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
@@ -80,47 +120,17 @@
</property>
</widget>
</item>
- <item row="6" column="1">
- <widget class="QComboBox" name="shapeComboBox">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <item>
- <property name="text">
- <string>North</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>South</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>West</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>East</string>
- </property>
- </item>
- </widget>
- </item>
- <item row="7" column="0">
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
+ <item row="9" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Tabs alignment:</string>
</property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>12</height>
- </size>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
- </spacer>
+ </widget>
</item>
- <item row="5" column="1">
+ <item row="6" column="1">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
@@ -133,17 +143,14 @@
</property>
</spacer>
</item>
- <item row="0" column="0">
- <widget class="QLabel" name="label_2">
+ <item row="4" column="1">
+ <widget class="QCheckBox" name="displayIconButton">
<property name="text">
- <string>Tab bar options:</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ <string>Display icon</string>
</property>
</widget>
</item>
- <item row="9" column="1">
+ <item row="10" column="1">
<widget class="QRadioButton" name="centeredButton">
<property name="text">
<string>Centered</string>
@@ -153,20 +160,20 @@
</attribute>
</widget>
</item>
- <item row="6" column="0">
- <widget class="QLabel" name="label_3">
+ <item row="11" column="1">
+ <widget class="QRadioButton" name="rightAlignedButton">
<property name="text">
- <string>Tab shape (TODO):</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ <string>Right aligned</string>
</property>
+ <attribute name="buttonGroup">
+ <string notr="true">textAlignmentGroup</string>
+ </attribute>
</widget>
</item>
- <item row="4" column="1">
- <widget class="QCheckBox" name="displayIconButton">
+ <item row="5" column="1">
+ <widget class="QCheckBox" name="longLabelButton">
<property name="text">
- <string>Display icon</string>
+ <string>Long tab label</string>
</property>
</widget>
</item>