Merge remote-tracking branch 'origin/5.7' into dev
Conflicts: src/corelib/global/qglobal.cpp src/corelib/global/qsysinfo.h src/corelib/kernel/qcoreapplication_win.cpp src/gui/text/qdistancefield.cpp src/gui/text/qdistancefield_p.h src/plugins/platforms/windows/qwindowsglcontext.cpp src/plugins/platforms/windows/qwindowsglcontext.h Change-Id: Ib3500acc2b28553bde06758cd9a2e19eb7fe2978
This commit is contained in:
commit
ea438b2508
3
.gitignore
vendored
3
.gitignore
vendored
@ -53,6 +53,7 @@ wrapper.sh
|
|||||||
wrapper.bat
|
wrapper.bat
|
||||||
core
|
core
|
||||||
.qmake.cache
|
.qmake.cache
|
||||||
|
.qmake.stash
|
||||||
.qmake.vars
|
.qmake.vars
|
||||||
.device.vars
|
.device.vars
|
||||||
*.prl
|
*.prl
|
||||||
@ -118,6 +119,7 @@ mkspecs/default-host
|
|||||||
mkspecs/qconfig.pri
|
mkspecs/qconfig.pri
|
||||||
mkspecs/qdevice.pri
|
mkspecs/qdevice.pri
|
||||||
mkspecs/qfeatures.pri
|
mkspecs/qfeatures.pri
|
||||||
|
mkspecs/qhost.pri
|
||||||
moc_*.cpp
|
moc_*.cpp
|
||||||
qmake/qmake.exe
|
qmake/qmake.exe
|
||||||
qmake/Makefile.bak
|
qmake/Makefile.bak
|
||||||
@ -203,6 +205,7 @@ tools/qvfb/qwssignalhandler_p.h
|
|||||||
.rcc
|
.rcc
|
||||||
*.app
|
*.app
|
||||||
config.status
|
config.status
|
||||||
|
config.tests/common/c++default/c++default.ii
|
||||||
config.tests/unix/cups/cups
|
config.tests/unix/cups/cups
|
||||||
config.tests/unix/getaddrinfo/getaddrinfo
|
config.tests/unix/getaddrinfo/getaddrinfo
|
||||||
config.tests/unix/getifaddrs/getifaddrs
|
config.tests/unix/getifaddrs/getifaddrs
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
The Qt Toolkit is Copyright (C) 2015 The Qt Company Ltd.
|
The Qt Toolkit is Copyright (C) 2015 The Qt Company Ltd.
|
||||||
Contact: http://www.qt.io/licensing/
|
Contact: http://www.qt.io/licensing/
|
||||||
|
|
||||||
You may use, distribute and copy the Qt GUI Toolkit under the terms of
|
You may use, distribute and copy the Qt Toolkit under the terms of
|
||||||
GNU Lesser General Public License version 3. That license references
|
GNU Lesser General Public License version 3. That license references
|
||||||
the General Public License version 3, that is displayed below. Other
|
the General Public License version 3, that is displayed below. Other
|
||||||
portions of the Qt Toolkit may be licensed directly under this license.
|
portions of the Qt Toolkit may be licensed directly under this license.
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
The Qt Toolkit is Copyright (C) 2016 The Qt Company Ltd.
|
The Qt Toolkit is Copyright (C) 2016 The Qt Company Ltd.
|
||||||
Contact: http://www.qt.io/licensing/
|
Contact: http://www.qt.io/licensing/
|
||||||
|
|
||||||
You may use, distribute and copy the Qt GUI Toolkit under the terms of
|
You may use, distribute and copy the Qt Toolkit under the terms of
|
||||||
GNU Lesser General Public License version 2.1, which is displayed below.
|
GNU Lesser General Public License version 2.1, which is displayed below.
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
The Qt Toolkit is Copyright (C) 2016 The Qt Company Ltd.
|
The Qt Toolkit is Copyright (C) 2016 The Qt Company Ltd.
|
||||||
Contact: http://www.qt.io/licensing/
|
Contact: http://www.qt.io/licensing/
|
||||||
|
|
||||||
You may use, distribute and copy the Qt GUI Toolkit under the terms of
|
You may use, distribute and copy the Qt Toolkit under the terms of
|
||||||
GNU Lesser General Public License version 3, which is displayed below.
|
GNU Lesser General Public License version 3, which is displayed below.
|
||||||
This license makes reference to the version 3 of the GNU General
|
This license makes reference to the version 3 of the GNU General
|
||||||
Public License, which you can find in the LICENSE.GPLv3 file.
|
Public License, which you can find in the LICENSE.GPLv3 file.
|
||||||
|
@ -275,6 +275,12 @@ const char msg2[] = "==Qt=magic=Qt== Sub-architecture:"
|
|||||||
// -- POWER, PowerPC --
|
// -- POWER, PowerPC --
|
||||||
#ifdef __ALTIVEC__
|
#ifdef __ALTIVEC__
|
||||||
" altivec"
|
" altivec"
|
||||||
|
#endif
|
||||||
|
#ifdef __SPE__
|
||||||
|
" spe"
|
||||||
|
#endif
|
||||||
|
#ifdef __VSX__
|
||||||
|
" vsx"
|
||||||
#endif
|
#endif
|
||||||
"";
|
"";
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ echo QT_VERSION_MINOR = %QTVERMIN% >> Makefile
|
|||||||
echo QT_VERSION_PATCH = %QTVERPAT% >> Makefile
|
echo QT_VERSION_PATCH = %QTVERPAT% >> Makefile
|
||||||
if not "%icl.exe%" == "" (
|
if not "%icl.exe%" == "" (
|
||||||
echo CXX = icl>>Makefile
|
echo CXX = icl>>Makefile
|
||||||
echo EXTRA_CXXFLAGS = /Zc:forScope>>Makefile
|
echo EXTRA_CXXFLAGS = /Qstd=c++11 /Zc:forScope>>Makefile
|
||||||
rem This must have a trailing space.
|
rem This must have a trailing space.
|
||||||
echo QTSRC = %QTSRC% >> Makefile
|
echo QTSRC = %QTSRC% >> Makefile
|
||||||
set tmpl=win32
|
set tmpl=win32
|
||||||
|
30
mkspecs/common/bsd/bsd.conf
Normal file
30
mkspecs/common/bsd/bsd.conf
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
#
|
||||||
|
# common qmake configuration for *BSD
|
||||||
|
#
|
||||||
|
|
||||||
|
MAKEFILE_GENERATOR = UNIX
|
||||||
|
QMAKE_PLATFORM += bsd
|
||||||
|
|
||||||
|
include(../unix.conf)
|
||||||
|
|
||||||
|
QMAKE_CFLAGS_THREAD = -pthread
|
||||||
|
|
||||||
|
QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD
|
||||||
|
|
||||||
|
QMAKE_LFLAGS_THREAD = -pthread
|
||||||
|
QMAKE_LFLAGS_GCSECTIONS = -Wl,--gc-sections
|
||||||
|
|
||||||
|
QMAKE_LIBS =
|
||||||
|
QMAKE_LIBS_DYNLOAD =
|
||||||
|
QMAKE_LIBS_EXECINFO = -lexecinfo
|
||||||
|
QMAKE_LIBS_X11 = -lXext -lX11 -lm
|
||||||
|
QMAKE_LIBS_OPENGL = -lGL
|
||||||
|
QMAKE_LIBS_THREAD =
|
||||||
|
|
||||||
|
QMAKE_AR = ar cqs
|
||||||
|
QMAKE_OBJCOPY = objcopy
|
||||||
|
QMAKE_NM = nm -P
|
||||||
|
QMAKE_RANLIB =
|
||||||
|
|
||||||
|
QMAKE_STRIP = strip
|
||||||
|
QMAKE_STRIPFLAGS_LIB += --strip-unneeded
|
79
mkspecs/common/bsd/qplatformdefs.h
Normal file
79
mkspecs/common/bsd/qplatformdefs.h
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2015 The Qt Company Ltd.
|
||||||
|
** 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$
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Q_BSD_PLATFORMDEFS_H
|
||||||
|
#define Q_BSD_PLATFORMDEFS_H
|
||||||
|
|
||||||
|
// Get Qt defines/settings
|
||||||
|
|
||||||
|
#include "qglobal.h"
|
||||||
|
|
||||||
|
// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
|
||||||
|
// We are hot - unistd.h should have turned on the specific APIs we requested
|
||||||
|
|
||||||
|
|
||||||
|
#include <pthread.h>
|
||||||
|
#include <dirent.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <grp.h>
|
||||||
|
#include <pwd.h>
|
||||||
|
#include <signal.h>
|
||||||
|
#include <dlfcn.h>
|
||||||
|
|
||||||
|
#include <sys/param.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/ioctl.h>
|
||||||
|
#include <sys/ipc.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
#include <sys/shm.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <sys/wait.h>
|
||||||
|
#include <netinet/in.h>
|
||||||
|
#ifndef QT_NO_IPV6IFNAME
|
||||||
|
#include <net/if.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "../posix/qplatformdefs.h"
|
||||||
|
|
||||||
|
#undef QT_OPEN_LARGEFILE
|
||||||
|
#define QT_OPEN_LARGEFILE 0
|
||||||
|
|
||||||
|
#define QT_SNPRINTF ::snprintf
|
||||||
|
#define QT_VSNPRINTF ::vsnprintf
|
||||||
|
|
||||||
|
#endif // QPLATFORMDEFS_H
|
@ -2,7 +2,7 @@
|
|||||||
# qmake configuration for common OS X
|
# qmake configuration for common OS X
|
||||||
#
|
#
|
||||||
|
|
||||||
QMAKE_PLATFORM += osx macx
|
QMAKE_PLATFORM += macos osx macx
|
||||||
QMAKE_MAC_SDK = macosx
|
QMAKE_MAC_SDK = macosx
|
||||||
|
|
||||||
include(mac.conf)
|
include(mac.conf)
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
MAKEFILE_GENERATOR = UNIX
|
MAKEFILE_GENERATOR = UNIX
|
||||||
QMAKE_PLATFORM = osx macx mac darwin
|
QMAKE_PLATFORM = macos osx macx mac darwin
|
||||||
CONFIG += native_precompiled_headers
|
CONFIG += native_precompiled_headers
|
||||||
DEFINES += __USE_WS_X11__
|
DEFINES += __USE_WS_X11__
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# qmake configuration for the Raspberry Pi 3
|
# qmake configuration for the Raspberry Pi 3 (32-bit) using the Broadcom graphics stack
|
||||||
|
|
||||||
include(../common/linux_device_pre.conf)
|
include(../common/linux_device_pre.conf)
|
||||||
|
|
||||||
@ -27,9 +27,8 @@ QMAKE_LIBS_OPENGL_ES2 = $${VC_LINK_LINE} -lGLESv2
|
|||||||
# The official opt vc EGL references GLESv2 symbols: need to link it
|
# The official opt vc EGL references GLESv2 symbols: need to link it
|
||||||
QMAKE_LIBS_EGL = $${VC_LINK_LINE} -lEGL -lGLESv2
|
QMAKE_LIBS_EGL = $${VC_LINK_LINE} -lEGL -lGLESv2
|
||||||
|
|
||||||
# We deliberately override the existing Qt CFLAGS as they might be problematic
|
QMAKE_CFLAGS = -march=armv8-a -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8
|
||||||
QMAKE_CFLAGS = -march=armv8-a+crc -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8 -pipe -Os -mthumb
|
QMAKE_CXXFLAGS = $$QMAKE_CFLAGS
|
||||||
QMAKE_CXXFLAGS = $$QMAKE_CFLAGS -std=c++1z
|
|
||||||
|
|
||||||
DISTRO_OPTS += hard-float
|
DISTRO_OPTS += hard-float
|
||||||
DISTRO_OPTS += deb-multi-arch
|
DISTRO_OPTS += deb-multi-arch
|
||||||
|
44
mkspecs/devices/linux-rpi3-vc4-g++/qmake.conf
Normal file
44
mkspecs/devices/linux-rpi3-vc4-g++/qmake.conf
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
# qmake configuration for the Raspberry Pi 3 (32-bit) using the
|
||||||
|
# *experimental* VC4 driver for Mesa and DRM.
|
||||||
|
#
|
||||||
|
# This should allow accelerated EGL and OpenGL with eglfs via
|
||||||
|
# KMS/DRM/GBM (instead of the Broadcom-specific backend), under X11
|
||||||
|
# with xcb, and also enables (Qt)Wayland via the standard wayland-egl
|
||||||
|
# path. See https://dri.freedesktop.org/wiki/VC4
|
||||||
|
#
|
||||||
|
# Note that this is not the same as the default, Broadcom proprietary
|
||||||
|
# driver. Some functionality and extensions may therefore be missing,
|
||||||
|
# in particular when it comes to accelerated multimedia (video,
|
||||||
|
# camera).
|
||||||
|
#
|
||||||
|
# At the time of writing Raspbian has to be switched explicitly to the
|
||||||
|
# experimental VC4 driver. To do this, run raspi-config and enable it
|
||||||
|
# in Advanced Options -> GL Driver.
|
||||||
|
#
|
||||||
|
# Example configure command below. We disable using the GNU gold
|
||||||
|
# linker as it apparently has issues with ARMv8. In the configure
|
||||||
|
# output check that "EGLFS GBM .......... yes" is present, otherwise
|
||||||
|
# eglfs will not be functional.
|
||||||
|
#
|
||||||
|
# ./configure -release -opengl es2 -device linux-rpi3-vc4-g++ \
|
||||||
|
# -device-option CROSS_COMPILE=~/raspbian/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- \
|
||||||
|
# -sysroot ~/raspbian/sysroot \
|
||||||
|
# -prefix /usr/local/qt5pi -extprefix ~/raspbian/qt5pi -hostprefix ~/raspbian/qt5 \
|
||||||
|
# -v -nomake examples -nomake tests -no-use-gold-linker
|
||||||
|
|
||||||
|
include(../common/linux_device_pre.conf)
|
||||||
|
|
||||||
|
QMAKE_LIBS_EGL += -lEGL
|
||||||
|
QMAKE_LIBS_OPENGL_ES2 += -lGLESv2 -lEGL
|
||||||
|
|
||||||
|
QMAKE_CFLAGS = -march=armv8-a -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8
|
||||||
|
QMAKE_CXXFLAGS = $$QMAKE_CFLAGS
|
||||||
|
|
||||||
|
DISTRO_OPTS += hard-float
|
||||||
|
DISTRO_OPTS += deb-multi-arch
|
||||||
|
|
||||||
|
EGLFS_DEVICE_INTEGRATION = eglfs_kms
|
||||||
|
|
||||||
|
include(../common/linux_arm_device_post.conf)
|
||||||
|
|
||||||
|
load(qt_config)
|
34
mkspecs/devices/linux-rpi3-vc4-g++/qplatformdefs.h
Normal file
34
mkspecs/devices/linux-rpi3-vc4-g++/qplatformdefs.h
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2016 The Qt Company Ltd.
|
||||||
|
** 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 "../../linux-g++/qplatformdefs.h"
|
@ -48,10 +48,11 @@ isEmpty(QMAKE_DEFAULT_INCDIRS):!host_build {
|
|||||||
QMAKE_DEFAULT_LIBDIRS += $$clean_path($$path)
|
QMAKE_DEFAULT_LIBDIRS += $$clean_path($$path)
|
||||||
} else: contains(line, "$${LITERAL_HASH}include <.*") { # #include <...> search starts here:
|
} else: contains(line, "$${LITERAL_HASH}include <.*") { # #include <...> search starts here:
|
||||||
add_includes = true
|
add_includes = true
|
||||||
} else: contains(line, "End of search list.*") {
|
} else: contains(line, "End of search.*") {
|
||||||
add_includes = false
|
add_includes = false
|
||||||
} else {
|
} else: $$add_includes {
|
||||||
$$add_includes: QMAKE_DEFAULT_INCDIRS += $$clean_path($$line)
|
!contains(line, ".* \\(framework directory\\)"): \
|
||||||
|
QMAKE_DEFAULT_INCDIRS += $$clean_path($$line)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
QMAKE_DEFAULT_LIBDIRS = $$unique(QMAKE_DEFAULT_LIBDIRS)
|
QMAKE_DEFAULT_LIBDIRS = $$unique(QMAKE_DEFAULT_LIBDIRS)
|
||||||
|
@ -15,7 +15,7 @@ TEMPLATE = lib
|
|||||||
CONFIG += plugin
|
CONFIG += plugin
|
||||||
|
|
||||||
if(win32|mac):!macx-xcode {
|
if(win32|mac):!macx-xcode {
|
||||||
contains(QT_CONFIG, simulator_and_device): CONFIG += iphonesimulator_and_iphoneos
|
contains(QT_CONFIG, simulator_and_device): CONFIG += simulator_and_device
|
||||||
contains(QT_CONFIG, debug_and_release): CONFIG += debug_and_release
|
contains(QT_CONFIG, debug_and_release): CONFIG += debug_and_release
|
||||||
contains(QT_CONFIG, build_all): CONFIG += build_all
|
contains(QT_CONFIG, build_all): CONFIG += build_all
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ QT = # In case qt is re-added.
|
|||||||
CONFIG -= warning_clean # Don't presume 3rd party code to be clean
|
CONFIG -= warning_clean # Don't presume 3rd party code to be clean
|
||||||
load(qt_common)
|
load(qt_common)
|
||||||
|
|
||||||
contains(QT_CONFIG, simulator_and_device): CONFIG += iphonesimulator_and_iphoneos
|
contains(QT_CONFIG, simulator_and_device): CONFIG += simulator_and_device
|
||||||
contains(QT_CONFIG, debug_and_release): CONFIG += debug_and_release
|
contains(QT_CONFIG, debug_and_release): CONFIG += debug_and_release
|
||||||
contains(QT_CONFIG, build_all): CONFIG += build_all
|
contains(QT_CONFIG, build_all): CONFIG += build_all
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ INCLUDEPATH *= $$eval(QT.$${MODULE}.includes) $$eval(QT.$${MODULE}_private.inclu
|
|||||||
# If Qt was configured with -debug-and-release then build the module the same way
|
# If Qt was configured with -debug-and-release then build the module the same way
|
||||||
# - unless this is a host library
|
# - unless this is a host library
|
||||||
!host_build:if(win32|mac):!macx-xcode {
|
!host_build:if(win32|mac):!macx-xcode {
|
||||||
contains(QT_CONFIG, simulator_and_device): CONFIG += iphonesimulator_and_iphoneos
|
contains(QT_CONFIG, simulator_and_device): CONFIG += simulator_and_device
|
||||||
contains(QT_CONFIG, debug_and_release): CONFIG += debug_and_release
|
contains(QT_CONFIG, debug_and_release): CONFIG += debug_and_release
|
||||||
contains(QT_CONFIG, build_all): CONFIG += build_all
|
contains(QT_CONFIG, build_all): CONFIG += build_all
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ win32:CONFIG(shared, static|shared) {
|
|||||||
tool_plugin {
|
tool_plugin {
|
||||||
!build_pass:contains(QT_CONFIG, debug_and_release): CONFIG += release
|
!build_pass:contains(QT_CONFIG, debug_and_release): CONFIG += release
|
||||||
} else:if(win32|mac):!macx-xcode {
|
} else:if(win32|mac):!macx-xcode {
|
||||||
contains(QT_CONFIG, simulator_and_device): CONFIG += iphonesimulator_and_iphoneos
|
contains(QT_CONFIG, simulator_and_device): CONFIG += simulator_and_device
|
||||||
contains(QT_CONFIG, debug_and_release): CONFIG += debug_and_release
|
contains(QT_CONFIG, debug_and_release): CONFIG += debug_and_release
|
||||||
contains(QT_CONFIG, build_all): CONFIG += build_all
|
contains(QT_CONFIG, build_all): CONFIG += build_all
|
||||||
}
|
}
|
||||||
|
@ -26,18 +26,25 @@ isEmpty(QMAKE_PLATFORM) {
|
|||||||
equals(TARGET_PLATFORM, unix): \
|
equals(TARGET_PLATFORM, unix): \
|
||||||
QMAKE_PLATFORM = unix
|
QMAKE_PLATFORM = unix
|
||||||
else:equals(TARGET_PLATFORM, macx): \
|
else:equals(TARGET_PLATFORM, macx): \
|
||||||
QMAKE_PLATFORM = osx macx mac darwin unix
|
QMAKE_PLATFORM = macos osx macx mac darwin unix
|
||||||
else:equals(TARGET_PLATFORM, win32): \
|
else:equals(TARGET_PLATFORM, win32): \
|
||||||
QMAKE_PLATFORM = win32
|
QMAKE_PLATFORM = win32
|
||||||
else: \
|
else: \
|
||||||
error("Qmake spec sets an invalid TARGET_PLATFORM.")
|
error("Qmake spec sets an invalid TARGET_PLATFORM.")
|
||||||
}
|
}
|
||||||
|
|
||||||
contains(QMAKE_PLATFORM, macx):!contains(QMAKE_PLATFORM, osx) {
|
contains(QMAKE_PLATFORM, macx) {
|
||||||
warning("qmake spec specifies platform macx, but not osx.")
|
!contains(QMAKE_PLATFORM, osx) {
|
||||||
|
warning("qmake spec specified platform macx, but not osx.");
|
||||||
QMAKE_PLATFORM = osx $$QMAKE_PLATFORM
|
QMAKE_PLATFORM = osx $$QMAKE_PLATFORM
|
||||||
}
|
}
|
||||||
|
|
||||||
|
!contains(QMAKE_PLATFORM, macos) {
|
||||||
|
warning("qmake spec specifies platform macx, but not macos.")
|
||||||
|
QMAKE_PLATFORM = macos $$QMAKE_PLATFORM
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
CONFIG += $$QMAKE_PLATFORM
|
CONFIG += $$QMAKE_PLATFORM
|
||||||
|
|
||||||
isEmpty(QMAKE_COMPILER) {
|
isEmpty(QMAKE_COMPILER) {
|
||||||
|
@ -3,34 +3,16 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
MAKEFILE_GENERATOR = UNIX
|
MAKEFILE_GENERATOR = UNIX
|
||||||
QMAKE_PLATFORM = freebsd bsd
|
QMAKE_PLATFORM = freebsd
|
||||||
|
|
||||||
include(../common/unix.conf)
|
include(../common/bsd/bsd.conf)
|
||||||
|
|
||||||
QMAKE_CFLAGS_THREAD = -pthread
|
# Addon software goes into /usr/local on FreeBSD, by default we will look there
|
||||||
|
|
||||||
QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD
|
|
||||||
|
|
||||||
# Addon software goes into /usr/local on the BSDs, by default we will look there
|
|
||||||
QMAKE_INCDIR = /usr/local/include
|
QMAKE_INCDIR = /usr/local/include
|
||||||
QMAKE_LIBDIR = /usr/local/lib
|
QMAKE_LIBDIR = /usr/local/lib
|
||||||
|
|
||||||
QMAKE_LFLAGS_NOUNDEF = -Wl,--no-undefined
|
QMAKE_LFLAGS_NOUNDEF = -Wl,--no-undefined
|
||||||
QMAKE_LFLAGS_THREAD = -pthread
|
|
||||||
|
|
||||||
QMAKE_LIBS =
|
|
||||||
QMAKE_LIBS_DYNLOAD =
|
|
||||||
QMAKE_LIBS_EXECINFO = -lexecinfo
|
|
||||||
QMAKE_LIBS_X11 = -lXext -lX11 -lm
|
|
||||||
QMAKE_LIBS_OPENGL = -lGL
|
|
||||||
QMAKE_LIBS_THREAD =
|
|
||||||
|
|
||||||
QMAKE_AR = ar cqs
|
|
||||||
QMAKE_OBJCOPY = objcopy
|
|
||||||
QMAKE_NM = nm -P
|
|
||||||
QMAKE_RANLIB =
|
|
||||||
|
|
||||||
include(../common/gcc-base-unix.conf)
|
include(../common/gcc-base-unix.conf)
|
||||||
include(../common/clang.conf)
|
include(../common/clang.conf)
|
||||||
|
|
||||||
load(qt_config)
|
load(qt_config)
|
||||||
|
@ -40,47 +40,6 @@
|
|||||||
#ifndef QPLATFORMDEFS_H
|
#ifndef QPLATFORMDEFS_H
|
||||||
#define QPLATFORMDEFS_H
|
#define QPLATFORMDEFS_H
|
||||||
|
|
||||||
// Get Qt defines/settings
|
#include "../common/bsd/qplatformdefs.h"
|
||||||
|
|
||||||
#include "qglobal.h"
|
|
||||||
|
|
||||||
// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs
|
|
||||||
|
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
|
|
||||||
// We are hot - unistd.h should have turned on the specific APIs we requested
|
|
||||||
|
|
||||||
|
|
||||||
#include <pthread.h>
|
|
||||||
#include <dirent.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <grp.h>
|
|
||||||
#include <pwd.h>
|
|
||||||
#include <signal.h>
|
|
||||||
#include <dlfcn.h>
|
|
||||||
|
|
||||||
#include <sys/param.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/ioctl.h>
|
|
||||||
#include <sys/ipc.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
#include <sys/shm.h>
|
|
||||||
#include <sys/socket.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <sys/wait.h>
|
|
||||||
#include <netinet/in.h>
|
|
||||||
#ifndef QT_NO_IPV6IFNAME
|
|
||||||
#include <net/if.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "../common/posix/qplatformdefs.h"
|
|
||||||
|
|
||||||
#undef QT_OPEN_LARGEFILE
|
|
||||||
|
|
||||||
#define QT_OPEN_LARGEFILE 0
|
|
||||||
|
|
||||||
#define QT_SNPRINTF ::snprintf
|
|
||||||
#define QT_VSNPRINTF ::vsnprintf
|
|
||||||
|
|
||||||
#endif // QPLATFORMDEFS_H
|
#endif // QPLATFORMDEFS_H
|
||||||
|
@ -3,32 +3,14 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
MAKEFILE_GENERATOR = UNIX
|
MAKEFILE_GENERATOR = UNIX
|
||||||
QMAKE_PLATFORM = freebsd bsd
|
QMAKE_PLATFORM = freebsd
|
||||||
|
|
||||||
include(../common/unix.conf)
|
include(../common/bsd/bsd.conf)
|
||||||
|
|
||||||
QMAKE_CFLAGS_THREAD = -pthread
|
# Addon software goes into /usr/local on FreeBSD, by default we will look there
|
||||||
|
|
||||||
QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD
|
|
||||||
|
|
||||||
# Addon software goes into /usr/local on the BSDs, by default we will look there
|
|
||||||
QMAKE_INCDIR = /usr/local/include
|
QMAKE_INCDIR = /usr/local/include
|
||||||
QMAKE_LIBDIR = /usr/local/lib
|
QMAKE_LIBDIR = /usr/local/lib
|
||||||
|
|
||||||
QMAKE_LFLAGS_THREAD = -pthread
|
|
||||||
|
|
||||||
QMAKE_LIBS =
|
|
||||||
QMAKE_LIBS_DYNLOAD =
|
|
||||||
QMAKE_LIBS_EXECINFO = -lexecinfo
|
|
||||||
QMAKE_LIBS_X11 = -lXext -lX11 -lm
|
|
||||||
QMAKE_LIBS_OPENGL = -lGL
|
|
||||||
QMAKE_LIBS_THREAD =
|
|
||||||
|
|
||||||
QMAKE_AR = ar cqs
|
|
||||||
QMAKE_OBJCOPY = objcopy
|
|
||||||
QMAKE_NM = nm -P
|
|
||||||
QMAKE_RANLIB =
|
|
||||||
|
|
||||||
include(../common/gcc-base-unix.conf)
|
include(../common/gcc-base-unix.conf)
|
||||||
include(../common/g++-unix.conf)
|
include(../common/g++-unix.conf)
|
||||||
load(qt_config)
|
load(qt_config)
|
||||||
|
@ -37,4 +37,9 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "../freebsd-clang/qplatformdefs.h"
|
#ifndef QPLATFORMDEFS_H
|
||||||
|
#define QPLATFORMDEFS_H
|
||||||
|
|
||||||
|
#include "../common/bsd/qplatformdefs.h"
|
||||||
|
|
||||||
|
#endif // QPLATFORMDEFS_H
|
||||||
|
@ -3,35 +3,20 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
MAKEFILE_GENERATOR = UNIX
|
MAKEFILE_GENERATOR = UNIX
|
||||||
QMAKE_PLATFORM = netbsd bsd
|
QMAKE_PLATFORM = netbsd
|
||||||
|
|
||||||
include(../common/unix.conf)
|
include(../common/bsd/bsd.conf)
|
||||||
include(../common/gcc-base-unix.conf)
|
|
||||||
include(../common/g++-unix.conf)
|
|
||||||
|
|
||||||
QMAKE_CFLAGS_THREAD = -pthread
|
|
||||||
|
|
||||||
QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD
|
|
||||||
|
|
||||||
|
# Addon software goes into /usr/pkg on NetBSD, by default we will look there
|
||||||
QMAKE_INCDIR = /usr/pkg/include
|
QMAKE_INCDIR = /usr/pkg/include
|
||||||
QMAKE_LIBDIR = /usr/pkg/lib
|
QMAKE_LIBDIR = /usr/pkg/lib
|
||||||
|
|
||||||
|
# System provided X11 defaults to X11R7 path on NetBSD since 5.0
|
||||||
QMAKE_INCDIR_X11 = /usr/X11R7/include
|
QMAKE_INCDIR_X11 = /usr/X11R7/include
|
||||||
QMAKE_LIBDIR_X11 = /usr/X11R7/lib
|
QMAKE_LIBDIR_X11 = /usr/X11R7/lib
|
||||||
QMAKE_INCDIR_OPENGL = /usr/X11R7/include
|
QMAKE_INCDIR_OPENGL = /usr/X11R7/include
|
||||||
QMAKE_LIBDIR_OPENGL = /usr/X11R7/lib
|
QMAKE_LIBDIR_OPENGL = /usr/X11R7/lib
|
||||||
|
|
||||||
QMAKE_LFLAGS_THREAD = -pthread
|
include(../common/gcc-base-unix.conf)
|
||||||
|
include(../common/g++-unix.conf)
|
||||||
QMAKE_LIBS =
|
|
||||||
QMAKE_LIBS_DYNLOAD =
|
|
||||||
QMAKE_LIBS_EXECINFO = -lexecinfo
|
|
||||||
QMAKE_LIBS_X11 = -lXext -lX11 -lm
|
|
||||||
QMAKE_LIBS_OPENGL = -lGL
|
|
||||||
QMAKE_LIBS_THREAD =
|
|
||||||
|
|
||||||
QMAKE_AR = ar cqs
|
|
||||||
QMAKE_OBJCOPY = objcopy
|
|
||||||
QMAKE_NM = nm -P
|
|
||||||
QMAKE_RANLIB =
|
|
||||||
|
|
||||||
load(qt_config)
|
load(qt_config)
|
||||||
|
@ -40,45 +40,6 @@
|
|||||||
#ifndef QPLATFORMDEFS_H
|
#ifndef QPLATFORMDEFS_H
|
||||||
#define QPLATFORMDEFS_H
|
#define QPLATFORMDEFS_H
|
||||||
|
|
||||||
// Get Qt defines/settings
|
#include "../common/bsd/qplatformdefs.h"
|
||||||
|
|
||||||
#include "qglobal.h"
|
|
||||||
|
|
||||||
// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs
|
|
||||||
|
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
|
|
||||||
// We are hot - unistd.h should have turned on the specific APIs we requested
|
|
||||||
|
|
||||||
|
|
||||||
#include <pthread.h>
|
|
||||||
#include <dirent.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <grp.h>
|
|
||||||
#include <pwd.h>
|
|
||||||
#include <signal.h>
|
|
||||||
#include <dlfcn.h>
|
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/ioctl.h>
|
|
||||||
#include <sys/ipc.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
#include <sys/shm.h>
|
|
||||||
#include <sys/socket.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <sys/wait.h>
|
|
||||||
#include <netinet/in.h>
|
|
||||||
#ifndef QT_NO_IPV6IFNAME
|
|
||||||
#include <net/if.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "../common/posix/qplatformdefs.h"
|
|
||||||
|
|
||||||
#undef QT_OPEN_LARGEFILE
|
|
||||||
#define QT_OPEN_LARGEFILE 0
|
|
||||||
|
|
||||||
#define QT_SNPRINTF ::snprintf
|
|
||||||
#define QT_VSNPRINTF ::vsnprintf
|
|
||||||
|
|
||||||
#endif // QPLATFORMDEFS_H
|
#endif // QPLATFORMDEFS_H
|
||||||
|
@ -3,36 +3,24 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
MAKEFILE_GENERATOR = UNIX
|
MAKEFILE_GENERATOR = UNIX
|
||||||
QMAKE_PLATFORM = openbsd bsd
|
QMAKE_PLATFORM = openbsd
|
||||||
|
|
||||||
include(../common/unix.conf)
|
include(../common/bsd/bsd.conf)
|
||||||
include(../common/gcc-base-unix.conf)
|
|
||||||
include(../common/g++-unix.conf)
|
|
||||||
|
|
||||||
QMAKE_CFLAGS_THREAD = -pthread
|
|
||||||
|
|
||||||
QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD
|
|
||||||
|
|
||||||
|
# Addon software goes into /usr/local on OpenBSD, by default we will look there
|
||||||
QMAKE_INCDIR = /usr/local/include
|
QMAKE_INCDIR = /usr/local/include
|
||||||
QMAKE_LIBDIR = /usr/local/lib
|
QMAKE_LIBDIR = /usr/local/lib
|
||||||
|
|
||||||
|
# System provided X11 defaults to X11R6 path on OpenBSD
|
||||||
QMAKE_INCDIR_X11 = /usr/X11R6/include
|
QMAKE_INCDIR_X11 = /usr/X11R6/include
|
||||||
QMAKE_LIBDIR_X11 = /usr/X11R6/lib
|
QMAKE_LIBDIR_X11 = /usr/X11R6/lib
|
||||||
QMAKE_INCDIR_OPENGL = /usr/X11R6/include
|
QMAKE_INCDIR_OPENGL = /usr/X11R6/include
|
||||||
QMAKE_LIBDIR_OPENGL = /usr/X11R6/lib
|
QMAKE_LIBDIR_OPENGL = /usr/X11R6/lib
|
||||||
|
|
||||||
QMAKE_LFLAGS_THREAD = -pthread
|
include(../common/gcc-base-unix.conf)
|
||||||
|
include(../common/g++-unix.conf)
|
||||||
|
|
||||||
|
# Reset g++-unix.conf's NOUNDEF flags as OpenBSD libc can't handle environ
|
||||||
QMAKE_LFLAGS_NOUNDEF =
|
QMAKE_LFLAGS_NOUNDEF =
|
||||||
|
|
||||||
QMAKE_LIBS =
|
|
||||||
QMAKE_LIBS_DYNLOAD =
|
|
||||||
QMAKE_LIBS_EXECINFO = -lexecinfo
|
|
||||||
QMAKE_LIBS_X11 = -lXext -lX11 -lm
|
|
||||||
QMAKE_LIBS_OPENGL = -lGL
|
|
||||||
QMAKE_LIBS_THREAD =
|
|
||||||
|
|
||||||
QMAKE_AR = ar cqs
|
|
||||||
QMAKE_OBJCOPY = objcopy
|
|
||||||
QMAKE_NM = nm -P
|
|
||||||
QMAKE_RANLIB =
|
|
||||||
|
|
||||||
load(qt_config)
|
load(qt_config)
|
||||||
|
@ -40,46 +40,6 @@
|
|||||||
#ifndef QPLATFORMDEFS_H
|
#ifndef QPLATFORMDEFS_H
|
||||||
#define QPLATFORMDEFS_H
|
#define QPLATFORMDEFS_H
|
||||||
|
|
||||||
// Get Qt defines/settings
|
#include "../common/bsd/qplatformdefs.h"
|
||||||
|
|
||||||
#include "qglobal.h"
|
|
||||||
|
|
||||||
// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs
|
|
||||||
|
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
|
|
||||||
// We are hot - unistd.h should have turned on the specific APIs we requested
|
|
||||||
|
|
||||||
|
|
||||||
#include <pthread.h>
|
|
||||||
#include <dirent.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <grp.h>
|
|
||||||
#include <pwd.h>
|
|
||||||
#include <signal.h>
|
|
||||||
#include <dlfcn.h>
|
|
||||||
|
|
||||||
#include <sys/param.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/ioctl.h>
|
|
||||||
#include <sys/ipc.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
#include <sys/shm.h>
|
|
||||||
#include <sys/socket.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <sys/wait.h>
|
|
||||||
#include <netinet/in.h>
|
|
||||||
#ifndef QT_NO_IPV6IFNAME
|
|
||||||
#include <net/if.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "../common/posix/qplatformdefs.h"
|
|
||||||
|
|
||||||
#undef QT_OPEN_LARGEFILE
|
|
||||||
#define QT_OPEN_LARGEFILE 0
|
|
||||||
|
|
||||||
#define QT_SNPRINTF ::snprintf
|
|
||||||
#define QT_VSNPRINTF ::vsnprintf
|
|
||||||
|
|
||||||
#endif // QPLATFORMDEFS_H
|
#endif // QPLATFORMDEFS_H
|
||||||
|
@ -421,7 +421,7 @@ This is a test.
|
|||||||
|
|
||||||
|
|
||||||
#! [71]
|
#! [71]
|
||||||
system(ls /bin):HAS_BIN=FALSE
|
system("ls /bin"): HAS_BIN = TRUE
|
||||||
#! [71]
|
#! [71]
|
||||||
|
|
||||||
|
|
||||||
|
@ -1954,7 +1954,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
|
|||||||
char buff[256];
|
char buff[256];
|
||||||
QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, inpf, tmp_out, LocalShell);
|
QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, inpf, tmp_out, LocalShell);
|
||||||
dep_cmd = dep_cd_cmd + fixEnvVariables(dep_cmd);
|
dep_cmd = dep_cd_cmd + fixEnvVariables(dep_cmd);
|
||||||
if(FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), "r")) {
|
if (FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), QT_POPEN_READ)) {
|
||||||
QString indeps;
|
QString indeps;
|
||||||
while(!feof(proc)) {
|
while(!feof(proc)) {
|
||||||
int read_in = (int)fread(buff, 1, 255, proc);
|
int read_in = (int)fread(buff, 1, 255, proc);
|
||||||
@ -2046,7 +2046,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
|
|||||||
char buff[256];
|
char buff[256];
|
||||||
QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, inpf, out, LocalShell);
|
QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, inpf, out, LocalShell);
|
||||||
dep_cmd = dep_cd_cmd + fixEnvVariables(dep_cmd);
|
dep_cmd = dep_cd_cmd + fixEnvVariables(dep_cmd);
|
||||||
if(FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), "r")) {
|
if (FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), QT_POPEN_READ)) {
|
||||||
QString indeps;
|
QString indeps;
|
||||||
while(!feof(proc)) {
|
while(!feof(proc)) {
|
||||||
int read_in = (int)fread(buff, 1, 255, proc);
|
int read_in = (int)fread(buff, 1, 255, proc);
|
||||||
|
@ -41,9 +41,11 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
#ifdef Q_OS_WIN32
|
#ifdef Q_OS_WIN32
|
||||||
#define QT_POPEN _popen
|
#define QT_POPEN _popen
|
||||||
|
#define QT_POPEN_READ "rb"
|
||||||
#define QT_PCLOSE _pclose
|
#define QT_PCLOSE _pclose
|
||||||
#else
|
#else
|
||||||
#define QT_POPEN popen
|
#define QT_POPEN popen
|
||||||
|
#define QT_POPEN_READ "r"
|
||||||
#define QT_PCLOSE pclose
|
#define QT_PCLOSE pclose
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -601,8 +601,11 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
|
|||||||
} else if (project->first("TEMPLATE") == "lib" && project->isActiveConfig("staticlib")) {
|
} else if (project->first("TEMPLATE") == "lib" && project->isActiveConfig("staticlib")) {
|
||||||
copy_cmd += "-$(INSTALL_FILE) " + src_targ + ' ' + dst_targ;
|
copy_cmd += "-$(INSTALL_FILE) " + src_targ + ' ' + dst_targ;
|
||||||
} else if (!isAux) {
|
} else if (!isAux) {
|
||||||
if (bundle == SlicedBundle)
|
if (bundle == SlicedBundle) {
|
||||||
ret += mkdir_p_asstring("\"`dirname " + dst_targ + "`\"", false) + "\n\t";
|
if (!ret.isEmpty())
|
||||||
|
ret += "\n\t";
|
||||||
|
ret += mkdir_p_asstring("\"`dirname " + dst_targ + "`\"", false);
|
||||||
|
}
|
||||||
copy_cmd += "-$(INSTALL_PROGRAM) " + src_targ + ' ' + dst_targ;
|
copy_cmd += "-$(INSTALL_PROGRAM) " + src_targ + ' ' + dst_targ;
|
||||||
}
|
}
|
||||||
if(project->first("TEMPLATE") == "lib" && !project->isActiveConfig("staticlib")
|
if(project->first("TEMPLATE") == "lib" && !project->isActiveConfig("staticlib")
|
||||||
|
@ -374,11 +374,14 @@ void NmakeMakefileGenerator::init()
|
|||||||
project->values("QMAKE_DISTCLEAN").append(tgt + ".lib");
|
project->values("QMAKE_DISTCLEAN").append(tgt + ".lib");
|
||||||
}
|
}
|
||||||
if (project->isActiveConfig("debug_info")) {
|
if (project->isActiveConfig("debug_info")) {
|
||||||
QString pdbfile = tgt + ".pdb";
|
// Add the compiler's PDB file.
|
||||||
|
QString pdbfile = var("OBJECTS_DIR") + project->first("TARGET") + ".vc.pdb";
|
||||||
QString escapedPdbFile = escapeFilePath(pdbfile);
|
QString escapedPdbFile = escapeFilePath(pdbfile);
|
||||||
project->values("QMAKE_CFLAGS").append("/Fd" + escapedPdbFile);
|
project->values("QMAKE_CFLAGS").append("/Fd" + escapedPdbFile);
|
||||||
project->values("QMAKE_CXXFLAGS").append("/Fd" + escapedPdbFile);
|
project->values("QMAKE_CXXFLAGS").append("/Fd" + escapedPdbFile);
|
||||||
project->values("QMAKE_DISTCLEAN").append(pdbfile);
|
project->values("QMAKE_CLEAN").append(pdbfile);
|
||||||
|
// Add the linker's PDB file to the distclean target.
|
||||||
|
project->values("QMAKE_DISTCLEAN").append(tgt + ".pdb");
|
||||||
}
|
}
|
||||||
if (project->isActiveConfig("debug")) {
|
if (project->isActiveConfig("debug")) {
|
||||||
project->values("QMAKE_CLEAN").append(tgt + ".ilk");
|
project->values("QMAKE_CLEAN").append(tgt + ".ilk");
|
||||||
|
@ -2318,7 +2318,7 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info)
|
|||||||
dep_cmd.prepend(QLatin1String("cd ")
|
dep_cmd.prepend(QLatin1String("cd ")
|
||||||
+ Project->escapeFilePath(Option::fixPathToLocalOS(Option::output_dir, false))
|
+ Project->escapeFilePath(Option::fixPathToLocalOS(Option::output_dir, false))
|
||||||
+ QLatin1String(" && "));
|
+ QLatin1String(" && "));
|
||||||
if(FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), "r")) {
|
if (FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), QT_POPEN_READ)) {
|
||||||
QString indeps;
|
QString indeps;
|
||||||
while(!feof(proc)) {
|
while(!feof(proc)) {
|
||||||
int read_in = (int)fread(buff, 1, 255, proc);
|
int read_in = (int)fread(buff, 1, 255, proc);
|
||||||
|
@ -1544,7 +1544,7 @@ void VcprojGenerator::initResourceFiles()
|
|||||||
dep_cmd.prepend(QLatin1String("cd ")
|
dep_cmd.prepend(QLatin1String("cd ")
|
||||||
+ escapeFilePath(Option::fixPathToLocalOS(Option::output_dir, false))
|
+ escapeFilePath(Option::fixPathToLocalOS(Option::output_dir, false))
|
||||||
+ QLatin1String(" && "));
|
+ QLatin1String(" && "));
|
||||||
if(FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), "r")) {
|
if (FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), QT_POPEN_READ)) {
|
||||||
QString indeps;
|
QString indeps;
|
||||||
while(!feof(proc)) {
|
while(!feof(proc)) {
|
||||||
int read_in = (int)fread(buff, 1, 255, proc);
|
int read_in = (int)fread(buff, 1, 255, proc);
|
||||||
|
@ -67,9 +67,11 @@
|
|||||||
|
|
||||||
#ifdef Q_OS_WIN32
|
#ifdef Q_OS_WIN32
|
||||||
#define QT_POPEN _popen
|
#define QT_POPEN _popen
|
||||||
|
#define QT_POPEN_READ "rb"
|
||||||
#define QT_PCLOSE _pclose
|
#define QT_PCLOSE _pclose
|
||||||
#else
|
#else
|
||||||
#define QT_POPEN popen
|
#define QT_POPEN popen
|
||||||
|
#define QT_POPEN_READ "r"
|
||||||
#define QT_PCLOSE pclose
|
#define QT_PCLOSE pclose
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -471,7 +473,7 @@ QByteArray QMakeEvaluator::getCommandOutput(const QString &args) const
|
|||||||
#else
|
#else
|
||||||
if (FILE *proc = QT_POPEN(QString(QLatin1String("cd ")
|
if (FILE *proc = QT_POPEN(QString(QLatin1String("cd ")
|
||||||
+ IoUtils::shellQuote(QDir::toNativeSeparators(currentDirectory()))
|
+ IoUtils::shellQuote(QDir::toNativeSeparators(currentDirectory()))
|
||||||
+ QLatin1String(" && ") + args).toLocal8Bit().constData(), "r")) {
|
+ QLatin1String(" && ") + args).toLocal8Bit().constData(), QT_POPEN_READ)) {
|
||||||
while (!feof(proc)) {
|
while (!feof(proc)) {
|
||||||
char buff[10 * 1024];
|
char buff[10 * 1024];
|
||||||
int read_in = int(fread(buff, 1, sizeof(buff), proc));
|
int read_in = int(fread(buff, 1, sizeof(buff), proc));
|
||||||
@ -481,6 +483,9 @@ QByteArray QMakeEvaluator::getCommandOutput(const QString &args) const
|
|||||||
}
|
}
|
||||||
QT_PCLOSE(proc);
|
QT_PCLOSE(proc);
|
||||||
}
|
}
|
||||||
|
# ifdef Q_OS_WIN
|
||||||
|
out.replace("\r\n", "\n");
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
@ -59,9 +59,11 @@
|
|||||||
|
|
||||||
#ifdef Q_OS_WIN32
|
#ifdef Q_OS_WIN32
|
||||||
#define QT_POPEN _popen
|
#define QT_POPEN _popen
|
||||||
|
#define QT_POPEN_READ "rb"
|
||||||
#define QT_PCLOSE _pclose
|
#define QT_PCLOSE _pclose
|
||||||
#else
|
#else
|
||||||
#define QT_POPEN popen
|
#define QT_POPEN popen
|
||||||
|
#define QT_POPEN_READ "r"
|
||||||
#define QT_PCLOSE pclose
|
#define QT_PCLOSE pclose
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -318,7 +320,7 @@ bool QMakeGlobals::initProperties()
|
|||||||
data = proc.readAll();
|
data = proc.readAll();
|
||||||
#else
|
#else
|
||||||
if (FILE *proc = QT_POPEN(QString(QMakeInternal::IoUtils::shellQuote(qmake_abslocation)
|
if (FILE *proc = QT_POPEN(QString(QMakeInternal::IoUtils::shellQuote(qmake_abslocation)
|
||||||
+ QLatin1String(" -query")).toLocal8Bit(), "r")) {
|
+ QLatin1String(" -query")).toLocal8Bit(), QT_POPEN_READ)) {
|
||||||
char buff[1024];
|
char buff[1024];
|
||||||
while (!feof(proc))
|
while (!feof(proc))
|
||||||
data.append(buff, int(fread(buff, 1, 1023, proc)));
|
data.append(buff, int(fread(buff, 1, 1023, proc)));
|
||||||
|
@ -93,6 +93,7 @@ public class QtNative
|
|||||||
private static final int m_moveThreshold = 0;
|
private static final int m_moveThreshold = 0;
|
||||||
private static ClipboardManager m_clipboardManager = null;
|
private static ClipboardManager m_clipboardManager = null;
|
||||||
private static Method m_checkSelfPermissionMethod = null;
|
private static Method m_checkSelfPermissionMethod = null;
|
||||||
|
private static Boolean m_tabletEventSupported = null;
|
||||||
private static final Runnable runPendingCppRunnablesRunnable = new Runnable() {
|
private static final Runnable runPendingCppRunnablesRunnable = new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@ -385,6 +386,9 @@ public class QtNative
|
|||||||
{
|
{
|
||||||
int pointerType = 0;
|
int pointerType = 0;
|
||||||
|
|
||||||
|
if (m_tabletEventSupported == null)
|
||||||
|
m_tabletEventSupported = isTabletEventSupported();
|
||||||
|
|
||||||
switch (event.getToolType(0)) {
|
switch (event.getToolType(0)) {
|
||||||
case MotionEvent.TOOL_TYPE_STYLUS:
|
case MotionEvent.TOOL_TYPE_STYLUS:
|
||||||
pointerType = 1; // QTabletEvent::Pen
|
pointerType = 1; // QTabletEvent::Pen
|
||||||
@ -395,7 +399,7 @@ public class QtNative
|
|||||||
// TODO TOOL_TYPE_MOUSE
|
// TODO TOOL_TYPE_MOUSE
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pointerType != 0) {
|
if (m_tabletEventSupported && pointerType != 0) {
|
||||||
tabletEvent(id, event.getDeviceId(), event.getEventTime(), event.getAction(), pointerType,
|
tabletEvent(id, event.getDeviceId(), event.getEventTime(), event.getAction(), pointerType,
|
||||||
event.getButtonState(), event.getX(), event.getY(), event.getPressure());
|
event.getButtonState(), event.getX(), event.getY(), event.getPressure());
|
||||||
} else {
|
} else {
|
||||||
@ -762,6 +766,7 @@ public class QtNative
|
|||||||
// pointer methods
|
// pointer methods
|
||||||
|
|
||||||
// tablet methods
|
// tablet methods
|
||||||
|
public static native boolean isTabletEventSupported();
|
||||||
public static native void tabletEvent(int winId, int deviceId, long time, int action, int pointerType, int buttonState, float x, float y, float pressure);
|
public static native void tabletEvent(int winId, int deviceId, long time, int action, int pointerType, int buttonState, float x, float y, float pressure);
|
||||||
// tablet methods
|
// tablet methods
|
||||||
|
|
||||||
|
@ -121,7 +121,12 @@
|
|||||||
# define ARCH_ABI1 ""
|
# define ARCH_ABI1 ""
|
||||||
#endif
|
#endif
|
||||||
#if defined(__ARM_PCS_VFP) || defined(__mips_hard_float)
|
#if defined(__ARM_PCS_VFP) || defined(__mips_hard_float)
|
||||||
|
// Use "-hardfloat" for platforms that usually have no FPUs
|
||||||
|
// (and for the platforms which had "-hardfloat" before we established the rule)
|
||||||
# define ARCH_ABI2 "-hardfloat"
|
# define ARCH_ABI2 "-hardfloat"
|
||||||
|
#elif defined(_SOFT_FLOAT)
|
||||||
|
// Use "-softfloat" for architectures that usually have FPUs
|
||||||
|
# define ARCH_ABI2 "-softfloat"
|
||||||
#else
|
#else
|
||||||
# define ARCH_ABI2 ""
|
# define ARCH_ABI2 ""
|
||||||
#endif
|
#endif
|
||||||
|
@ -1196,6 +1196,7 @@ bool qSharedBuild() Q_DECL_NOTHROW
|
|||||||
\value MV_10_9 OS X 10.9
|
\value MV_10_9 OS X 10.9
|
||||||
\value MV_10_10 OS X 10.10
|
\value MV_10_10 OS X 10.10
|
||||||
\value MV_10_11 OS X 10.11
|
\value MV_10_11 OS X 10.11
|
||||||
|
\value MV_10_12 macOS 10.12
|
||||||
\value MV_Unknown An unknown and currently unsupported platform
|
\value MV_Unknown An unknown and currently unsupported platform
|
||||||
|
|
||||||
\value MV_CHEETAH Apple codename for MV_10_0
|
\value MV_CHEETAH Apple codename for MV_10_0
|
||||||
@ -1210,6 +1211,7 @@ bool qSharedBuild() Q_DECL_NOTHROW
|
|||||||
\value MV_MAVERICKS Apple codename for MV_10_9
|
\value MV_MAVERICKS Apple codename for MV_10_9
|
||||||
\value MV_YOSEMITE Apple codename for MV_10_10
|
\value MV_YOSEMITE Apple codename for MV_10_10
|
||||||
\value MV_ELCAPITAN Apple codename for MV_10_11
|
\value MV_ELCAPITAN Apple codename for MV_10_11
|
||||||
|
\value MV_SIERRA Apple codename for MV_10_12
|
||||||
|
|
||||||
\value MV_IOS iOS (any)
|
\value MV_IOS iOS (any)
|
||||||
\value MV_IOS_4_3 iOS 4.3
|
\value MV_IOS_4_3 iOS 4.3
|
||||||
@ -1225,6 +1227,10 @@ bool qSharedBuild() Q_DECL_NOTHROW
|
|||||||
\value MV_IOS_8_3 iOS 8.3
|
\value MV_IOS_8_3 iOS 8.3
|
||||||
\value MV_IOS_8_4 iOS 8.4
|
\value MV_IOS_8_4 iOS 8.4
|
||||||
\value MV_IOS_9_0 iOS 9.0
|
\value MV_IOS_9_0 iOS 9.0
|
||||||
|
\value MV_IOS_9_1 iOS 9.1
|
||||||
|
\value MV_IOS_9_2 iOS 9.2
|
||||||
|
\value MV_IOS_9_3 iOS 9.3
|
||||||
|
\value MV_IOS_10_0 iOS 10.0
|
||||||
|
|
||||||
\value MV_None Not a Darwin operating system
|
\value MV_None Not a Darwin operating system
|
||||||
|
|
||||||
@ -1238,11 +1244,25 @@ bool qSharedBuild() Q_DECL_NOTHROW
|
|||||||
Defined on Darwin-based operating systems such as OS X, iOS, watchOS, and tvOS.
|
Defined on Darwin-based operating systems such as OS X, iOS, watchOS, and tvOS.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\macro Q_OS_MAC
|
||||||
|
\relates <QtGlobal>
|
||||||
|
|
||||||
|
Deprecated synonym for \c Q_OS_DARWIN. Do not use.
|
||||||
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\macro Q_OS_OSX
|
\macro Q_OS_OSX
|
||||||
\relates <QtGlobal>
|
\relates <QtGlobal>
|
||||||
|
|
||||||
Defined on OS X.
|
Deprecated synonym for \c Q_OS_MACOS. Do not use.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\macro Q_OS_MACOS
|
||||||
|
\relates <QtGlobal>
|
||||||
|
|
||||||
|
Defined on macOS.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -2603,10 +2623,12 @@ QString QSysInfo::kernelVersion()
|
|||||||
to determine the distribution name and returns that. If determining the
|
to determine the distribution name and returns that. If determining the
|
||||||
distribution name failed, it returns "unknown".
|
distribution name failed, it returns "unknown".
|
||||||
|
|
||||||
\b{Darwin, OS X, iOS and tvOS note}: this function returns "osx" for OS X
|
\b{Darwin, OS X, iOS and tvOS note}: this function returns "macos" for macOS
|
||||||
systems, "ios" for iOS systems, "tvos" for tvOS systems and "darwin" in case
|
systems, "ios" for iOS systems, "tvos" for tvOS systems and "darwin" in case
|
||||||
the system could not be determined.
|
the system could not be determined.
|
||||||
|
|
||||||
|
\b{OS X note}: this function returns "osx" for versions of macOS prior to 10.12.
|
||||||
|
|
||||||
\b{FreeBSD note}: this function returns "debian" for Debian/kFreeBSD and
|
\b{FreeBSD note}: this function returns "debian" for Debian/kFreeBSD and
|
||||||
"unknown" otherwise.
|
"unknown" otherwise.
|
||||||
|
|
||||||
@ -2637,8 +2659,11 @@ QString QSysInfo::productType()
|
|||||||
return QStringLiteral("ios");
|
return QStringLiteral("ios");
|
||||||
#elif defined(Q_OS_TVOS)
|
#elif defined(Q_OS_TVOS)
|
||||||
return QStringLiteral("tvos");
|
return QStringLiteral("tvos");
|
||||||
#elif defined(Q_OS_OSX)
|
#elif defined(Q_OS_MACOS)
|
||||||
|
const QAppleOperatingSystemVersion version = qt_apple_os_version();
|
||||||
|
if (version.major == 10 && version.minor < 12)
|
||||||
return QStringLiteral("osx");
|
return QStringLiteral("osx");
|
||||||
|
return QStringLiteral("macos");
|
||||||
#elif defined(Q_OS_DARWIN)
|
#elif defined(Q_OS_DARWIN)
|
||||||
return QStringLiteral("darwin");
|
return QStringLiteral("darwin");
|
||||||
|
|
||||||
@ -2721,7 +2746,7 @@ QString QSysInfo::prettyProductName()
|
|||||||
return QLatin1String("iOS ") + productVersion();
|
return QLatin1String("iOS ") + productVersion();
|
||||||
#elif defined(Q_OS_TVOS)
|
#elif defined(Q_OS_TVOS)
|
||||||
return QLatin1String("tvOS ") + productVersion();
|
return QLatin1String("tvOS ") + productVersion();
|
||||||
#elif defined(Q_OS_OSX)
|
#elif defined(Q_OS_MACOS)
|
||||||
const QAppleOperatingSystemVersion version = qt_apple_os_version();
|
const QAppleOperatingSystemVersion version = qt_apple_os_version();
|
||||||
const char *name = osxVer_helper(version);
|
const char *name = osxVer_helper(version);
|
||||||
if (name) {
|
if (name) {
|
||||||
@ -2730,7 +2755,7 @@ QString QSysInfo::prettyProductName()
|
|||||||
+ QLatin1Char('.') + QString::number(version.minor)
|
+ QLatin1Char('.') + QString::number(version.minor)
|
||||||
+ QLatin1Char(')');
|
+ QLatin1Char(')');
|
||||||
} else {
|
} else {
|
||||||
return QLatin1String("OS X ")
|
return QLatin1String("macOS ")
|
||||||
+ QString::number(version.major) + QLatin1Char('.')
|
+ QString::number(version.major) + QLatin1Char('.')
|
||||||
+ QString::number(version.minor);
|
+ QString::number(version.minor);
|
||||||
}
|
}
|
||||||
|
@ -140,6 +140,7 @@ public:
|
|||||||
MV_10_9 = Q_MV_OSX(10, 9),
|
MV_10_9 = Q_MV_OSX(10, 9),
|
||||||
MV_10_10 = Q_MV_OSX(10, 10),
|
MV_10_10 = Q_MV_OSX(10, 10),
|
||||||
MV_10_11 = Q_MV_OSX(10, 11),
|
MV_10_11 = Q_MV_OSX(10, 11),
|
||||||
|
MV_10_12 = Q_MV_OSX(10, 12),
|
||||||
|
|
||||||
/* codenames */
|
/* codenames */
|
||||||
MV_CHEETAH = MV_10_0,
|
MV_CHEETAH = MV_10_0,
|
||||||
@ -154,6 +155,7 @@ public:
|
|||||||
MV_MAVERICKS = MV_10_9,
|
MV_MAVERICKS = MV_10_9,
|
||||||
MV_YOSEMITE = MV_10_10,
|
MV_YOSEMITE = MV_10_10,
|
||||||
MV_ELCAPITAN = MV_10_11,
|
MV_ELCAPITAN = MV_10_11,
|
||||||
|
MV_SIERRA = MV_10_12,
|
||||||
|
|
||||||
/* iOS */
|
/* iOS */
|
||||||
MV_IOS = 1 << 8,
|
MV_IOS = 1 << 8,
|
||||||
@ -170,6 +172,10 @@ public:
|
|||||||
MV_IOS_8_3 = Q_MV_IOS(8, 3),
|
MV_IOS_8_3 = Q_MV_IOS(8, 3),
|
||||||
MV_IOS_8_4 = Q_MV_IOS(8, 4),
|
MV_IOS_8_4 = Q_MV_IOS(8, 4),
|
||||||
MV_IOS_9_0 = Q_MV_IOS(9, 0),
|
MV_IOS_9_0 = Q_MV_IOS(9, 0),
|
||||||
|
MV_IOS_9_1 = Q_MV_IOS(9, 1),
|
||||||
|
MV_IOS_9_2 = Q_MV_IOS(9, 2),
|
||||||
|
MV_IOS_9_3 = Q_MV_IOS(9, 3),
|
||||||
|
MV_IOS_10_0 = Q_MV_IOS(10, 0),
|
||||||
|
|
||||||
/* tvOS */
|
/* tvOS */
|
||||||
MV_TVOS = 1 << 9,
|
MV_TVOS = 1 << 9,
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
The operating system, must be one of: (Q_OS_x)
|
The operating system, must be one of: (Q_OS_x)
|
||||||
|
|
||||||
DARWIN - Any Darwin system (OS X, iOS, watchOS, tvOS)
|
DARWIN - Any Darwin system (OS X, iOS, watchOS, tvOS)
|
||||||
OSX - OS X
|
MACOS - macOS
|
||||||
IOS - iOS
|
IOS - iOS
|
||||||
WATCHOS - watchOS
|
WATCHOS - watchOS
|
||||||
TVOS - tvOS
|
TVOS - tvOS
|
||||||
@ -117,7 +117,7 @@
|
|||||||
# else
|
# else
|
||||||
# // there is no "real" OS X define (rdar://22640089),
|
# // there is no "real" OS X define (rdar://22640089),
|
||||||
# // assume any non iOS-based platform is OS X for now
|
# // assume any non iOS-based platform is OS X for now
|
||||||
# define Q_OS_OSX
|
# define Q_OS_MACOS
|
||||||
# endif
|
# endif
|
||||||
# else
|
# else
|
||||||
# error "Qt has not been ported to this Apple platform - see http://www.qt.io/developers"
|
# error "Qt has not been ported to this Apple platform - see http://www.qt.io/developers"
|
||||||
@ -229,15 +229,16 @@
|
|||||||
#ifdef Q_OS_DARWIN64
|
#ifdef Q_OS_DARWIN64
|
||||||
#define Q_OS_MAC64
|
#define Q_OS_MAC64
|
||||||
#endif
|
#endif
|
||||||
#ifdef Q_OS_OSX
|
#ifdef Q_OS_MACOS
|
||||||
#define Q_OS_MACX
|
#define Q_OS_MACX
|
||||||
|
#define Q_OS_OSX
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef Q_OS_DARWIN
|
#ifdef Q_OS_DARWIN
|
||||||
# include <Availability.h>
|
# include <Availability.h>
|
||||||
# include <AvailabilityMacros.h>
|
# include <AvailabilityMacros.h>
|
||||||
#
|
#
|
||||||
# ifdef Q_OS_OSX
|
# ifdef Q_OS_MACOS
|
||||||
# if !defined(__MAC_OS_X_VERSION_MIN_REQUIRED) || __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_6
|
# if !defined(__MAC_OS_X_VERSION_MIN_REQUIRED) || __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_6
|
||||||
# undef __MAC_OS_X_VERSION_MIN_REQUIRED
|
# undef __MAC_OS_X_VERSION_MIN_REQUIRED
|
||||||
# define __MAC_OS_X_VERSION_MIN_REQUIRED __MAC_10_6
|
# define __MAC_OS_X_VERSION_MIN_REQUIRED __MAC_10_6
|
||||||
@ -266,6 +267,9 @@
|
|||||||
# if !defined(__MAC_10_11)
|
# if !defined(__MAC_10_11)
|
||||||
# define __MAC_10_11 101100
|
# define __MAC_10_11 101100
|
||||||
# endif
|
# endif
|
||||||
|
# if !defined(__MAC_10_12)
|
||||||
|
# define __MAC_10_12 101200
|
||||||
|
# endif
|
||||||
# if !defined(MAC_OS_X_VERSION_10_7)
|
# if !defined(MAC_OS_X_VERSION_10_7)
|
||||||
# define MAC_OS_X_VERSION_10_7 1070
|
# define MAC_OS_X_VERSION_10_7 1070
|
||||||
# endif
|
# endif
|
||||||
@ -281,6 +285,9 @@
|
|||||||
# if !defined(MAC_OS_X_VERSION_10_11)
|
# if !defined(MAC_OS_X_VERSION_10_11)
|
||||||
# define MAC_OS_X_VERSION_10_11 101100
|
# define MAC_OS_X_VERSION_10_11 101100
|
||||||
# endif
|
# endif
|
||||||
|
# if !defined(MAC_OS_X_VERSION_10_12)
|
||||||
|
# define MAC_OS_X_VERSION_10_12 101200
|
||||||
|
# endif
|
||||||
#
|
#
|
||||||
# if !defined(__IPHONE_4_3)
|
# if !defined(__IPHONE_4_3)
|
||||||
# define __IPHONE_4_3 40300
|
# define __IPHONE_4_3 40300
|
||||||
@ -321,6 +328,18 @@
|
|||||||
# if !defined(__IPHONE_9_0)
|
# if !defined(__IPHONE_9_0)
|
||||||
# define __IPHONE_9_0 90000
|
# define __IPHONE_9_0 90000
|
||||||
# endif
|
# endif
|
||||||
|
# if !defined(__IPHONE_9_1)
|
||||||
|
# define __IPHONE_9_1 90100
|
||||||
|
# endif
|
||||||
|
# if !defined(__IPHONE_9_2)
|
||||||
|
# define __IPHONE_9_2 90200
|
||||||
|
# endif
|
||||||
|
# if !defined(__IPHONE_9_3)
|
||||||
|
# define __IPHONE_9_3 90300
|
||||||
|
# endif
|
||||||
|
# if !defined(__IPHONE_10_0)
|
||||||
|
# define __IPHONE_10_0 100000
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __LSB_VERSION__
|
#ifdef __LSB_VERSION__
|
||||||
|
@ -387,8 +387,12 @@ QStringList QFileSelectorPrivate::platformSelectors()
|
|||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
QString productName = QSysInfo::productType();
|
QString productName = QSysInfo::productType();
|
||||||
|
# ifdef Q_OS_MACOS
|
||||||
|
if (productName != QStringLiteral("osx"))
|
||||||
|
ret << QStringLiteral("osx"); // compatibility
|
||||||
|
# endif
|
||||||
if (productName != QLatin1String("unknown"))
|
if (productName != QLatin1String("unknown"))
|
||||||
ret << productName; // "opensuse", "fedora", "osx", "ios", "android"
|
ret << productName; // "opensuse", "fedora", "macos", "ios", "android"
|
||||||
#endif
|
#endif
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -1183,8 +1183,6 @@ QByteArray QIODevice::read(qint64 maxSize)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\overload
|
|
||||||
|
|
||||||
Reads all remaining data from the device, and returns it as a
|
Reads all remaining data from the device, and returns it as a
|
||||||
byte array.
|
byte array.
|
||||||
|
|
||||||
|
@ -111,7 +111,8 @@ public:
|
|||||||
void removeNativeEventFilter(QAbstractNativeEventFilter *filterObj);
|
void removeNativeEventFilter(QAbstractNativeEventFilter *filterObj);
|
||||||
bool filterNativeEvent(const QByteArray &eventType, void *message, long *result);
|
bool filterNativeEvent(const QByteArray &eventType, void *message, long *result);
|
||||||
#if QT_DEPRECATED_SINCE(5, 0)
|
#if QT_DEPRECATED_SINCE(5, 0)
|
||||||
QT_DEPRECATED bool filterEvent(void *message) { return filterNativeEvent("", message, 0); }
|
QT_DEPRECATED bool filterEvent(void *message)
|
||||||
|
{ return filterNativeEvent("", message, Q_NULLPTR); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
|
@ -2131,7 +2131,6 @@ QString QCoreApplication::applicationFilePath()
|
|||||||
QCoreApplicationPrivate::setApplicationFilePath(fi.canonicalFilePath());
|
QCoreApplicationPrivate::setApplicationFilePath(fi.canonicalFilePath());
|
||||||
return *QCoreApplicationPrivate::cachedApplicationFilePath;
|
return *QCoreApplicationPrivate::cachedApplicationFilePath;
|
||||||
}
|
}
|
||||||
return QString();
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if defined( Q_OS_UNIX )
|
#if defined( Q_OS_UNIX )
|
||||||
@ -2177,9 +2176,8 @@ QString QCoreApplication::applicationFilePath()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return QString();
|
|
||||||
#endif
|
#endif
|
||||||
Q_UNREACHABLE();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -55,7 +55,10 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
int appCmdShow = 0;
|
int appCmdShow = 0;
|
||||||
|
|
||||||
#if defined(Q_OS_WINRT)
|
// GetModuleFileName only exists for MSVC2015 and upwards for WinRT, meaning
|
||||||
|
// Windows 10 (Mobile). Hence take the first argument passed to the
|
||||||
|
// QCoreApplication contructor for older versions as a fallback on older platforms.
|
||||||
|
#if defined(Q_OS_WINRT) && _MSC_VER < 1900
|
||||||
|
|
||||||
Q_CORE_EXPORT QString qAppFileName()
|
Q_CORE_EXPORT QString qAppFileName()
|
||||||
{
|
{
|
||||||
@ -67,27 +70,7 @@ QString QCoreApplicationPrivate::appName() const
|
|||||||
return QFileInfo(QCoreApplication::arguments().constFirst()).baseName();
|
return QFileInfo(QCoreApplication::arguments().constFirst()).baseName();
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else // !(defined(Q_OS_WINRT) && _MSC_VER < 1900)
|
||||||
|
|
||||||
Q_CORE_EXPORT HINSTANCE qWinAppInst() // get Windows app handle
|
|
||||||
{
|
|
||||||
return GetModuleHandle(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
Q_CORE_EXPORT HINSTANCE qWinAppPrevInst() // get Windows prev app handle
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Q_CORE_EXPORT int qWinAppCmdShow() // get main window show command
|
|
||||||
{
|
|
||||||
STARTUPINFO startupInfo;
|
|
||||||
GetStartupInfo(&startupInfo);
|
|
||||||
|
|
||||||
return (startupInfo.dwFlags & STARTF_USESHOWWINDOW)
|
|
||||||
? startupInfo.wShowWindow
|
|
||||||
: SW_SHOWDEFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
Q_CORE_EXPORT QString qAppFileName() // get application file name
|
Q_CORE_EXPORT QString qAppFileName() // get application file name
|
||||||
{
|
{
|
||||||
@ -135,6 +118,34 @@ QString QCoreApplicationPrivate::appName() const
|
|||||||
return QFileInfo(qAppFileName()).baseName();
|
return QFileInfo(qAppFileName()).baseName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // !(defined(Q_OS_WINRT) && _MSC_VER < 1900)
|
||||||
|
|
||||||
|
#ifndef Q_OS_WINRT
|
||||||
|
|
||||||
|
Q_CORE_EXPORT HINSTANCE qWinAppInst() // get Windows app handle
|
||||||
|
{
|
||||||
|
return GetModuleHandle(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
Q_CORE_EXPORT HINSTANCE qWinAppPrevInst() // get Windows prev app handle
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
Q_CORE_EXPORT int qWinAppCmdShow() // get main window show command
|
||||||
|
{
|
||||||
|
#if defined(Q_OS_WINCE)
|
||||||
|
return appCmdShow;
|
||||||
|
#else
|
||||||
|
STARTUPINFO startupInfo;
|
||||||
|
GetStartupInfo(&startupInfo);
|
||||||
|
|
||||||
|
return (startupInfo.dwFlags & STARTF_USESHOWWINDOW)
|
||||||
|
? startupInfo.wShowWindow
|
||||||
|
: SW_SHOWDEFAULT;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
qWinMain() - Initializes Windows. Called from WinMain() in qtmain_win.cpp
|
qWinMain() - Initializes Windows. Called from WinMain() in qtmain_win.cpp
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
@ -209,6 +209,9 @@ static inline HRESULT _await_impl(const Microsoft::WRL::ComPtr<T> &asyncOp, Awai
|
|||||||
if (FAILED(hr) || status != Completed) {
|
if (FAILED(hr) || status != Completed) {
|
||||||
HRESULT ec;
|
HRESULT ec;
|
||||||
hr = asyncInfo->get_ErrorCode(&ec);
|
hr = asyncInfo->get_ErrorCode(&ec);
|
||||||
|
if (FAILED(hr))
|
||||||
|
return hr;
|
||||||
|
hr = asyncInfo->Close();
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
return hr;
|
return hr;
|
||||||
return ec;
|
return ec;
|
||||||
|
@ -183,7 +183,7 @@ private:
|
|||||||
// signature() has been renamed to methodSignature() in Qt 5.
|
// signature() has been renamed to methodSignature() in Qt 5.
|
||||||
// Warning, that function returns a QByteArray; check the life time if
|
// Warning, that function returns a QByteArray; check the life time if
|
||||||
// you convert to char*.
|
// you convert to char*.
|
||||||
char *signature(struct renamedInQt5_warning_checkTheLifeTime * = 0) Q_DECL_EQ_DELETE;
|
char *signature(struct renamedInQt5_warning_checkTheLifeTime * = Q_NULLPTR) Q_DECL_EQ_DELETE;
|
||||||
#endif
|
#endif
|
||||||
static QMetaMethod fromSignalImpl(const QMetaObject *, void **);
|
static QMetaMethod fromSignalImpl(const QMetaObject *, void **);
|
||||||
|
|
||||||
|
@ -175,7 +175,7 @@ QPpsAttribute QPpsObjectPrivate::decodeNumber(pps_decoder_t *decoder)
|
|||||||
// In order to support more number types, we have to do something stupid because the PPS
|
// In order to support more number types, we have to do something stupid because the PPS
|
||||||
// library won't let us work any other way. Basically, we have to probe the encoded type in
|
// library won't let us work any other way. Basically, we have to probe the encoded type in
|
||||||
// order to try to get exactly what we want.
|
// order to try to get exactly what we want.
|
||||||
long long llValue;
|
int64_t llValue;
|
||||||
double dValue;
|
double dValue;
|
||||||
int iValue;
|
int iValue;
|
||||||
QPpsAttribute::Flags flags;
|
QPpsAttribute::Flags flags;
|
||||||
@ -193,7 +193,7 @@ QPpsAttribute QPpsObjectPrivate::decodeNumber(pps_decoder_t *decoder)
|
|||||||
return QPpsAttribute();
|
return QPpsAttribute();
|
||||||
}
|
}
|
||||||
flags = readFlags(decoder);
|
flags = readFlags(decoder);
|
||||||
return QPpsAttributePrivate::createPpsAttribute(llValue, flags);
|
return QPpsAttributePrivate::createPpsAttribute(static_cast<long long>(llValue), flags);
|
||||||
default:
|
default:
|
||||||
qWarning("QPpsObjectPrivate::decodeNumber: pps_decoder_get_int failed");
|
qWarning("QPpsObjectPrivate::decodeNumber: pps_decoder_get_int failed");
|
||||||
return QPpsAttribute();
|
return QPpsAttribute();
|
||||||
|
@ -110,7 +110,7 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
#ifndef QT_NO_THREAD
|
#ifndef QT_NO_THREAD
|
||||||
|
|
||||||
Q_STATIC_ASSERT(sizeof(pthread_t) == sizeof(Qt::HANDLE));
|
Q_STATIC_ASSERT(sizeof(pthread_t) <= sizeof(Qt::HANDLE));
|
||||||
|
|
||||||
enum { ThreadPriorityResetFlag = 0x80000000 };
|
enum { ThreadPriorityResetFlag = 0x80000000 };
|
||||||
|
|
||||||
@ -210,6 +210,30 @@ static void clear_thread_data()
|
|||||||
pthread_setspecific(current_thread_data_key, 0);
|
pthread_setspecific(current_thread_data_key, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
static typename QtPrivate::QEnableIf<QTypeInfo<T>::isIntegral, Qt::HANDLE>::Type to_HANDLE(T id)
|
||||||
|
{
|
||||||
|
return reinterpret_cast<Qt::HANDLE>(static_cast<intptr_t>(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
static typename QtPrivate::QEnableIf<QTypeInfo<T>::isIntegral, T>::Type from_HANDLE(Qt::HANDLE id)
|
||||||
|
{
|
||||||
|
return static_cast<T>(reinterpret_cast<intptr_t>(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
static typename QtPrivate::QEnableIf<QTypeInfo<T>::isPointer, Qt::HANDLE>::Type to_HANDLE(T id)
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
static typename QtPrivate::QEnableIf<QTypeInfo<T>::isPointer, T>::Type from_HANDLE(Qt::HANDLE id)
|
||||||
|
{
|
||||||
|
return static_cast<T>(id);
|
||||||
|
}
|
||||||
|
|
||||||
void QThreadData::clearCurrentThreadData()
|
void QThreadData::clearCurrentThreadData()
|
||||||
{
|
{
|
||||||
clear_thread_data();
|
clear_thread_data();
|
||||||
@ -231,7 +255,7 @@ QThreadData *QThreadData::current(bool createIfNecessary)
|
|||||||
}
|
}
|
||||||
data->deref();
|
data->deref();
|
||||||
data->isAdopted = true;
|
data->isAdopted = true;
|
||||||
data->threadId = (Qt::HANDLE)pthread_self();
|
data->threadId = to_HANDLE(pthread_self());
|
||||||
if (!QCoreApplicationPrivate::theMainThread)
|
if (!QCoreApplicationPrivate::theMainThread)
|
||||||
QCoreApplicationPrivate::theMainThread = data->thread.load();
|
QCoreApplicationPrivate::theMainThread = data->thread.load();
|
||||||
}
|
}
|
||||||
@ -311,7 +335,7 @@ void *QThreadPrivate::start(void *arg)
|
|||||||
thr->d_func()->setPriority(QThread::Priority(thr->d_func()->priority & ~ThreadPriorityResetFlag));
|
thr->d_func()->setPriority(QThread::Priority(thr->d_func()->priority & ~ThreadPriorityResetFlag));
|
||||||
}
|
}
|
||||||
|
|
||||||
data->threadId = (Qt::HANDLE)pthread_self();
|
data->threadId = to_HANDLE(pthread_self());
|
||||||
set_thread_data(data);
|
set_thread_data(data);
|
||||||
|
|
||||||
data->ref();
|
data->ref();
|
||||||
@ -328,7 +352,7 @@ void *QThreadPrivate::start(void *arg)
|
|||||||
// sets the name of the current thread.
|
// sets the name of the current thread.
|
||||||
QString objectName = thr->objectName();
|
QString objectName = thr->objectName();
|
||||||
|
|
||||||
pthread_t thread_id = reinterpret_cast<pthread_t>(data->threadId);
|
pthread_t thread_id = from_HANDLE<pthread_t>(data->threadId);
|
||||||
if (Q_LIKELY(objectName.isEmpty()))
|
if (Q_LIKELY(objectName.isEmpty()))
|
||||||
setCurrentThreadName(thread_id, thr->metaObject()->className());
|
setCurrentThreadName(thread_id, thr->metaObject()->className());
|
||||||
else
|
else
|
||||||
@ -391,7 +415,7 @@ void QThreadPrivate::finish(void *arg)
|
|||||||
Qt::HANDLE QThread::currentThreadId() Q_DECL_NOTHROW
|
Qt::HANDLE QThread::currentThreadId() Q_DECL_NOTHROW
|
||||||
{
|
{
|
||||||
// requires a C cast here otherwise we run into trouble on AIX
|
// requires a C cast here otherwise we run into trouble on AIX
|
||||||
return (Qt::HANDLE)pthread_self();
|
return to_HANDLE(pthread_self());
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(QT_LINUXBASE) && !defined(_SC_NPROCESSORS_ONLN)
|
#if defined(QT_LINUXBASE) && !defined(_SC_NPROCESSORS_ONLN)
|
||||||
@ -617,18 +641,17 @@ void QThread::start(Priority priority)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int code =
|
pthread_t threadId;
|
||||||
pthread_create(reinterpret_cast<pthread_t *>(&d->data->threadId), &attr,
|
int code = pthread_create(&threadId, &attr, QThreadPrivate::start, this);
|
||||||
QThreadPrivate::start, this);
|
|
||||||
if (code == EPERM) {
|
if (code == EPERM) {
|
||||||
// caller does not have permission to set the scheduling
|
// caller does not have permission to set the scheduling
|
||||||
// parameters/policy
|
// parameters/policy
|
||||||
#if defined(QT_HAS_THREAD_PRIORITY_SCHEDULING)
|
#if defined(QT_HAS_THREAD_PRIORITY_SCHEDULING)
|
||||||
pthread_attr_setinheritsched(&attr, PTHREAD_INHERIT_SCHED);
|
pthread_attr_setinheritsched(&attr, PTHREAD_INHERIT_SCHED);
|
||||||
#endif
|
#endif
|
||||||
code = pthread_create(reinterpret_cast<pthread_t *>(&d->data->threadId), &attr,
|
code = pthread_create(&threadId, &attr, QThreadPrivate::start, this);
|
||||||
QThreadPrivate::start, this);
|
|
||||||
}
|
}
|
||||||
|
d->data->threadId = to_HANDLE(threadId);
|
||||||
|
|
||||||
pthread_attr_destroy(&attr);
|
pthread_attr_destroy(&attr);
|
||||||
|
|
||||||
@ -650,7 +673,7 @@ void QThread::terminate()
|
|||||||
if (!d->data->threadId)
|
if (!d->data->threadId)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int code = pthread_cancel(reinterpret_cast<pthread_t>(d->data->threadId));
|
int code = pthread_cancel(from_HANDLE<pthread_t>(d->data->threadId));
|
||||||
if (code) {
|
if (code) {
|
||||||
qWarning("QThread::start: Thread termination error: %s",
|
qWarning("QThread::start: Thread termination error: %s",
|
||||||
qPrintable(qt_error_string((code))));
|
qPrintable(qt_error_string((code))));
|
||||||
@ -663,7 +686,7 @@ bool QThread::wait(unsigned long time)
|
|||||||
Q_D(QThread);
|
Q_D(QThread);
|
||||||
QMutexLocker locker(&d->mutex);
|
QMutexLocker locker(&d->mutex);
|
||||||
|
|
||||||
if (reinterpret_cast<pthread_t>(d->data->threadId) == pthread_self()) {
|
if (from_HANDLE<pthread_t>(d->data->threadId) == pthread_self()) {
|
||||||
qWarning("QThread::wait: Thread tried to wait on itself");
|
qWarning("QThread::wait: Thread tried to wait on itself");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -705,7 +728,7 @@ void QThreadPrivate::setPriority(QThread::Priority threadPriority)
|
|||||||
int sched_policy;
|
int sched_policy;
|
||||||
sched_param param;
|
sched_param param;
|
||||||
|
|
||||||
if (pthread_getschedparam(reinterpret_cast<pthread_t>(data->threadId), &sched_policy, ¶m) != 0) {
|
if (pthread_getschedparam(from_HANDLE<pthread_t>(data->threadId), &sched_policy, ¶m) != 0) {
|
||||||
// failed to get the scheduling policy, don't bother setting
|
// failed to get the scheduling policy, don't bother setting
|
||||||
// the priority
|
// the priority
|
||||||
qWarning("QThread::setPriority: Cannot get scheduler parameters");
|
qWarning("QThread::setPriority: Cannot get scheduler parameters");
|
||||||
@ -721,15 +744,15 @@ void QThreadPrivate::setPriority(QThread::Priority threadPriority)
|
|||||||
}
|
}
|
||||||
|
|
||||||
param.sched_priority = prio;
|
param.sched_priority = prio;
|
||||||
int status = pthread_setschedparam(reinterpret_cast<pthread_t>(data->threadId), sched_policy, ¶m);
|
int status = pthread_setschedparam(from_HANDLE<pthread_t>(data->threadId), sched_policy, ¶m);
|
||||||
|
|
||||||
# ifdef SCHED_IDLE
|
# ifdef SCHED_IDLE
|
||||||
// were we trying to set to idle priority and failed?
|
// were we trying to set to idle priority and failed?
|
||||||
if (status == -1 && sched_policy == SCHED_IDLE && errno == EINVAL) {
|
if (status == -1 && sched_policy == SCHED_IDLE && errno == EINVAL) {
|
||||||
// reset to lowest priority possible
|
// reset to lowest priority possible
|
||||||
pthread_getschedparam(reinterpret_cast<pthread_t>(data->threadId), &sched_policy, ¶m);
|
pthread_getschedparam(from_HANDLE<pthread_t>(data->threadId), &sched_policy, ¶m);
|
||||||
param.sched_priority = sched_get_priority_min(sched_policy);
|
param.sched_priority = sched_get_priority_min(sched_policy);
|
||||||
pthread_setschedparam(reinterpret_cast<pthread_t>(data->threadId), sched_policy, ¶m);
|
pthread_setschedparam(from_HANDLE<pthread_t>(data->threadId), sched_policy, ¶m);
|
||||||
}
|
}
|
||||||
# else
|
# else
|
||||||
Q_UNUSED(status);
|
Q_UNUSED(status);
|
||||||
|
@ -598,6 +598,7 @@ static int ucstrncmp(const QChar *a, const uchar *c, int l)
|
|||||||
}
|
}
|
||||||
# else
|
# else
|
||||||
// 32-bit, we can't do MOVQ to load 8 bytes
|
// 32-bit, we can't do MOVQ to load 8 bytes
|
||||||
|
Q_UNUSED(nullmask);
|
||||||
enum { MaxTailLength = 15 };
|
enum { MaxTailLength = 15 };
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
@ -565,7 +565,7 @@ static bool directoryMatchesSize(const QIconDirInfo &dir, int iconsize)
|
|||||||
return dir.size == iconsize;
|
return dir.size == iconsize;
|
||||||
|
|
||||||
} else if (dir.type == QIconDirInfo::Scalable) {
|
} else if (dir.type == QIconDirInfo::Scalable) {
|
||||||
return dir.size <= dir.maxSize &&
|
return iconsize <= dir.maxSize &&
|
||||||
iconsize >= dir.minSize;
|
iconsize >= dir.minSize;
|
||||||
|
|
||||||
} else if (dir.type == QIconDirInfo::Threshold) {
|
} else if (dir.type == QIconDirInfo::Threshold) {
|
||||||
|
@ -3133,6 +3133,8 @@ void QImage::mirrored_inplace(bool horizontal, bool vertical)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
detach();
|
detach();
|
||||||
|
if (!d->own_data)
|
||||||
|
*this = copy();
|
||||||
|
|
||||||
do_mirror(d, d, horizontal, vertical);
|
do_mirror(d, d, horizontal, vertical);
|
||||||
}
|
}
|
||||||
@ -3279,6 +3281,8 @@ void QImage::rgbSwapped_inplace()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
detach();
|
detach();
|
||||||
|
if (!d->own_data)
|
||||||
|
*this = copy();
|
||||||
|
|
||||||
switch (d->format) {
|
switch (d->format) {
|
||||||
case Format_Invalid:
|
case Format_Invalid:
|
||||||
@ -4762,7 +4766,7 @@ bool QImageData::convertInPlace(QImage::Format newFormat, Qt::ImageConversionFla
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
// No in-place conversion if we have to detach
|
// No in-place conversion if we have to detach
|
||||||
if (ref.load() > 1 || ro_data)
|
if (ref.load() > 1 || !own_data)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
InPlace_Image_Converter converter = qimage_inplace_converter_map[format][newFormat];
|
InPlace_Image_Converter converter = qimage_inplace_converter_map[format][newFormat];
|
||||||
|
@ -321,7 +321,7 @@ public:
|
|||||||
static QImage::Format toImageFormat(QPixelFormat format) Q_DECL_NOTHROW;
|
static QImage::Format toImageFormat(QPixelFormat format) Q_DECL_NOTHROW;
|
||||||
|
|
||||||
#if QT_DEPRECATED_SINCE(5, 0)
|
#if QT_DEPRECATED_SINCE(5, 0)
|
||||||
QT_DEPRECATED inline QString text(const char* key, const char* lang=0) const;
|
QT_DEPRECATED inline QString text(const char *key, const char *lang = Q_NULLPTR) const;
|
||||||
QT_DEPRECATED inline QList<QImageTextKeyLang> textList() const;
|
QT_DEPRECATED inline QList<QImageTextKeyLang> textList() const;
|
||||||
QT_DEPRECATED inline QStringList textLanguages() const;
|
QT_DEPRECATED inline QStringList textLanguages() const;
|
||||||
QT_DEPRECATED inline QString text(const QImageTextKeyLang&) const;
|
QT_DEPRECATED inline QString text(const QImageTextKeyLang&) const;
|
||||||
|
@ -782,8 +782,8 @@ static bool convert_A2RGB30_PM_to_ARGB_inplace(QImageData *data, Qt::ImageConver
|
|||||||
static bool convert_indexed8_to_ARGB_PM_inplace(QImageData *data, Qt::ImageConversionFlags)
|
static bool convert_indexed8_to_ARGB_PM_inplace(QImageData *data, Qt::ImageConversionFlags)
|
||||||
{
|
{
|
||||||
Q_ASSERT(data->format == QImage::Format_Indexed8);
|
Q_ASSERT(data->format == QImage::Format_Indexed8);
|
||||||
if (!data->own_data)
|
Q_ASSERT(data->own_data);
|
||||||
return false;
|
|
||||||
const int depth = 32;
|
const int depth = 32;
|
||||||
|
|
||||||
const int dst_bytes_per_line = ((data->width * depth + 31) >> 5) << 2;
|
const int dst_bytes_per_line = ((data->width * depth + 31) >> 5) << 2;
|
||||||
@ -836,8 +836,8 @@ static bool convert_indexed8_to_ARGB_PM_inplace(QImageData *data, Qt::ImageConve
|
|||||||
static bool convert_indexed8_to_ARGB_inplace(QImageData *data, Qt::ImageConversionFlags)
|
static bool convert_indexed8_to_ARGB_inplace(QImageData *data, Qt::ImageConversionFlags)
|
||||||
{
|
{
|
||||||
Q_ASSERT(data->format == QImage::Format_Indexed8);
|
Q_ASSERT(data->format == QImage::Format_Indexed8);
|
||||||
if (!data->own_data)
|
Q_ASSERT(data->own_data);
|
||||||
return false;
|
|
||||||
const int depth = 32;
|
const int depth = 32;
|
||||||
|
|
||||||
const int dst_bytes_per_line = ((data->width * depth + 31) >> 5) << 2;
|
const int dst_bytes_per_line = ((data->width * depth + 31) >> 5) << 2;
|
||||||
@ -887,8 +887,7 @@ static bool convert_indexed8_to_ARGB_inplace(QImageData *data, Qt::ImageConversi
|
|||||||
static bool convert_indexed8_to_RGB_inplace(QImageData *data, Qt::ImageConversionFlags flags)
|
static bool convert_indexed8_to_RGB_inplace(QImageData *data, Qt::ImageConversionFlags flags)
|
||||||
{
|
{
|
||||||
Q_ASSERT(data->format == QImage::Format_Indexed8);
|
Q_ASSERT(data->format == QImage::Format_Indexed8);
|
||||||
if (!data->own_data)
|
Q_ASSERT(data->own_data);
|
||||||
return false;
|
|
||||||
|
|
||||||
if (data->has_alpha_clut) {
|
if (data->has_alpha_clut) {
|
||||||
for (int i = 0; i < data->colortable.size(); ++i)
|
for (int i = 0; i < data->colortable.size(); ++i)
|
||||||
@ -905,8 +904,8 @@ static bool convert_indexed8_to_RGB_inplace(QImageData *data, Qt::ImageConversio
|
|||||||
static bool convert_indexed8_to_RGB16_inplace(QImageData *data, Qt::ImageConversionFlags)
|
static bool convert_indexed8_to_RGB16_inplace(QImageData *data, Qt::ImageConversionFlags)
|
||||||
{
|
{
|
||||||
Q_ASSERT(data->format == QImage::Format_Indexed8);
|
Q_ASSERT(data->format == QImage::Format_Indexed8);
|
||||||
if (!data->own_data)
|
Q_ASSERT(data->own_data);
|
||||||
return false;
|
|
||||||
const int depth = 16;
|
const int depth = 16;
|
||||||
|
|
||||||
const int dst_bytes_per_line = ((data->width * depth + 31) >> 5) << 2;
|
const int dst_bytes_per_line = ((data->width * depth + 31) >> 5) << 2;
|
||||||
@ -962,8 +961,8 @@ static bool convert_indexed8_to_RGB16_inplace(QImageData *data, Qt::ImageConvers
|
|||||||
static bool convert_RGB_to_RGB16_inplace(QImageData *data, Qt::ImageConversionFlags)
|
static bool convert_RGB_to_RGB16_inplace(QImageData *data, Qt::ImageConversionFlags)
|
||||||
{
|
{
|
||||||
Q_ASSERT(data->format == QImage::Format_RGB32);
|
Q_ASSERT(data->format == QImage::Format_RGB32);
|
||||||
if (!data->own_data)
|
Q_ASSERT(data->own_data);
|
||||||
return false;
|
|
||||||
const int depth = 16;
|
const int depth = 16;
|
||||||
|
|
||||||
const int dst_bytes_per_line = ((data->width * depth + 31) >> 5) << 2;
|
const int dst_bytes_per_line = ((data->width * depth + 31) >> 5) << 2;
|
||||||
|
@ -353,9 +353,9 @@ bool QShortcutMap::tryShortcut(QKeyEvent *e)
|
|||||||
// shouldn't say that we handled the event.
|
// shouldn't say that we handled the event.
|
||||||
return identicalMatches > 0;
|
return identicalMatches > 0;
|
||||||
}
|
}
|
||||||
default:
|
|
||||||
Q_UNREACHABLE();
|
|
||||||
}
|
}
|
||||||
|
Q_UNREACHABLE();
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! \internal
|
/*! \internal
|
||||||
|
@ -552,7 +552,9 @@ static void makeDistanceField(QDistanceFieldData *data, const QPainterPath &path
|
|||||||
QPoint n(to.y() - from.y(), from.x() - to.x());
|
QPoint n(to.y() - from.y(), from.x() - to.x());
|
||||||
if (n.x() == 0 && n.y() == 0)
|
if (n.x() == 0 && n.y() == 0)
|
||||||
continue;
|
continue;
|
||||||
int scale = qRound((offs << 16) / qSqrt(qreal(n.x() * n.x() + n.y() * n.y()))); // 8:16
|
int scale = qRound((offs << 16) / qSqrt(qreal(n.x()) * n.x() + qreal(n.y()) * n.y())); // 8:16
|
||||||
|
Q_ASSERT(scale != 0);
|
||||||
|
|
||||||
n.rx() = n.x() * scale >> 8;
|
n.rx() = n.x() * scale >> 8;
|
||||||
n.ry() = n.y() * scale >> 8;
|
n.ry() = n.y() * scale >> 8;
|
||||||
normals.append(n);
|
normals.append(n);
|
||||||
@ -737,7 +739,6 @@ static bool imageHasNarrowOutlines(const QImage &im)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int QT_DISTANCEFIELD_DEFAULT_BASEFONTSIZE = 54;
|
static int QT_DISTANCEFIELD_DEFAULT_BASEFONTSIZE = 54;
|
||||||
static int QT_DISTANCEFIELD_DEFAULT_TILESIZE = 64;
|
|
||||||
static int QT_DISTANCEFIELD_DEFAULT_SCALE = 16;
|
static int QT_DISTANCEFIELD_DEFAULT_SCALE = 16;
|
||||||
static int QT_DISTANCEFIELD_DEFAULT_RADIUS = 80;
|
static int QT_DISTANCEFIELD_DEFAULT_RADIUS = 80;
|
||||||
static int QT_DISTANCEFIELD_DEFAULT_HIGHGLYPHCOUNT = 2000;
|
static int QT_DISTANCEFIELD_DEFAULT_HIGHGLYPHCOUNT = 2000;
|
||||||
@ -754,10 +755,6 @@ static void initialDistanceFieldFactor()
|
|||||||
qCDebug(lcDistanceField) << "set the QT_DISTANCEFIELD_DEFAULT_BASEFONTSIZE:" << QT_DISTANCEFIELD_DEFAULT_BASEFONTSIZE;
|
qCDebug(lcDistanceField) << "set the QT_DISTANCEFIELD_DEFAULT_BASEFONTSIZE:" << QT_DISTANCEFIELD_DEFAULT_BASEFONTSIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (qEnvironmentVariableIsSet("QT_DISTANCEFIELD_DEFAULT_TILESIZE")) {
|
|
||||||
QT_DISTANCEFIELD_DEFAULT_TILESIZE = qEnvironmentVariableIntValue("QT_DISTANCEFIELD_DEFAULT_TILESIZE");
|
|
||||||
qCDebug(lcDistanceField) << "set the QT_DISTANCEFIELD_DEFAULT_TILESIZE:" << QT_DISTANCEFIELD_DEFAULT_TILESIZE;
|
|
||||||
}
|
|
||||||
if (qEnvironmentVariableIsSet("QT_DISTANCEFIELD_DEFAULT_SCALE")) {
|
if (qEnvironmentVariableIsSet("QT_DISTANCEFIELD_DEFAULT_SCALE")) {
|
||||||
QT_DISTANCEFIELD_DEFAULT_SCALE = qEnvironmentVariableIntValue("QT_DISTANCEFIELD_DEFAULT_SCALE");
|
QT_DISTANCEFIELD_DEFAULT_SCALE = qEnvironmentVariableIntValue("QT_DISTANCEFIELD_DEFAULT_SCALE");
|
||||||
qCDebug(lcDistanceField) << "set the QT_DISTANCEFIELD_DEFAULT_SCALE:" << QT_DISTANCEFIELD_DEFAULT_SCALE;
|
qCDebug(lcDistanceField) << "set the QT_DISTANCEFIELD_DEFAULT_SCALE:" << QT_DISTANCEFIELD_DEFAULT_SCALE;
|
||||||
@ -817,16 +814,6 @@ int QT_DISTANCEFIELD_BASEFONTSIZE(bool narrowOutlineFont)
|
|||||||
return QT_DISTANCEFIELD_DEFAULT_BASEFONTSIZE;
|
return QT_DISTANCEFIELD_DEFAULT_BASEFONTSIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int QT_DISTANCEFIELD_TILESIZE(bool narrowOutlineFont)
|
|
||||||
{
|
|
||||||
initialDistanceFieldFactor();
|
|
||||||
|
|
||||||
if (Q_UNLIKELY(narrowOutlineFont))
|
|
||||||
return QT_DISTANCEFIELD_DEFAULT_TILESIZE * 2;
|
|
||||||
else
|
|
||||||
return QT_DISTANCEFIELD_DEFAULT_TILESIZE;
|
|
||||||
}
|
|
||||||
|
|
||||||
int QT_DISTANCEFIELD_SCALE(bool narrowOutlineFont)
|
int QT_DISTANCEFIELD_SCALE(bool narrowOutlineFont)
|
||||||
{
|
{
|
||||||
initialDistanceFieldFactor();
|
initialDistanceFieldFactor();
|
||||||
@ -890,8 +877,9 @@ QDistanceFieldData *QDistanceFieldData::create(const QPainterPath &path, bool do
|
|||||||
{
|
{
|
||||||
int dfMargin = QT_DISTANCEFIELD_RADIUS(doubleResolution) / QT_DISTANCEFIELD_SCALE(doubleResolution);
|
int dfMargin = QT_DISTANCEFIELD_RADIUS(doubleResolution) / QT_DISTANCEFIELD_SCALE(doubleResolution);
|
||||||
int glyphWidth = qCeil(path.boundingRect().width() / QT_DISTANCEFIELD_SCALE(doubleResolution)) + dfMargin * 2;
|
int glyphWidth = qCeil(path.boundingRect().width() / QT_DISTANCEFIELD_SCALE(doubleResolution)) + dfMargin * 2;
|
||||||
|
int glyphHeight = qCeil(path.boundingRect().height() / QT_DISTANCEFIELD_SCALE(doubleResolution)) + dfMargin * 2;
|
||||||
|
|
||||||
QDistanceFieldData *data = create(QSize(glyphWidth, QT_DISTANCEFIELD_TILESIZE(doubleResolution)));
|
QDistanceFieldData *data = create(QSize(glyphWidth, glyphHeight));
|
||||||
|
|
||||||
makeDistanceField(data,
|
makeDistanceField(data,
|
||||||
path,
|
path,
|
||||||
|
@ -34,7 +34,8 @@ ANDROID_PERMISSIONS += \
|
|||||||
|
|
||||||
MODULE_WINRT_CAPABILITIES = \
|
MODULE_WINRT_CAPABILITIES = \
|
||||||
internetClient \
|
internetClient \
|
||||||
internetClientServer
|
internetClientServer \
|
||||||
|
privateNetworkClientServer
|
||||||
|
|
||||||
MODULE_PLUGIN_TYPES = \
|
MODULE_PLUGIN_TYPES = \
|
||||||
bearer
|
bearer
|
||||||
|
@ -259,31 +259,23 @@ bool QNativeSocketEngine::initialize(qintptr socketDescriptor, QAbstractSocket::
|
|||||||
// Start processing incoming data
|
// Start processing incoming data
|
||||||
if (d->socketType == QAbstractSocket::TcpSocket) {
|
if (d->socketType == QAbstractSocket::TcpSocket) {
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
hr = QEventDispatcherWinRT::runOnXamlThread([d, socket, this]() {
|
QEventDispatcherWinRT::runOnXamlThread([d, &hr, socket, this]() {
|
||||||
ComPtr<IBuffer> buffer;
|
ComPtr<IBuffer> buffer;
|
||||||
HRESULT hr = g->bufferFactory->Create(READ_BUFFER_SIZE, &buffer);
|
HRESULT hr = g->bufferFactory->Create(READ_BUFFER_SIZE, &buffer);
|
||||||
RETURN_HR_IF_FAILED("initialize(): Could not create buffer");
|
RETURN_OK_IF_FAILED("initialize(): Could not create buffer");
|
||||||
|
|
||||||
ComPtr<IInputStream> stream;
|
ComPtr<IInputStream> stream;
|
||||||
hr = socket->get_InputStream(&stream);
|
hr = socket->get_InputStream(&stream);
|
||||||
RETURN_HR_IF_FAILED("initialize(): Could not obtain input stream");
|
RETURN_OK_IF_FAILED("initialize(): Could not obtain input stream");
|
||||||
hr = stream->ReadAsync(buffer.Get(), READ_BUFFER_SIZE, InputStreamOptions_Partial, d->readOp.GetAddressOf());
|
hr = stream->ReadAsync(buffer.Get(), READ_BUFFER_SIZE, InputStreamOptions_Partial, d->readOp.GetAddressOf());
|
||||||
if (FAILED(hr)) {
|
RETURN_OK_IF_FAILED_WITH_ARGS("initialize(): Failed to read from the socket buffer (%s).",
|
||||||
qErrnoWarning(hr, "initialize(): Failed to read from the socket buffer (%s).",
|
|
||||||
socketDescription(this).constData());
|
socketDescription(this).constData());
|
||||||
return E_FAIL;
|
|
||||||
}
|
|
||||||
hr = d->readOp->put_Completed(Callback<SocketReadCompletedHandler>(d, &QNativeSocketEnginePrivate::handleReadyRead).Get());
|
hr = d->readOp->put_Completed(Callback<SocketReadCompletedHandler>(d, &QNativeSocketEnginePrivate::handleReadyRead).Get());
|
||||||
if (FAILED(hr)) {
|
RETURN_OK_IF_FAILED_WITH_ARGS("initialize(): Failed to set socket read callback (%s).",
|
||||||
qErrnoWarning(hr, "initialize(): Failed to set socket read callback (%s).",
|
|
||||||
socketDescription(this).constData());
|
socketDescription(this).constData());
|
||||||
return E_FAIL;
|
|
||||||
}
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
});
|
});
|
||||||
if (hr == E_FAIL)
|
if (FAILED(hr))
|
||||||
return false;
|
return false;
|
||||||
Q_ASSERT_SUCCEEDED(hr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
d->socketState = socketState;
|
d->socketState = socketState;
|
||||||
@ -335,11 +327,14 @@ bool QNativeSocketEngine::connectToHostByName(const QString &name, quint16 port)
|
|||||||
Q_ASSERT_SUCCEEDED(hr);
|
Q_ASSERT_SUCCEEDED(hr);
|
||||||
|
|
||||||
d->socketState = QAbstractSocket::ConnectingState;
|
d->socketState = QAbstractSocket::ConnectingState;
|
||||||
hr = QEventDispatcherWinRT::runOnXamlThread([d]() {
|
QEventDispatcherWinRT::runOnXamlThread([d, &hr]() {
|
||||||
return d->connectOp->put_Completed(Callback<IAsyncActionCompletedHandler>(
|
hr = d->connectOp->put_Completed(Callback<IAsyncActionCompletedHandler>(
|
||||||
d, &QNativeSocketEnginePrivate::handleConnectOpFinished).Get());
|
d, &QNativeSocketEnginePrivate::handleConnectOpFinished).Get());
|
||||||
|
RETURN_OK_IF_FAILED("connectToHostByName: Could not register \"connectOp\" callback");
|
||||||
|
return S_OK;
|
||||||
});
|
});
|
||||||
Q_ASSERT_SUCCEEDED(hr);
|
if (FAILED(hr))
|
||||||
|
return false;
|
||||||
|
|
||||||
return d->socketState == QAbstractSocket::ConnectedState;
|
return d->socketState == QAbstractSocket::ConnectedState;
|
||||||
}
|
}
|
||||||
@ -348,19 +343,21 @@ bool QNativeSocketEngine::bind(const QHostAddress &address, quint16 port)
|
|||||||
{
|
{
|
||||||
Q_D(QNativeSocketEngine);
|
Q_D(QNativeSocketEngine);
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
hr = QEventDispatcherWinRT::runOnXamlThread([address, d, port, this]() {
|
// runOnXamlThread may only return S_OK (will assert otherwise) so no need to check its result.
|
||||||
HRESULT hr;
|
// hr is set inside the lambda though. If an error occurred hr will point that out.
|
||||||
|
bool specificErrorSet = false;
|
||||||
|
QEventDispatcherWinRT::runOnXamlThread([address, d, &hr, port, &specificErrorSet, this]() {
|
||||||
ComPtr<IHostName> hostAddress;
|
ComPtr<IHostName> hostAddress;
|
||||||
|
|
||||||
if (address != QHostAddress::Any && address != QHostAddress::AnyIPv4 && address != QHostAddress::AnyIPv6) {
|
if (address != QHostAddress::Any && address != QHostAddress::AnyIPv4 && address != QHostAddress::AnyIPv6) {
|
||||||
ComPtr<IHostNameFactory> hostNameFactory;
|
ComPtr<IHostNameFactory> hostNameFactory;
|
||||||
hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Networking_HostName).Get(),
|
hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Networking_HostName).Get(),
|
||||||
&hostNameFactory);
|
&hostNameFactory);
|
||||||
RETURN_HR_IF_FAILED("QNativeSocketEngine::bind: Could not obtain hostname factory");
|
RETURN_OK_IF_FAILED("QNativeSocketEngine::bind: Could not obtain hostname factory");
|
||||||
const QString addressString = address.toString();
|
const QString addressString = address.toString();
|
||||||
HStringReference addressRef(reinterpret_cast<LPCWSTR>(addressString.utf16()));
|
HStringReference addressRef(reinterpret_cast<LPCWSTR>(addressString.utf16()));
|
||||||
hr = hostNameFactory->CreateHostName(addressRef.Get(), &hostAddress);
|
hr = hostNameFactory->CreateHostName(addressRef.Get(), &hostAddress);
|
||||||
RETURN_HR_IF_FAILED("QNativeSocketEngine::bind: Could not create hostname.");
|
RETURN_OK_IF_FAILED("QNativeSocketEngine::bind: Could not create hostname.");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString portQString = port ? QString::number(port) : QString();
|
QString portQString = port ? QString::number(port) : QString();
|
||||||
@ -371,13 +368,13 @@ bool QNativeSocketEngine::bind(const QHostAddress &address, quint16 port)
|
|||||||
if (!d->tcpListener) {
|
if (!d->tcpListener) {
|
||||||
hr = RoActivateInstance(HString::MakeReference(RuntimeClass_Windows_Networking_Sockets_StreamSocketListener).Get(),
|
hr = RoActivateInstance(HString::MakeReference(RuntimeClass_Windows_Networking_Sockets_StreamSocketListener).Get(),
|
||||||
&d->tcpListener);
|
&d->tcpListener);
|
||||||
RETURN_HR_IF_FAILED("QNativeSocketEngine::bind: Could not create tcp listener");
|
RETURN_OK_IF_FAILED("QNativeSocketEngine::bind: Could not create tcp listener");
|
||||||
}
|
}
|
||||||
|
|
||||||
hr = d->tcpListener->add_ConnectionReceived(
|
hr = d->tcpListener->add_ConnectionReceived(
|
||||||
Callback<ClientConnectedHandler>(d, &QNativeSocketEnginePrivate::handleClientConnection).Get(),
|
Callback<ClientConnectedHandler>(d, &QNativeSocketEnginePrivate::handleClientConnection).Get(),
|
||||||
&d->connectionToken);
|
&d->connectionToken);
|
||||||
RETURN_HR_IF_FAILED("QNativeSocketEngine::bind: Could not register client connection callback");
|
RETURN_OK_IF_FAILED("QNativeSocketEngine::bind: Could not register client connection callback");
|
||||||
hr = d->tcpListener->BindEndpointAsync(hostAddress.Get(), portString.Get(), &op);
|
hr = d->tcpListener->BindEndpointAsync(hostAddress.Get(), portString.Get(), &op);
|
||||||
} else if (d->socketType == QAbstractSocket::UdpSocket) {
|
} else if (d->socketType == QAbstractSocket::UdpSocket) {
|
||||||
hr = d->udpSocket()->BindEndpointAsync(hostAddress.Get(), portString.Get(), &op);
|
hr = d->udpSocket()->BindEndpointAsync(hostAddress.Get(), portString.Get(), &op);
|
||||||
@ -385,15 +382,40 @@ bool QNativeSocketEngine::bind(const QHostAddress &address, quint16 port)
|
|||||||
if (hr == E_ACCESSDENIED) {
|
if (hr == E_ACCESSDENIED) {
|
||||||
qErrnoWarning(hr, "Unable to bind socket (%s:%hu/%s). Please check your manifest capabilities.",
|
qErrnoWarning(hr, "Unable to bind socket (%s:%hu/%s). Please check your manifest capabilities.",
|
||||||
qPrintable(address.toString()), port, socketDescription(this).constData());
|
qPrintable(address.toString()), port, socketDescription(this).constData());
|
||||||
return hr;
|
d->setError(QAbstractSocket::SocketAccessError,
|
||||||
|
QNativeSocketEnginePrivate::AccessErrorString);
|
||||||
|
d->socketState = QAbstractSocket::UnconnectedState;
|
||||||
|
specificErrorSet = true;
|
||||||
|
return S_OK;
|
||||||
}
|
}
|
||||||
RETURN_HR_IF_FAILED("QNativeSocketEngine::bind: Unable to bind socket");
|
RETURN_OK_IF_FAILED("QNativeSocketEngine::bind: Unable to bind socket");
|
||||||
|
|
||||||
hr = QWinRTFunctions::await(op);
|
hr = QWinRTFunctions::await(op);
|
||||||
RETURN_HR_IF_FAILED("QNativeSocketEngine::bind: Could not wait for bind to finish");
|
if (hr == 0x80072741) { // The requested address is not valid in its context
|
||||||
|
d->setError(QAbstractSocket::SocketAddressNotAvailableError,
|
||||||
|
QNativeSocketEnginePrivate::AddressNotAvailableErrorString);
|
||||||
|
d->socketState = QAbstractSocket::UnconnectedState;
|
||||||
|
specificErrorSet = true;
|
||||||
|
return S_OK;
|
||||||
|
// Only one usage of each socket address (protocol/network address/port) is normally permitted
|
||||||
|
} else if (hr == 0x80072740) {
|
||||||
|
d->setError(QAbstractSocket::AddressInUseError,
|
||||||
|
QNativeSocketEnginePrivate::AddressInuseErrorString);
|
||||||
|
d->socketState = QAbstractSocket::UnconnectedState;
|
||||||
|
specificErrorSet = true;
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
RETURN_OK_IF_FAILED("QNativeSocketEngine::bind: Could not wait for bind to finish");
|
||||||
return S_OK;
|
return S_OK;
|
||||||
});
|
});
|
||||||
Q_ASSERT_SUCCEEDED(hr);
|
if (FAILED(hr)) {
|
||||||
|
if (!specificErrorSet) {
|
||||||
|
d->setError(QAbstractSocket::UnknownSocketError,
|
||||||
|
QNativeSocketEnginePrivate::UnknownSocketErrorString);
|
||||||
|
d->socketState = QAbstractSocket::UnconnectedState;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
d->socketState = QAbstractSocket::BoundState;
|
d->socketState = QAbstractSocket::BoundState;
|
||||||
return d->fetchConnectionParameters();
|
return d->fetchConnectionParameters();
|
||||||
@ -853,20 +875,22 @@ bool QNativeSocketEnginePrivate::createNewSocket(QAbstractSocket::SocketType soc
|
|||||||
case QAbstractSocket::TcpSocket: {
|
case QAbstractSocket::TcpSocket: {
|
||||||
ComPtr<IStreamSocket> socket;
|
ComPtr<IStreamSocket> socket;
|
||||||
hr = RoActivateInstance(HString::MakeReference(RuntimeClass_Windows_Networking_Sockets_StreamSocket).Get(), &socket);
|
hr = RoActivateInstance(HString::MakeReference(RuntimeClass_Windows_Networking_Sockets_StreamSocket).Get(), &socket);
|
||||||
Q_ASSERT_SUCCEEDED(hr);
|
RETURN_FALSE_IF_FAILED("createNewSocket: Could not create socket instance");
|
||||||
socketDescriptor = qintptr(socket.Detach());
|
socketDescriptor = qintptr(socket.Detach());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case QAbstractSocket::UdpSocket: {
|
case QAbstractSocket::UdpSocket: {
|
||||||
ComPtr<IDatagramSocket> socket;
|
ComPtr<IDatagramSocket> socket;
|
||||||
hr = RoActivateInstance(HString::MakeReference(RuntimeClass_Windows_Networking_Sockets_DatagramSocket).Get(), &socket);
|
hr = RoActivateInstance(HString::MakeReference(RuntimeClass_Windows_Networking_Sockets_DatagramSocket).Get(), &socket);
|
||||||
Q_ASSERT_SUCCEEDED(hr);
|
RETURN_FALSE_IF_FAILED("createNewSocket: Could not create socket instance");
|
||||||
socketDescriptor = qintptr(socket.Detach());
|
socketDescriptor = qintptr(socket.Detach());
|
||||||
hr = QEventDispatcherWinRT::runOnXamlThread([this]() {
|
QEventDispatcherWinRT::runOnXamlThread([&hr, this]() {
|
||||||
HRESULT hr = udpSocket()->add_MessageReceived(Callback<DatagramReceivedHandler>(this, &QNativeSocketEnginePrivate::handleNewDatagram).Get(), &connectionToken);
|
hr = udpSocket()->add_MessageReceived(Callback<DatagramReceivedHandler>(this, &QNativeSocketEnginePrivate::handleNewDatagram).Get(), &connectionToken);
|
||||||
return hr;
|
RETURN_OK_IF_FAILED("createNewSocket: Could not add \"message received\" callback")
|
||||||
|
return S_OK;
|
||||||
});
|
});
|
||||||
Q_ASSERT_SUCCEEDED(hr);
|
if (FAILED(hr))
|
||||||
|
return false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
@ -1191,6 +1191,11 @@ bool QSslSocketBackendPrivate::startHandshake()
|
|||||||
#endif
|
#endif
|
||||||
if (!checkSslErrors())
|
if (!checkSslErrors())
|
||||||
return false;
|
return false;
|
||||||
|
// A slot, attached to sslErrors signal can call
|
||||||
|
// abort/close/disconnetFromHost/etc; no need to
|
||||||
|
// continue handshake then.
|
||||||
|
if (q->state() != QAbstractSocket::ConnectedState)
|
||||||
|
return false;
|
||||||
} else {
|
} else {
|
||||||
sslErrors.clear();
|
sslErrors.clear();
|
||||||
}
|
}
|
||||||
|
@ -212,6 +212,12 @@ void QCoreTextFontDatabase::populateFontDatabase()
|
|||||||
if (familyName.startsWith(QLatin1Char('.')) || familyName == QLatin1String("LastResort"))
|
if (familyName.startsWith(QLatin1Char('.')) || familyName == QLatin1String("LastResort"))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
#if defined(Q_OS_IOS) || defined(Q_OS_TVOS)
|
||||||
|
// Skip font families with no corresponding fonts
|
||||||
|
if (![UIFont fontNamesForFamilyName:(NSString*)familyNameRef].count)
|
||||||
|
continue;
|
||||||
|
#endif
|
||||||
|
|
||||||
QPlatformFontDatabase::registerFontFamily(familyName);
|
QPlatformFontDatabase::registerFontFamily(familyName);
|
||||||
|
|
||||||
#if defined(Q_OS_OSX)
|
#if defined(Q_OS_OSX)
|
||||||
|
@ -85,7 +85,7 @@ extern "C" { // Otherwise it won't find CWKeychain* symbols at link time
|
|||||||
[locker lock];
|
[locker lock];
|
||||||
QMacAutoReleasePool pool;
|
QMacAutoReleasePool pool;
|
||||||
notificationCenter = [NSNotificationCenter defaultCenter];
|
notificationCenter = [NSNotificationCenter defaultCenter];
|
||||||
currentInterface = [CWInterface interfaceWithName:nil];
|
currentInterface = [CWInterface interface];
|
||||||
[notificationCenter addObserver:self selector:@selector(notificationHandler:) name:CWPowerDidChangeNotification object:nil];
|
[notificationCenter addObserver:self selector:@selector(notificationHandler:) name:CWPowerDidChangeNotification object:nil];
|
||||||
[locker unlock];
|
[locker unlock];
|
||||||
return self;
|
return self;
|
||||||
|
@ -334,7 +334,6 @@ QWindowSystemInterface::TouchPoint QTuioHandler::cursorToTouchPoint(const QTuioC
|
|||||||
tp.normalPosition = m_transform.map(tp.normalPosition);
|
tp.normalPosition = m_transform.map(tp.normalPosition);
|
||||||
|
|
||||||
tp.state = tc.state();
|
tp.state = tc.state();
|
||||||
tp.area = QRectF(0, 0, 1, 1);
|
|
||||||
|
|
||||||
// we map the touch to the size of the window. we do this, because frankly,
|
// we map the touch to the size of the window. we do this, because frankly,
|
||||||
// trying to figure out which part of the screen to hit in order to press an
|
// trying to figure out which part of the screen to hit in order to press an
|
||||||
|
@ -252,9 +252,19 @@ namespace QtAndroidInput
|
|||||||
QWindowSystemInterface::handleTouchEvent(window, touchDevice, m_touchPoints);
|
QWindowSystemInterface::handleTouchEvent(window, touchDevice, m_touchPoints);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool isTabletEventSupported(JNIEnv */*env*/, jobject /*thiz*/)
|
||||||
|
{
|
||||||
|
#ifdef QT_NO_TABLETEVENT
|
||||||
|
return false;
|
||||||
|
#else
|
||||||
|
return true;
|
||||||
|
#endif // QT_NO_TABLETEVENT
|
||||||
|
}
|
||||||
|
|
||||||
static void tabletEvent(JNIEnv */*env*/, jobject /*thiz*/, jint /*winId*/, jint deviceId, jlong time, jint action,
|
static void tabletEvent(JNIEnv */*env*/, jobject /*thiz*/, jint /*winId*/, jint deviceId, jlong time, jint action,
|
||||||
jint pointerType, jint buttonState, jfloat x, jfloat y, jfloat pressure)
|
jint pointerType, jint buttonState, jfloat x, jfloat y, jfloat pressure)
|
||||||
{
|
{
|
||||||
|
#ifndef QT_NO_TABLETEVENT
|
||||||
QPointF globalPosF(x, y);
|
QPointF globalPosF(x, y);
|
||||||
QPoint globalPos((int)x, (int)y);
|
QPoint globalPos((int)x, (int)y);
|
||||||
QWindow *tlw = topLevelWindowAt(globalPos);
|
QWindow *tlw = topLevelWindowAt(globalPos);
|
||||||
@ -296,6 +306,7 @@ namespace QtAndroidInput
|
|||||||
QWindowSystemInterface::handleTabletEvent(tlw, ulong(time),
|
QWindowSystemInterface::handleTabletEvent(tlw, ulong(time),
|
||||||
localPos, globalPosF, QTabletEvent::Stylus, pointerType,
|
localPos, globalPosF, QTabletEvent::Stylus, pointerType,
|
||||||
buttons, pressure, 0, 0, 0., 0., 0, deviceId, Qt::NoModifier);
|
buttons, pressure, 0, 0, 0., 0., 0, deviceId, Qt::NoModifier);
|
||||||
|
#endif // QT_NO_TABLETEVENT
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mapAndroidKey(int key)
|
static int mapAndroidKey(int key)
|
||||||
@ -783,6 +794,7 @@ namespace QtAndroidInput
|
|||||||
{"mouseUp", "(III)V", (void *)mouseUp},
|
{"mouseUp", "(III)V", (void *)mouseUp},
|
||||||
{"mouseMove", "(III)V", (void *)mouseMove},
|
{"mouseMove", "(III)V", (void *)mouseMove},
|
||||||
{"longPress", "(III)V", (void *)longPress},
|
{"longPress", "(III)V", (void *)longPress},
|
||||||
|
{"isTabletEventSupported", "()Z", (void *)isTabletEventSupported},
|
||||||
{"tabletEvent", "(IIJIIIFFF)V", (void *)tabletEvent},
|
{"tabletEvent", "(IIJIIIFFF)V", (void *)tabletEvent},
|
||||||
{"keyDown", "(IIIZ)V", (void *)keyDown},
|
{"keyDown", "(IIIZ)V", (void *)keyDown},
|
||||||
{"keyUp", "(IIIZ)V", (void *)keyUp},
|
{"keyUp", "(IIIZ)V", (void *)keyUp},
|
||||||
|
@ -41,18 +41,19 @@
|
|||||||
#define QIOSAPPLICATIONSTATE_H
|
#define QIOSAPPLICATIONSTATE_H
|
||||||
|
|
||||||
#include <QtCore/qglobal.h>
|
#include <QtCore/qglobal.h>
|
||||||
|
#include <QtCore/qvector.h>
|
||||||
|
|
||||||
|
Q_FORWARD_DECLARE_OBJC_CLASS(NSObject);
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
@class QIOSApplicationStateListener;
|
|
||||||
|
|
||||||
class QIOSApplicationState
|
class QIOSApplicationState
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QIOSApplicationState();
|
QIOSApplicationState();
|
||||||
~QIOSApplicationState();
|
~QIOSApplicationState();
|
||||||
private:
|
private:
|
||||||
QIOSApplicationStateListener *m_listener;
|
QVector<NSObject*> m_observers;
|
||||||
};
|
};
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
@ -42,100 +42,21 @@
|
|||||||
#include <qpa/qwindowsysteminterface.h>
|
#include <qpa/qwindowsysteminterface.h>
|
||||||
#include <QtCore/qcoreapplication.h>
|
#include <QtCore/qcoreapplication.h>
|
||||||
|
|
||||||
|
#include <QtGui/private/qguiapplication_p.h>
|
||||||
|
|
||||||
#import <UIKit/UIKit.h>
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
@interface QIOSApplicationStateListener : NSObject
|
static Qt::ApplicationState qtApplicationState(UIApplicationState uiApplicationState)
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation QIOSApplicationStateListener
|
|
||||||
|
|
||||||
- (id)init
|
|
||||||
{
|
{
|
||||||
self = [super init];
|
|
||||||
if (self) {
|
|
||||||
// Listen for application state changes.
|
|
||||||
// Note: We use notifications rather than application delegate callbacks to
|
|
||||||
// also support hybrid applications were QIOSApplicationDelegate is not in use.
|
|
||||||
[[NSNotificationCenter defaultCenter]
|
|
||||||
addObserver:self
|
|
||||||
selector:@selector(applicationDidBecomeActive)
|
|
||||||
name:UIApplicationDidBecomeActiveNotification
|
|
||||||
object:nil];
|
|
||||||
[[NSNotificationCenter defaultCenter]
|
|
||||||
addObserver:self
|
|
||||||
selector:@selector(applicationWillResignActive)
|
|
||||||
name:UIApplicationWillResignActiveNotification
|
|
||||||
object:nil];
|
|
||||||
[[NSNotificationCenter defaultCenter]
|
|
||||||
addObserver:self
|
|
||||||
selector:@selector(applicationDidEnterBackground)
|
|
||||||
name:UIApplicationDidEnterBackgroundNotification
|
|
||||||
object:nil];
|
|
||||||
|
|
||||||
// Update the current state now, since we have missed all the updates
|
|
||||||
// posted from AppKit so far. But let QPA finish initialization first.
|
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
|
||||||
[self handleApplicationStateChanged:[UIApplication sharedApplication].applicationState];
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return self;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)dealloc
|
|
||||||
{
|
|
||||||
[[NSNotificationCenter defaultCenter]
|
|
||||||
removeObserver:self
|
|
||||||
name:UIApplicationDidBecomeActiveNotification
|
|
||||||
object:nil];
|
|
||||||
[[NSNotificationCenter defaultCenter]
|
|
||||||
removeObserver:self
|
|
||||||
name:UIApplicationWillResignActiveNotification
|
|
||||||
object:nil];
|
|
||||||
[[NSNotificationCenter defaultCenter]
|
|
||||||
removeObserver:self
|
|
||||||
name:UIApplicationDidEnterBackgroundNotification
|
|
||||||
object:nil];
|
|
||||||
[super dealloc];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)applicationDidBecomeActive
|
|
||||||
{
|
|
||||||
[self handleApplicationStateChanged:UIApplicationStateActive];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)applicationWillResignActive
|
|
||||||
{
|
|
||||||
// Note that UIApplication is still UIApplicationStateActive at this
|
|
||||||
// point, but since there is no separate notification for the inactive
|
|
||||||
// state, we report UIApplicationStateInactive now:
|
|
||||||
[self handleApplicationStateChanged:UIApplicationStateInactive];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)applicationDidEnterBackground
|
|
||||||
{
|
|
||||||
[self handleApplicationStateChanged:UIApplicationStateBackground];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)handleApplicationStateChanged:(UIApplicationState)uiApplicationState
|
|
||||||
{
|
|
||||||
// We may receive application state changes after QCoreApplication has
|
|
||||||
// gone down, as the block we schedule on the main queue keeps the
|
|
||||||
// listener alive. In that case we just ignore the notification.
|
|
||||||
if (!qApp)
|
|
||||||
return;
|
|
||||||
|
|
||||||
Qt::ApplicationState state;
|
|
||||||
switch (uiApplicationState) {
|
switch (uiApplicationState) {
|
||||||
case UIApplicationStateActive:
|
case UIApplicationStateActive:
|
||||||
// The application is visible in front, and receiving events:
|
// The application is visible in front, and receiving events
|
||||||
state = Qt::ApplicationActive;
|
return Qt::ApplicationActive;
|
||||||
break;
|
|
||||||
case UIApplicationStateInactive:
|
case UIApplicationStateInactive:
|
||||||
// The app is running in the foreground but is not receiving events. This
|
// The app is running in the foreground but is not receiving events. This
|
||||||
// typically happens while transitioning to/from active/background, like
|
// typically happens while transitioning to/from active/background, like
|
||||||
// upon app launch or when receiving incoming calls:
|
// upon app launch or when receiving incoming calls.
|
||||||
state = Qt::ApplicationInactive;
|
return Qt::ApplicationInactive;
|
||||||
break;
|
|
||||||
case UIApplicationStateBackground:
|
case UIApplicationStateBackground:
|
||||||
// Normally the app would enter this state briefly before it gets
|
// Normally the app would enter this state briefly before it gets
|
||||||
// suspeded (you have five seconds, according to Apple).
|
// suspeded (you have five seconds, according to Apple).
|
||||||
@ -144,25 +65,54 @@
|
|||||||
// API for doing that yet, we handle this state as "about to be suspended".
|
// API for doing that yet, we handle this state as "about to be suspended".
|
||||||
// Note: A screen-shot for the SpringBoard will also be taken after this
|
// Note: A screen-shot for the SpringBoard will also be taken after this
|
||||||
// call returns.
|
// call returns.
|
||||||
state = Qt::ApplicationSuspended;
|
return Qt::ApplicationSuspended;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void handleApplicationStateChanged(UIApplicationState uiApplicationState)
|
||||||
|
{
|
||||||
|
Qt::ApplicationState state = qtApplicationState(uiApplicationState);
|
||||||
QWindowSystemInterface::handleApplicationStateChanged(state);
|
QWindowSystemInterface::handleApplicationStateChanged(state);
|
||||||
QWindowSystemInterface::flushWindowSystemEvents();
|
QWindowSystemInterface::flushWindowSystemEvents();
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
QIOSApplicationState::QIOSApplicationState()
|
QIOSApplicationState::QIOSApplicationState()
|
||||||
: m_listener([[QIOSApplicationStateListener alloc] init])
|
|
||||||
{
|
{
|
||||||
|
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
|
||||||
|
|
||||||
|
m_observers.push_back([notificationCenter addObserverForName:UIApplicationDidBecomeActiveNotification
|
||||||
|
object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *) {
|
||||||
|
handleApplicationStateChanged(UIApplicationStateActive);
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
|
m_observers.push_back([notificationCenter addObserverForName:UIApplicationWillResignActiveNotification
|
||||||
|
object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *) {
|
||||||
|
// Note: UIApplication is still UIApplicationStateActive at this point,
|
||||||
|
// but since there is no separate notification for the inactive state,
|
||||||
|
// we report UIApplicationStateInactive now.
|
||||||
|
handleApplicationStateChanged(UIApplicationStateInactive);
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
|
m_observers.push_back([notificationCenter addObserverForName:UIApplicationDidEnterBackgroundNotification
|
||||||
|
object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *) {
|
||||||
|
handleApplicationStateChanged(UIApplicationStateBackground);
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
|
// Initialize correct startup state, which may not be the Qt default (inactive)
|
||||||
|
UIApplicationState startupState = [UIApplication sharedApplication].applicationState;
|
||||||
|
QGuiApplicationPrivate::applicationState = qtApplicationState(startupState);
|
||||||
}
|
}
|
||||||
|
|
||||||
QIOSApplicationState::~QIOSApplicationState()
|
QIOSApplicationState::~QIOSApplicationState()
|
||||||
{
|
{
|
||||||
[m_listener release];
|
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
|
||||||
|
foreach (const NSObject* observer, m_observers)
|
||||||
|
[notificationCenter removeObserver:observer];
|
||||||
}
|
}
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
@ -40,6 +40,7 @@
|
|||||||
#ifndef QIOSCONTEXT_H
|
#ifndef QIOSCONTEXT_H
|
||||||
#define QIOSCONTEXT_H
|
#define QIOSCONTEXT_H
|
||||||
|
|
||||||
|
#include <QtCore/qloggingcategory.h>
|
||||||
#include <qpa/qplatformopenglcontext.h>
|
#include <qpa/qplatformopenglcontext.h>
|
||||||
|
|
||||||
@class EAGLContext;
|
@class EAGLContext;
|
||||||
@ -89,7 +90,9 @@ private:
|
|||||||
static void deleteBuffers(const FramebufferObject &framebufferObject);
|
static void deleteBuffers(const FramebufferObject &framebufferObject);
|
||||||
|
|
||||||
FramebufferObject &backingFramebufferObjectFor(QPlatformSurface *) const;
|
FramebufferObject &backingFramebufferObjectFor(QPlatformSurface *) const;
|
||||||
mutable QHash<QIOSWindow *, FramebufferObject> m_framebufferObjects;
|
mutable QHash<QPlatformSurface *, FramebufferObject> m_framebufferObjects;
|
||||||
|
|
||||||
|
bool needsRenderbufferResize(QPlatformSurface *) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
@ -48,6 +48,8 @@
|
|||||||
#import <OpenGLES/ES2/glext.h>
|
#import <OpenGLES/ES2/glext.h>
|
||||||
#import <QuartzCore/CAEAGLLayer.h>
|
#import <QuartzCore/CAEAGLLayer.h>
|
||||||
|
|
||||||
|
Q_LOGGING_CATEGORY(lcQpaGLContext, "qt.qpa.glcontext");
|
||||||
|
|
||||||
QIOSContext::QIOSContext(QOpenGLContext *context)
|
QIOSContext::QIOSContext(QOpenGLContext *context)
|
||||||
: QPlatformOpenGLContext()
|
: QPlatformOpenGLContext()
|
||||||
, m_sharedContext(static_cast<QIOSContext *>(context->shareHandle()))
|
, m_sharedContext(static_cast<QIOSContext *>(context->shareHandle()))
|
||||||
@ -81,6 +83,8 @@ QIOSContext::QIOSContext(QOpenGLContext *context)
|
|||||||
// could take advantage of the unchanged buffer, but this means clients (and Qt)
|
// could take advantage of the unchanged buffer, but this means clients (and Qt)
|
||||||
// will also assume that swapBufferes() is not needed, which is _not_ the case.
|
// will also assume that swapBufferes() is not needed, which is _not_ the case.
|
||||||
m_format.setSwapBehavior(QSurfaceFormat::DoubleBuffer);
|
m_format.setSwapBehavior(QSurfaceFormat::DoubleBuffer);
|
||||||
|
|
||||||
|
qCDebug(lcQpaGLContext) << "created context with format" << m_format << "shared with" << m_sharedContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
QIOSContext::~QIOSContext()
|
QIOSContext::~QIOSContext()
|
||||||
@ -123,10 +127,12 @@ static QString fboStatusString(GLenum status)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define Q_ASSERT_IS_GL_SURFACE(surface) \
|
||||||
|
Q_ASSERT(surface && (surface->surface()->surfaceType() & (QSurface::OpenGLSurface | QSurface::RasterGLSurface)))
|
||||||
|
|
||||||
bool QIOSContext::makeCurrent(QPlatformSurface *surface)
|
bool QIOSContext::makeCurrent(QPlatformSurface *surface)
|
||||||
{
|
{
|
||||||
Q_ASSERT(surface && (surface->surface()->surfaceType() == QSurface::OpenGLSurface
|
Q_ASSERT_IS_GL_SURFACE(surface);
|
||||||
|| surface->surface()->surfaceType() == QSurface::RasterGLSurface));
|
|
||||||
|
|
||||||
[EAGLContext setCurrentContext:m_eaglContext];
|
[EAGLContext setCurrentContext:m_eaglContext];
|
||||||
|
|
||||||
@ -134,54 +140,11 @@ bool QIOSContext::makeCurrent(QPlatformSurface *surface)
|
|||||||
if (surface->surface()->surfaceClass() == QSurface::Offscreen)
|
if (surface->surface()->surfaceClass() == QSurface::Offscreen)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
Q_ASSERT(surface->surface()->surfaceClass() == QSurface::Window);
|
||||||
FramebufferObject &framebufferObject = backingFramebufferObjectFor(surface);
|
FramebufferObject &framebufferObject = backingFramebufferObjectFor(surface);
|
||||||
|
|
||||||
// We bind the default FBO even if it's incomplete, so that clients who
|
|
||||||
// call glCheckFramebufferStatus as a result of this function returning
|
|
||||||
// false will get a matching error code.
|
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER, framebufferObject.handle);
|
|
||||||
|
|
||||||
return framebufferObject.isComplete;
|
|
||||||
}
|
|
||||||
|
|
||||||
void QIOSContext::doneCurrent()
|
|
||||||
{
|
|
||||||
[EAGLContext setCurrentContext:nil];
|
|
||||||
}
|
|
||||||
|
|
||||||
void QIOSContext::swapBuffers(QPlatformSurface *surface)
|
|
||||||
{
|
|
||||||
Q_ASSERT(surface && (surface->surface()->surfaceType() == QSurface::OpenGLSurface
|
|
||||||
|| surface->surface()->surfaceType() == QSurface::RasterGLSurface));
|
|
||||||
|
|
||||||
if (surface->surface()->surfaceClass() == QSurface::Offscreen)
|
|
||||||
return; // Nothing to do
|
|
||||||
|
|
||||||
FramebufferObject &framebufferObject = backingFramebufferObjectFor(surface);
|
|
||||||
|
|
||||||
[EAGLContext setCurrentContext:m_eaglContext];
|
|
||||||
glBindRenderbuffer(GL_RENDERBUFFER, framebufferObject.colorRenderbuffer);
|
|
||||||
[m_eaglContext presentRenderbuffer:GL_RENDERBUFFER];
|
|
||||||
}
|
|
||||||
|
|
||||||
QIOSContext::FramebufferObject &QIOSContext::backingFramebufferObjectFor(QPlatformSurface *surface) const
|
|
||||||
{
|
|
||||||
// We keep track of default-FBOs in the root context of a share-group. This assumes
|
|
||||||
// that the contexts form a tree, where leaf nodes are always destroyed before their
|
|
||||||
// parents. If that assumption (based on the current implementation) doesn't hold we
|
|
||||||
// should probably use QOpenGLMultiGroupSharedResource to track the shared default-FBOs.
|
|
||||||
if (m_sharedContext)
|
|
||||||
return m_sharedContext->backingFramebufferObjectFor(surface);
|
|
||||||
|
|
||||||
Q_ASSERT(surface && surface->surface()->surfaceClass() == QSurface::Window);
|
|
||||||
QIOSWindow *window = static_cast<QIOSWindow *>(surface);
|
|
||||||
|
|
||||||
FramebufferObject &framebufferObject = m_framebufferObjects[window];
|
|
||||||
|
|
||||||
// Set up an FBO for the window if it hasn't been created yet
|
|
||||||
if (!framebufferObject.handle) {
|
if (!framebufferObject.handle) {
|
||||||
[EAGLContext setCurrentContext:m_eaglContext];
|
// Set up an FBO for the window if it hasn't been created yet
|
||||||
|
|
||||||
glGenFramebuffers(1, &framebufferObject.handle);
|
glGenFramebuffers(1, &framebufferObject.handle);
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER, framebufferObject.handle);
|
glBindFramebuffer(GL_FRAMEBUFFER, framebufferObject.handle);
|
||||||
|
|
||||||
@ -201,17 +164,17 @@ QIOSContext::FramebufferObject &QIOSContext::backingFramebufferObjectFor(QPlatfo
|
|||||||
framebufferObject.depthRenderbuffer);
|
framebufferObject.depthRenderbuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
connect(window, SIGNAL(destroyed(QObject*)), this, SLOT(windowDestroyed(QObject*)));
|
connect(static_cast<QIOSWindow *>(surface), SIGNAL(destroyed(QObject*)), this, SLOT(windowDestroyed(QObject*)));
|
||||||
|
} else {
|
||||||
|
glBindFramebuffer(GL_FRAMEBUFFER, framebufferObject.handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (needsRenderbufferResize(surface)) {
|
||||||
// Ensure that the FBO's buffers match the size of the layer
|
// Ensure that the FBO's buffers match the size of the layer
|
||||||
UIView *view = reinterpret_cast<UIView *>(window->winId());
|
CAEAGLLayer *layer = static_cast<QIOSWindow *>(surface)->eaglLayer();
|
||||||
CAEAGLLayer *layer = static_cast<CAEAGLLayer *>(view.layer);
|
qCDebug(lcQpaGLContext, "Reallocating renderbuffer storage - current: %dx%d, layer: %gx%g",
|
||||||
if (framebufferObject.renderbufferWidth != (layer.frame.size.width * layer.contentsScale) ||
|
framebufferObject.renderbufferWidth, framebufferObject.renderbufferHeight,
|
||||||
framebufferObject.renderbufferHeight != (layer.frame.size.height * layer.contentsScale)) {
|
layer.frame.size.width * layer.contentsScale, layer.frame.size.height * layer.contentsScale);
|
||||||
|
|
||||||
[EAGLContext setCurrentContext:m_eaglContext];
|
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER, framebufferObject.handle);
|
|
||||||
|
|
||||||
glBindRenderbuffer(GL_RENDERBUFFER, framebufferObject.colorRenderbuffer);
|
glBindRenderbuffer(GL_RENDERBUFFER, framebufferObject.colorRenderbuffer);
|
||||||
[m_eaglContext renderbufferStorage:GL_RENDERBUFFER fromDrawable:layer];
|
[m_eaglContext renderbufferStorage:GL_RENDERBUFFER fromDrawable:layer];
|
||||||
@ -234,12 +197,54 @@ QIOSContext::FramebufferObject &QIOSContext::backingFramebufferObjectFor(QPlatfo
|
|||||||
framebufferObject.isComplete = glCheckFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE;
|
framebufferObject.isComplete = glCheckFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE;
|
||||||
|
|
||||||
if (!framebufferObject.isComplete) {
|
if (!framebufferObject.isComplete) {
|
||||||
qWarning("QIOSContext failed to make complete framebuffer object (%s)",
|
qCWarning(lcQpaGLContext, "QIOSContext failed to make complete framebuffer object (%s)",
|
||||||
qPrintable(fboStatusString(glCheckFramebufferStatus(GL_FRAMEBUFFER))));
|
qPrintable(fboStatusString(glCheckFramebufferStatus(GL_FRAMEBUFFER))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return framebufferObject;
|
return framebufferObject.isComplete;
|
||||||
|
}
|
||||||
|
|
||||||
|
void QIOSContext::doneCurrent()
|
||||||
|
{
|
||||||
|
[EAGLContext setCurrentContext:nil];
|
||||||
|
}
|
||||||
|
|
||||||
|
void QIOSContext::swapBuffers(QPlatformSurface *surface)
|
||||||
|
{
|
||||||
|
Q_ASSERT_IS_GL_SURFACE(surface);
|
||||||
|
|
||||||
|
if (surface->surface()->surfaceClass() == QSurface::Offscreen)
|
||||||
|
return; // Nothing to do
|
||||||
|
|
||||||
|
if (!static_cast<QIOSWindow *>(surface)->isExposed()) {
|
||||||
|
qCWarning(lcQpaGLContext, "Detected swapBuffers on a non-exposed window, skipping flush");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
FramebufferObject &framebufferObject = backingFramebufferObjectFor(surface);
|
||||||
|
Q_ASSERT_X(framebufferObject.isComplete, "QIOSContext", "swapBuffers on incomplete FBO");
|
||||||
|
|
||||||
|
if (needsRenderbufferResize(surface)) {
|
||||||
|
qCWarning(lcQpaGLContext, "CAEAGLLayer was resized between makeCurrent and swapBuffers, skipping flush");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
[EAGLContext setCurrentContext:m_eaglContext];
|
||||||
|
glBindRenderbuffer(GL_RENDERBUFFER, framebufferObject.colorRenderbuffer);
|
||||||
|
[m_eaglContext presentRenderbuffer:GL_RENDERBUFFER];
|
||||||
|
}
|
||||||
|
|
||||||
|
QIOSContext::FramebufferObject &QIOSContext::backingFramebufferObjectFor(QPlatformSurface *surface) const
|
||||||
|
{
|
||||||
|
// We keep track of default-FBOs in the root context of a share-group. This assumes
|
||||||
|
// that the contexts form a tree, where leaf nodes are always destroyed before their
|
||||||
|
// parents. If that assumption (based on the current implementation) doesn't hold we
|
||||||
|
// should probably use QOpenGLMultiGroupSharedResource to track the shared default-FBOs.
|
||||||
|
if (m_sharedContext)
|
||||||
|
return m_sharedContext->backingFramebufferObjectFor(surface);
|
||||||
|
else
|
||||||
|
return m_framebufferObjects[surface];
|
||||||
}
|
}
|
||||||
|
|
||||||
GLuint QIOSContext::defaultFramebufferObject(QPlatformSurface *surface) const
|
GLuint QIOSContext::defaultFramebufferObject(QPlatformSurface *surface) const
|
||||||
@ -251,20 +256,42 @@ GLuint QIOSContext::defaultFramebufferObject(QPlatformSurface *surface) const
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return backingFramebufferObjectFor(surface).handle;
|
FramebufferObject &framebufferObject = backingFramebufferObjectFor(surface);
|
||||||
|
Q_ASSERT_X(framebufferObject.handle, "QIOSContext", "can't resolve default FBO before makeCurrent");
|
||||||
|
|
||||||
|
return framebufferObject.handle;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool QIOSContext::needsRenderbufferResize(QPlatformSurface *surface) const
|
||||||
|
{
|
||||||
|
Q_ASSERT(surface->surface()->surfaceClass() == QSurface::Window);
|
||||||
|
|
||||||
|
FramebufferObject &framebufferObject = backingFramebufferObjectFor(surface);
|
||||||
|
CAEAGLLayer *layer = static_cast<QIOSWindow *>(surface)->eaglLayer();
|
||||||
|
|
||||||
|
if (framebufferObject.renderbufferWidth != (layer.frame.size.width * layer.contentsScale))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if (framebufferObject.renderbufferHeight != (layer.frame.size.height * layer.contentsScale))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QIOSContext::windowDestroyed(QObject *object)
|
void QIOSContext::windowDestroyed(QObject *object)
|
||||||
{
|
{
|
||||||
QIOSWindow *window = static_cast<QIOSWindow *>(object);
|
QIOSWindow *window = static_cast<QIOSWindow *>(object);
|
||||||
if (m_framebufferObjects.contains(window)) {
|
if (!m_framebufferObjects.contains(window))
|
||||||
|
return;
|
||||||
|
|
||||||
|
qCDebug(lcQpaGLContext) << object << "destroyed, deleting corresponding FBO";
|
||||||
|
|
||||||
EAGLContext *originalContext = [EAGLContext currentContext];
|
EAGLContext *originalContext = [EAGLContext currentContext];
|
||||||
[EAGLContext setCurrentContext:m_eaglContext];
|
[EAGLContext setCurrentContext:m_eaglContext];
|
||||||
deleteBuffers(m_framebufferObjects[window]);
|
deleteBuffers(m_framebufferObjects[window]);
|
||||||
m_framebufferObjects.remove(window);
|
m_framebufferObjects.remove(window);
|
||||||
[EAGLContext setCurrentContext:originalContext];
|
[EAGLContext setCurrentContext:originalContext];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
QFunctionPointer QIOSContext::getProcAddress(const char *functionName)
|
QFunctionPointer QIOSContext::getProcAddress(const char *functionName)
|
||||||
{
|
{
|
||||||
|
@ -71,9 +71,13 @@ public:
|
|||||||
UIScreen *uiScreen() const;
|
UIScreen *uiScreen() const;
|
||||||
UIWindow *uiWindow() const;
|
UIWindow *uiWindow() const;
|
||||||
|
|
||||||
|
void setUpdatesPaused(bool);
|
||||||
|
|
||||||
void updateProperties();
|
void updateProperties();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void deliverUpdateRequests() const;
|
||||||
|
|
||||||
UIScreen *m_uiScreen;
|
UIScreen *m_uiScreen;
|
||||||
UIWindow *m_uiWindow;
|
UIWindow *m_uiWindow;
|
||||||
QRect m_geometry;
|
QRect m_geometry;
|
||||||
@ -82,6 +86,7 @@ private:
|
|||||||
uint m_physicalDpi;
|
uint m_physicalDpi;
|
||||||
QSizeF m_physicalSize;
|
QSizeF m_physicalSize;
|
||||||
QIOSOrientationListener *m_orientationListener;
|
QIOSOrientationListener *m_orientationListener;
|
||||||
|
CADisplayLink *m_displayLink;
|
||||||
};
|
};
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
@ -46,8 +46,31 @@
|
|||||||
#include "qiosviewcontroller.h"
|
#include "qiosviewcontroller.h"
|
||||||
#include "quiview.h"
|
#include "quiview.h"
|
||||||
|
|
||||||
|
#include <QtGui/private/qwindow_p.h>
|
||||||
|
|
||||||
#include <sys/sysctl.h>
|
#include <sys/sysctl.h>
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------------
|
||||||
|
|
||||||
|
typedef void (^DisplayLinkBlock)(CADisplayLink *displayLink);
|
||||||
|
|
||||||
|
@implementation UIScreen (DisplayLinkBlock)
|
||||||
|
- (CADisplayLink*)displayLinkWithBlock:(DisplayLinkBlock)block
|
||||||
|
{
|
||||||
|
return [self displayLinkWithTarget:[[block copy] autorelease]
|
||||||
|
selector:@selector(invokeDisplayLinkBlock:)];
|
||||||
|
}
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation NSObject (DisplayLinkBlock)
|
||||||
|
- (void)invokeDisplayLinkBlock:(CADisplayLink *)sender
|
||||||
|
{
|
||||||
|
DisplayLinkBlock block = static_cast<id>(self);
|
||||||
|
block(sender);
|
||||||
|
}
|
||||||
|
@end
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------------
|
// -------------------------------------------------------------------------
|
||||||
|
|
||||||
static QIOSScreen* qtPlatformScreenFor(UIScreen *uiScreen)
|
static QIOSScreen* qtPlatformScreenFor(UIScreen *uiScreen)
|
||||||
@ -218,10 +241,16 @@ QIOSScreen::QIOSScreen(UIScreen *screen)
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateProperties();
|
updateProperties();
|
||||||
|
|
||||||
|
m_displayLink = [m_uiScreen displayLinkWithBlock:^(CADisplayLink *) { deliverUpdateRequests(); }];
|
||||||
|
m_displayLink.paused = YES; // Enabled when clients call QWindow::requestUpdate()
|
||||||
|
[m_displayLink addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode];
|
||||||
}
|
}
|
||||||
|
|
||||||
QIOSScreen::~QIOSScreen()
|
QIOSScreen::~QIOSScreen()
|
||||||
{
|
{
|
||||||
|
[m_displayLink invalidate];
|
||||||
|
|
||||||
[m_orientationListener release];
|
[m_orientationListener release];
|
||||||
[m_uiWindow release];
|
[m_uiWindow release];
|
||||||
}
|
}
|
||||||
@ -304,6 +333,35 @@ void QIOSScreen::updateProperties()
|
|||||||
QWindowSystemInterface::handleScreenGeometryChange(screen(), m_geometry, m_availableGeometry);
|
QWindowSystemInterface::handleScreenGeometryChange(screen(), m_geometry, m_availableGeometry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QIOSScreen::setUpdatesPaused(bool paused)
|
||||||
|
{
|
||||||
|
m_displayLink.paused = paused;
|
||||||
|
}
|
||||||
|
|
||||||
|
void QIOSScreen::deliverUpdateRequests() const
|
||||||
|
{
|
||||||
|
bool pauseUpdates = true;
|
||||||
|
|
||||||
|
QList<QWindow*> windows = QGuiApplication::allWindows();
|
||||||
|
for (int i = 0; i < windows.size(); ++i) {
|
||||||
|
if (platformScreenForWindow(windows.at(i)) != this)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
QWindowPrivate *wp = static_cast<QWindowPrivate *>(QObjectPrivate::get(windows.at(i)));
|
||||||
|
if (!wp->updateRequestPending)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
wp->deliverUpdateRequest();
|
||||||
|
|
||||||
|
// Another update request was triggered, keep the display link running
|
||||||
|
if (wp->updateRequestPending)
|
||||||
|
pauseUpdates = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Pause the display link if there are no pending update requests
|
||||||
|
m_displayLink.paused = pauseUpdates;
|
||||||
|
}
|
||||||
|
|
||||||
QRect QIOSScreen::geometry() const
|
QRect QIOSScreen::geometry() const
|
||||||
{
|
{
|
||||||
return m_geometry;
|
return m_geometry;
|
||||||
|
@ -88,6 +88,10 @@ public:
|
|||||||
|
|
||||||
QSurfaceFormat format() const Q_DECL_OVERRIDE;
|
QSurfaceFormat format() const Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
|
void requestUpdate() Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
|
CAEAGLLayer *eaglLayer() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void applicationStateChanged(Qt::ApplicationState state);
|
void applicationStateChanged(Qt::ApplicationState state);
|
||||||
void applyGeometry(const QRect &rect);
|
void applyGeometry(const QRect &rect);
|
||||||
|
@ -377,6 +377,17 @@ void QIOSWindow::clearAccessibleCache()
|
|||||||
[m_view clearAccessibleCache];
|
[m_view clearAccessibleCache];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QIOSWindow::requestUpdate()
|
||||||
|
{
|
||||||
|
static_cast<QIOSScreen *>(screen())->setUpdatesPaused(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
CAEAGLLayer *QIOSWindow::eaglLayer() const
|
||||||
|
{
|
||||||
|
Q_ASSERT([m_view.layer isKindOfClass:[CAEAGLLayer class]]);
|
||||||
|
return static_cast<CAEAGLLayer *>(m_view.layer);
|
||||||
|
}
|
||||||
|
|
||||||
#include "moc_qioswindow.cpp"
|
#include "moc_qioswindow.cpp"
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
@ -1333,21 +1333,21 @@ QFunctionPointer QWindowsGLContext::getProcAddress(const char *procName)
|
|||||||
// Even though we use QFunctionPointer, it does not mean the function can be called.
|
// Even though we use QFunctionPointer, it does not mean the function can be called.
|
||||||
// It will need to be cast to the proper function type with the correct calling
|
// It will need to be cast to the proper function type with the correct calling
|
||||||
// convention. QFunctionPointer is nothing more than a glorified void* here.
|
// convention. QFunctionPointer is nothing more than a glorified void* here.
|
||||||
QFunctionPointer procAddress = reinterpret_cast<QFunctionPointer>(QOpenGLStaticContext::opengl32.wglGetProcAddress(procName));
|
PROC procAddress = QOpenGLStaticContext::opengl32.wglGetProcAddress(procName);
|
||||||
|
|
||||||
// We support AllGLFunctionsQueryable, which means this function must be able to
|
// We support AllGLFunctionsQueryable, which means this function must be able to
|
||||||
// return a function pointer even for functions that are in GL.h and exported
|
// return a function pointer even for functions that are in GL.h and exported
|
||||||
// normally from opengl32.dll. wglGetProcAddress() is not guaranteed to work for such
|
// normally from opengl32.dll. wglGetProcAddress() is not guaranteed to work for such
|
||||||
// functions, however in QT_OPENGL_DYNAMIC builds QOpenGLFunctions will just blindly
|
// functions, however in QT_OPENGL_DYNAMIC builds QOpenGLFunctions will just blindly
|
||||||
// call into here for _any_ OpenGL function.
|
// call into here for _any_ OpenGL function.
|
||||||
if (!procAddress || procAddress == reinterpret_cast<void *>(0x1) || procAddress == reinterpret_cast<void *>(0x2)
|
if (!procAddress || procAddress == reinterpret_cast<PROC>(0x1) || procAddress == reinterpret_cast<PROC>(0x2)
|
||||||
|| procAddress == reinterpret_cast<void *>(0x3) || procAddress == reinterpret_cast<void *>(-1))
|
|| procAddress == reinterpret_cast<PROC>(0x3) || procAddress == reinterpret_cast<PROC>(-1))
|
||||||
procAddress = reinterpret_cast<QFunctionPointer>(QOpenGLStaticContext::opengl32.resolve(procName));
|
procAddress = QOpenGLStaticContext::opengl32.resolve(procName);
|
||||||
|
|
||||||
if (QWindowsContext::verbose > 1)
|
if (QWindowsContext::verbose > 1)
|
||||||
qCDebug(lcQpaGl) << __FUNCTION__ << procName << QOpenGLStaticContext::opengl32.wglGetCurrentContext() << "returns" << procAddress;
|
qCDebug(lcQpaGl) << __FUNCTION__ << procName << QOpenGLStaticContext::opengl32.wglGetCurrentContext() << "returns" << procAddress;
|
||||||
|
|
||||||
return procAddress;
|
return reinterpret_cast<QFunctionPointer>(procAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
@ -31,7 +31,7 @@ contains(QT_CONFIG, xcb-qt) {
|
|||||||
DEFINES += XCB_USE_RENDER
|
DEFINES += XCB_USE_RENDER
|
||||||
XCB_DIR = $$clean_path($$PWD/../../../../3rdparty/xcb)
|
XCB_DIR = $$clean_path($$PWD/../../../../3rdparty/xcb)
|
||||||
INCLUDEPATH += $$XCB_DIR/include $$XCB_DIR/include/xcb $$XCB_DIR/sysinclude
|
INCLUDEPATH += $$XCB_DIR/include $$XCB_DIR/include/xcb $$XCB_DIR/sysinclude
|
||||||
LIBS += -lxcb -L$$OUT_PWD/xcb-static -lxcb-static
|
LIBS += -lxcb -L$$MODULE_BASE_OUTDIR/lib -lxcb-static$$qtPlatformTargetSuffix()
|
||||||
} else {
|
} else {
|
||||||
LIBS += -lxcb -lxcb-image -lxcb-icccm -lxcb-sync -lxcb-xfixes -lxcb-shm -lxcb-randr -lxcb-shape -lxcb-keysyms
|
LIBS += -lxcb -lxcb-image -lxcb-icccm -lxcb-sync -lxcb-xfixes -lxcb-shm -lxcb-randr -lxcb-shape -lxcb-keysyms
|
||||||
!contains(DEFINES, QT_NO_XKB):LIBS += -lxcb-xkb
|
!contains(DEFINES, QT_NO_XKB):LIBS += -lxcb-xkb
|
||||||
|
@ -88,7 +88,7 @@ contains(QT_CONFIG, xcb-qt) {
|
|||||||
DEFINES += XCB_USE_RENDER
|
DEFINES += XCB_USE_RENDER
|
||||||
XCB_DIR = ../../../3rdparty/xcb
|
XCB_DIR = ../../../3rdparty/xcb
|
||||||
INCLUDEPATH += $$XCB_DIR/include $$XCB_DIR/sysinclude
|
INCLUDEPATH += $$XCB_DIR/include $$XCB_DIR/sysinclude
|
||||||
LIBS += -lxcb -L$$OUT_PWD/xcb-static -lxcb-static
|
LIBS += -lxcb -L$$MODULE_BASE_OUTDIR/lib -lxcb-static$$qtPlatformTargetSuffix()
|
||||||
} else {
|
} else {
|
||||||
LIBS += -lxcb -lxcb-image -lxcb-icccm -lxcb-sync -lxcb-xfixes -lxcb-shm -lxcb-randr -lxcb-shape -lxcb-keysyms -lxcb-xinerama
|
LIBS += -lxcb -lxcb-image -lxcb-icccm -lxcb-sync -lxcb-xfixes -lxcb-shm -lxcb-randr -lxcb-shape -lxcb-keysyms -lxcb-xinerama
|
||||||
!contains(DEFINES, QT_NO_XKB):LIBS += -lxcb-xkb
|
!contains(DEFINES, QT_NO_XKB):LIBS += -lxcb-xkb
|
||||||
|
@ -428,6 +428,7 @@ bool QMYSQLResultPrivate::bindInValues()
|
|||||||
bind->buffer_length = f.bufLength = fieldInfo->length + 1;
|
bind->buffer_length = f.bufLength = fieldInfo->length + 1;
|
||||||
bind->is_null = &f.nullIndicator;
|
bind->is_null = &f.nullIndicator;
|
||||||
bind->length = &f.bufLength;
|
bind->length = &f.bufLength;
|
||||||
|
bind->is_unsigned = fieldInfo->flags & UNSIGNED_FLAG ? 1 : 0;
|
||||||
f.outField=field;
|
f.outField=field;
|
||||||
|
|
||||||
++i;
|
++i;
|
||||||
|
@ -170,7 +170,7 @@ contains(QT_CONFIG, concurrent):SUBDIRS += src_concurrent
|
|||||||
contains(QT_CONFIG, png) {
|
contains(QT_CONFIG, png) {
|
||||||
SUBDIRS += src_3rdparty_libpng
|
SUBDIRS += src_3rdparty_libpng
|
||||||
src_3rdparty_freetype.depends += src_3rdparty_libpng
|
src_3rdparty_freetype.depends += src_3rdparty_libpng
|
||||||
src_plugins.depends += src_3rdparty_libpng
|
src_gui.depends += src_3rdparty_libpng
|
||||||
}
|
}
|
||||||
contains(QT_CONFIG, freetype):!contains(QT_CONFIG, system-freetype) {
|
contains(QT_CONFIG, freetype):!contains(QT_CONFIG, system-freetype) {
|
||||||
SUBDIRS += src_3rdparty_freetype
|
SUBDIRS += src_3rdparty_freetype
|
||||||
|
@ -159,7 +159,7 @@ public:
|
|||||||
#if QT_DEPRECATED_SINCE(5, 0)
|
#if QT_DEPRECATED_SINCE(5, 0)
|
||||||
QT_DEPRECATED inline QGraphicsItem *itemAt(const QPointF &position) const {
|
QT_DEPRECATED inline QGraphicsItem *itemAt(const QPointF &position) const {
|
||||||
QList<QGraphicsItem *> itemsAtPoint = items(position);
|
QList<QGraphicsItem *> itemsAtPoint = items(position);
|
||||||
return itemsAtPoint.isEmpty() ? 0 : itemsAtPoint.first();
|
return itemsAtPoint.isEmpty() ? Q_NULLPTR : itemsAtPoint.first();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
QGraphicsItem *itemAt(const QPointF &pos, const QTransform &deviceTransform) const;
|
QGraphicsItem *itemAt(const QPointF &pos, const QTransform &deviceTransform) const;
|
||||||
@ -173,7 +173,7 @@ public:
|
|||||||
#if QT_DEPRECATED_SINCE(5, 0)
|
#if QT_DEPRECATED_SINCE(5, 0)
|
||||||
QT_DEPRECATED inline QGraphicsItem *itemAt(qreal x, qreal y) const {
|
QT_DEPRECATED inline QGraphicsItem *itemAt(qreal x, qreal y) const {
|
||||||
QList<QGraphicsItem *> itemsAtPoint = items(QPointF(x, y));
|
QList<QGraphicsItem *> itemsAtPoint = items(QPointF(x, y));
|
||||||
return itemsAtPoint.isEmpty() ? 0 : itemsAtPoint.first();
|
return itemsAtPoint.isEmpty() ? Q_NULLPTR : itemsAtPoint.first();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
inline QGraphicsItem *itemAt(qreal x, qreal y, const QTransform &deviceTransform) const
|
inline QGraphicsItem *itemAt(qreal x, qreal y, const QTransform &deviceTransform) const
|
||||||
|
@ -2302,8 +2302,8 @@ QModelIndex QTreeView::moveCursor(CursorAction cursorAction, Qt::KeyboardModifie
|
|||||||
int visualColumn = d->header->visualIndex(current.column()) + 1;
|
int visualColumn = d->header->visualIndex(current.column()) + 1;
|
||||||
while (visualColumn < d->model->columnCount(current.parent()) && isColumnHidden(d->header->logicalIndex(visualColumn)))
|
while (visualColumn < d->model->columnCount(current.parent()) && isColumnHidden(d->header->logicalIndex(visualColumn)))
|
||||||
visualColumn++;
|
visualColumn++;
|
||||||
|
const int newColumn = d->header->logicalIndex(visualColumn);
|
||||||
QModelIndex next = current.sibling(current.row(), visualColumn);
|
const QModelIndex next = current.sibling(current.row(), newColumn);
|
||||||
if (next.isValid())
|
if (next.isValid())
|
||||||
return next;
|
return next;
|
||||||
}
|
}
|
||||||
|
@ -237,22 +237,9 @@ void QSystemTrayIconSys::setIconContents(NOTIFYICONDATA &tnd)
|
|||||||
qStringToLimitedWCharArray(tip, tnd.szTip, sizeof(tnd.szTip)/sizeof(wchar_t));
|
qStringToLimitedWCharArray(tip, tnd.szTip, sizeof(tnd.szTip)/sizeof(wchar_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
static int iconFlag( QSystemTrayIcon::MessageIcon icon )
|
#ifndef NIIF_LARGE_ICON
|
||||||
{
|
# define NIIF_LARGE_ICON 0x00000020
|
||||||
switch (icon) {
|
#endif
|
||||||
case QSystemTrayIcon::Information:
|
|
||||||
return NIIF_INFO;
|
|
||||||
case QSystemTrayIcon::Warning:
|
|
||||||
return NIIF_WARNING;
|
|
||||||
case QSystemTrayIcon::Critical:
|
|
||||||
return NIIF_ERROR;
|
|
||||||
case QSystemTrayIcon::NoIcon:
|
|
||||||
return NIIF_NONE;
|
|
||||||
default:
|
|
||||||
Q_ASSERT_X(false, "QSystemTrayIconSys::showMessage", "Invalid QSystemTrayIcon::MessageIcon value");
|
|
||||||
return NIIF_NONE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool QSystemTrayIconSys::showMessage(const QString &title, const QString &message, QSystemTrayIcon::MessageIcon type, uint uSecs)
|
bool QSystemTrayIconSys::showMessage(const QString &title, const QString &message, QSystemTrayIcon::MessageIcon type, uint uSecs)
|
||||||
{
|
{
|
||||||
@ -262,7 +249,22 @@ bool QSystemTrayIconSys::showMessage(const QString &title, const QString &messag
|
|||||||
qStringToLimitedWCharArray(title, tnd.szInfoTitle, 64);
|
qStringToLimitedWCharArray(title, tnd.szInfoTitle, 64);
|
||||||
|
|
||||||
tnd.uID = q_uNOTIFYICONID;
|
tnd.uID = q_uNOTIFYICONID;
|
||||||
tnd.dwInfoFlags = iconFlag(type);
|
switch (type) {
|
||||||
|
case QSystemTrayIcon::Information:
|
||||||
|
tnd.dwInfoFlags = NIIF_INFO;
|
||||||
|
break;
|
||||||
|
case QSystemTrayIcon::Warning:
|
||||||
|
tnd.dwInfoFlags = NIIF_WARNING;
|
||||||
|
break;
|
||||||
|
case QSystemTrayIcon::Critical:
|
||||||
|
tnd.dwInfoFlags = NIIF_ERROR;
|
||||||
|
break;
|
||||||
|
case QSystemTrayIcon::NoIcon:
|
||||||
|
tnd.dwInfoFlags = hIcon ? NIIF_USER : NIIF_NONE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (QSysInfo::windowsVersion() >= QSysInfo::WV_VISTA)
|
||||||
|
tnd.dwInfoFlags |= NIIF_LARGE_ICON;
|
||||||
tnd.cbSize = notifyIconSize;
|
tnd.cbSize = notifyIconSize;
|
||||||
tnd.hWnd = m_hwnd;
|
tnd.hWnd = m_hwnd;
|
||||||
tnd.uTimeout = uSecs;
|
tnd.uTimeout = uSecs;
|
||||||
@ -303,9 +305,10 @@ HICON QSystemTrayIconSys::createIcon()
|
|||||||
const QIcon icon = q->icon();
|
const QIcon icon = q->icon();
|
||||||
if (icon.isNull())
|
if (icon.isNull())
|
||||||
return oldIcon;
|
return oldIcon;
|
||||||
const int iconSizeX = GetSystemMetrics(SM_CXSMICON);
|
const QSize requestedSize = QSysInfo::windowsVersion() >= QSysInfo::WV_VISTA
|
||||||
const int iconSizeY = GetSystemMetrics(SM_CYSMICON);
|
? QSize(GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON))
|
||||||
const QSize size = icon.actualSize(QSize(iconSizeX, iconSizeY));
|
: QSize(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON));
|
||||||
|
const QSize size = icon.actualSize(requestedSize);
|
||||||
const QPixmap pm = icon.pixmap(size);
|
const QPixmap pm = icon.pixmap(size);
|
||||||
if (pm.isNull())
|
if (pm.isNull())
|
||||||
return oldIcon;
|
return oldIcon;
|
||||||
|
@ -2488,6 +2488,35 @@ void tst_QImage::inplaceRgbSwapped()
|
|||||||
}
|
}
|
||||||
|
|
||||||
QCOMPARE(imageSwapped.constScanLine(0), orginalPtr);
|
QCOMPARE(imageSwapped.constScanLine(0), orginalPtr);
|
||||||
|
|
||||||
|
for (int rw = 0; rw <= 1; rw++) {
|
||||||
|
// Test attempted inplace conversion of images created on existing buffer
|
||||||
|
uchar *volatileData = 0;
|
||||||
|
QImage orig = imageSwapped;
|
||||||
|
QImage dataSwapped;
|
||||||
|
{
|
||||||
|
QVERIFY(!orig.isNull());
|
||||||
|
volatileData = new uchar[orig.byteCount()];
|
||||||
|
memcpy(volatileData, orig.constBits(), orig.byteCount());
|
||||||
|
|
||||||
|
QImage dataImage;
|
||||||
|
if (rw)
|
||||||
|
dataImage = QImage(volatileData, orig.width(), orig.height(), orig.format());
|
||||||
|
else
|
||||||
|
dataImage = QImage((const uchar *)volatileData, orig.width(), orig.height(), orig.format());
|
||||||
|
|
||||||
|
if (orig.colorCount())
|
||||||
|
dataImage.setColorTable(orig.colorTable());
|
||||||
|
|
||||||
|
dataSwapped = std::move(dataImage).rgbSwapped();
|
||||||
|
QVERIFY(!dataSwapped.isNull());
|
||||||
|
delete[] volatileData;
|
||||||
|
}
|
||||||
|
|
||||||
|
QVERIFY2(dataSwapped.constBits() != volatileData, rw ? "non-const" : "const");
|
||||||
|
QCOMPARE(dataSwapped, orig.rgbSwapped());
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2570,6 +2599,35 @@ void tst_QImage::inplaceMirrored()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
QCOMPARE(imageMirrored.constScanLine(0), originalPtr);
|
QCOMPARE(imageMirrored.constScanLine(0), originalPtr);
|
||||||
|
|
||||||
|
for (int rw = 0; rw <= 1; rw++) {
|
||||||
|
// Test attempted inplace conversion of images created on existing buffer
|
||||||
|
uchar *volatileData = 0;
|
||||||
|
QImage orig = imageMirrored;
|
||||||
|
QImage dataSwapped;
|
||||||
|
{
|
||||||
|
QVERIFY(!orig.isNull());
|
||||||
|
volatileData = new uchar[orig.byteCount()];
|
||||||
|
memcpy(volatileData, orig.constBits(), orig.byteCount());
|
||||||
|
|
||||||
|
QImage dataImage;
|
||||||
|
if (rw)
|
||||||
|
dataImage = QImage(volatileData, orig.width(), orig.height(), orig.format());
|
||||||
|
else
|
||||||
|
dataImage = QImage((const uchar *)volatileData, orig.width(), orig.height(), orig.format());
|
||||||
|
|
||||||
|
if (orig.colorCount())
|
||||||
|
dataImage.setColorTable(orig.colorTable());
|
||||||
|
|
||||||
|
dataSwapped = std::move(dataImage).mirrored(swap_horizontal, swap_vertical);
|
||||||
|
QVERIFY(!dataSwapped.isNull());
|
||||||
|
delete[] volatileData;
|
||||||
|
}
|
||||||
|
|
||||||
|
QVERIFY2(dataSwapped.constBits() != volatileData, rw ? "non-const" : "const");
|
||||||
|
QCOMPARE(dataSwapped, orig.mirrored(swap_horizontal, swap_vertical));
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2722,16 +2780,24 @@ void tst_QImage::inplaceRgbConversion()
|
|||||||
static const quint32 readOnlyData[] = { 0xff0102ffU, 0xff0506ffU, 0xff0910ffU, 0xff1314ffU };
|
static const quint32 readOnlyData[] = { 0xff0102ffU, 0xff0506ffU, 0xff0910ffU, 0xff1314ffU };
|
||||||
quint32 readWriteData[] = { 0xff0102ffU, 0xff0506ffU, 0xff0910ffU, 0xff1314ffU };
|
quint32 readWriteData[] = { 0xff0102ffU, 0xff0506ffU, 0xff0910ffU, 0xff1314ffU };
|
||||||
|
|
||||||
|
QImage roInplaceConverted;
|
||||||
|
QImage rwInplaceConverted;
|
||||||
|
|
||||||
|
{
|
||||||
QImage roImage((const uchar *)readOnlyData, 2, 2, format);
|
QImage roImage((const uchar *)readOnlyData, 2, 2, format);
|
||||||
QImage roInplaceConverted = std::move(roImage).convertToFormat(dest_format);
|
roInplaceConverted = std::move(roImage).convertToFormat(dest_format);
|
||||||
|
|
||||||
QImage rwImage((uchar *)readWriteData, 2, 2, format);
|
QImage rwImage((uchar *)readWriteData, 2, 2, format);
|
||||||
QImage rwInplaceConverted = std::move(rwImage).convertToFormat(dest_format);
|
rwInplaceConverted = std::move(rwImage).convertToFormat(dest_format);
|
||||||
|
}
|
||||||
|
|
||||||
QImage roImage2((const uchar *)readOnlyData, 2, 2, format);
|
QImage roImage2((const uchar *)readOnlyData, 2, 2, format);
|
||||||
QImage normalConverted = roImage2.convertToFormat(dest_format);
|
QImage normalConverted = roImage2.convertToFormat(dest_format);
|
||||||
|
|
||||||
|
QVERIFY(roInplaceConverted.constBits() != (const uchar *)readOnlyData);
|
||||||
QCOMPARE(normalConverted, roInplaceConverted);
|
QCOMPARE(normalConverted, roInplaceConverted);
|
||||||
|
|
||||||
|
QVERIFY(rwInplaceConverted.constBits() != (const uchar *)readWriteData);
|
||||||
QCOMPARE(normalConverted, rwInplaceConverted);
|
QCOMPARE(normalConverted, rwInplaceConverted);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
13
tests/auto/network/socket/qtcpsocket/BLACKLIST
Normal file
13
tests/auto/network/socket/qtcpsocket/BLACKLIST
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
[bindThenResolveHost:first-fail]
|
||||||
|
windows
|
||||||
|
[bind:[::]]
|
||||||
|
windows
|
||||||
|
[bind:[::]:randomport]
|
||||||
|
windows
|
||||||
|
[invalidProxy:socks5-on-http]
|
||||||
|
windows
|
||||||
|
[disconnectWhileLookingUp]
|
||||||
|
windows
|
||||||
|
[timeoutConnect:ip]
|
||||||
|
windows
|
||||||
|
]
|
@ -15,5 +15,3 @@ win32 {
|
|||||||
} else {
|
} else {
|
||||||
DESTDIR = ../
|
DESTDIR = ../
|
||||||
}
|
}
|
||||||
|
|
||||||
win32: CONFIG += insignificant_test # Hangs in release builds
|
|
||||||
|
@ -1,8 +1,28 @@
|
|||||||
[multicast:same bind, group ipv6 address]
|
[multicast:same bind, group ipv6 address]
|
||||||
*
|
*
|
||||||
[multicast:valid bind, group ipv6 address]
|
[multicast]
|
||||||
osx
|
osx
|
||||||
[multicast:dual bind, group ipv6 address]
|
[writeDatagramToNonExistingPeer]
|
||||||
|
windows
|
||||||
osx
|
osx
|
||||||
[multicast:same bind, group ipv4 address]
|
[asyncReadDatagram]
|
||||||
|
windows
|
||||||
osx
|
osx
|
||||||
|
[multicastLeaveAfterClose]
|
||||||
|
osx
|
||||||
|
[readyRead]
|
||||||
|
osx
|
||||||
|
[readyReadForEmptyDatagram]
|
||||||
|
osx
|
||||||
|
[echo]
|
||||||
|
linux
|
||||||
|
osx
|
||||||
|
[ipv6Loop]
|
||||||
|
osx
|
||||||
|
[loop]
|
||||||
|
osx
|
||||||
|
[broadcasting]
|
||||||
|
osx
|
||||||
|
[zeroLengthDatagram]
|
||||||
|
osx
|
||||||
|
|
||||||
|
@ -16,5 +16,3 @@ win32 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TARGET = tst_qudpsocket
|
TARGET = tst_qudpsocket
|
||||||
|
|
||||||
CONFIG+=insignificant_test # QTBUG-25367, QTBUG-25368
|
|
||||||
|
@ -206,6 +206,7 @@ private slots:
|
|||||||
void ignoreSslErrorsList();
|
void ignoreSslErrorsList();
|
||||||
void ignoreSslErrorsListWithSlot_data();
|
void ignoreSslErrorsListWithSlot_data();
|
||||||
void ignoreSslErrorsListWithSlot();
|
void ignoreSslErrorsListWithSlot();
|
||||||
|
void abortOnSslErrors();
|
||||||
void readFromClosedSocket();
|
void readFromClosedSocket();
|
||||||
void writeBigChunk();
|
void writeBigChunk();
|
||||||
void blacklistedCertificates();
|
void blacklistedCertificates();
|
||||||
@ -254,6 +255,11 @@ protected slots:
|
|||||||
{
|
{
|
||||||
socket->ignoreSslErrors();
|
socket->ignoreSslErrors();
|
||||||
}
|
}
|
||||||
|
void abortOnErrorSlot()
|
||||||
|
{
|
||||||
|
QSslSocket *sock = static_cast<QSslSocket *>(sender());
|
||||||
|
sock->abort();
|
||||||
|
}
|
||||||
void untrustedWorkaroundSlot(const QList<QSslError> &errors)
|
void untrustedWorkaroundSlot(const QList<QSslError> &errors)
|
||||||
{
|
{
|
||||||
if (errors.size() == 1 &&
|
if (errors.size() == 1 &&
|
||||||
@ -2311,6 +2317,27 @@ void tst_QSslSocket::ignoreSslErrorsListWithSlot()
|
|||||||
QSKIP("Skipping flaky test - See QTBUG-29941");
|
QSKIP("Skipping flaky test - See QTBUG-29941");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void tst_QSslSocket::abortOnSslErrors()
|
||||||
|
{
|
||||||
|
QFETCH_GLOBAL(bool, setProxy);
|
||||||
|
if (setProxy)
|
||||||
|
return;
|
||||||
|
|
||||||
|
SslServer server;
|
||||||
|
QVERIFY(server.listen());
|
||||||
|
|
||||||
|
QSslSocket clientSocket;
|
||||||
|
connect(&clientSocket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(abortOnErrorSlot()));
|
||||||
|
clientSocket.connectToHostEncrypted("127.0.0.1", server.serverPort());
|
||||||
|
clientSocket.ignoreSslErrors();
|
||||||
|
|
||||||
|
QEventLoop loop;
|
||||||
|
QTimer::singleShot(1000, &loop, SLOT(quit()));
|
||||||
|
loop.exec();
|
||||||
|
|
||||||
|
QCOMPARE(clientSocket.state(), QAbstractSocket::UnconnectedState);
|
||||||
|
}
|
||||||
|
|
||||||
// make sure a closed socket has no bytesAvailable()
|
// make sure a closed socket has no bytesAvailable()
|
||||||
// related to https://bugs.webkit.org/show_bug.cgi?id=28016
|
// related to https://bugs.webkit.org/show_bug.cgi?id=28016
|
||||||
void tst_QSslSocket::readFromClosedSocket()
|
void tst_QSslSocket::readFromClosedSocket()
|
||||||
|
@ -228,6 +228,9 @@ private slots:
|
|||||||
void QTBUG_36211_data() { generic_data("QPSQL"); }
|
void QTBUG_36211_data() { generic_data("QPSQL"); }
|
||||||
void QTBUG_36211();
|
void QTBUG_36211();
|
||||||
|
|
||||||
|
void QTBUG_53969_data() { generic_data("QMYSQL"); }
|
||||||
|
void QTBUG_53969();
|
||||||
|
|
||||||
void sqlite_constraint_data() { generic_data("QSQLITE"); }
|
void sqlite_constraint_data() { generic_data("QSQLITE"); }
|
||||||
void sqlite_constraint();
|
void sqlite_constraint();
|
||||||
|
|
||||||
@ -3647,6 +3650,42 @@ void tst_QSqlQuery::QTBUG_36211()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void tst_QSqlQuery::QTBUG_53969()
|
||||||
|
{
|
||||||
|
QFETCH( QString, dbName );
|
||||||
|
QVector<int> values = QVector<int>() << 10 << 20 << 127 << 128 << 1, tableValues;
|
||||||
|
QSqlDatabase db = QSqlDatabase::database( dbName );
|
||||||
|
CHECK_DATABASE( db );
|
||||||
|
tableValues.reserve(values.size());
|
||||||
|
if (tst_Databases::getDatabaseType(db) == QSqlDriver::MySqlServer) {
|
||||||
|
const QString tableName(qTableName("bug53969", __FILE__, db));
|
||||||
|
tst_Databases::safeDropTable( db, tableName );
|
||||||
|
|
||||||
|
QSqlQuery q(db);
|
||||||
|
QVERIFY_SQL(q, exec(QString("CREATE TABLE %1 (id INT AUTO_INCREMENT PRIMARY KEY, "
|
||||||
|
"test_number TINYINT(3) UNSIGNED)")
|
||||||
|
.arg(tableName)));
|
||||||
|
|
||||||
|
QVERIFY_SQL(q, prepare("INSERT INTO " + tableName + " (test_number) VALUES (:value)"));
|
||||||
|
|
||||||
|
QVector<int>::iterator begin = values.begin(), end = values.end(), it;
|
||||||
|
for (it = begin; it != end; ++it) {
|
||||||
|
q.bindValue(":value", *it);
|
||||||
|
QVERIFY_SQL(q, exec());
|
||||||
|
}
|
||||||
|
|
||||||
|
QVERIFY_SQL(q, prepare("SELECT test_number FROM " + tableName));
|
||||||
|
QVERIFY_SQL(q, exec());
|
||||||
|
|
||||||
|
while (q.next()) {
|
||||||
|
bool ok;
|
||||||
|
tableValues.push_back(q.value(0).toUInt(&ok));
|
||||||
|
QVERIFY(ok);
|
||||||
|
}
|
||||||
|
QCOMPARE(values, tableValues);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void tst_QSqlQuery::oraOCINumber()
|
void tst_QSqlQuery::oraOCINumber()
|
||||||
{
|
{
|
||||||
QFETCH( QString, dbName );
|
QFETCH( QString, dbName );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user