Merge remote-tracking branch 'origin/5.6' into 5.7

Conflicts:
	configure
	src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp
	src/network/access/qnetworkaccessmanager.cpp
	src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
	src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp
	src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.h
	src/widgets/widgets/qlineedit_p.cpp
	src/widgets/widgets/qlineedit_p.h
	src/winmain/winmain.pro
	tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp
	tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp
	tests/auto/dbus/qdbusconnection/tst_qdbusconnection.h
	tests/auto/testlib/selftests/expected_cmptest.teamcity
	tests/auto/testlib/selftests/expected_cmptest.txt
	tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp
	tools/configure/configureapp.cpp

Change-Id: Ib9997b0d0f91946e4081d36c0c6b696c5c983b2a
This commit is contained in:
Liang Qi 2016-05-19 11:04:19 +02:00
commit 818014b449
174 changed files with 1744 additions and 638 deletions

View File

@ -1,5 +1,4 @@
load(qt_build_config)
CONFIG += qt_example_installs
CONFIG += warning_clean
QT_SOURCE_TREE = $$PWD

View File

@ -1,4 +1,4 @@
SOURCES = kms.cpp
CONFIG += link_pkgconfig
PKGCONFIG += libdrm libudev
PKGCONFIG += libdrm
CONFIG -= qt

View File

@ -66,9 +66,6 @@ while [ "$#" -gt 0 ]; do
shift
done
# debuggery
[ "$VERBOSE" = "yes" ] && echo "$DESCRIPTION auto-detection... ($*)"
test -d "$OUTDIR/$TEST" || mkdir -p "$OUTDIR/$TEST"
cd "$OUTDIR/$TEST"
@ -96,6 +93,7 @@ set -- \
"$SRCDIR/$TEST/$EXE.pro" \
-o "$OUTDIR/$TEST/Makefile"
if [ "$VERBOSE" = "yes" ]; then
echo
OUTDIR=$OUTDIR "$@" && $MAKE && SUCCESS=yes
else
OUTDIR=$OUTDIR "$@" >/dev/null 2>&1 && $MAKE >/dev/null 2>&1 && SUCCESS=yes
@ -103,9 +101,9 @@ fi
# done
if [ "$SUCCESS" != "yes" ]; then
[ "$VERBOSE" = "yes" ] && echo "$DESCRIPTION disabled."
[ "$VERBOSE" = "yes" ] && echo "$DESCRIPTION disabled." || echo " no."
exit 1
else
[ "$VERBOSE" = "yes" ] && echo "$DESCRIPTION enabled."
[ "$VERBOSE" = "yes" ] && echo "$DESCRIPTION enabled." || echo " yes."
exit 0
fi

49
configure vendored
View File

@ -91,6 +91,7 @@ for i in "$@"; do
done
# initialize global variables
CONFIG_SEPARATORS=`printf ' \t'`
QMAKE_SWITCHES=
QMAKE_VARS=
QMAKE_CONFIG=
@ -348,6 +349,21 @@ getXQMakeConf()
getSingleQMakeVariable "$1" "$xspecvals"
}
testXConfig()
{
# Put a space on each end of the CONFIG value so that searching for the
# target with whitespace on either side will work even when it's the
# first/last/only item in the CONFIG value.
case \ `getXQMakeConf CONFIG`\ in
*[${CONFIG_SEPARATORS}]$1[${CONFIG_SEPARATORS}]*)
return 0
;;
*)
return 1
;;
esac
}
compilerSupportsFlag()
{
cat >conftest.cpp <<EOF
@ -3926,7 +3942,7 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
setBootstrapVariable QMAKE_LFLAGS
setBootstrapVariable QMAKE_LFLAGS_GCSECTIONS
if [ "$CFG_RELEASE_TOOLS" = "yes" ]; then
if [ "$CFG_DEBUG" = "no" ] || [ "$CFG_RELEASE_TOOLS" = "yes" ]; then
setBootstrapVariable QMAKE_CFLAGS_RELEASE
setBootstrapVariable QMAKE_CXXFLAGS_RELEASE
EXTRA_CFLAGS="$EXTRA_CFLAGS \$(QMAKE_CFLAGS_RELEASE)"
@ -3938,12 +3954,6 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS \$(QMAKE_CXXFLAGS_DEBUG)"
fi
if [ -n "$RPATH_FLAGS" ] && [ -n "`getQMakeConf 'QMAKE_(LFLAGS_)?RPATH'`" ]; then
setBootstrapVariable "QMAKE_(LFLAGS_)?RPATH" QMAKE_LFLAGS_RPATH
for rpath in $RPATH_FLAGS; do
EXTRA_LFLAGS="\$(QMAKE_LFLAGS_RPATH)\"$rpath\" $EXTRA_LFLAGS"
done
fi
case `basename "$PLATFORM"` in
win32-g++*)
EXTRA_CFLAGS="$EXTRA_CFLAGS -DUNICODE"
@ -3994,9 +4004,6 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
\"\$(SOURCE_PATH)/src/corelib/kernel/qcore_mac.cpp\" \
\"\$(SOURCE_PATH)/src/corelib/kernel/qcore_mac_objc.mm\""
fi
if [ '!' -z "$D_FLAGS" ]; then
EXTRA_CFLAGS="$EXTRA_CFLAGS $D_FLAGS"
fi
echo >>"$mkfile"
adjrelpath=`echo "$relpath" | sed 's/ /\\\\\\\\ /g'`
@ -4225,6 +4232,7 @@ compileTest()
if [ "$CFG_SHARED" = "no" ]; then
test_config="$QMAKE_CONFIG static"
fi
echo $ECHO_N "checking for $name... $ECHO_C"
"$unixtests/compile.test" "$XQMAKESPEC" "$test_config" $OPT_VERBOSE "$relpath" "$outpath" "$path" "$name" "$CFG_QMAKE_PATH" "$QTCONFFILE" $I_FLAGS $D_FLAGS $L_FLAGS "$@"
}
@ -5437,6 +5445,7 @@ if [ "$CFG_OPENGL" = "es2" ]; then
fi
# auto-detect FontConfig support
ORIG_CFG_FREETYPE="$CFG_FREETYPE"
if [ "$CFG_FONTCONFIG" != "no" ]; then
if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists fontconfig --exists freetype2 2>/dev/null; then
QT_CFLAGS_FONTCONFIG=`$PKG_CONFIG --cflags fontconfig --cflags freetype2 2>/dev/null`
@ -5630,6 +5639,11 @@ if [ "$CFG_XCB" != "no" ]; then
if [ "$CFG_XCB" = "qt" ]; then
QT_CONFIG="$QT_CONFIG xcb-qt"
if compileTest qpa/xcb-glx "xcb-glx" $QMAKE_CFLAGS_XCB $QMAKE_LIBS_XCB; then
CFG_XCB_GLX=yes
QT_CONFIG="$QT_CONFIG xcb-glx"
fi
else
CFG_XCB="system"
if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists "xcb >= 1.5" 2>/dev/null; then
@ -6439,7 +6453,11 @@ fi
[ "$CFG_STACK_PROTECTOR_STRONG" = "yes" ] && QT_CONFIG="$QT_CONFIG stack-protector-strong"
[ "$CFG_REDUCE_RELOCATIONS" = "yes" ] && QT_CONFIG="$QT_CONFIG reduce_relocations"
[ "$CFG_STRIP" = "no" ] && QMAKE_CONFIG="$QMAKE_CONFIG nostrip"
[ "$CFG_PRECOMPILE" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG precompile_header"
if testXConfig precompile_header; then
[ "$CFG_PRECOMPILE" = "no" ] && QMakeVar del CONFIG precompile_header
else
[ "$CFG_PRECOMPILE" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG precompile_header"
fi
[ "$CFG_USE_GOLD_LINKER" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG use_gold_linker"
[ "$CFG_ENABLE_NEW_DTAGS" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG enable_new_dtags"
if [ "$CFG_SEPARATE_DEBUG_INFO" = "yes" ]; then
@ -7536,6 +7554,15 @@ if [ "$CFG_SHARED" = "no" ]; then
echo "loaded plugins. Make sure to import all needed static plugins,"
echo "or compile needed modules into the library."
fi
if [ "$CFG_FREETYPE" = "system" ]; then
if [ "$ORIG_CFG_FREETYPE" = "qt" ]; then
echo
echo "WARNING: Bundled FreeType can't be used. FontConfig use requires system FreeType."
elif [ "$ORIG_CFG_FREETYPE" = "no" ]; then
echo
echo "WARNING: FreeType can't be disabled. FontConfig use requires system FreeType."
fi
fi
if [ "$CFG_OPENSSL" = "linked" ] && [ "$OPENSSL_LIBS" = "" ]; then
echo
echo "NOTE: When linking against OpenSSL, you can override the default"

View File

@ -51,6 +51,7 @@
#include <QApplication>
#include <QDesktopWidget>
#include <QFileSystemModel>
#include <QFileIconProvider>
#include <QTreeView>
#include <QCommandLineParser>
#include <QCommandLineOption>
@ -64,6 +65,8 @@ int main(int argc, char *argv[])
parser.setApplicationDescription("Qt Dir View Example");
parser.addHelpOption();
parser.addVersionOption();
QCommandLineOption dontUseCustomDirectoryIconsOption("c", "Set QFileIconProvider::DontUseCustomDirectoryIcons");
parser.addOption(dontUseCustomDirectoryIconsOption);
parser.addPositionalArgument("directory", "The directory to start in.");
parser.process(app);
const QString rootPath = parser.positionalArguments().isEmpty()
@ -71,6 +74,8 @@ int main(int argc, char *argv[])
QFileSystemModel model;
model.setRootPath("");
if (parser.isSet(dontUseCustomDirectoryIconsOption))
model.iconProvider()->setOptions(QFileIconProvider::DontUseCustomDirectoryIcons);
QTreeView tree;
tree.setModel(&model);
if (!rootPath.isEmpty()) {

View File

@ -1,6 +1,23 @@
#
# qmake configuration for the Freescale iMX6 boards (single, dual and quad)
#
# The configuration below is set up for running with EGL on the framebuffer via
# the eglfs platform plugin and its eglfs_viv backend.
# Wayland is also fully functional out of the box. However, when writing Wayland
# *compositors* with Qt, the eglfs backend will have to be switched to
# eglfs_viv_wl by setting the QT_QPA_EGLFS_INTEGRATION environment variable.
#
# Below is an example configure line that assumes the SDK is in
# $HOME/imx6/toolchain. On device Qt is expected to be placed under
# /usr/local/qt5 whereas on the host 'make install' will copy the host tools and
# the target libraries to $HOME/imx6/qt5.
#
# ./configure -prefix /usr/local/qt5 -extprefix $HOME/imx6/qt5 -device linux-imx6-g++ \
# -device-option CROSS_COMPILE=$HOME/imx6/toolchain/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi- \
# -sysroot $HOME/imx6/toolchain/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi \
# -nomake examples -nomake tests -v
#
include(../common/linux_device_pre.conf)

View File

@ -1,9 +1,7 @@
QMAKE_MAKE = $$(MAKE)
!isEmpty(QMAKE_MAKE) {
# We were called recursively. Use the right make, as MAKEFLAGS may be set as well.
} else:equals(MAKEFILE_GENERATOR, UNIX) {
QMAKE_MAKE = make
} else:equals(MAKEFILE_GENERATOR, MINGW) {
} else:if(equals(MAKEFILE_GENERATOR, UNIX)|equals(MAKEFILE_GENERATOR, MINGW)) {
!equals(QMAKE_HOST.os, Windows): \
QMAKE_MAKE = make
else: \

View File

@ -11,9 +11,13 @@
lex.variable_out = GENERATED_SOURCES
}
isEmpty(QMAKE_LEXFLAGS_MANGLE):QMAKE_LEXFLAGS_MANGLE = -P${QMAKE_FILE_BASE}
QMAKE_LEXEXTRAFLAGS = $$QMAKE_LEXFLAGS
!yacc_no_name_mangle:QMAKE_LEXEXTRAFLAGS += $$QMAKE_LEXFLAGS_MANGLE
contains(QMAKE_LEX, .*flex) {
# GNU flex, we can use -o outfile
lex.commands = $$QMAKE_LEX $$QMAKE_LEXFLAGS --nounistd -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
lex.commands = $$QMAKE_LEX $$QMAKE_LEXEXTRAFLAGS --nounistd -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
} else {
# stupid POSIX lex, it only generates a file called lex.yy.c
# or lex.prefix.c if the -P<prefix> option is active

View File

@ -15,8 +15,7 @@ TEMPLATE = lib
CONFIG += plugin
if(win32|mac):!macx-xcode {
contains(QT_CONFIG, debug_and_release):CONFIG += debug_and_release
contains(QT_CONFIG, build_all):CONFIG += build_all
contains(QT_CONFIG, debug_and_release): CONFIG += debug_and_release build_all
}
CONFIG += relative_qt_rpath # Qt's QML plugins should be relocatable

View File

@ -28,7 +28,7 @@ host_build:force_bootstrap {
}
target.path = $$[QT_HOST_BINS]
} else {
!build_pass:contains(QT_CONFIG, debug_and_release):contains(QT_CONFIG, build_all): CONFIG += release
!build_pass:contains(QT_CONFIG, debug_and_release): CONFIG += release
target.path = $$[QT_INSTALL_BINS]
CONFIG += relative_qt_rpath # Qt's tools and apps should be relocatable
}

View File

@ -71,6 +71,7 @@ CONFIG += \
create_prl link_prl \
prepare_docs qt_docs_targets \
no_private_qt_headers_warning QTDIR_build \
qt_example_installs \
# Qt modules get compiled without exceptions enabled by default.
# However, testcases should be still built with exceptions.
exceptions_off testcase_exceptions

View File

@ -100,6 +100,20 @@ probase = $$relative_path($$_PRO_FILE_PWD_, $$dirname(_QMAKE_CONF_)/examples)
!isEmpty(allfiles): warning("remaining files in $$_PRO_FILE_PWD_: $$allfiles")
}
equals(TEMPLATE, app)|equals(TEMPLATE, lib) {
!contains(INSTALLS, target) {
!install_ok: \
error("$$_PRO_FILE_ is lacking an install target.")
else: check_examples: \
warning("$$_PRO_FILE_ is lacking an install target.")
} else: !equals(target.path, $$sources.path) {
!install_ok: \
error("$$_PRO_FILE_ installs target to unexpected location.")
else: check_examples: \
warning("$$_PRO_FILE_ installs target to unexpected location.")
}
}
!equals(TEMPLATE, subdirs):!compile_examples {
TEMPLATE = aux
CONFIG -= have_target qt staticlib dll

View File

@ -13,12 +13,12 @@ load(qt_build_paths)
TEMPLATE = lib
CONFIG -= qt
QT = # In case qt is re-added.
CONFIG -= warning_clean # Don't presume 3rd party code to be clean
load(qt_common)
contains(QT_CONFIG, debug_and_release): CONFIG += debug_and_release
contains(QT_CONFIG, build_all): CONFIG += build_all
contains(QT_CONFIG, debug_and_release): CONFIG += debug_and_release build_all
DESTDIR = $$MODULE_BASE_OUTDIR/lib
DLLDESTDIR = $$MODULE_BASE_OUTDIR/bin

View File

@ -38,7 +38,7 @@ host_build {
QT += bootstrap-private
}
} else {
!build_pass:contains(QT_CONFIG, build_all): CONFIG += release
!build_pass:contains(QT_CONFIG, debug_and_release): CONFIG += release
}
}
@ -89,8 +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
# - unless this is a host library
!host_build:if(win32|mac):!macx-xcode {
contains(QT_CONFIG, debug_and_release):CONFIG += debug_and_release
contains(QT_CONFIG, build_all):CONFIG += build_all
contains(QT_CONFIG, debug_and_release): CONFIG += debug_and_release build_all
}
QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF

View File

@ -188,6 +188,16 @@ headersclean:!internal_module {
!contains(QT_ARCH, arm):!contains(QT_ARCH, mips): \
hcleanFLAGS += -Wcast-align
!clang {
# options accepted only by GCC
c++11 {
# only enabled for actual c++11 builds due to
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52806
hcleanFLAGS += -Wzero-as-null-pointer-constant
}
}
}
# Use strict mode C++11 or C++98, with no GNU extensions (see -pedantic-errors above).

View File

@ -24,10 +24,9 @@ win32:CONFIG(shared, static|shared) {
}
tool_plugin {
!build_pass:contains(QT_CONFIG, build_all): CONFIG += release
!build_pass:contains(QT_CONFIG, debug_and_release): CONFIG += release
} else:if(win32|mac):!macx-xcode {
contains(QT_CONFIG, debug_and_release):CONFIG += debug_and_release
contains(QT_CONFIG, build_all):CONFIG += build_all
contains(QT_CONFIG, debug_and_release): CONFIG += debug_and_release build_all
}
CONFIG += relative_qt_rpath # Qt's plugins should be relocatable

View File

@ -7,6 +7,7 @@ include(../common/wince/qmake.conf)
CE_SDK = Toradex_CE800 # replace with actual SDK name
CE_ARCH = ARMV7
CE_PLATFORMNAME = Toradex_CE800
QT_CONFIG -= accessibility
DEFINES += QT_NO_CLIPBOARD QT_NO_ACCESSIBILITY QT_NO_NATIVE_GESTURES QT_NOSTANDARDSHELL_UI_MODEL _CRT_SECURE_NO_DEPRECATE _WIN32_WCE=0x800 $$CE_ARCH _AMRV7_ armv7 _ARM_ UNDER_CE WINCE ARM QT_NO_WINCE_SHELLSDK QT_NO_WINCE_NUIOUSER

View File

@ -700,6 +700,8 @@ void VcprojGenerator::writeSubDirs(QTextStream &t)
QString slnConf = _slnSolutionConf;
if (!project->isEmpty("VCPROJ_ARCH")) {
slnConf.replace(QLatin1String("|Win32"), "|" + project->first("VCPROJ_ARCH"));
} else if (!project->isEmpty("CE_PLATFORMNAME")) {
slnConf.replace(QLatin1String("|Win32"), "|" + project->first("CE_PLATFORMNAME"));
} else if (!project->isEmpty("CE_SDK") && !project->isEmpty("CE_ARCH")) {
QString slnPlatform = QString("|") + project->values("CE_SDK").join(' ') + " (" + project->first("CE_ARCH") + ")";
slnConf.replace(QLatin1String("|Win32"), slnPlatform);
@ -717,6 +719,8 @@ void VcprojGenerator::writeSubDirs(QTextStream &t)
QString xplatform = platform;
if (!project->isEmpty("VCPROJ_ARCH")) {
xplatform = project->first("VCPROJ_ARCH").toQString();
} else if (!project->isEmpty("CE_PLATFORMNAME")) {
xplatform = project->first("CE_PLATFORMNAME").toQString();
} else if (!project->isEmpty("CE_SDK") && !project->isEmpty("CE_ARCH")) {
xplatform = project->values("CE_SDK").join(' ') + " (" + project->first("CE_ARCH") + ")";
}
@ -976,6 +980,8 @@ void VcprojGenerator::initProject()
vcProject.Keyword = project->first("VCPROJ_KEYWORD").toQString();
if (!project->isEmpty("VCPROJ_ARCH")) {
vcProject.PlatformName = project->first("VCPROJ_ARCH").toQString();
} else if (!project->isEmpty("CE_PLATFORMNAME")) {
vcProject.PlatformName = project->first("CE_PLATFORMNAME").toQString();
} else if (project->isHostBuild() || project->isEmpty("CE_SDK") || project->isEmpty("CE_ARCH")) {
vcProject.PlatformName = (is64Bit ? "x64" : "Win32");
} else {
@ -1060,6 +1066,8 @@ void VcprojGenerator::initConfiguration()
conf.ConfigurationName = conf.Name;
if (!project->isEmpty("VCPROJ_ARCH")) {
conf.Name += "|" + project->first("VCPROJ_ARCH");
} else if (!project->isEmpty("CE_PLATFORMNAME")) {
conf.Name += "|" + project->first("CE_PLATFORMNAME");
} else if (project->isHostBuild() || project->isEmpty("CE_SDK") || project->isEmpty("CE_ARCH")) {
conf.Name += (is64Bit ? "|x64" : "|Win32");
} else {

View File

@ -64,10 +64,10 @@ win32 {
INCLUDEPATH += $$PWD/include
DEFINES += FT2_BUILD_LIBRARY
contains(QT_CONFIG, system-zlib) {
DEFINES += FT_CONFIG_OPTION_SYSTEM_ZLIB
include($$PWD/../zlib_dependency.pri)
}
DEFINES += FT_CONFIG_OPTION_SYSTEM_ZLIB
include(../zlib_dependency.pri)
contains(QT_CONFIG, system-png) {
DEFINES += FT_CONFIG_OPTION_USE_PNG
include($$PWD/../png_dependency.pri)

View File

@ -7,4 +7,8 @@ contains(QT_CONFIG, system-zlib) {
}
} else {
INCLUDEPATH += $$PWD/zlib
!no_core_dep {
CONFIG += qt
QT_PRIVATE += core
}
}

View File

@ -0,0 +1,44 @@
From db13a9cf7e41207660f080827983655864df802d Mon Sep 17 00:00:00 2001
From: Oliver Wolff <oliver.wolff@qt.io>
Date: Wed, 11 May 2016 13:51:54 +0200
Subject: [PATCH] ANGLE: Disable support for shared handles in warp mode on
Windows < 8
Shared handles are not supported on Windows 7 and below. If the
according flag is set CreateTexture2D will fail with E_OUTOFMEMORY. The
check already happens with newer ANGLE versions, which we use in 5.7
but has to happen here as well. Otherwise Qt applications running on
Windows 7 and below will crash at startup.
Change-Id: I8f539f16dce298611fb1ec7b2f6804d4a04d04e0
---
.../angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp
index 223e2b0..dd554f4 100644
--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp
+++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp
@@ -2370,6 +2370,19 @@ unsigned int Renderer11::getReservedFragmentUniformBuffers() const
bool Renderer11::getShareHandleSupport() const
{
+ if (mDriverType == D3D_DRIVER_TYPE_WARP)
+ {
+#if !defined(ANGLE_ENABLE_WINDOWS_STORE)
+ // Warp mode does not support shared handles in Windows versions below Windows 8
+ OSVERSIONINFO result = { sizeof(OSVERSIONINFO), 0, 0, 0, 0, {'\0'}};
+ if (GetVersionEx(&result) &&
+ ((result.dwMajorVersion == 6 && result.dwMinorVersion < 2) || result.dwMajorVersion < 6))
+ {
+ // WARP on Windows 7 doesn't support shared handles
+ return false;
+ }
+#endif // ANGLE_ENABLE_WINDOWS_STORE
+ }
// We only currently support share handles with BGRA surfaces, because
// chrome needs BGRA. Once chrome fixes this, we should always support them.
// PIX doesn't seem to support using share handles, so disable them.
--
2.7.0.windows.1

View File

@ -4,7 +4,7 @@ project = QtConcurrent
description = Qt Concurrent Reference Documentation
version = $QT_VERSION
examplesinstallpath = qtbase/qtconcurrent
examplesinstallpath = qtconcurrent
qhp.projects = QtConcurrent

View File

@ -4,7 +4,7 @@ project = QtCore
description = Qt Core Reference Documentation
version = $QT_VERSION
examplesinstallpath = qtbase/corelib
examplesinstallpath = corelib
qhp.projects = QtCore

View File

@ -61,6 +61,9 @@
#include <QtCore/qfeatures.h>
#endif
// The QT_SUPPORTS macro is deprecated. Don't use it in new code.
// Instead, use #ifdef/ndef QT_NO_feature.
// ### Qt6: remove macro
#ifdef _MSC_VER
# define QT_SUPPORTS(FEATURE) (!defined QT_NO_##FEATURE)
#else

View File

@ -885,7 +885,9 @@ static bool tryDriveUNCFallback(const QFileSystemEntry &fname, QFileSystemMetaDa
#if !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
if (fname.isDriveRoot()) {
// a valid drive ??
const UINT oldErrorMode = ::SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX);
DWORD drivesBitmask = ::GetLogicalDrives();
::SetErrorMode(oldErrorMode);
int drivebit = 1 << (fname.filePath().at(0).toUpper().unicode() - QLatin1Char('A').unicode());
if (drivesBitmask & drivebit) {
fileAttrib = FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_SYSTEM;

View File

@ -632,7 +632,9 @@ QFileInfoList QFSFileEngine::drives()
QFileInfoList ret;
#if !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
#if defined(Q_OS_WIN32)
const UINT oldErrorMode = ::SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX);
quint32 driveBits = (quint32) GetLogicalDrives() & 0x3ffffff;
::SetErrorMode(oldErrorMode);
#endif
char driveName[] = "A:/";

View File

@ -108,25 +108,6 @@
QT_BEGIN_NAMESPACE
static bool isPseudoFs(const QString &mountDir, const QByteArray &type)
{
if (mountDir.startsWith(QLatin1String("/dev"))
|| mountDir.startsWith(QLatin1String("/proc"))
|| mountDir.startsWith(QLatin1String("/sys"))
|| mountDir.startsWith(QLatin1String("/var/run"))
|| mountDir.startsWith(QLatin1String("/var/lock"))) {
return true;
}
if (type == "tmpfs")
return true;
#if defined(Q_OS_LINUX)
if (type == "rootfs" || type == "rpc_pipefs")
return true;
#endif
return false;
}
class QStorageIterator
{
public:
@ -164,6 +145,39 @@ private:
#endif
};
template <typename String>
static bool isParentOf(const String &parent, const QString &dirName)
{
return dirName.startsWith(parent) &&
(dirName.size() == parent.size() || dirName.at(parent.size()) == QLatin1Char('/') ||
parent.size() == 1);
}
static bool isPseudoFs(const QStorageIterator &it)
{
QString mountDir = it.rootPath();
if (isParentOf(QLatin1String("/dev"), mountDir)
|| isParentOf(QLatin1String("/proc"), mountDir)
|| isParentOf(QLatin1String("/sys"), mountDir)
|| isParentOf(QLatin1String("/var/run"), mountDir)
|| isParentOf(QLatin1String("/var/lock"), mountDir)) {
return true;
}
QByteArray type = it.fileSystemType();
if (type == "tmpfs")
return false;
#if defined(Q_OS_LINUX)
if (type == "rootfs" || type == "rpc_pipefs")
return true;
#endif
if (!it.device().startsWith('/'))
return true;
return false;
}
#if defined(Q_OS_BSD4)
inline QStorageIterator::QStorageIterator()
@ -450,10 +464,8 @@ void QStorageInfoPrivate::initRootPath()
while (it.next()) {
const QString mountDir = it.rootPath();
const QByteArray fsName = it.fileSystemType();
if (isPseudoFs(mountDir, fsName))
continue;
// we try to find most suitable entry
if (oldRootPath.startsWith(mountDir) && maxLength < mountDir.length()) {
if (isParentOf(mountDir, oldRootPath) && maxLength < mountDir.length()) {
maxLength = mountDir.length();
rootPath = mountDir;
device = it.device();
@ -467,11 +479,14 @@ static inline QString retrieveLabel(const QByteArray &device)
#ifdef Q_OS_LINUX
static const char pathDiskByLabel[] = "/dev/disk/by-label";
QFileInfo devinfo(QFile::decodeName(device));
QString devicePath = devinfo.canonicalFilePath();
QDirIterator it(QLatin1String(pathDiskByLabel), QDir::NoDotAndDotDot);
while (it.hasNext()) {
it.next();
QFileInfo fileInfo(it.fileInfo());
if (fileInfo.isSymLink() && fileInfo.symLinkTarget().toLocal8Bit() == device)
if (fileInfo.isSymLink() && fileInfo.symLinkTarget() == devicePath)
return fileInfo.fileName();
}
#elif defined Q_OS_HAIKU
@ -542,11 +557,10 @@ QList<QStorageInfo> QStorageInfoPrivate::mountedVolumes()
QList<QStorageInfo> volumes;
while (it.next()) {
const QString mountDir = it.rootPath();
const QByteArray fsName = it.fileSystemType();
if (isPseudoFs(mountDir, fsName))
if (isPseudoFs(it))
continue;
const QString mountDir = it.rootPath();
volumes.append(QStorageInfo(mountDir));
}

View File

@ -3690,7 +3690,7 @@ bool QAbstractListModel::dropMimeData(const QMimeData *data, Qt::DropAction acti
\fn QAbstractItemModel::modelAboutToBeReset()
\since 4.2
This signal is emitted when reset() is called, before the model's internal
This signal is emitted when beginResetModel() is called, before the model's internal
state (e.g. persistent model indexes) has been invalidated.
\sa beginResetModel(), modelReset()
@ -3700,7 +3700,7 @@ bool QAbstractListModel::dropMimeData(const QMimeData *data, Qt::DropAction acti
\fn QAbstractItemModel::modelReset()
\since 4.1
This signal is emitted when reset() or endResetModel() is called, after the
This signal is emitted when endResetModel() is called, after the
model's internal state (e.g. persistent model indexes) has been invalidated.
Note that if a model is reset it should be considered that all information

View File

@ -945,6 +945,26 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok)
}
}
#endif
if (QMetaType::typeFlags(t) & QMetaType::IsEnumeration) {
qlonglong value = qConvertToNumber(d, ok);
if (*ok) {
switch (QMetaType::sizeOf(t)) {
case 1:
*static_cast<signed char *>(result) = value;
return true;
case 2:
*static_cast<qint16 *>(result) = value;
return true;
case 4:
*static_cast<qint32 *>(result) = value;
return true;
case 8:
*static_cast<qint64 *>(result) = value;
return true;
}
}
return *ok;
}
return false;
}
return true;
@ -2819,7 +2839,7 @@ static const quint32 qCanConvertMatrix[QVariant::LastCoreType + 1] =
/*Int*/ 1 << QVariant::UInt | 1 << QVariant::String | 1 << QVariant::Double
| 1 << QVariant::Bool | 1 << QVariant::LongLong | 1 << QVariant::ULongLong
| 1 << QVariant::Char | 1 << QVariant::ByteArray,
| 1 << QVariant::Char | 1 << QVariant::ByteArray | 1 << QVariant::Int,
/*UInt*/ 1 << QVariant::Int | 1 << QVariant::String | 1 << QVariant::Double
| 1 << QVariant::Bool | 1 << QVariant::LongLong | 1 << QVariant::ULongLong

View File

@ -232,8 +232,8 @@ public:
AtomicType _q_value;
Type load() const Q_DECL_NOTHROW { return _q_value; }
void store(Type newValue) Q_DECL_NOTHROW { _q_value = newValue; }
Type load() const Q_DECL_NOTHROW { return Ops::load(_q_value); }
void store(Type newValue) Q_DECL_NOTHROW { Ops::store(_q_value, newValue); }
operator Type() const Q_DECL_NOTHROW { return loadAcquire(); }
Type operator=(Type newValue) Q_DECL_NOTHROW { storeRelease(newValue); return newValue; }

View File

@ -71,7 +71,7 @@ QArrayData *QArrayData::allocate(size_t objectSize, size_t alignment,
// Don't allocate empty headers
if (!(options & RawData) && !capacity) {
#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
if (options & Unsharable)
return const_cast<QArrayData *>(&qt_array_unsharable_empty);
#endif
@ -116,7 +116,7 @@ QArrayData *QArrayData::allocate(size_t objectSize, size_t alignment,
quintptr data = (quintptr(header) + sizeof(QArrayData) + alignment - 1)
& ~(alignment - 1);
#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
header->ref.atomic.store(bool(!(options & Unsharable)));
#else
header->ref.atomic.store(1);
@ -138,7 +138,7 @@ void QArrayData::deallocate(QArrayData *data, size_t objectSize,
&& !(alignment & (alignment - 1)));
Q_UNUSED(objectSize) Q_UNUSED(alignment)
#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
if (data == &qt_array_unsharable_empty)
return;
#endif

View File

@ -78,7 +78,7 @@ struct Q_CORE_EXPORT QArrayData
enum AllocationOption {
CapacityReserved = 0x1,
#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
Unsharable = 0x2,
#endif
RawData = 0x4,
@ -255,7 +255,7 @@ struct QTypedArrayData
return allocate(/* capacity */ 0);
}
#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
static QTypedArrayData *unsharableEmpty()
{
Q_STATIC_ASSERT(sizeof(QTypedArrayData) == sizeof(QArrayData));

View File

@ -133,7 +133,7 @@ public:
return (!d->isMutable() || d->ref.isShared());
}
#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
void setSharable(bool sharable)
{
if (needsDetach()) {

View File

@ -102,7 +102,7 @@ public:
inline void detach() { if (d->ref.load() != 1) detach_helper(); }
inline bool isDetached() const { return d->ref.load() == 1; }
#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; }
#endif

View File

@ -38,9 +38,6 @@
**
****************************************************************************/
// ask for the latest POSIX, just in case
#define _POSIX_C_SOURCE 200809L
#include "qelapsedtimer.h"
#if defined(Q_OS_VXWORKS)
#include "qfunctions_vxworks.h"

View File

@ -272,7 +272,7 @@ public:
inline void detach() { if (d->ref.isShared()) detach_helper(); }
inline bool isDetached() const { return !d->ref.isShared(); }
#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
inline void setSharable(bool sharable) { if (!sharable) detach(); if (d != &QHashData::shared_null) d->sharable = sharable; }
#endif
bool isSharedWith(const QHash &other) const { return d == other.d; }
@ -1092,9 +1092,6 @@ Q_INLINE_TEMPLATE int QMultiHash<Key, T>::count(const Key &key, const T &value)
return n;
}
Q_CORE_EXPORT int qGlobalQHashSeed();
Q_CORE_EXPORT void qSetGlobalQHashSeed(int newSeed);
Q_DECLARE_ASSOCIATIVE_ITERATOR(Hash)
Q_DECLARE_MUTABLE_ASSOCIATIVE_ITERATOR(Hash)

View File

@ -64,6 +64,9 @@ class QString;
class QStringRef;
class QLatin1String;
Q_CORE_EXPORT int qGlobalQHashSeed();
Q_CORE_EXPORT void qSetGlobalQHashSeed(int newSeed);
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qHashBits(const void *p, size_t size, uint seed = 0) Q_DECL_NOTHROW;
Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(char key, uint seed = 0) Q_DECL_NOTHROW { return uint(key) ^ seed; }

View File

@ -105,7 +105,7 @@ public:
inline void detach()
{ if (d->ref.isShared()) detach_helper2(this->e); }
inline bool isDetached() const { return !d->ref.isShared(); }
#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
inline void setSharable(bool sharable) { if (!sharable) detach(); if (d != &QLinkedListData::shared_null) d->sharable = sharable; }
#endif
inline bool isSharedWith(const QLinkedList<T> &other) const { return d == other.d; }

View File

@ -175,7 +175,7 @@ public:
}
inline bool isDetached() const { return !d->ref.isShared(); }
#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
inline void setSharable(bool sharable)
{
if (sharable == d->ref.isSharable())

View File

@ -365,7 +365,7 @@ public:
inline void detach() { if (d->ref.isShared()) detach_helper(); }
inline bool isDetached() const { return !d->ref.isShared(); }
#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
inline void setSharable(bool sharable)
{
if (sharable == d->ref.isSharable())

View File

@ -53,7 +53,7 @@ class RefCount
public:
inline bool ref() Q_DECL_NOTHROW {
int count = atomic.load();
#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
if (count == 0) // !isSharable
return false;
#endif
@ -64,7 +64,7 @@ public:
inline bool deref() Q_DECL_NOTHROW {
int count = atomic.load();
#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
if (count == 0) // !isSharable
return false;
#endif
@ -73,7 +73,7 @@ public:
return atomic.deref();
}
#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
bool setSharable(bool sharable) Q_DECL_NOTHROW
{
Q_ASSERT(!isShared());

View File

@ -85,7 +85,7 @@ public:
inline void detach() { q_hash.detach(); }
inline bool isDetached() const { return q_hash.isDetached(); }
#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
inline void setSharable(bool sharable) { q_hash.setSharable(sharable); }
#endif

View File

@ -697,7 +697,11 @@ void qDetectCpuFeatures()
// contains all the features that the code required. Qt 4 ran for years
// like that, so it shouldn't be a problem.
qt_cpu_features.store(minFeature | quint32(QSimdInitialized));
qt_cpu_features[0].store(minFeature | quint32(QSimdInitialized));
#ifndef Q_ATOMIC_INT64_IS_SUPPORTED
qt_cpu_features[1].store(minFeature >> 32);
#endif
return;
# endif
#endif

View File

@ -106,7 +106,7 @@ public:
inline void detach();
inline bool isDetached() const { return !d->ref.isShared(); }
#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
inline void setSharable(bool sharable)
{
if (sharable == d->ref.isSharable())
@ -382,7 +382,7 @@ template <typename T>
void QVector<T>::detach()
{
if (!isDetached()) {
#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
if (!d->alloc)
d = Data::unsharableEmpty();
else
@ -539,7 +539,7 @@ void QVector<T>::reallocData(const int asize, const int aalloc, QArrayData::Allo
x = Data::allocate(aalloc, options);
Q_CHECK_PTR(x);
// aalloc is bigger then 0 so it is not [un]sharedEmpty
#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
Q_ASSERT(x->ref.isSharable() || options.testFlag(QArrayData::Unsharable));
#endif
Q_ASSERT(!x->ref.isStatic());
@ -607,7 +607,7 @@ void QVector<T>::reallocData(const int asize, const int aalloc, QArrayData::Allo
Q_ASSERT(d->data());
Q_ASSERT(uint(d->size) <= d->alloc);
#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
Q_ASSERT(d != Data::unsharableEmpty());
#endif
Q_ASSERT(aalloc ? d != Data::sharedNull() : d == Data::sharedNull());

View File

@ -155,6 +155,7 @@ else:SOURCES += tools/qelapsedtimer_generic.cpp
contains(QT_CONFIG, zlib) {
include($$PWD/../../3rdparty/zlib.pri)
} else {
CONFIG += no_core_dep
include($$PWD/../../3rdparty/zlib_dependency.pri)
}

View File

@ -19,7 +19,7 @@ sourcedirs += .. \
../../../examples/dbus/doc/src
excludedirs += ../../../examples/widgets/doc
examplesinstallpath = qtbase/dbus
examplesinstallpath = dbus
depends += qtdoc qtcore

View File

@ -259,7 +259,7 @@ private:
const QVector<int> &metaTypes, int slotIdx);
SignalHookHash::Iterator removeSignalHookNoLock(SignalHookHash::Iterator it);
void disconnectObjectTree(ObjectTreeNode &node);
void collectAllObjects(ObjectTreeNode &node, QSet<QObject *> &set);
bool isServiceRegisteredByThread(const QString &serviceName);

View File

@ -1076,17 +1076,18 @@ QDBusConnectionPrivate::~QDBusConnectionPrivate()
}
}
void QDBusConnectionPrivate::disconnectObjectTree(QDBusConnectionPrivate::ObjectTreeNode &haystack)
void QDBusConnectionPrivate::collectAllObjects(QDBusConnectionPrivate::ObjectTreeNode &haystack,
QSet<QObject *> &set)
{
QDBusConnectionPrivate::ObjectTreeNode::DataList::Iterator it = haystack.children.begin();
while (it != haystack.children.end()) {
disconnectObjectTree(*it);
collectAllObjects(*it, set);
it++;
}
if (haystack.obj)
haystack.obj->disconnect(this);
set.insert(haystack.obj);
}
void QDBusConnectionPrivate::closeConnection()
@ -1115,15 +1116,23 @@ void QDBusConnectionPrivate::closeConnection()
// Disconnect all signals from signal hooks and from the object tree to
// avoid QObject::destroyed being sent to dbus daemon thread which has
// already quit.
SignalHookHash::iterator sit = signalHooks.begin();
while (sit != signalHooks.end()) {
sit.value().obj->disconnect(this);
sit++;
// already quit. We need to make sure we disconnect exactly once per
// object, because if we tried a second time, we might be hitting a
// dangling pointer.
QSet<QObject *> allObjects;
collectAllObjects(rootNode, allObjects);
SignalHookHash::const_iterator sit = signalHooks.constBegin();
while (sit != signalHooks.constEnd()) {
allObjects.insert(sit.value().obj);
++sit;
}
disconnectObjectTree(rootNode);
rootNode.children.clear(); // free resources
// now disconnect ourselves
QSet<QObject *>::const_iterator oit = allObjects.constBegin();
while (oit != allObjects.constEnd()) {
(*oit)->disconnect(this);
++oit;
}
}
void QDBusConnectionPrivate::handleDBusDisconnection()

View File

@ -4,7 +4,7 @@ project = QtGui
description = Qt GUI Reference Documentation
version = $QT_VERSION
examplesinstallpath = qtbase/gui
examplesinstallpath = gui
qhp.projects = QtGui

View File

@ -6272,7 +6272,7 @@ static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const
pen.setColor(uc);
// Adapt wave to underlineOffset or pen width, whatever is larger, to make it work on all platforms
const QPixmap wave = generateWavyPixmap(qMin(qMax(underlineOffset, pen.widthF()), maxHeight / 2.), pen);
const QPixmap wave = generateWavyPixmap(qMin(qMax(underlineOffset, pen.widthF()), maxHeight / qreal(2.)), pen);
const int descent = qFloor(maxHeight);
painter->setBrushOrigin(painter->brushOrigin().x(), 0);
@ -6283,7 +6283,7 @@ static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const
// the text above it, but limit it to stay within descent.
qreal adjustedUnderlineOffset = std::ceil(underlineOffset) + 0.5;
if (underlineOffset <= fe->descent().toReal())
adjustedUnderlineOffset = qMin(adjustedUnderlineOffset, fe->descent().toReal() - 0.5);
adjustedUnderlineOffset = qMin(adjustedUnderlineOffset, fe->descent().toReal() - qreal(0.5));
const qreal underlinePos = pos.y() + adjustedUnderlineOffset;
QColor uc = charFormat.underlineColor();
if (uc.isValid())

View File

@ -232,7 +232,8 @@ void QPlatformTextureList::clear()
Flushes the given \a region from the specified \a window onto the
screen.
Note that the \a offset parameter is currently unused.
The \a offset parameter is relative to the origin of the backing
store image.
*/
#ifndef QT_NO_OPENGL

View File

@ -428,7 +428,7 @@ void QStroker::processCurrentSubpath()
bool fwclosed = qt_stroke_side(&fwit, this, false, &fwStartTangent);
bool bwclosed = qt_stroke_side(&bwit, this, !fwclosed, &bwStartTangent);
if (!bwclosed)
if (!bwclosed && !fwStartTangent.isNull())
joinPoints(m_elements.at(0).x, m_elements.at(0).y, fwStartTangent, m_capStyle);
}

View File

@ -480,6 +480,9 @@ QNetworkAccessManager::QNetworkAccessManager(QObject *parent)
//
connect(&d->networkConfigurationManager, SIGNAL(onlineStateChanged(bool)),
SLOT(_q_onlineStateChanged(bool)));
connect(&d->networkConfigurationManager, SIGNAL(configurationChanged(const QNetworkConfiguration &)),
SLOT(_q_configurationChanged(const QNetworkConfiguration &)));
#endif
}
@ -1570,6 +1573,8 @@ void QNetworkAccessManagerPrivate::createSession(const QNetworkConfiguration &co
QObject::disconnect(networkSessionStrongRef.data(), SIGNAL(closed()), q, SLOT(_q_networkSessionClosed()));
QObject::disconnect(networkSessionStrongRef.data(), SIGNAL(stateChanged(QNetworkSession::State)),
q, SLOT(_q_networkSessionStateChanged(QNetworkSession::State)));
QObject::disconnect(networkSessionStrongRef.data(), SIGNAL(error(QNetworkSession::SessionError)),
q, SLOT(_q_networkSessionFailed(QNetworkSession::SessionError)));
}
//switch to new session (null if config was invalid)
@ -1577,7 +1582,6 @@ void QNetworkAccessManagerPrivate::createSession(const QNetworkConfiguration &co
networkSessionWeakRef = networkSessionStrongRef.toWeakRef();
if (!networkSessionStrongRef) {
online = false;
if (networkAccessible == QNetworkAccessManager::NotAccessible || !online)
emit q->networkAccessibleChanged(QNetworkAccessManager::NotAccessible);
@ -1593,6 +1597,8 @@ void QNetworkAccessManagerPrivate::createSession(const QNetworkConfiguration &co
QObject::connect(networkSessionStrongRef.data(), SIGNAL(closed()), q, SLOT(_q_networkSessionClosed()), Qt::QueuedConnection);
QObject::connect(networkSessionStrongRef.data(), SIGNAL(stateChanged(QNetworkSession::State)),
q, SLOT(_q_networkSessionStateChanged(QNetworkSession::State)), Qt::QueuedConnection);
QObject::connect(networkSessionStrongRef.data(), SIGNAL(error(QNetworkSession::SessionError)),
q, SLOT(_q_networkSessionFailed(QNetworkSession::SessionError)));
_q_networkSessionStateChanged(networkSessionStrongRef->state());
}
@ -1609,6 +1615,9 @@ void QNetworkAccessManagerPrivate::_q_networkSessionClosed()
QObject::disconnect(networkSession.data(), SIGNAL(closed()), q, SLOT(_q_networkSessionClosed()));
QObject::disconnect(networkSession.data(), SIGNAL(stateChanged(QNetworkSession::State)),
q, SLOT(_q_networkSessionStateChanged(QNetworkSession::State)));
QObject::disconnect(networkSessionStrongRef.data(), SIGNAL(error(QNetworkSession::SessionError)),
q, SLOT(_q_networkSessionFailed(QNetworkSession::SessionError)));
networkSessionStrongRef.clear();
networkSessionWeakRef.clear();
}
@ -1617,46 +1626,57 @@ void QNetworkAccessManagerPrivate::_q_networkSessionClosed()
void QNetworkAccessManagerPrivate::_q_networkSessionStateChanged(QNetworkSession::State state)
{
Q_Q(QNetworkAccessManager);
bool reallyOnline = false;
//Do not emit the networkSessionConnected signal here, except for roaming -> connected
//transition, otherwise it is emitted twice in a row when opening a connection.
if (state == QNetworkSession::Connected && lastSessionState == QNetworkSession::Roaming)
if (state == QNetworkSession::Connected && lastSessionState != QNetworkSession::Roaming)
emit q->networkSessionConnected();
lastSessionState = state;
if (online) {
if (online && state == QNetworkSession::Disconnected) {
const auto cfgs = networkConfigurationManager.allConfigurations();
for (const QNetworkConfiguration &cfg : cfgs) {
if (cfg.state().testFlag(QNetworkConfiguration::Active)) {
reallyOnline = true;
}
}
} else if (state == QNetworkSession::Connected || state == QNetworkSession::Roaming) {
reallyOnline = true;
}
if (!reallyOnline) {
if (state != QNetworkSession::Connected && state != QNetworkSession::Roaming) {
online = false;
if (networkAccessible != QNetworkAccessManager::NotAccessible) {
networkAccessible = QNetworkAccessManager::NotAccessible;
emit q->networkAccessibleChanged(networkAccessible);
}
}
} else {
if (state == QNetworkSession::Connected || state == QNetworkSession::Roaming) {
online = true;
if (defaultAccessControl)
if (networkAccessible != QNetworkAccessManager::Accessible) {
networkAccessible = QNetworkAccessManager::Accessible;
emit q->networkAccessibleChanged(networkAccessible);
}
}
if (defaultAccessControl)
if (networkAccessible != QNetworkAccessManager::Accessible) {
networkAccessible = QNetworkAccessManager::Accessible;
emit q->networkAccessibleChanged(networkAccessible);
}
}
online = reallyOnline;
if (online && (state != QNetworkSession::Connected && state != QNetworkSession::Roaming)) {
_q_networkSessionClosed();
createSession(q->configuration());
}
}
void QNetworkAccessManagerPrivate::_q_onlineStateChanged(bool isOnline)
{
Q_Q(QNetworkAccessManager);
// if the user set a config, we only care whether this one is active.
// Otherwise, this QNAM is online if there is an online config.
if (customNetworkConfiguration) {
online = (networkConfiguration.state() & QNetworkConfiguration::Active);
} else {
if (online != isOnline) {
if (isOnline) {
networkSessionStrongRef.clear();
networkSessionWeakRef.clear();
}
_q_networkSessionClosed();
createSession(q->configuration());
online = isOnline;
}
}
@ -1667,11 +1687,6 @@ void QNetworkAccessManagerPrivate::_q_onlineStateChanged(bool isOnline)
emit q->networkAccessibleChanged(networkAccessible);
}
}
} else if (networkConfiguration.state().testFlag(QNetworkConfiguration::Undefined)) {
if (networkAccessible != QNetworkAccessManager::UnknownAccessibility) {
networkAccessible = QNetworkAccessManager::UnknownAccessibility;
emit q->networkAccessibleChanged(networkAccessible);
}
} else {
if (networkAccessible != QNetworkAccessManager::NotAccessible) {
networkAccessible = QNetworkAccessManager::NotAccessible;
@ -1680,6 +1695,50 @@ void QNetworkAccessManagerPrivate::_q_onlineStateChanged(bool isOnline)
}
}
void QNetworkAccessManagerPrivate::_q_configurationChanged(const QNetworkConfiguration &configuration)
{
const QString id = configuration.identifier();
if (configuration.state().testFlag(QNetworkConfiguration::Active)) {
if (!onlineConfigurations.contains(id)) {
QSharedPointer<QNetworkSession> session(getNetworkSession());
if (session) {
if (online && session->configuration().identifier()
!= networkConfigurationManager.defaultConfiguration().identifier()) {
onlineConfigurations.insert(id);
//this one disconnected but another one is online,
// close and create new session
_q_networkSessionClosed();
createSession(networkConfigurationManager.defaultConfiguration());
}
}
}
} else if (onlineConfigurations.contains(id)) {
//this one is disconnecting
onlineConfigurations.remove(id);
if (!onlineConfigurations.isEmpty()) {
_q_networkSessionClosed();
createSession(configuration);
}
}
}
void QNetworkAccessManagerPrivate::_q_networkSessionFailed(QNetworkSession::SessionError)
{
const auto cfgs = networkConfigurationManager.allConfigurations();
for (const QNetworkConfiguration &cfg : cfgs) {
if (cfg.state().testFlag(QNetworkConfiguration::Active)) {
online = true;
_q_networkSessionClosed();
createSession(networkConfigurationManager.defaultConfiguration());
return;
}
}
}
#endif // QT_NO_BEARERMANAGEMENT
QNetworkRequest QNetworkAccessManagerPrivate::prepareMultipart(const QNetworkRequest &request, QHttpMultiPart *multiPart)

View File

@ -182,6 +182,8 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_networkSessionClosed())
Q_PRIVATE_SLOT(d_func(), void _q_networkSessionStateChanged(QNetworkSession::State))
Q_PRIVATE_SLOT(d_func(), void _q_onlineStateChanged(bool))
Q_PRIVATE_SLOT(d_func(), void _q_configurationChanged(const QNetworkConfiguration &))
Q_PRIVATE_SLOT(d_func(), void _q_networkSessionFailed(QNetworkSession::SessionError))
#endif
};

View File

@ -149,6 +149,11 @@ public:
bool isSeamless);
void _q_networkSessionStateChanged(QNetworkSession::State state);
void _q_onlineStateChanged(bool isOnline);
void _q_configurationChanged(const QNetworkConfiguration &configuration);
void _q_networkSessionFailed(QNetworkSession::SessionError error);
QSet<QString> onlineConfigurations;
#endif
QNetworkRequest prepareMultipart(const QNetworkRequest &request, QHttpMultiPart *multiPart);

View File

@ -4,7 +4,7 @@ project = QtNetwork
description = Qt Network Reference Documentation
version = $QT_VERSION
examplesinstallpath = qtbase/network
examplesinstallpath = network
qhp.projects = QtNetwork

View File

@ -199,6 +199,8 @@ bool QAuthenticator::operator==(const QAuthenticator &other) const
{
if (d == other.d)
return true;
if (!d || !other.d)
return false;
return d->user == other.d->user
&& d->password == other.d->password
&& d->realm == other.d->realm

View File

@ -464,17 +464,24 @@ void QNativeSocketEngine::close()
}
#if _MSC_VER >= 1900
// To close the connection properly (not with a hard reset) all pending read operation have to
// be finished or cancelled. The API isn't available on Windows 8.1 though.
ComPtr<IStreamSocket3> socket3;
hr = d->tcpSocket()->QueryInterface(IID_PPV_ARGS(&socket3));
Q_ASSERT_SUCCEEDED(hr);
if (d->socketType == QAbstractSocket::TcpSocket) {
hr = QEventDispatcherWinRT::runOnXamlThread([d]() {
HRESULT hr;
// To close the connection properly (not with a hard reset) all pending read operation have to
// be finished or cancelled. The API isn't available on Windows 8.1 though.
ComPtr<IStreamSocket3> socket3;
hr = d->tcpSocket()->QueryInterface(IID_PPV_ARGS(&socket3));
Q_ASSERT_SUCCEEDED(hr);
ComPtr<IAsyncAction> action;
hr = socket3->CancelIOAsync(&action);
Q_ASSERT_SUCCEEDED(hr);
hr = QWinRTFunctions::await(action);
Q_ASSERT_SUCCEEDED(hr);
ComPtr<IAsyncAction> action;
hr = socket3->CancelIOAsync(&action);
Q_ASSERT_SUCCEEDED(hr);
hr = QWinRTFunctions::await(action);
Q_ASSERT_SUCCEEDED(hr);
return S_OK;
});
Q_ASSERT_SUCCEEDED(hr);
}
#endif // _MSC_VER >= 1900
if (d->readOp) {
@ -1271,9 +1278,12 @@ void QNativeSocketEnginePrivate::handleConnectionEstablished(IAsyncAction *actio
HRESULT QNativeSocketEnginePrivate::handleReadyRead(IAsyncBufferOperation *asyncInfo, AsyncStatus status)
{
Q_Q(QNativeSocketEngine);
if (wasDeleted || isDeletingChildren)
if (closingDown || wasDeleted || isDeletingChildren
|| socketState == QAbstractSocket::UnconnectedState) {
return S_OK;
}
Q_Q(QNativeSocketEngine);
// A read in UnconnectedState will close the socket and return -1 and thus tell the caller,
// that the connection was closed. The socket cannot be closed here, as the subsequent read

View File

@ -154,7 +154,7 @@ public:
qintptr socketDescriptor;
bool notifyOnRead, notifyOnWrite, notifyOnException;
bool closingDown;
QAtomicInt closingDown;
enum ErrorString {
NonBlockingInitFailedErrorString,

View File

@ -21,7 +21,7 @@ imagedirs += images \
depends += qtdoc qtcore qtgui qtwidgets qmake
examplesinstallpath = qtbase/opengl
examplesinstallpath = opengl
# The following parameters are for creating a qhp file, the qhelpgenerator
# program can convert the qhp file into a qch file which can be opened in

View File

@ -4,7 +4,7 @@ project = QtPlatformHeaders
description = Qt Platform Headers Reference Documentation
version = $QT_VERSION
examplesinstallpath = qtbase/qtplatformheaders
examplesinstallpath = qtplatformheaders
qhp.projects = QtPlatformHeaders

View File

@ -757,7 +757,7 @@ bool QMacPasteboardMimeVCard::canConvert(const QString &mime, QString flav)
QString QMacPasteboardMimeVCard::flavorFor(const QString &mime)
{
if (mime.startsWith(QLatin1String("text/plain")))
if (mime.startsWith(QLatin1String("text/vcard")))
return QLatin1String("public.vcard");
return QString();
}
@ -765,14 +765,14 @@ QString QMacPasteboardMimeVCard::flavorFor(const QString &mime)
QString QMacPasteboardMimeVCard::mimeFor(QString flav)
{
if (flav == QLatin1String("public.vcard"))
return QLatin1String("text/plain");
return QLatin1String("text/vcard");
return QString();
}
QVariant QMacPasteboardMimeVCard::convertToMime(const QString &mime, QList<QByteArray> data, QString)
{
QByteArray cards;
if (mime == QLatin1String("text/plain")) {
if (mime == QLatin1String("text/vcard")) {
for (int i=0; i<data.size(); ++i)
cards += data[i];
}
@ -782,7 +782,7 @@ QVariant QMacPasteboardMimeVCard::convertToMime(const QString &mime, QList<QByte
QList<QByteArray> QMacPasteboardMimeVCard::convertFromMime(const QString &mime, QVariant data, QString)
{
QList<QByteArray> ret;
if (mime == QLatin1String("text/plain"))
if (mime == QLatin1String("text/vcard"))
ret.append(data.toString().toUtf8());
return ret;
}

View File

@ -65,9 +65,10 @@ const QString MenuBarPath = QLatin1String("/MenuBar");
A D-Bus connection which is used for both menu and tray icon services.
Connects to the session bus and registers with the respective watcher services.
*/
QDBusMenuConnection::QDBusMenuConnection(QObject *parent)
QDBusMenuConnection::QDBusMenuConnection(QObject *parent, const QString &serviceName)
: QObject(parent)
, m_connection(QDBusConnection::sessionBus())
, m_connection(serviceName.isNull() ? QDBusConnection::sessionBus()
: QDBusConnection::connectToBus(QDBusConnection::SessionBus, serviceName))
, m_dbusWatcher(new QDBusServiceWatcher(StatusNotifierWatcherService, m_connection, QDBusServiceWatcher::WatchForRegistration, this))
, m_statusNotifierHostRegistered(false)
{

View File

@ -67,7 +67,7 @@ class QDBusMenuConnection : public QObject
Q_OBJECT
public:
QDBusMenuConnection(QObject *parent = 0);
QDBusMenuConnection(QObject *parent = 0, const QString &serviceName = QString());
QDBusConnection connection() const { return m_connection; }
bool isStatusNotifierHostRegistered() const { return m_statusNotifierHostRegistered; }
#ifndef QT_NO_SYSTEMTRAYICON

View File

@ -171,7 +171,7 @@ QTemporaryFile *QDBusTrayIcon::tempIcon(const QIcon &icon)
QDBusMenuConnection * QDBusTrayIcon::dBusConnection()
{
if (!m_dbusConnection) {
m_dbusConnection = new QDBusMenuConnection(this);
m_dbusConnection = new QDBusMenuConnection(this, m_instanceId);
m_notifier = new QXdgNotificationInterface(XdgNotificationService,
XdgNotificationPath, m_dbusConnection->connection(), this);
connect(m_notifier, SIGNAL(NotificationClosed(uint,uint)), this, SLOT(notificationClosed(uint,uint)));

View File

@ -51,9 +51,9 @@
// We mean it.
//
#include <EGL/egl.h>
#include <qpa/qplatformoffscreensurface.h>
#include <QtPlatformSupport/private/qeglplatformcontext_p.h>
#include <EGL/egl.h>
QT_BEGIN_NAMESPACE

View File

@ -43,6 +43,7 @@
#include <qpa/qplatformwindow.h>
#include <QtGui/qscreen.h>
#include <QtGui/qpainter.h>
QT_BEGIN_NAMESPACE
@ -90,9 +91,17 @@ void QFbBackingStore::unlock()
mImageMutex.unlock();
}
void QFbBackingStore::beginPaint(const QRegion &)
void QFbBackingStore::beginPaint(const QRegion &region)
{
lock();
if (mImage.hasAlphaChannel()) {
QPainter p(&mImage);
p.setCompositionMode(QPainter::CompositionMode_Source);
const QVector<QRect> rects = region.rects();
for (QVector<QRect>::const_iterator it = rects.begin(); it != rects.end(); ++it)
p.fillRect(*it, Qt::transparent);
}
}
void QFbBackingStore::endPaint()

View File

@ -239,6 +239,7 @@ QRegion QFbScreen::doRedraw()
if (!mCompositePainter)
mCompositePainter = new QPainter(mScreenImage);
for (int rectIndex = 0; rectIndex < mRepaintRegion.rectCount(); rectIndex++) {
QRegion rectRegion = rects[rectIndex];
@ -256,7 +257,8 @@ QRegion QFbScreen::doRedraw()
foreach (const QRect &rect, intersect.rects()) {
bool firstLayer = true;
if (layer == -1) {
mCompositePainter->fillRect(rect, Qt::black);
mCompositePainter->setCompositionMode(QPainter::CompositionMode_Source);
mCompositePainter->fillRect(rect, mScreenImage->hasAlphaChannel() ? Qt::transparent : Qt::black);
firstLayer = false;
layer = mWindowStack.size() - 1;
}
@ -289,6 +291,7 @@ QRegion QFbScreen::doRedraw()
QRect cursorRect;
if (mCursor && (mCursor->isDirty() || mRepaintRegion.intersects(mCursor->lastPainted()))) {
mCompositePainter->setCompositionMode(QPainter::CompositionMode_SourceOver);
cursorRect = mCursor->drawCursor(*mCompositePainter);
touchedRegion += cursorRect;
}

View File

@ -373,7 +373,7 @@ static QByteArray filenameForCFUrl(CFURLRef url)
if (!CFURLGetFileSystemRepresentation(url, true, buffer, sizeof(buffer))) {
qWarning("QCoreTextFontDatabase::filenameForCFUrl: could not resolve file for URL %s",
qPrintable(QString::fromCFString(CFURLGetString(url))));
url ? qPrintable(QString::fromCFString(CFURLGetString(url))) : "(null)");
} else {
QCFType<CFStringRef> scheme = CFURLCopyScheme(url);
if (QString::fromCFString(scheme) == QLatin1String("qrc"))

View File

@ -47,6 +47,49 @@
#include <cmath>
#if defined(Q_OS_OSX) && !QT_OSX_DEPLOYMENT_TARGET_BELOW(__MAC_10_11)
#import <AppKit/AppKit.h>
#endif
#if defined(Q_OS_IOS) && !QT_IOS_DEPLOYMENT_TARGET_BELOW(__IPHONE_8_2)
#import <UIKit/UIKit.h>
#endif
// These are available cross platform, exported as kCTFontWeightXXX from CoreText.framework,
// but they are not documented and are not in public headers so are private API and exposed
// only through the NSFontWeightXXX and UIFontWeightXXX aliases in AppKit and UIKit (rdar://26109857)
#if QT_MAC_DEPLOYMENT_TARGET_BELOW(__MAC_10_11, __IPHONE_8_2)
#define kCTFontWeightUltraLight -0.8
#define kCTFontWeightThin -0.6
#define kCTFontWeightLight -0.4
#define kCTFontWeightRegular 0
#define kCTFontWeightMedium 0.23
#define kCTFontWeightSemibold 0.3
#define kCTFontWeightBold 0.4
#define kCTFontWeightHeavy 0.56
#define kCTFontWeightBlack 0.62
#elif defined(Q_OS_OSX)
#define kCTFontWeightUltraLight NSFontWeightUltraLight
#define kCTFontWeightThin NSFontWeightThin
#define kCTFontWeightLight NSFontWeightLight
#define kCTFontWeightRegular NSFontWeightRegular
#define kCTFontWeightMedium NSFontWeightMedium
#define kCTFontWeightSemibold NSFontWeightSemibold
#define kCTFontWeightBold NSFontWeightBold
#define kCTFontWeightHeavy NSFontWeightHeavy
#define kCTFontWeightBlack NSFontWeightBlack
#elif defined(Q_OS_IOS)
#define kCTFontWeightUltraLight UIFontWeightUltraLight
#define kCTFontWeightThin UIFontWeightThin
#define kCTFontWeightLight UIFontWeightLight
#define kCTFontWeightRegular UIFontWeightRegular
#define kCTFontWeightMedium UIFontWeightMedium
#define kCTFontWeightSemibold UIFontWeightSemibold
#define kCTFontWeightBold UIFontWeightBold
#define kCTFontWeightHeavy UIFontWeightHeavy
#define kCTFontWeightBlack UIFontWeightBlack
#endif
QT_BEGIN_NAMESPACE
static float SYNTHETIC_ITALIC_SKEW = std::tan(14.f * std::acos(0.f) / 90.f);
@ -69,24 +112,24 @@ bool QCoreTextFontEngine::ct_getSfntTable(void *user_data, uint tag, uchar *buff
QFont::Weight QCoreTextFontEngine::qtWeightFromCFWeight(float value)
{
if (value >= 0.62)
if (value >= kCTFontWeightBlack)
return QFont::Black;
if (value >= 0.5)
if (value >= kCTFontWeightHeavy)
return QFont::ExtraBold;
if (value >= 0.4)
if (value >= kCTFontWeightBold)
return QFont::Bold;
if (value >= 0.3)
if (value >= kCTFontWeightSemibold)
return QFont::DemiBold;
if (value >= 0.2)
if (value >= kCTFontWeightMedium)
return QFont::Medium;
if (value == 0.0)
if (value == kCTFontWeightRegular)
return QFont::Normal;
if (value <= -0.4)
return QFont::Light;
if (value <= -0.6)
return QFont::ExtraLight;
if (value <= -0.8)
if (value <= kCTFontWeightUltraLight)
return QFont::Thin;
if (value <= kCTFontWeightThin)
return QFont::ExtraLight;
if (value <= kCTFontWeightLight)
return QFont::Light;
return QFont::Normal;
}

View File

@ -41,7 +41,6 @@
#include "platformdefs.h"
#include <QtCore/qmutex.h>
#include <QtCore/private/qmutexpool_p.h>
#include <QtCore/qlibrary.h>
#include <QtNetwork/private/qbearerplugin_p.h>
@ -52,42 +51,32 @@
QT_BEGIN_NAMESPACE
static void resolveLibrary()
static bool resolveLibraryInternal()
{
static QBasicAtomicInt triedResolve = Q_BASIC_ATOMIC_INITIALIZER(false);
if (!triedResolve.loadAcquire()) {
#ifndef QT_NO_THREAD
QMutexLocker locker(QMutexPool::globalInstanceGet(&local_WlanOpenHandle));
#endif
if (!triedResolve.load()) {
QLibrary wlanapiLib(QLatin1String("wlanapi"));
local_WlanOpenHandle = (WlanOpenHandleProto)
wlanapiLib.resolve("WlanOpenHandle");
local_WlanRegisterNotification = (WlanRegisterNotificationProto)
wlanapiLib.resolve("WlanRegisterNotification");
local_WlanEnumInterfaces = (WlanEnumInterfacesProto)
wlanapiLib.resolve("WlanEnumInterfaces");
local_WlanGetAvailableNetworkList = (WlanGetAvailableNetworkListProto)
wlanapiLib.resolve("WlanGetAvailableNetworkList");
local_WlanQueryInterface = (WlanQueryInterfaceProto)
wlanapiLib.resolve("WlanQueryInterface");
local_WlanConnect = (WlanConnectProto)
wlanapiLib.resolve("WlanConnect");
local_WlanDisconnect = (WlanDisconnectProto)
wlanapiLib.resolve("WlanDisconnect");
local_WlanScan = (WlanScanProto)
wlanapiLib.resolve("WlanScan");
local_WlanFreeMemory = (WlanFreeMemoryProto)
wlanapiLib.resolve("WlanFreeMemory");
local_WlanCloseHandle = (WlanCloseHandleProto)
wlanapiLib.resolve("WlanCloseHandle");
triedResolve.storeRelease(true);
}
}
QLibrary wlanapiLib(QLatin1String("wlanapi"));
local_WlanOpenHandle = (WlanOpenHandleProto)
wlanapiLib.resolve("WlanOpenHandle");
local_WlanRegisterNotification = (WlanRegisterNotificationProto)
wlanapiLib.resolve("WlanRegisterNotification");
local_WlanEnumInterfaces = (WlanEnumInterfacesProto)
wlanapiLib.resolve("WlanEnumInterfaces");
local_WlanGetAvailableNetworkList = (WlanGetAvailableNetworkListProto)
wlanapiLib.resolve("WlanGetAvailableNetworkList");
local_WlanQueryInterface = (WlanQueryInterfaceProto)
wlanapiLib.resolve("WlanQueryInterface");
local_WlanConnect = (WlanConnectProto)
wlanapiLib.resolve("WlanConnect");
local_WlanDisconnect = (WlanDisconnectProto)
wlanapiLib.resolve("WlanDisconnect");
local_WlanScan = (WlanScanProto)
wlanapiLib.resolve("WlanScan");
local_WlanFreeMemory = (WlanFreeMemoryProto)
wlanapiLib.resolve("WlanFreeMemory");
local_WlanCloseHandle = (WlanCloseHandleProto)
wlanapiLib.resolve("WlanCloseHandle");
return true;
}
Q_GLOBAL_STATIC_WITH_ARGS(bool, resolveLibrary, (resolveLibraryInternal()))
class QNativeWifiEnginePlugin : public QBearerEnginePlugin
{

View File

@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE
typedef struct
{
quint8 bWidth; // Width of the image
quint8 bHeight; // Height of the image (times 2)
quint8 bHeight; // Height of the image (actual height, not times 2)
quint8 bColorCount; // Number of colors in image (0 if >=8bpp) [ not ture ]
quint8 bReserved; // Reserved
quint16 wPlanes; // Color Planes
@ -687,8 +687,8 @@ bool ICOReader::write(QIODevice *device, const QVector<QImage> &images)
entries[i].bColorCount = 0;
entries[i].bReserved = 0;
entries[i].wBitCount = nbits;
entries[i].bHeight = image.height();
entries[i].bWidth = image.width();
entries[i].bHeight = image.height() < 256 ? image.height() : 0; // 0 means 256
entries[i].bWidth = image.width() < 256 ? image.width() : 0; // 0 means 256
entries[i].dwBytesInRes = BMP_INFOHDR_SIZE + (bpl_bmp * image.height())
+ (maskImage.bytesPerLine() * maskImage.height());
entries[i].wPlanes = 1;
@ -702,11 +702,11 @@ bool ICOReader::write(QIODevice *device, const QVector<QImage> &images)
bmpHeaders[i].biClrImportant = 0;
bmpHeaders[i].biClrUsed = entries[i].bColorCount;
bmpHeaders[i].biCompression = 0;
bmpHeaders[i].biHeight = entries[i].bHeight * 2; // 2 is for the mask
bmpHeaders[i].biHeight = entries[i].bHeight ? entries[i].bHeight * 2 : 256 * 2; // 2 is for the mask
bmpHeaders[i].biPlanes = entries[i].wPlanes;
bmpHeaders[i].biSize = BMP_INFOHDR_SIZE;
bmpHeaders[i].biSizeImage = entries[i].dwBytesInRes - BMP_INFOHDR_SIZE;
bmpHeaders[i].biWidth = entries[i].bWidth;
bmpHeaders[i].biWidth = entries[i].bWidth ? entries[i].bWidth : 256;
bmpHeaders[i].biXPelsPerMeter = 0;
bmpHeaders[i].biYPelsPerMeter = 0;

View File

@ -58,7 +58,7 @@ static NSButton *macCreateButton(const char *text, NSView *superview)
[button setButtonType:NSMomentaryLightButton];
[button setBezelStyle:NSRoundedBezelStyle];
[button setTitle:(NSString*)(CFStringRef)QCFString(
QPlatformTheme::removeMnemonics(QCoreApplication::translate("QDialogButtonBox", text)))];
QPlatformTheme::removeMnemonics(QCoreApplication::translate("QPlatformTheme", text)))];
[[button cell] setFont:[NSFont systemFontOfSize:
[NSFont systemFontSizeForControlSize:NSRegularControlSize]]];
[superview addSubview:button];

View File

@ -179,7 +179,9 @@ void QCocoaMenuBar::syncMenu(QPlatformMenu *menu)
}
}
nativeItemForMenu(cocoaMenu).hidden = shouldHide;
NSMenuItem *nativeMenuItem = nativeItemForMenu(cocoaMenu);
nativeMenuItem.title = cocoaMenu->nsMenu().title;
nativeMenuItem.hidden = shouldHide;
}
NSMenuItem *QCocoaMenuBar::nativeItemForMenu(QCocoaMenu *menu) const

View File

@ -118,6 +118,8 @@ QCocoaMenuItem::~QCocoaMenuItem()
if (m_merged) {
[m_native setHidden:YES];
} else {
if (m_menu && m_menu->attachedItem() == m_native)
m_menu->setAttachedItem(nil);
[m_native release];
}

View File

@ -44,6 +44,7 @@
#include <qpa/qplatformwindow.h>
#include <QRect>
#include <QPointer>
#ifndef QT_NO_OPENGL
#include "qcocoaglcontext.h"
@ -53,6 +54,32 @@
QT_FORWARD_DECLARE_CLASS(QCocoaWindow)
QT_BEGIN_NAMESPACE
class QCocoaWindowPointer
{
public:
void assign(QCocoaWindow *w);
void clear();
QCocoaWindow *data() const
{ return watcher.isNull() ? Q_NULLPTR : window; }
bool isNull() const
{ return watcher.isNull(); }
operator QCocoaWindow*() const
{ return data(); }
QCocoaWindow *operator->() const
{ return data(); }
QCocoaWindow &operator*() const
{ return *data(); }
private:
QPointer<QObject> watcher;
QCocoaWindow *window;
};
QT_END_NAMESPACE
@class QT_MANGLE_NAMESPACE(QNSWindowHelper);
@protocol QNSWindowProtocol
@ -69,14 +96,13 @@ typedef NSWindow<QNSWindowProtocol> QCocoaNSWindow;
@interface QT_MANGLE_NAMESPACE(QNSWindowHelper) : NSObject
{
QCocoaNSWindow *_window;
QCocoaWindow *_platformWindow;
QCocoaWindowPointer _platformWindow;
BOOL _grabbingMouse;
BOOL _releaseOnMouseUp;
QPointer<QObject> _watcher;
}
@property (nonatomic, readonly) QCocoaNSWindow *window;
@property (nonatomic, readonly) QCocoaWindow *platformWindow;
@property (nonatomic, readonly) QCocoaWindowPointer platformWindow;
@property (nonatomic) BOOL grabbingMouse;
@property (nonatomic) BOOL releaseOnMouseUp;
@ -260,7 +286,7 @@ public: // for QNSView
NSView *m_contentView;
QNSView *m_qtView;
QCocoaNSWindow *m_nsWindow;
QCocoaWindow *m_forwardWindow;
QCocoaWindowPointer m_forwardWindow;
// TODO merge to one variable if possible
bool m_contentViewIsEmbedded; // true if the m_contentView is actually embedded in a "foreign" NSView hiearchy
@ -323,9 +349,8 @@ public: // for QNSView
QHash<quintptr, BorderRange> m_contentBorderAreas; // identifer -> uppper/lower
QHash<quintptr, bool> m_enabledContentBorderAreas; // identifer -> enabled state (true/false)
// This object is tracked by a 'watcher'
// object in a window helper, preventing use of dangling
// pointers.
// This object is tracked by QCocoaWindowPointer,
// preventing the use of dangling pointers.
QObject sentinel;
};

View File

@ -90,7 +90,7 @@ static bool isMouseEvent(NSEvent *ev)
self = [super init];
if (self) {
_window = window;
_platformWindow = platformWindow;
_platformWindow.assign(platformWindow);
_window.delegate = [[QNSWindowDelegate alloc] initWithQCocoaWindow:_platformWindow];
@ -99,7 +99,6 @@ static bool isMouseEvent(NSEvent *ev)
// make sure that m_nsWindow stays valid until the
// QCocoaWindow is deleted by Qt.
[_window setReleasedWhenClosed:NO];
_watcher = &_platformWindow->sentinel;
}
return self;
@ -108,19 +107,19 @@ static bool isMouseEvent(NSEvent *ev)
- (void)handleWindowEvent:(NSEvent *)theEvent
{
QCocoaWindow *pw = self.platformWindow;
if (_watcher && pw && pw->m_forwardWindow) {
if (pw && pw->m_forwardWindow) {
if (theEvent.type == NSLeftMouseUp || theEvent.type == NSLeftMouseDragged) {
QNSView *forwardView = pw->m_qtView;
if (theEvent.type == NSLeftMouseUp) {
[forwardView mouseUp:theEvent];
pw->m_forwardWindow = 0;
pw->m_forwardWindow.clear();
} else {
[forwardView mouseDragged:theEvent];
}
}
if (!pw->m_isNSWindowChild && theEvent.type == NSLeftMouseDown) {
pw->m_forwardWindow = 0;
pw->m_forwardWindow.clear();
}
}
@ -147,7 +146,7 @@ static bool isMouseEvent(NSEvent *ev)
if (!self.window.delegate)
return; // Already detached, pending NSAppKitDefined event
if (_watcher && pw && pw->frameStrutEventsEnabled() && isMouseEvent(theEvent)) {
if (pw && pw->frameStrutEventsEnabled() && isMouseEvent(theEvent)) {
NSPoint loc = [theEvent locationInWindow];
NSRect windowFrame = [self.window convertRectFromScreen:[self.window frame]];
NSRect contentFrame = [[self.window contentView] frame];
@ -162,8 +161,7 @@ static bool isMouseEvent(NSEvent *ev)
- (void)detachFromPlatformWindow
{
_platformWindow = 0;
_watcher.clear();
self.platformWindow.clear();
[self.window.delegate release];
self.window.delegate = nil;
}
@ -184,7 +182,7 @@ static bool isMouseEvent(NSEvent *ev)
- (void)dealloc
{
_window = nil;
_platformWindow = 0;
self.platformWindow.clear();
[super dealloc];
}
@ -336,6 +334,18 @@ static bool isMouseEvent(NSEvent *ev)
@end
void QCocoaWindowPointer::assign(QCocoaWindow *w)
{
window = w;
watcher = &w->sentinel;
}
void QCocoaWindowPointer::clear()
{
window = Q_NULLPTR;
watcher.clear();
}
const int QCocoaWindow::NoAlertRequest = -1;
QCocoaWindow::QCocoaWindow(QWindow *tlw)
@ -343,7 +353,6 @@ QCocoaWindow::QCocoaWindow(QWindow *tlw)
, m_contentView(nil)
, m_qtView(nil)
, m_nsWindow(0)
, m_forwardWindow(0)
, m_contentViewIsEmbedded(false)
, m_contentViewIsToBeEmbedded(false)
, m_parentCocoaWindow(0)
@ -1138,8 +1147,7 @@ bool QCocoaWindow::setKeyboardGrabEnabled(bool grab)
if (grab && ![m_nsWindow isKeyWindow])
[m_nsWindow makeKeyWindow];
else if (!grab && [m_nsWindow isKeyWindow])
[m_nsWindow resignKeyWindow];
return true;
}
@ -1151,8 +1159,7 @@ bool QCocoaWindow::setMouseGrabEnabled(bool grab)
if (grab && ![m_nsWindow isKeyWindow])
[m_nsWindow makeKeyWindow];
else if (!grab && [m_nsWindow isKeyWindow])
[m_nsWindow resignKeyWindow];
return true;
}
@ -1339,7 +1346,7 @@ void QCocoaWindow::recreateWindow(const QPlatformWindow *parentWindow)
if (oldParentCocoaWindow) {
if (!m_isNSWindowChild || oldParentCocoaWindow != m_parentCocoaWindow)
oldParentCocoaWindow->removeChildWindow(this);
m_forwardWindow = oldParentCocoaWindow;
m_forwardWindow.assign(oldParentCocoaWindow);
}
setNSWindow(m_nsWindow);

View File

@ -290,6 +290,7 @@ static bool _q_dontOverrideCtrlLMB = false;
- (void)viewDidMoveToWindow
{
m_backingStore = Q_NULLPTR;
m_isMenuView = [self.window.className isEqualToString:@"NSCarbonMenuWindow"];
if (self.window) {
// This is the case of QWidgetAction's generated QWidget inserted in an NSMenu.
@ -760,7 +761,7 @@ QT_WARNING_POP
if (theEvent.type == NSLeftMouseDragged || theEvent.type == NSLeftMouseUp)
targetView = m_platformWindow->m_forwardWindow->m_qtView;
else
m_platformWindow->m_forwardWindow = 0;
m_platformWindow->m_forwardWindow.clear();
}
// Popups implicitly grap mouse events; forward to the active popup if there is one

View File

@ -48,6 +48,7 @@
#include <QtCore/QJsonArray>
#include <QtCore/QLoggingCategory>
#include <QtGui/QPainter>
#include <QtGui/private/qguiapplication_p.h>
#include <xf86drm.h>
#include <xf86drmMode.h>
@ -69,13 +70,13 @@ QEglFSKmsGbmCursor::QEglFSKmsGbmCursor(QEglFSKmsGbmScreen *screen)
, m_cursorSize(64, 64) // 64x64 is the old standard size, we now try to query the real size below
, m_bo(Q_NULLPTR)
, m_cursorImage(0, 0, 0, 0, 0, 0)
, m_visible(true)
, m_state(CursorPendingVisible)
{
QByteArray hideCursorVal = qgetenv("QT_QPA_EGLFS_HIDECURSOR");
if (!hideCursorVal.isEmpty())
m_visible = hideCursorVal.toInt() == 0;
if (!m_visible)
if (!hideCursorVal.isEmpty() && hideCursorVal.toInt()) {
m_state = CursorDisabled;
return;
}
uint64_t width, height;
if ((drmGetCap(m_screen->device()->fd(), DRM_CAP_CURSOR_WIDTH, &width) == 0)
@ -92,6 +93,12 @@ QEglFSKmsGbmCursor::QEglFSKmsGbmCursor(QEglFSKmsGbmScreen *screen)
initCursorAtlas();
}
m_deviceListener = new QEglFSKmsGbmCursorDeviceListener(this);
connect(QGuiApplicationPrivate::inputDeviceManager(), &QInputDeviceManager::deviceListChanged,
m_deviceListener, &QEglFSKmsGbmCursorDeviceListener::onDeviceListChanged);
if (!m_deviceListener->hasMouse())
m_state = CursorPendingHidden;
#ifndef QT_NO_CURSOR
QCursor cursor(Qt::ArrowCursor);
changeCursor(&cursor, 0);
@ -101,6 +108,8 @@ QEglFSKmsGbmCursor::QEglFSKmsGbmCursor(QEglFSKmsGbmScreen *screen)
QEglFSKmsGbmCursor::~QEglFSKmsGbmCursor()
{
delete m_deviceListener;
Q_FOREACH (QPlatformScreen *screen, m_screen->virtualSiblings()) {
QEglFSKmsScreen *kmsScreen = static_cast<QEglFSKmsScreen *>(screen);
drmModeSetCursor(kmsScreen->device()->fd(), kmsScreen->output().crtc_id, 0, 0, 0);
@ -113,6 +122,31 @@ QEglFSKmsGbmCursor::~QEglFSKmsGbmCursor()
}
}
void QEglFSKmsGbmCursor::updateMouseStatus()
{
const bool wasVisible = m_state == CursorVisible;
const bool visible = m_deviceListener->hasMouse();
if (visible == wasVisible)
return;
m_state = visible ? CursorPendingVisible : CursorPendingHidden;
#ifndef QT_NO_CURSOR
changeCursor(nullptr, m_screen->topLevelAt(pos()));
#endif
}
bool QEglFSKmsGbmCursorDeviceListener::hasMouse() const
{
return QGuiApplicationPrivate::inputDeviceManager()->deviceCount(QInputDeviceManager::DeviceTypePointer) > 0;
}
void QEglFSKmsGbmCursorDeviceListener::onDeviceListChanged(QInputDeviceManager::DeviceType type)
{
if (type == QInputDeviceManager::DeviceTypePointer)
m_cursor->updateMouseStatus();
}
void QEglFSKmsGbmCursor::pointerEvent(const QMouseEvent &event)
{
setPos(event.screenPos().toPoint());
@ -126,7 +160,15 @@ void QEglFSKmsGbmCursor::changeCursor(QCursor *windowCursor, QWindow *window)
if (!m_bo)
return;
if (!m_visible)
if (m_state == CursorPendingHidden) {
m_state = CursorHidden;
Q_FOREACH (QPlatformScreen *screen, m_screen->virtualSiblings()) {
QEglFSKmsScreen *kmsScreen = static_cast<QEglFSKmsScreen *>(screen);
drmModeSetCursor(kmsScreen->device()->fd(), kmsScreen->output().crtc_id, 0, 0, 0);
}
}
if (m_state == CursorHidden || m_state == CursorDisabled)
return;
const Qt::CursorShape newShape = windowCursor ? windowCursor->shape() : Qt::ArrowCursor;
@ -166,6 +208,9 @@ void QEglFSKmsGbmCursor::changeCursor(QCursor *windowCursor, QWindow *window)
uint32_t handle = gbm_bo_get_handle(m_bo).u32;
if (m_state == CursorPendingVisible)
m_state = CursorVisible;
Q_FOREACH (QPlatformScreen *screen, m_screen->virtualSiblings()) {
QEglFSKmsScreen *kmsScreen = static_cast<QEglFSKmsScreen *>(screen);
@ -213,7 +258,7 @@ void QEglFSKmsGbmCursor::initCursorAtlas()
drmModeSetCursor(kmsScreen->device()->fd(), kmsScreen->output().crtc_id, 0, 0, 0);
drmModeMoveCursor(kmsScreen->device()->fd(), kmsScreen->output().crtc_id, 0, 0);
}
m_visible = false;
m_state = CursorDisabled;
return;
}

View File

@ -43,12 +43,29 @@
#include <qpa/qplatformcursor.h>
#include <QtCore/QList>
#include <QtGui/QImage>
#include <QtGui/private/qinputdevicemanager_p.h>
#include <gbm.h>
QT_BEGIN_NAMESPACE
class QEglFSKmsGbmScreen;
class QEglFSKmsGbmCursor;
class QEglFSKmsGbmCursorDeviceListener : public QObject
{
Q_OBJECT
public:
QEglFSKmsGbmCursorDeviceListener(QEglFSKmsGbmCursor *cursor) : m_cursor(cursor) { }
bool hasMouse() const;
public slots:
void onDeviceListChanged(QInputDeviceManager::DeviceType type);
private:
QEglFSKmsGbmCursor *m_cursor;
};
class QEglFSKmsGbmCursor : public QPlatformCursor
{
@ -66,15 +83,26 @@ public:
QPoint pos() const Q_DECL_OVERRIDE;
void setPos(const QPoint &pos) Q_DECL_OVERRIDE;
void updateMouseStatus();
private:
void initCursorAtlas();
enum CursorState {
CursorDisabled,
CursorPendingHidden,
CursorHidden,
CursorPendingVisible,
CursorVisible
};
QEglFSKmsGbmScreen *m_screen;
QSize m_cursorSize;
gbm_bo *m_bo;
QPoint m_pos;
QPlatformCursorImage m_cursorImage;
bool m_visible;
CursorState m_state;
QEglFSKmsGbmCursorDeviceListener *m_deviceListener;
// cursor atlas information
struct CursorAtlas {

View File

@ -37,6 +37,7 @@
**
****************************************************************************/
#include "qeglfsglobal.h"
#include <QtGui/QSurface>
#include <QtPlatformSupport/private/qeglconvenience_p.h>
#include <QtPlatformSupport/private/qeglpbuffer_p.h>

View File

@ -40,9 +40,9 @@
#ifndef QEGLFSCONTEXT_H
#define QEGLFSCONTEXT_H
#include "qeglfsglobal.h"
#include <QtPlatformSupport/private/qeglplatformcontext_p.h>
#include <QtCore/QVariant>
#include "qeglfsglobal.h"
QT_BEGIN_NAMESPACE

View File

@ -51,13 +51,12 @@
// We mean it.
//
#include "qeglfsglobal.h"
#include <qpa/qplatformintegration.h>
#include <qpa/qplatformscreen.h>
#include <QtCore/QString>
#include <QtGui/QSurfaceFormat>
#include <QtGui/QImage>
#include <EGL/egl.h>
#include "qeglfsglobal.h"
QT_BEGIN_NAMESPACE

View File

@ -48,4 +48,17 @@
#define Q_EGLFS_EXPORT Q_DECL_IMPORT
#endif
#include <EGL/egl.h>
#undef Status
#undef None
#undef Bool
#undef CursorShape
#undef KeyPress
#undef KeyRelease
#undef FocusIn
#undef FocusOut
#undef FontChange
#undef Expose
#undef Unsorted
#endif

View File

@ -40,8 +40,8 @@
#ifndef QEGLFSHOOKS_H
#define QEGLFSHOOKS_H
#include "qeglfsdeviceintegration.h"
#include "qeglfsglobal.h"
#include "qeglfsdeviceintegration.h"
QT_BEGIN_NAMESPACE

View File

@ -86,8 +86,6 @@
#include <QtPlatformHeaders/qeglfsfunctions.h>
#include <EGL/egl.h>
static void initResources()
{
#ifndef QT_NO_CURSOR

View File

@ -40,12 +40,11 @@
#ifndef QEGLFSINTEGRATION_H
#define QEGLFSINTEGRATION_H
#include "qeglfsglobal.h"
#include <QtCore/QVariant>
#include <qpa/qplatformintegration.h>
#include <qpa/qplatformnativeinterface.h>
#include <qpa/qplatformscreen.h>
#include <EGL/egl.h>
#include "qeglfsglobal.h"
QT_BEGIN_NAMESPACE

View File

@ -40,9 +40,8 @@
#ifndef QEGLFSOFFSCREENWINDOW_H
#define QEGLFSOFFSCREENWINDOW_H
#include <EGL/egl.h>
#include <qpa/qplatformoffscreensurface.h>
#include "qeglfsglobal.h"
#include <qpa/qplatformoffscreensurface.h>
QT_BEGIN_NAMESPACE

View File

@ -42,7 +42,6 @@
#include "qeglfsglobal.h"
#include <QtCore/QPointer>
#include <EGL/egl.h>
QT_BEGIN_NAMESPACE

View File

@ -40,13 +40,12 @@
#ifndef QEGLFSWINDOW_H
#define QEGLFSWINDOW_H
#include "qeglfsglobal.h"
#include "qeglfsintegration.h"
#include "qeglfsscreen.h"
#include "qeglfsglobal.h"
#include <qpa/qplatformwindow.h>
#include <QtPlatformSupport/private/qopenglcompositor_p.h>
#include <EGL/egl.h>
QT_BEGIN_NAMESPACE

View File

@ -412,9 +412,12 @@ QRegion QLinuxFbScreen::doRedraw()
if (!mBlitter)
mBlitter = new QPainter(&mFbScreenImage);
QVector<QRect> rects = touched.rects();
for (int i = 0; i < rects.size(); i++)
const QVector<QRect> rects = touched.rects();
mBlitter->setCompositionMode(QPainter::CompositionMode_Source);
for (int i = 0; i < rects.size(); ++i)
mBlitter->drawImage(rects[i], *mScreenImage, rects[i]);
return touched;
}

View File

@ -504,7 +504,8 @@ HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::accHitTest(long xLeft, long yT
if (!accessible)
return E_FAIL;
const QPoint pos = QHighDpi::fromNativeLocalPosition(QPoint(xLeft, yTop), accessible->window());
const QPoint pos = QHighDpi::fromNativeLocalPosition(QPoint(xLeft, yTop),
QWindowsAccessibility::windowHelper(accessible));
QAccessibleInterface *child = accessible->childAt(pos.x(), pos.y());
if (child == 0) {
// no child found, return this item if it contains the coordinates
@ -547,7 +548,8 @@ HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::accLocation(long *pxLeft, long
QAccessibleInterface *acc = childPointer(accessible, varID);
if (!acc || !acc->isValid())
return E_FAIL;
const QRect rect = QHighDpi::toNativePixels(acc->rect(), accessible->window());
const QRect rect = QHighDpi::toNativePixels(acc->rect(),
QWindowsAccessibility::windowHelper(accessible));
*pxLeft = rect.x();
*pyTop = rect.y();

View File

@ -90,6 +90,18 @@
"features": [
"disable_angle"
]
},
{
"id": 8,
"description": "Standard VGA: Insufficent support for OpenGL, D3D9 and D3D11",
"vendor_id": "0x0000",
"device_id": ["0x0000"],
"os": {
"type": "win"
},
"features": [
"disable_desktopgl", "disable_d3d11", "disable_d3d9"
]
}
]
}

View File

@ -146,7 +146,8 @@ struct QWindowsIntegrationPrivate
# endif
#endif
#ifndef QT_NO_OPENGL
QSharedPointer<QWindowsStaticOpenGLContext> m_staticOpenGLContext;
QMutex m_staticContextLock;
QScopedPointer<QWindowsStaticOpenGLContext> m_staticOpenGLContext;
#endif // QT_NO_OPENGL
QScopedPointer<QPlatformInputContext> m_inputContext;
#ifndef QT_NO_ACCESSIBILITY
@ -464,8 +465,9 @@ QWindowsStaticOpenGLContext *QWindowsIntegration::staticOpenGLContext()
if (!integration)
return 0;
QWindowsIntegrationPrivate *d = integration->d.data();
QMutexLocker lock(&d->m_staticContextLock);
if (d->m_staticOpenGLContext.isNull())
d->m_staticOpenGLContext = QSharedPointer<QWindowsStaticOpenGLContext>(QWindowsStaticOpenGLContext::create());
d->m_staticOpenGLContext.reset(QWindowsStaticOpenGLContext::create());
return d->m_staticOpenGLContext.data();
}
#endif // !QT_NO_OPENGL

View File

@ -126,6 +126,7 @@ contains(QT_CONFIG, freetype) {
SOURCES += \
$$PWD/qwindowsfontdatabase_ft.cpp
} else:contains(QT_CONFIG, system-freetype) {
CONFIG += qpa/basicunixfontdatabase
include($$QT_SOURCE_TREE/src/platformsupport/fontdatabases/basic/basic.pri)
HEADERS += \
$$PWD/qwindowsfontdatabase_ft.h

View File

@ -110,9 +110,6 @@ QWinRTWindow::QWinRTWindow(QWindow *window)
d->surface = EGL_NO_SURFACE;
d->display = EGL_NO_DISPLAY;
d->screen = static_cast<QWinRTScreen *>(screen());
setWindowFlags(window->flags());
setWindowState(window->windowState());
setWindowTitle(window->title());
handleContentOrientationChange(window->contentOrientation());
d->surfaceFormat.setAlphaBufferSize(0);
@ -160,6 +157,10 @@ QWinRTWindow::QWinRTWindow(QWindow *window)
});
Q_ASSERT_SUCCEEDED(hr);
setWindowFlags(window->flags());
setWindowState(window->windowState());
setWindowTitle(window->title());
setGeometry(window->geometry());
}

View File

@ -56,6 +56,7 @@
#include <qpa/qwindowsysteminterface.h>
#include <private/qguiapplication_p.h>
#include <private/qshapedpixmapdndwindow_p.h>
#include <private/qsimpledrag_p.h>
#include <private/qhighdpiscaling_p.h>
@ -176,6 +177,17 @@ QMimeData *QXcbDrag::platformDropData()
return dropData;
}
bool QXcbDrag::eventFilter(QObject *o, QEvent *e)
{
/* We are setting a mouse grab on the QShapedPixmapWindow in order not to
* lose the grab when the virtual desktop changes, but
* QBasicDrag::eventFilter() expects the events to be coming from the
* window where the drag was started. */
if (initiatorWindow && o == shapedPixmapWindow())
o = initiatorWindow.data();
return QBasicDrag::eventFilter(o, e);
}
void QXcbDrag::startDrag()
{
// #fixme enableEventFilter();
@ -200,6 +212,7 @@ void QXcbDrag::startDrag()
setUseCompositing(current_virtual_desktop->compositingActive());
setScreen(current_virtual_desktop->screens().constFirst()->screen());
initiatorWindow = QGuiApplicationPrivate::currentMouseWindow;
QBasicDrag::startDrag();
if (connection()->mouseGrabber() == Q_NULLPTR)
shapedPixmapWindow()->setMouseGrabEnabled(true);
@ -208,6 +221,7 @@ void QXcbDrag::startDrag()
void QXcbDrag::endDrag()
{
QBasicDrag::endDrag();
initiatorWindow.clear();
}
static xcb_translate_coordinates_reply_t *
@ -821,7 +835,7 @@ void QXcbDrag::handle_xdnd_status(const xcb_client_message_event_t *event)
DEBUG("xdndHandleStatus");
waiting_for_status = false;
// ignore late status messages
if (event->data.data32[0] && event->data.data32[0] != current_proxy_target)
if (event->data.data32[0] && event->data.data32[0] != current_target)
return;
const bool dropPossible = event->data.data32[1];

View File

@ -75,6 +75,7 @@ public:
~QXcbDrag();
virtual QMimeData *platformDropData() Q_DECL_OVERRIDE;
bool eventFilter(QObject *o, QEvent *e) Q_DECL_OVERRIDE;
void startDrag() Q_DECL_OVERRIDE;
void cancel() Q_DECL_OVERRIDE;
@ -112,6 +113,7 @@ private:
Qt::DropAction toDropAction(xcb_atom_t atom) const;
xcb_atom_t toXdndAction(Qt::DropAction a) const;
QPointer<QWindow> initiatorWindow;
QPointer<QWindow> currentWindow;
QPoint currentPosition;

View File

@ -117,17 +117,18 @@ bool QXcbMime::mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeDa
QString atomName = mimeAtomToString(connection, a);
if (QInternalMimeData::hasFormatHelper(atomName, mimeData)) {
*data = QInternalMimeData::renderDataHelper(atomName, mimeData);
if (atomName == QLatin1String("application/x-color"))
// mimeAtomToString() converts "text/x-moz-url" to "text/uri-list",
// so QXcbConnection::atomName() has to be used.
if (atomName == QLatin1String("text/uri-list")
&& connection->atomName(a) == "text/x-moz-url") {
const QByteArray uri = data->split('\n').first();
QString mozUri = QString::fromLatin1(uri, uri.size());
mozUri += QLatin1Char('\n');
*data = QByteArray(reinterpret_cast<const char *>(mozUri.utf16()),
mozUri.length() * 2);
} else if (atomName == QLatin1String("application/x-color"))
*dataFormat = 16;
ret = true;
} else if (atomName == QLatin1String("text/x-moz-url") &&
QInternalMimeData::hasFormatHelper(QLatin1String("text/uri-list"), mimeData)) {
QByteArray uri = QInternalMimeData::renderDataHelper(
QLatin1String("text/uri-list"), mimeData).split('\n').first();
QString mozUri = QString::fromLatin1(uri, uri.size());
mozUri += QLatin1Char('\n');
*data = QByteArray(reinterpret_cast<const char *>(mozUri.utf16()), mozUri.length() * 2);
ret = true;
} else if ((a == XCB_ATOM_PIXMAP || a == XCB_ATOM_BITMAP) && mimeData->hasImage()) {
ret = true;
}
@ -188,17 +189,37 @@ QVariant QXcbMime::mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a,
a == connection->atom(QXcbAtom::TEXT))
return QString::fromLatin1(data);
}
// special case for uri types
if (format == QLatin1String("text/uri-list")) {
if (atomName == QLatin1String("text/x-moz-url")) {
// we expect this as utf16 <url><space><title>
// the first part is a url that should only contain ascci char
// so it should be safe to check that the second char is 0
// to verify that it is utf16
if (data.size() > 1 && data.at(1) == 0)
return QString::fromRawData((const QChar *)data.constData(),
data.size() / 2).split(QLatin1Char('\n')).first().toLatin1();
// If data contains UTF16 text, convert it to a string.
// Firefox uses UTF16 without BOM for text/x-moz-url, "text/html",
// Google Chrome uses UTF16 without BOM for "text/x-moz-url",
// UTF16 with BOM for "text/html".
if ((format == QLatin1String("text/html") || format == QLatin1String("text/uri-list"))
&& data.size() > 1) {
const quint8 byte0 = data.at(0);
const quint8 byte1 = data.at(1);
if ((byte0 == 0xff && byte1 == 0xfe) || (byte0 == 0xfe && byte1 == 0xff)
|| (byte0 != 0 && byte1 == 0) || (byte0 == 0 && byte1 != 0)) {
const QString str = QString::fromUtf16(
reinterpret_cast<const ushort *>(data.constData()), data.size() / 2);
if (!str.isNull()) {
if (format == QLatin1String("text/uri-list")) {
const QStringList urls = str.split(QLatin1Char('\n'));
QList<QVariant> list;
foreach (const QString &s, urls) {
const QUrl url(s.trimmed());
if (url.isValid())
list.append(url);
}
// We expect "text/x-moz-url" as <url><space><title>.
// The atomName variable is not used because mimeAtomToString()
// converts "text/x-moz-url" to "text/uri-list".
if (!list.isEmpty() && connection->atomName(a) == "text/x-moz-url")
return list.first();
return list;
} else {
return str;
}
}
}
}

View File

@ -2336,9 +2336,14 @@ void QXcbWindow::handleMotionNotifyEvent(int event_x, int event_y, int root_x, i
QPoint local(event_x, event_y);
QPoint global(root_x, root_y);
// "mousePressWindow" can be NULL i.e. if a window will be grabbed or umnapped, so set it again here
if (connection()->buttons() != Qt::NoButton && connection()->mousePressWindow() == Q_NULLPTR)
// "mousePressWindow" can be NULL i.e. if a window will be grabbed or unmapped, so set it again here.
// Unset "mousePressWindow" when mouse button isn't pressed - in some cases the release event won't arrive.
const bool isMouseButtonPressed = (connection()->buttons() != Qt::NoButton);
const bool hasMousePressWindow = (connection()->mousePressWindow() != Q_NULLPTR);
if (isMouseButtonPressed && !hasMousePressWindow)
connection()->setMousePressWindow(this);
else if (hasMousePressWindow && !isMouseButtonPressed)
connection()->setMousePressWindow(Q_NULLPTR);
handleMouseEvent(timestamp, local, global, modifiers, source);
}

Some files were not shown because too many files have changed in this diff Show More