diff options
36 files changed, 223 insertions, 69 deletions
diff --git a/mkspecs/common/mac.conf b/mkspecs/common/mac.conf index 3adf868ea4..d24a1d665c 100644 --- a/mkspecs/common/mac.conf +++ b/mkspecs/common/mac.conf @@ -7,7 +7,7 @@ QMAKE_PLATFORM += mac darwin MAKEFILE_GENERATOR = UNIX -CONFIG += app_bundle incremental global_init_link_order lib_version_first plugin_no_soname sdk +CONFIG += app_bundle incremental global_init_link_order lib_version_first sdk QMAKE_INCREMENTAL_STYLE = sublib include(unix.conf) diff --git a/mkspecs/common/qcc-base-qnx-aarch64le.conf b/mkspecs/common/qcc-base-qnx-aarch64le.conf new file mode 100644 index 0000000000..914ef33f37 --- /dev/null +++ b/mkspecs/common/qcc-base-qnx-aarch64le.conf @@ -0,0 +1,23 @@ +# +# qmake configuration for qnx-qcc aarch64le targets +# + +MAKEFILE_GENERATOR = UNIX + +include(g++-unix.conf) +include(unix.conf) + +QMAKE_CC = qcc -Vgcc_ntoaarch64le +QMAKE_CXX = qcc -Vgcc_ntoaarch64le +QNX_CPUDIR = aarch64le + +include(qcc-base-qnx.conf) + +QMAKE_AR = ntoaarch64-ar cqs +QMAKE_OBJCOPY = ntoaarch64-objcopy +QMAKE_NM = ntoaarch64-nm -P +QMAKE_RANLIB = ntoaarch64-ranlib + +QMAKE_STRIP = ntoaarch64-strip + +load(qt_config) diff --git a/mkspecs/common/qcc-base-qnx-x86-64.conf b/mkspecs/common/qcc-base-qnx-x86-64.conf new file mode 100644 index 0000000000..fd04104f71 --- /dev/null +++ b/mkspecs/common/qcc-base-qnx-x86-64.conf @@ -0,0 +1,23 @@ +# +# qmake configuration for qnx-qcc x86-64 targets +# + +MAKEFILE_GENERATOR = UNIX + +include(g++-unix.conf) +include(unix.conf) + +QMAKE_CC = qcc -Vgcc_ntox86_64 +QMAKE_CXX = qcc -Vgcc_ntox86_64 +QNX_CPUDIR = x86_64 + +include(qcc-base-qnx.conf) + +QMAKE_AR = ntox86_64-ar cqs +QMAKE_OBJCOPY = ntox86_64-objcopy +QMAKE_NM = ntox86_64-nm -P +QMAKE_RANLIB = ntox86_64-ranlib + +QMAKE_STRIP = ntox86_64-strip + +load(qt_config) diff --git a/mkspecs/features/configure_base.prf b/mkspecs/features/configure_base.prf index ed2f599bb0..fd1730741a 100644 --- a/mkspecs/features/configure_base.prf +++ b/mkspecs/features/configure_base.prf @@ -1,6 +1,14 @@ +equals(QMAKE_HOST.os, Windows) { + SETENV_PFX = "set " + SETENV_SFX = "&" +} else { + SETENV_PFX = + SETENV_SFX = +} + QMAKE_MAKE = $$(MAKE) !isEmpty(QMAKE_MAKE) { - # We were called recursively. Use the right make, as MAKEFLAGS may be set as well. + # We were called recursively. Use the same make. } else: if(equals(MAKEFILE_GENERATOR, UNIX)|equals(MAKEFILE_GENERATOR, MINGW)) { !equals(QMAKE_HOST.os, Windows): \ QMAKE_MAKE = make @@ -11,6 +19,8 @@ QMAKE_MAKE = $$(MAKE) } else { error("Configure tests are not supported with the $$MAKEFILE_GENERATOR Makefile generator.") } +# Make sure we don't inherit MAKEFLAGS - -i in particular is fatal. +QMAKE_MAKE = "$${SETENV_PFX}MAKEFLAGS=$$SETENV_SFX $$QMAKE_MAKE" isEmpty(QMAKE_CONFIG_VERBOSE): QMAKE_CONFIG_VERBOSE = false diff --git a/mkspecs/features/qt_helper_lib.prf b/mkspecs/features/qt_helper_lib.prf index 668dead1d3..dc7a5da30e 100644 --- a/mkspecs/features/qt_helper_lib.prf +++ b/mkspecs/features/qt_helper_lib.prf @@ -27,6 +27,6 @@ DLLDESTDIR = $$MODULE_BASE_OUTDIR/bin # In static builds of Qt, convenience libraries must be installed, # as in this case they are not linked to the final library/plugin. -installed|contains(QT_CONFIG, static): load(qt_installs) +installed|if(!not_installed:contains(QT_CONFIG, static)): load(qt_installs) TARGET = $$qt5LibraryTarget($$TARGET) diff --git a/mkspecs/features/unix/separate_debug_info.prf b/mkspecs/features/unix/separate_debug_info.prf index 460ad63e22..272cc8ef79 100644 --- a/mkspecs/features/unix/separate_debug_info.prf +++ b/mkspecs/features/unix/separate_debug_info.prf @@ -27,7 +27,12 @@ have_target:!static:if(darwin|!isEmpty(QMAKE_OBJCOPY)) { CONFIG += any_bundle } - debug_info_target_dir = $${debug_info_target}.$$debug_info_suffix/Contents/Resources/DWARF + debug_info_target_rel = $$section(debug_info_target, /, -1, -1) + + debug_info_target_dir_suffix = .$$debug_info_suffix/Contents/Resources/DWARF + + debug_info_target_dir = $${debug_info_target}$${debug_info_target_dir_suffix} + debug_info_target_dir_rel = $${debug_info_target_rel}$${debug_info_target_dir_suffix} !isEmpty(QMAKE_RESOLVED_BUNDLE): \ QMAKE_TARGET_DEBUG_INFO = $$debug_info_target_dir/$$TARGET else: \ @@ -52,8 +57,23 @@ have_target:!static:if(darwin|!isEmpty(QMAKE_OBJCOPY)) { debug_info_plist.output = $${debug_info_target}.$$debug_info_suffix/Contents/Info.plist QMAKE_SUBSTITUTES += debug_info_plist } + + contains(INSTALLS, target):isEmpty(target.files):isEmpty(target.commands):isEmpty(target.extra) { + !build_pass|release { + debug_info_plist_target.CONFIG += no_check_exist + debug_info_plist_target.files = $${debug_info_target}.$$debug_info_suffix/Contents/Info.plist + debug_info_plist_target.path += $${target.path}/$${debug_info_target_rel}.$$debug_info_suffix/Contents + INSTALLS += debug_info_plist_target + } + + debug_info_target.CONFIG += no_check_exist + debug_info_target.files = $$QMAKE_TARGET_DEBUG_INFO + debug_info_target.path += $${target.path}/$${debug_info_target_dir_rel} + INSTALLS += debug_info_target + } } else { QMAKE_TARGET_DEBUG_INFO = $${QMAKE_RESOLVED_TARGET}.$$debug_info_suffix + target.targets += $$QMAKE_TARGET_DEBUG_INFO } shell_target = $$shell_quote($$relative_path($$QMAKE_RESOLVED_TARGET, $$OUT_PWD)) @@ -72,6 +92,5 @@ have_target:!static:if(darwin|!isEmpty(QMAKE_OBJCOPY)) { } silent:QMAKE_POST_LINK = @echo creating $@.$$debug_info_suffix && $$QMAKE_POST_LINK - target.targets += $$QMAKE_TARGET_DEBUG_INFO QMAKE_DISTCLEAN += $$QMAKE_TARGET_DEBUG_INFO } diff --git a/mkspecs/hpux-g++/qmake.conf b/mkspecs/hpux-g++/qmake.conf index b488da7178..bfd814b0cb 100644 --- a/mkspecs/hpux-g++/qmake.conf +++ b/mkspecs/hpux-g++/qmake.conf @@ -7,7 +7,6 @@ MAKEFILE_GENERATOR = UNIX QMAKE_PLATFORM = hpux -CONFIG += plugin_no_soname include(../common/unix.conf) diff --git a/mkspecs/hpuxi-acc-32/qmake.conf b/mkspecs/hpuxi-acc-32/qmake.conf index e80a7973fe..fed3b112d1 100644 --- a/mkspecs/hpuxi-acc-32/qmake.conf +++ b/mkspecs/hpuxi-acc-32/qmake.conf @@ -4,7 +4,6 @@ MAKEFILE_GENERATOR = UNIX QMAKE_PLATFORM = hpux -CONFIG += plugin_no_soname include(../common/unix.conf) diff --git a/mkspecs/hpuxi-acc-64/qmake.conf b/mkspecs/hpuxi-acc-64/qmake.conf index 360e35c5d6..20578cb377 100644 --- a/mkspecs/hpuxi-acc-64/qmake.conf +++ b/mkspecs/hpuxi-acc-64/qmake.conf @@ -47,7 +47,6 @@ MAKEFILE_GENERATOR = UNIX QMAKE_PLATFORM = hpux -CONFIG += plugin_no_soname include(../common/unix.conf) diff --git a/mkspecs/macx-g++-32/qmake.conf b/mkspecs/macx-g++-32/qmake.conf index 4d76472456..3cd707d537 100644 --- a/mkspecs/macx-g++-32/qmake.conf +++ b/mkspecs/macx-g++-32/qmake.conf @@ -7,7 +7,7 @@ # MAKEFILE_GENERATOR = UNIX -CONFIG += app_bundle incremental global_init_link_order lib_version_first plugin_no_soname +CONFIG += app_bundle incremental global_init_link_order lib_version_first QMAKE_INCREMENTAL_STYLE = sublib include(../common/macx.conf) diff --git a/mkspecs/macx-g++/qmake.conf b/mkspecs/macx-g++/qmake.conf index 65c53b20f6..5b3105c668 100644 --- a/mkspecs/macx-g++/qmake.conf +++ b/mkspecs/macx-g++/qmake.conf @@ -7,7 +7,7 @@ # MAKEFILE_GENERATOR = UNIX -CONFIG += app_bundle incremental global_init_link_order lib_version_first plugin_no_soname +CONFIG += app_bundle incremental global_init_link_order lib_version_first QMAKE_INCREMENTAL_STYLE = sublib include(../common/macx.conf) diff --git a/mkspecs/macx-g++40/qmake.conf b/mkspecs/macx-g++40/qmake.conf index a60261d0dc..308cc2007c 100644 --- a/mkspecs/macx-g++40/qmake.conf +++ b/mkspecs/macx-g++40/qmake.conf @@ -7,7 +7,7 @@ # MAKEFILE_GENERATOR = UNIX -CONFIG += app_bundle incremental global_init_link_order lib_version_first plugin_no_soname +CONFIG += app_bundle incremental global_init_link_order lib_version_first QMAKE_INCREMENTAL_STYLE = sublib include(../common/macx.conf) diff --git a/mkspecs/macx-g++42/qmake.conf b/mkspecs/macx-g++42/qmake.conf index afbe658dfa..b24cb7f3f3 100644 --- a/mkspecs/macx-g++42/qmake.conf +++ b/mkspecs/macx-g++42/qmake.conf @@ -7,7 +7,7 @@ # MAKEFILE_GENERATOR = UNIX -CONFIG += app_bundle incremental global_init_link_order lib_version_first plugin_no_soname +CONFIG += app_bundle incremental global_init_link_order lib_version_first QMAKE_INCREMENTAL_STYLE = sublib include(../common/macx.conf) diff --git a/mkspecs/macx-llvm/qmake.conf b/mkspecs/macx-llvm/qmake.conf index a22d2dfef3..0434d29b50 100644 --- a/mkspecs/macx-llvm/qmake.conf +++ b/mkspecs/macx-llvm/qmake.conf @@ -7,7 +7,7 @@ # MAKEFILE_GENERATOR = UNIX -CONFIG += app_bundle incremental global_init_link_order lib_version_first plugin_no_soname +CONFIG += app_bundle incremental global_init_link_order lib_version_first QMAKE_INCREMENTAL_STYLE = sublib include(../common/macx.conf) diff --git a/mkspecs/qnx-aarch64le-qcc/qmake.conf b/mkspecs/qnx-aarch64le-qcc/qmake.conf new file mode 100644 index 0000000000..8e229d360b --- /dev/null +++ b/mkspecs/qnx-aarch64le-qcc/qmake.conf @@ -0,0 +1,17 @@ +# +# qmake configuration for qnx aarch64le systems +# + +DEFINES += QT_NO_CLIPBOARD _FORTIFY_SOURCE=2 + +QMAKE_LFLAGS_SHLIB += -Wl,-z,relro -Wl,-z,now + +include(../common/qcc-base-qnx-aarch64le.conf) + +contains(QT_CONFIG, stack-protector-strong) { + QMAKE_CFLAGS += -fstack-protector-strong + QMAKE_CXXFLAGS += -fstack-protector-strong +} else { + QMAKE_CFLAGS += -fstack-protector -fstack-protector-all + QMAKE_CXXFLAGS += -fstack-protector -fstack-protector-all +} diff --git a/mkspecs/qnx-aarch64le-qcc/qplatformdefs.h b/mkspecs/qnx-aarch64le-qcc/qplatformdefs.h new file mode 100644 index 0000000000..029ee7e062 --- /dev/null +++ b/mkspecs/qnx-aarch64le-qcc/qplatformdefs.h @@ -0,0 +1,34 @@ +/**************************************************************************** +** +** Copyright (C) 2016 QNX Software Systems. All rights reserved. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the qmake spec 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$ +** +****************************************************************************/ + +#include "../qnx-armle-v7-qcc/qplatformdefs.h" diff --git a/mkspecs/qnx-x86-64-qcc/qmake.conf b/mkspecs/qnx-x86-64-qcc/qmake.conf new file mode 100644 index 0000000000..f1760e4072 --- /dev/null +++ b/mkspecs/qnx-x86-64-qcc/qmake.conf @@ -0,0 +1,17 @@ +# +# qmake configuration for qnx x86-64 systems +# + +DEFINES += QT_NO_CLIPBOARD + +QMAKE_LFLAGS_SHLIB += -Wl,-z,relro -Wl,-z,now + +include(../common/qcc-base-qnx-x86-64.conf) + +contains(QT_CONFIG, stack-protector-strong) { + QMAKE_CFLAGS += -fstack-protector-strong + QMAKE_CXXFLAGS += -fstack-protector-strong +} else { + QMAKE_CFLAGS += -fstack-protector -fstack-protector-all + QMAKE_CXXFLAGS += -fstack-protector -fstack-protector-all +} diff --git a/mkspecs/qnx-x86-64-qcc/qplatformdefs.h b/mkspecs/qnx-x86-64-qcc/qplatformdefs.h new file mode 100644 index 0000000000..a8c97172d0 --- /dev/null +++ b/mkspecs/qnx-x86-64-qcc/qplatformdefs.h @@ -0,0 +1,34 @@ +/**************************************************************************** +** +** Copyright (C) 2016 QNX Software Systems. All rights reserved. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the qmake spec 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$ +** +****************************************************************************/ + +#include "../qnx-x86-qcc/qplatformdefs.h" diff --git a/mkspecs/tru64-cxx/qmake.conf b/mkspecs/tru64-cxx/qmake.conf index 024590bf91..87dabfb7e1 100644 --- a/mkspecs/tru64-cxx/qmake.conf +++ b/mkspecs/tru64-cxx/qmake.conf @@ -4,7 +4,6 @@ MAKEFILE_GENERATOR = UNIX QMAKE_PLATFORM = tru64 -CONFIG += plugin_no_soname include(../common/unix.conf) diff --git a/mkspecs/tru64-g++/qmake.conf b/mkspecs/tru64-g++/qmake.conf index 193e2694ea..c31eccca3e 100644 --- a/mkspecs/tru64-g++/qmake.conf +++ b/mkspecs/tru64-g++/qmake.conf @@ -4,7 +4,6 @@ MAKEFILE_GENERATOR = UNIX QMAKE_PLATFORM = tru64 -CONFIG += plugin_no_soname include(../common/unix.conf) diff --git a/src/angle/src/common/common.pri b/src/angle/src/common/common.pri index 50dde6398b..83cd1e8687 100644 --- a/src/angle/src/common/common.pri +++ b/src/angle/src/common/common.pri @@ -1,3 +1,9 @@ +# static builds should still link ANGLE dynamically when dynamic GL is enabled +static:contains(QT_CONFIG, dynamicgl) { + CONFIG -= static + CONFIG += shared +} + CONFIG += installed include (../config.pri) @@ -48,10 +54,4 @@ winrt|if(msvc:!win32-msvc2005:!win32-msvc2008:!win32-msvc2010) { } } -# static builds should still link ANGLE dynamically when dynamic GL is enabled -static:contains(QT_CONFIG, dynamicgl) { - CONFIG -= static - CONFIG += shared -} - static: DEFINES *= LIBGLESV2_EXPORT_H_ ANGLE_EXPORT= diff --git a/src/angle/src/compiler/preprocessor/preprocessor.pro b/src/angle/src/compiler/preprocessor/preprocessor.pro index 12f644870d..cbf411623d 100644 --- a/src/angle/src/compiler/preprocessor/preprocessor.pro +++ b/src/angle/src/compiler/preprocessor/preprocessor.pro @@ -1,4 +1,5 @@ CONFIG += static +contains(QT_CONFIG, dynamicgl): CONFIG += not_installed include(../../config.pri) INCLUDEPATH = $$ANGLE_DIR/src/compiler/preprocessor diff --git a/src/angle/src/compiler/translator.pro b/src/angle/src/compiler/translator.pro index 928fd589fb..d48ac70472 100644 --- a/src/angle/src/compiler/translator.pro +++ b/src/angle/src/compiler/translator.pro @@ -1,4 +1,5 @@ CONFIG += static +contains(QT_CONFIG, dynamicgl): CONFIG += not_installed include(../config.pri) INCLUDEPATH += \ diff --git a/src/angle/src/libEGL/libEGL.pro b/src/angle/src/libEGL/libEGL.pro index 695f7fd50c..860b60735e 100644 --- a/src/angle/src/libEGL/libEGL.pro +++ b/src/angle/src/libEGL/libEGL.pro @@ -1,4 +1,3 @@ -CONFIG += installed include(../common/common.pri) DEF_FILE_TARGET=$${TARGET} TARGET=$$qtLibraryTarget($${LIBEGL_NAME}) diff --git a/src/angle/src/libGLESv2/libGLESv2.pro b/src/angle/src/libGLESv2/libGLESv2.pro index 49e69db2e5..b699ae159a 100644 --- a/src/angle/src/libGLESv2/libGLESv2.pro +++ b/src/angle/src/libGLESv2/libGLESv2.pro @@ -1,4 +1,4 @@ -CONFIG += simd installed no_batch +CONFIG += simd no_batch include(../common/common.pri) DEF_FILE_TARGET=$${TARGET} TARGET=$$qtLibraryTarget($${LIBGLESV2_NAME}) diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro index ccf9aaa612..1db814180b 100644 --- a/src/corelib/corelib.pro +++ b/src/corelib/corelib.pro @@ -27,8 +27,9 @@ ANDROID_PERMISSIONS = \ android.permission.WRITE_EXTERNAL_STORAGE # QtCore can't be compiled with -Wl,-no-undefined because it uses the "environ" -# variable and on FreeBSD, this variable is in the final executable itself -freebsd: QMAKE_LFLAGS_NOUNDEF = +# variable and on FreeBSD and OpenBSD, this variable is in the final executable itself. +# OpenBSD 6.0 will include environ in libc. +freebsd|openbsd: QMAKE_LFLAGS_NOUNDEF = load(qfeatures) diff --git a/src/corelib/global/qendian.h b/src/corelib/global/qendian.h index c2028289a7..4e9cd2e6e3 100644 --- a/src/corelib/global/qendian.h +++ b/src/corelib/global/qendian.h @@ -49,12 +49,6 @@ QT_BEGIN_NAMESPACE -#ifdef __has_builtin -# define QT_HAS_BUILTIN(x) __has_builtin(x) -#else -# define QT_HAS_BUILTIN(x) 0 -#endif - /* * ENDIAN FUNCTIONS */ diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp index ff04116705..f7e57461e3 100644 --- a/src/corelib/plugin/qlibrary.cpp +++ b/src/corelib/plugin/qlibrary.cpp @@ -318,7 +318,7 @@ static bool findPatternUnloaded(const QString &library, QLibraryPrivate *lib) } if (!ret && lib) - lib->errorString = QLibrary::tr("Plugin verification data mismatch in '%1'").arg(library); + lib->errorString = QLibrary::tr("Failed to extract plugin meta data from '%1'").arg(library); file.close(); return ret; } diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index 2284444f93..adb539c388 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -4313,8 +4313,6 @@ QDateTime QDateTime::currentDateTimeUtc() qint64 QDateTime::currentMSecsSinceEpoch() Q_DECL_NOTHROW { - QDate d; - QTime t; SYSTEMTIME st; memset(&st, 0, sizeof(SYSTEMTIME)); GetSystemTime(&st); diff --git a/src/gui/opengl/qopenglframebufferobject.cpp b/src/gui/opengl/qopenglframebufferobject.cpp index 303d4d4eb1..bcc17457d3 100644 --- a/src/gui/opengl/qopenglframebufferobject.cpp +++ b/src/gui/opengl/qopenglframebufferobject.cpp @@ -1289,7 +1289,8 @@ static inline QImage qt_gl_read_framebuffer_rgba8(const QSize &size, bool includ (qstrcmp(renderer, "Mali-T760") == 0 && ::strstr(ver, "3.1") != 0) || (qstrcmp(renderer, "Mali-T720") == 0 - && ::strstr(ver, "3.1") != 0); + && ::strstr(ver, "3.1") != 0) || + qstrcmp(renderer, "PowerVR SGX 554") == 0; const bool supports_bgra = has_bgra_ext && !blackListed; diff --git a/src/gui/painting/qblendfunctions_p.h b/src/gui/painting/qblendfunctions_p.h index 00036f9994..d21765bcde 100644 --- a/src/gui/painting/qblendfunctions_p.h +++ b/src/gui/painting/qblendfunctions_p.h @@ -140,7 +140,7 @@ void qt_scale_image_16bit(uchar *destPixels, int dbpl, if (yend < 0 || yend >= srch) --h; int xend = (basex + ix * (w - 1)) >> 16; - if (xend < 0 || xend >= (int)(sbpl/sizeof(quint32))) + if (xend < 0 || xend >= (int)(sbpl/sizeof(SRC))) --w; while (h--) { diff --git a/src/network/ssl/qsslsocket_openssl_symbols_p.h b/src/network/ssl/qsslsocket_openssl_symbols_p.h index c0ddb8e888..8743e3acd1 100644 --- a/src/network/ssl/qsslsocket_openssl_symbols_p.h +++ b/src/network/ssl/qsslsocket_openssl_symbols_p.h @@ -389,13 +389,13 @@ int q_SSL_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, CRYPT int q_SSL_set_ex_data(SSL *ssl, int idx, void *arg); void *q_SSL_get_ex_data(const SSL *ssl, int idx); #endif -#ifndef OPENSSL_NO_PSK +#if OPENSSL_VERSION_NUMBER >= 0x10001000L && !defined(OPENSSL_NO_PSK) typedef unsigned int (*q_psk_client_callback_t)(SSL *ssl, const char *hint, char *identity, unsigned int max_identity_len, unsigned char *psk, unsigned int max_psk_len); void q_SSL_set_psk_client_callback(SSL *ssl, q_psk_client_callback_t callback); typedef unsigned int (*q_psk_server_callback_t)(SSL *ssl, const char *identity, unsigned char *psk, unsigned int max_psk_len); void q_SSL_set_psk_server_callback(SSL *ssl, q_psk_server_callback_t callback); int q_SSL_CTX_use_psk_identity_hint(SSL_CTX *ctx, const char *hint); -#endif // OPENSSL_NO_PSK +#endif // OPENSSL_VERSION_NUMBER >= 0x10001000L && !defined(OPENSSL_NO_PSK) #if OPENSSL_VERSION_NUMBER >= 0x10000000L #ifndef OPENSSL_NO_SSL2 const SSL_METHOD *q_SSLv2_client_method(); diff --git a/src/plugins/platforms/ios/qioscontext.mm b/src/plugins/platforms/ios/qioscontext.mm index d18e317bfb..50374dc951 100644 --- a/src/plugins/platforms/ios/qioscontext.mm +++ b/src/plugins/platforms/ios/qioscontext.mm @@ -217,8 +217,12 @@ void QIOSContext::swapBuffers(QPlatformSurface *surface) if (surface->surface()->surfaceClass() == QSurface::Offscreen) return; // Nothing to do + // When using threaded rendering, the render-thread may not have picked up + // yet on the fact that a window is no longer exposed, and will try to swap + // a non-exposed window. This may in some cases result in crashes, e.g. when + // iOS is suspending an application, so we have an extra guard here. if (!static_cast<QIOSWindow *>(surface)->isExposed()) { - qCWarning(lcQpaGLContext, "Detected swapBuffers on a non-exposed window, skipping flush"); + qCDebug(lcQpaGLContext, "Detected swapBuffers on a non-exposed window, skipping flush"); return; } diff --git a/src/plugins/platforms/ios/qioswindow.mm b/src/plugins/platforms/ios/qioswindow.mm index 2805eaa304..cddfbe6b06 100644 --- a/src/plugins/platforms/ios/qioswindow.mm +++ b/src/plugins/platforms/ios/qioswindow.mm @@ -223,26 +223,7 @@ void QIOSWindow::applyGeometry(const QRect &rect) bool QIOSWindow::isExposed() const { - // Note: At startup of an iOS app it will enter UIApplicationStateInactive - // while showing the launch screen, and once the application returns from - // applicationDidFinishLaunching it will hide the launch screen and enter - // UIApplicationStateActive. Technically, a window is not exposed until - // it's actually visible on screen, and Apple also documents that "Apps - // that use OpenGL ES for drawing must not use didFinishLaunching to - // prepare their drawing environment. Instead, defer any OpenGL ES - // drawing calls to applicationDidBecomeActive". Unfortunately, if we - // wait until the applicationState reaches ApplicationActive to signal - // that the window is exposed, we get a lag between hiding the launch - // screen and blitting the first pixels of the application, as Qt - // spends some time drawing those pixels in response to the expose. - // In practice there doesn't seem to be any issues starting GL setup - // and drawing from within applicationDidFinishLaunching, and this is - // also the recommended approach for other 3rd party GL toolkits on iOS, - // so we 'cheat', and report that a window is exposed even if the app - // is in UIApplicationStateInactive, so that the startup transition - // between the launch screen and the application content is smooth. - - return qApp->applicationState() > Qt::ApplicationHidden + return qApp->applicationState() >= Qt::ApplicationActive && window()->isVisible() && !window()->geometry().isEmpty(); } diff --git a/src/widgets/kernel/qdesktopwidget.cpp b/src/widgets/kernel/qdesktopwidget.cpp index ece673337a..eee818b685 100644 --- a/src/widgets/kernel/qdesktopwidget.cpp +++ b/src/widgets/kernel/qdesktopwidget.cpp @@ -44,6 +44,9 @@ #include "qwidget_p.h" #include "qwindow.h" +#include <private/qhighdpiscaling_p.h> +#include <qpa/qplatformscreen.h> + QT_BEGIN_NAMESPACE QDesktopScreenWidget::QDesktopScreenWidget(QScreen *screen, const QRect &geometry) @@ -245,18 +248,18 @@ int QDesktopWidget::screenNumber(const QWidget *w) const if (screens.isEmpty()) // This should never happen return primaryScreen(); + const QWindow *winHandle = w->windowHandle(); + if (!winHandle) { + if (const QWidget *nativeParent = w->nativeParentWidget()) + winHandle = nativeParent->windowHandle(); + } + // If there is more than one virtual desktop if (screens.count() != screens.constFirst()->virtualSiblings().count()) { // Find the root widget, get a QScreen from it and use the // virtual siblings for checking the window position. - const QWidget *root = w; - const QWidget *tmp = w; - while ((tmp = tmp->parentWidget())) - root = tmp; - const QWindow *winHandle = root->windowHandle(); if (winHandle) { - const QScreen *winScreen = winHandle->screen(); - if (winScreen) + if (const QScreen *winScreen = winHandle->screen()) screens = winScreen->virtualSiblings(); } } @@ -266,11 +269,12 @@ int QDesktopWidget::screenNumber(const QWidget *w) const QRect frame = w->frameGeometry(); if (!w->isWindow()) frame.moveTopLeft(w->mapToGlobal(QPoint(0, 0))); + const QRect nativeFrame = QHighDpi::toNativePixels(frame, winHandle); QScreen *widgetScreen = Q_NULLPTR; int largestArea = 0; foreach (QScreen *screen, screens) { - QRect intersected = screen->geometry().intersected(frame); + const QRect intersected = screen->handle()->geometry().intersected(nativeFrame); int area = intersected.width() * intersected.height(); if (largestArea < area) { widgetScreen = screen; diff --git a/src/widgets/widgets/qdockwidget.cpp b/src/widgets/widgets/qdockwidget.cpp index 2358568efe..e8c5502ae6 100644 --- a/src/widgets/widgets/qdockwidget.cpp +++ b/src/widgets/widgets/qdockwidget.cpp @@ -1449,8 +1449,6 @@ bool QDockWidget::event(QEvent *event) switch (event->type()) { #ifndef QT_NO_ACTION case QEvent::Hide: - if (d->state && d->state->dragging) - d->endDrag(true); if (layout != 0) layout->keepSize(this); d->toggleViewAction->setChecked(false); |