Merge remote-tracking branch 'origin/5.7' into dev
Conflicts: mkspecs/wince80colibri-armv7-msvc2012/qmake.conf qmake/generators/win32/msvc_vcproj.cpp src/corelib/global/qnamespace.h src/corelib/global/qnamespace.qdoc src/corelib/io/qfsfileengine_win.cpp src/corelib/tools/tools.pri src/network/ssl/qsslconfiguration_p.h src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp src/plugins/platforms/windows/windows.pri src/src.pro src/tools/bootstrap/bootstrap.pro src/tools/uic/cpp/cppwriteinitialization.cpp src/widgets/dialogs/qfilesystemmodel.cpp tests/auto/testlib/selftests/expected_cmptest.teamcity tests/auto/testlib/selftests/expected_cmptest.txt Change-Id: I4d2ac78f0dcc97f008186bbbc769c6fe588ab0e5
This commit is contained in:
commit
56d6e000f7
@ -1,5 +1,4 @@
|
||||
load(qt_build_config)
|
||||
CONFIG += qt_example_installs
|
||||
CONFIG += warning_clean
|
||||
|
||||
QT_SOURCE_TREE = $$PWD
|
||||
|
@ -43,6 +43,8 @@
|
||||
|
||||
int main(int, char **)
|
||||
{
|
||||
fbGetDisplay();
|
||||
// Do not rely on fbGetDisplay() since the signature has changed over time.
|
||||
// Stick to fbGetDisplayByIndex().
|
||||
fbGetDisplayByIndex(0);
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
SOURCES = kms.cpp
|
||||
CONFIG += link_pkgconfig
|
||||
PKGCONFIG += libdrm libudev
|
||||
PKGCONFIG += libdrm
|
||||
CONFIG -= qt
|
||||
|
@ -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
49
configure
vendored
@ -91,6 +91,7 @@ for i in "$@"; do
|
||||
done
|
||||
|
||||
# initialize global variables
|
||||
CONFIG_SEPARATORS=`printf ' \t'`
|
||||
QMAKE_SWITCHES=
|
||||
QMAKE_VARS=
|
||||
QMAKE_CONFIG=
|
||||
@ -354,6 +355,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
|
||||
@ -3248,7 +3264,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)"
|
||||
@ -3260,12 +3276,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"
|
||||
@ -3316,9 +3326,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'`
|
||||
@ -3547,6 +3554,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 "$@"
|
||||
}
|
||||
|
||||
@ -4679,6 +4687,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
|
||||
QMAKE_CFLAGS_FONTCONFIG=`$PKG_CONFIG --cflags fontconfig --cflags freetype2 2>/dev/null`
|
||||
@ -4865,6 +4874,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
|
||||
@ -5599,7 +5613,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
|
||||
@ -6516,6 +6534,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"
|
||||
|
@ -11,3 +11,6 @@ SOURCES += \
|
||||
HEADERS += \
|
||||
mimetypemodel.h \
|
||||
mainwindow.h
|
||||
|
||||
target.path = $$[QT_INSTALL_EXAMPLES]/corelib/mimetypes/mimetypebrowser
|
||||
INSTALLS += target
|
||||
|
@ -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()) {
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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: \
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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).
|
||||
|
@ -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
|
||||
|
@ -105,6 +105,7 @@ CPPFLAGS = -g $(EXTRA_CPPFLAGS) \
|
||||
-DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL \
|
||||
-DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_COMPRESS \
|
||||
-DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \
|
||||
-DQT_NO_FOREACH \
|
||||
-DQT_CRYPTOGRAPHICHASH_ONLY_SHA1 -DQT_JSON_READONLY -DQT_NO_STANDARDPATHS
|
||||
|
||||
CXXFLAGS = $(EXTRA_CXXFLAGS) $(CPPFLAGS)
|
||||
|
@ -49,6 +49,7 @@ CFLAGS_BARE = -c -Fo./ -Fdqmake.pdb \
|
||||
-DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL \
|
||||
-DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_COMPRESS \
|
||||
-DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \
|
||||
-DQT_NO_FOREACH \
|
||||
-DUNICODE -DQT_CRYPTOGRAPHICHASH_ONLY_SHA1 -DQT_JSON_READONLY -DQT_NO_STANDARDPATHS
|
||||
CFLAGS = $(CFLAGS_PCH) $(CFLAGS_BARE) $(CFLAGS)
|
||||
|
||||
|
@ -1296,7 +1296,7 @@ void VcprojGenerator::initDeploymentTool()
|
||||
|
||||
if (foundGuid || dllName.contains(QLatin1String("Gui"))) {
|
||||
QFileInfo info2;
|
||||
foreach (const ProString &dllPath, dllPaths) {
|
||||
for (const ProString &dllPath : dllPaths) {
|
||||
QString absoluteDllFilePath = dllPath.toQString();
|
||||
if (!absoluteDllFilePath.endsWith(QLatin1Char('/')))
|
||||
absoluteDllFilePath += QLatin1Char('/');
|
||||
|
@ -130,8 +130,9 @@ public:
|
||||
bool contains(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return indexOf(s, 0, cs) >= 0; }
|
||||
bool contains(const char *s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return indexOf(QLatin1String(s), 0, cs) >= 0; }
|
||||
bool contains(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return indexOf(c, 0, cs) >= 0; }
|
||||
int toInt(bool *ok = 0, int base = 10) const { return toQString().toInt(ok, base); } // XXX optimize
|
||||
short toShort(bool *ok = 0, int base = 10) const { return toQString().toShort(ok, base); } // XXX optimize
|
||||
int toLongLong(bool *ok = 0, int base = 10) const { return toQStringRef().toLongLong(ok, base); }
|
||||
int toInt(bool *ok = 0, int base = 10) const { return toQStringRef().toInt(ok, base); }
|
||||
short toShort(bool *ok = 0, int base = 10) const { return toQStringRef().toShort(ok, base); }
|
||||
|
||||
uint hash() const { return m_hash; }
|
||||
static uint hash(const QChar *p, int n);
|
||||
|
@ -192,9 +192,8 @@ void QMakeEvaluator::initFunctionStatics()
|
||||
statics.functions.insert(ProKey(testInits[i].name), testInits[i].func);
|
||||
}
|
||||
|
||||
static bool isTrue(const ProString &_str, QString &tmp)
|
||||
static bool isTrue(const ProString &str)
|
||||
{
|
||||
const QString &str = _str.toQString(tmp);
|
||||
return !str.compare(statics.strtrue, Qt::CaseInsensitive) || str.toInt();
|
||||
}
|
||||
|
||||
@ -478,9 +477,9 @@ ProStringList QMakeEvaluator::evaluateBuiltinExpand(
|
||||
} else {
|
||||
var = args[0];
|
||||
sep = args.at(1).toQString();
|
||||
beg = args.at(2).toQString(m_tmp2).toInt();
|
||||
beg = args.at(2).toInt();
|
||||
if (args.count() == 4)
|
||||
end = args.at(3).toQString(m_tmp2).toInt();
|
||||
end = args.at(3).toInt();
|
||||
}
|
||||
} else {
|
||||
if (args.count() != 1) {
|
||||
@ -562,7 +561,7 @@ ProStringList QMakeEvaluator::evaluateBuiltinExpand(
|
||||
break;
|
||||
}
|
||||
bool ok;
|
||||
qlonglong num = m_tmp3.toLongLong(&ok, ibase);
|
||||
qlonglong num = args.at(0).toLongLong(&ok, ibase);
|
||||
if (!ok) {
|
||||
evalError(fL1S("format_number(): malformed number %2 for base %1.")
|
||||
.arg(ibase).arg(m_tmp3));
|
||||
@ -639,7 +638,7 @@ ProStringList QMakeEvaluator::evaluateBuiltinExpand(
|
||||
const ProStringList &var = values(map(args.at(0)));
|
||||
int start = 0, end = 0;
|
||||
if (args.count() >= 2) {
|
||||
const QString &start_str = args.at(1).toQString(m_tmp1);
|
||||
const ProString &start_str = args.at(1);
|
||||
start = start_str.toInt(&ok);
|
||||
if (!ok) {
|
||||
if (args.count() == 2) {
|
||||
@ -652,11 +651,11 @@ ProStringList QMakeEvaluator::evaluateBuiltinExpand(
|
||||
}
|
||||
if (!ok)
|
||||
evalError(fL1S("member() argument 2 (start) '%2' invalid.")
|
||||
.arg(start_str));
|
||||
.arg(start_str.toQString(m_tmp1)));
|
||||
} else {
|
||||
end = start;
|
||||
if (args.count() == 3)
|
||||
end = args.at(2).toQString(m_tmp1).toInt(&ok);
|
||||
end = args.at(2).toInt(&ok);
|
||||
if (!ok)
|
||||
evalError(fL1S("member() argument 3 (end) '%2' invalid.")
|
||||
.arg(args.at(2).toQString(m_tmp1)));
|
||||
@ -904,7 +903,7 @@ ProStringList QMakeEvaluator::evaluateBuiltinExpand(
|
||||
} else {
|
||||
bool recursive = false;
|
||||
if (args.count() == 2)
|
||||
recursive = isTrue(args.at(1), m_tmp2);
|
||||
recursive = isTrue(args.at(1));
|
||||
QStringList dirs;
|
||||
QString r = m_option->expandEnvVars(args.at(0).toQString(m_tmp1))
|
||||
.replace(QLatin1Char('\\'), QLatin1Char('/'));
|
||||
@ -1292,7 +1291,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
|
||||
return ReturnFalse;
|
||||
}
|
||||
int cnt = values(map(args.at(0))).count();
|
||||
int val = args.at(1).toQString(m_tmp1).toInt();
|
||||
int val = args.at(1).toInt();
|
||||
if (args.count() == 3) {
|
||||
const ProString &comp = args.at(2);
|
||||
if (comp == QLatin1String(">") || comp == QLatin1String("greaterThan")) {
|
||||
@ -1403,7 +1402,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
|
||||
flags = LoadSilent;
|
||||
if (args.count() >= 2) {
|
||||
parseInto = args.at(1).toQString(m_tmp2);
|
||||
if (args.count() >= 3 && isTrue(args.at(2), m_tmp3))
|
||||
if (args.count() >= 3 && isTrue(args.at(2)))
|
||||
flags = LoadSilent;
|
||||
}
|
||||
QString fn = resolvePath(m_option->expandEnvVars(args.at(0).toQString(m_tmp1)));
|
||||
@ -1441,7 +1440,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
|
||||
case T_LOAD: {
|
||||
bool ignore_error = false;
|
||||
if (args.count() == 2) {
|
||||
ignore_error = isTrue(args.at(1), m_tmp2);
|
||||
ignore_error = isTrue(args.at(1));
|
||||
} else if (args.count() != 1) {
|
||||
evalError(fL1S("load(feature) requires one or two arguments."));
|
||||
return ReturnFalse;
|
||||
|
@ -7,6 +7,7 @@ CONFIG += console bootstrap
|
||||
CONFIG -= qt
|
||||
DEFINES += \
|
||||
QT_BUILD_QMAKE \
|
||||
QT_NO_FOREACH \
|
||||
PROEVALUATOR_FULL
|
||||
|
||||
VPATH += \
|
||||
|
@ -2618,12 +2618,15 @@ bool Renderer11::getShareHandleSupport() const
|
||||
return false;
|
||||
}
|
||||
|
||||
// Qt: we don't care about the 9_3 limitation
|
||||
#if 0
|
||||
// Also disable share handles on Feature Level 9_3, since it doesn't support share handles on RGBA8 textures/swapchains.
|
||||
if (mRenderer11DeviceCaps.featureLevel <= D3D_FEATURE_LEVEL_9_3)
|
||||
{
|
||||
mSupportsShareHandles = false;
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Find out which type of D3D11 device the Renderer11 is using
|
||||
d3d11::ANGLED3D11DeviceType deviceType = getDeviceType();
|
||||
|
@ -642,11 +642,14 @@ Error ValidateCreatePbufferFromClientBuffer(Display *display, EGLenum buftype, E
|
||||
return Error(EGL_BAD_ATTRIBUTE);
|
||||
}
|
||||
|
||||
// On Windows Store, we know the originating texture came from D3D11, so bypass this check
|
||||
#if !defined(ANGLE_ENABLE_WINDOWS_STORE)
|
||||
const Caps &caps = display->getCaps();
|
||||
if (textureFormat != EGL_NO_TEXTURE && !caps.textureNPOT && (!gl::isPow2(width) || !gl::isPow2(height)))
|
||||
{
|
||||
return Error(EGL_BAD_MATCH);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
return Error(EGL_SUCCESS);
|
||||
|
8
src/3rdparty/freetype/freetype.pro
vendored
8
src/3rdparty/freetype/freetype.pro
vendored
@ -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)
|
||||
|
4
src/3rdparty/zlib_dependency.pri
vendored
4
src/3rdparty/zlib_dependency.pri
vendored
@ -7,4 +7,8 @@ contains(QT_CONFIG, system-zlib) {
|
||||
}
|
||||
} else {
|
||||
INCLUDEPATH += $$PWD/zlib
|
||||
!no_core_dep {
|
||||
CONFIG += qt
|
||||
QT_PRIVATE += core
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,57 @@
|
||||
From 5cacddc702624d64a4917a7a704dbbb92aeba53c Mon Sep 17 00:00:00 2001
|
||||
From: Oliver Wolff <oliver.wolff@qt.io>
|
||||
Date: Thu, 19 May 2016 10:55:46 +0200
|
||||
Subject: [PATCH] ANGLE: fixed usage of shared handles for WinRT/WinPhone
|
||||
applications
|
||||
|
||||
Both checks are not relevant in Qt's context and were skipped before but
|
||||
they sneaked back in with the latest ANGLE update.
|
||||
|
||||
Change-Id: Ic44de5468a3254afd76ef4804d97d245676daeb1
|
||||
---
|
||||
src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp | 3 +++
|
||||
src/3rdparty/angle/src/libANGLE/validationEGL.cpp | 3 +++
|
||||
2 files changed, 6 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 62badcc..0173311 100644
|
||||
--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp
|
||||
+++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp
|
||||
@@ -2618,12 +2618,15 @@ bool Renderer11::getShareHandleSupport() const
|
||||
return false;
|
||||
}
|
||||
|
||||
+ // Qt: we don't care about the 9_3 limitation
|
||||
+#if 0
|
||||
// Also disable share handles on Feature Level 9_3, since it doesn't support share handles on RGBA8 textures/swapchains.
|
||||
if (mRenderer11DeviceCaps.featureLevel <= D3D_FEATURE_LEVEL_9_3)
|
||||
{
|
||||
mSupportsShareHandles = false;
|
||||
return false;
|
||||
}
|
||||
+#endif
|
||||
|
||||
// Find out which type of D3D11 device the Renderer11 is using
|
||||
d3d11::ANGLED3D11DeviceType deviceType = getDeviceType();
|
||||
diff --git a/src/3rdparty/angle/src/libANGLE/validationEGL.cpp b/src/3rdparty/angle/src/libANGLE/validationEGL.cpp
|
||||
index 972f6a7..903f51b 100644
|
||||
--- a/src/3rdparty/angle/src/libANGLE/validationEGL.cpp
|
||||
+++ b/src/3rdparty/angle/src/libANGLE/validationEGL.cpp
|
||||
@@ -642,11 +642,14 @@ Error ValidateCreatePbufferFromClientBuffer(Display *display, EGLenum buftype, E
|
||||
return Error(EGL_BAD_ATTRIBUTE);
|
||||
}
|
||||
|
||||
+// On Windows Store, we know the originating texture came from D3D11, so bypass this check
|
||||
+#if !defined(ANGLE_ENABLE_WINDOWS_STORE)
|
||||
const Caps &caps = display->getCaps();
|
||||
if (textureFormat != EGL_NO_TEXTURE && !caps.textureNPOT && (!gl::isPow2(width) || !gl::isPow2(height)))
|
||||
{
|
||||
return Error(EGL_BAD_MATCH);
|
||||
}
|
||||
+#endif
|
||||
}
|
||||
|
||||
return Error(EGL_SUCCESS);
|
||||
--
|
||||
2.7.0.windows.1
|
||||
|
@ -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
|
||||
|
@ -2,7 +2,8 @@ TARGET = QtConcurrent
|
||||
QT = core-private
|
||||
CONFIG += exceptions
|
||||
|
||||
DEFINES += QT_NO_USING_NAMESPACE
|
||||
DEFINES += QT_NO_USING_NAMESPACE QT_NO_FOREACH
|
||||
|
||||
win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x66000000
|
||||
|
||||
QMAKE_DOCS = $$PWD/doc/qtconcurrent.qdocconf
|
||||
|
@ -4,7 +4,7 @@ project = QtConcurrent
|
||||
description = Qt Concurrent Reference Documentation
|
||||
version = $QT_VERSION
|
||||
|
||||
examplesinstallpath = qtbase/qtconcurrent
|
||||
examplesinstallpath = qtconcurrent
|
||||
|
||||
qhp.projects = QtConcurrent
|
||||
|
||||
|
@ -8,7 +8,7 @@ MODULE_CONFIG = moc resources
|
||||
|
||||
CONFIG += $$MODULE_CONFIG
|
||||
DEFINES += $$MODULE_DEFINES
|
||||
DEFINES += QT_NO_USING_NAMESPACE
|
||||
DEFINES += QT_NO_USING_NAMESPACE QT_NO_FOREACH
|
||||
win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x67000000
|
||||
irix-cc*:QMAKE_CXXFLAGS += -no_prelink -ptused
|
||||
|
||||
|
@ -4,7 +4,7 @@ project = QtCore
|
||||
description = Qt Core Reference Documentation
|
||||
version = $QT_VERSION
|
||||
|
||||
examplesinstallpath = qtbase/corelib
|
||||
examplesinstallpath = corelib
|
||||
|
||||
qhp.projects = QtCore
|
||||
|
||||
|
@ -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
|
||||
@ -920,6 +923,8 @@ QT_WARNING_DISABLE_MSVC(4530) /* C++ exception handler used, but unwind semantic
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_FOREACH
|
||||
|
||||
template <typename T>
|
||||
class QForeachContainer {
|
||||
QForeachContainer &operator=(const QForeachContainer &) Q_DECL_EQ_DELETE;
|
||||
@ -945,11 +950,15 @@ for (QForeachContainer<typename QtPrivate::remove_reference<decltype(container)>
|
||||
++_container_.i, _container_.control ^= 1) \
|
||||
for (variable = *_container_.i; _container_.control; _container_.control = 0)
|
||||
|
||||
#endif // QT_NO_FOREACH
|
||||
|
||||
#define Q_FOREVER for(;;)
|
||||
#ifndef QT_NO_KEYWORDS
|
||||
# ifndef QT_NO_FOREACH
|
||||
# ifndef foreach
|
||||
# define foreach Q_FOREACH
|
||||
# endif
|
||||
# endif // QT_NO_FOREACH
|
||||
# ifndef forever
|
||||
# define forever Q_FOREVER
|
||||
# endif
|
||||
|
@ -54,6 +54,7 @@
|
||||
#include "qthread.h"
|
||||
#include "private/qloggingregistry_p.h"
|
||||
#include "private/qcoreapplication_p.h"
|
||||
#include "private/qsimd_p.h"
|
||||
#endif
|
||||
#ifdef Q_OS_WIN
|
||||
#include <qt_windows.h>
|
||||
@ -1193,6 +1194,89 @@ void QMessagePattern::setPattern(const QString &pattern)
|
||||
memcpy(literals, literalsVar.constData(), literalsVar.size() * sizeof(const char*));
|
||||
}
|
||||
|
||||
#if defined(QLOGGING_HAVE_BACKTRACE) && !defined(QT_BOOTSTRAPPED)
|
||||
// make sure the function has "Message" in the name so the function is removed
|
||||
|
||||
#if (defined(Q_CC_GNU) && defined(QT_COMPILER_SUPPORTS_SIMD_ALWAYS)) || QT_HAS_ATTRIBUTE(optimize)
|
||||
// force skipping the frame pointer, to save the backtrace() function some work
|
||||
__attribute__((optimize("omit-frame-pointer")))
|
||||
#endif
|
||||
static QStringList backtraceFramesForLogMessage(int frameCount)
|
||||
{
|
||||
QStringList result;
|
||||
if (frameCount == 0)
|
||||
return result;
|
||||
|
||||
// The results of backtrace_symbols looks like this:
|
||||
// /lib/libc.so.6(__libc_start_main+0xf3) [0x4a937413]
|
||||
// The offset and function name are optional.
|
||||
// This regexp tries to extract the library name (without the path) and the function name.
|
||||
// This code is protected by QMessagePattern::mutex so it is thread safe on all compilers
|
||||
static QRegularExpression rx(QStringLiteral("^(?:[^(]*/)?([^(/]+)\\(([^+]*)(?:[\\+[a-f0-9x]*)?\\) \\[[a-f0-9x]*\\]$"),
|
||||
QRegularExpression::OptimizeOnFirstUsageOption);
|
||||
|
||||
QVarLengthArray<void*, 32> buffer(7 + frameCount);
|
||||
int n = backtrace(buffer.data(), buffer.size());
|
||||
if (n > 0) {
|
||||
int numberPrinted = 0;
|
||||
for (int i = 0; i < n && numberPrinted < frameCount; ++i) {
|
||||
QScopedPointer<char*, QScopedPointerPodDeleter> strings(backtrace_symbols(buffer.data() + i, 1));
|
||||
QString trace = QString::fromLatin1(strings.data()[0]);
|
||||
QRegularExpressionMatch m = rx.match(trace);
|
||||
if (m.hasMatch()) {
|
||||
QString library = m.captured(1);
|
||||
QString function = m.captured(2);
|
||||
|
||||
// skip the trace from QtCore that are because of the qDebug itself
|
||||
if (!numberPrinted && library.contains(QLatin1String("Qt5Core"))
|
||||
&& (function.isEmpty() || function.contains(QLatin1String("Message"), Qt::CaseInsensitive)
|
||||
|| function.contains(QLatin1String("QDebug")))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (function.startsWith(QLatin1String("_Z"))) {
|
||||
QScopedPointer<char, QScopedPointerPodDeleter> demangled(
|
||||
abi::__cxa_demangle(function.toUtf8(), 0, 0, 0));
|
||||
if (demangled)
|
||||
function = QString::fromUtf8(qCleanupFuncinfo(demangled.data()));
|
||||
}
|
||||
|
||||
if (function.isEmpty()) {
|
||||
result.append(QLatin1Char('?') + library + QLatin1Char('?'));
|
||||
} else {
|
||||
result.append(function);
|
||||
}
|
||||
} else {
|
||||
if (numberPrinted == 0) {
|
||||
// innermost, unknown frames are usually the logging framework itself
|
||||
continue;
|
||||
}
|
||||
result.append(QStringLiteral("???"));
|
||||
}
|
||||
numberPrinted++;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
static QString formatBacktraceForLogMessage(const QMessagePattern::BacktraceParams backtraceParams,
|
||||
const char *function)
|
||||
{
|
||||
QString backtraceSeparator = backtraceParams.backtraceSeparator;
|
||||
int backtraceDepth = backtraceParams.backtraceDepth;
|
||||
|
||||
QStringList frames = backtraceFramesForLogMessage(backtraceDepth);
|
||||
if (frames.isEmpty())
|
||||
return QString();
|
||||
|
||||
// if the first frame is unknown, replace it with the context function
|
||||
if (function && frames.at(0).startsWith(QLatin1Char('?')))
|
||||
frames[0] = QString::fromUtf8(qCleanupFuncinfo(function));
|
||||
|
||||
return frames.join(backtraceSeparator);
|
||||
}
|
||||
#endif // QLOGGING_HAVE_BACKTRACE && !QT_BOOTSTRAPPED
|
||||
|
||||
#if defined(QT_USE_SLOG2)
|
||||
#ifndef QT_LOG_CODE
|
||||
#define QT_LOG_CODE 9000
|
||||
@ -1336,62 +1420,8 @@ QString qFormatLogMessage(QtMsgType type, const QMessageLogContext &context, con
|
||||
#ifdef QLOGGING_HAVE_BACKTRACE
|
||||
} else if (token == backtraceTokenC) {
|
||||
QMessagePattern::BacktraceParams backtraceParams = pattern->backtraceArgs.at(backtraceArgsIdx);
|
||||
QString backtraceSeparator = backtraceParams.backtraceSeparator;
|
||||
int backtraceDepth = backtraceParams.backtraceDepth;
|
||||
backtraceArgsIdx++;
|
||||
QVarLengthArray<void*, 32> buffer(7 + backtraceDepth);
|
||||
int n = backtrace(buffer.data(), buffer.size());
|
||||
if (n > 0) {
|
||||
int numberPrinted = 0;
|
||||
for (int i = 0; i < n && numberPrinted < backtraceDepth; ++i) {
|
||||
QScopedPointer<char*, QScopedPointerPodDeleter> strings(backtrace_symbols(buffer.data() + i, 1));
|
||||
QString trace = QString::fromLatin1(strings.data()[0]);
|
||||
// The results of backtrace_symbols looks like this:
|
||||
// /lib/libc.so.6(__libc_start_main+0xf3) [0x4a937413]
|
||||
// The offset and function name are optional.
|
||||
// This regexp tries to extract the librry name (without the path) and the function name.
|
||||
// This code is protected by QMessagePattern::mutex so it is thread safe on all compilers
|
||||
static QRegularExpression rx(QStringLiteral("^(?:[^(]*/)?([^(/]+)\\(([^+]*)(?:[\\+[a-f0-9x]*)?\\) \\[[a-f0-9x]*\\]$"),
|
||||
QRegularExpression::OptimizeOnFirstUsageOption);
|
||||
|
||||
QRegularExpressionMatch m = rx.match(trace);
|
||||
if (m.hasMatch()) {
|
||||
// skip the trace from QtCore that are because of the qDebug itself
|
||||
QString library = m.captured(1);
|
||||
QString function = m.captured(2);
|
||||
if (!numberPrinted && library.contains(QLatin1String("Qt5Core"))
|
||||
&& (function.isEmpty() || function.contains(QLatin1String("Message"), Qt::CaseInsensitive)
|
||||
|| function.contains(QLatin1String("QDebug")))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (function.startsWith(QLatin1String("_Z"))) {
|
||||
QScopedPointer<char, QScopedPointerPodDeleter> demangled(
|
||||
abi::__cxa_demangle(function.toUtf8(), 0, 0, 0));
|
||||
if (demangled)
|
||||
function = QString::fromUtf8(qCleanupFuncinfo(demangled.data()));
|
||||
}
|
||||
|
||||
if (numberPrinted > 0)
|
||||
message.append(backtraceSeparator);
|
||||
|
||||
if (function.isEmpty()) {
|
||||
if (numberPrinted == 0 && context.function)
|
||||
message += QString::fromUtf8(qCleanupFuncinfo(context.function));
|
||||
else
|
||||
message += QLatin1Char('?') + library + QLatin1Char('?');
|
||||
} else {
|
||||
message += function;
|
||||
}
|
||||
|
||||
} else {
|
||||
if (numberPrinted == 0)
|
||||
continue;
|
||||
message += backtraceSeparator + QLatin1String("???");
|
||||
}
|
||||
numberPrinted++;
|
||||
}
|
||||
}
|
||||
message.append(formatBacktraceForLogMessage(backtraceParams, context.function));
|
||||
#endif
|
||||
} else if (token == timeTokenC) {
|
||||
QString timeFormat = pattern->timeArgs.at(timeArgsIdx);
|
||||
|
@ -503,7 +503,8 @@ public:
|
||||
AA_UseStyleSheetPropagationInWidgetStyles = 22, // ### Qt 6: remove me
|
||||
AA_DontUseNativeDialogs = 23,
|
||||
AA_SynthesizeMouseForUnhandledTabletEvents = 24,
|
||||
AA_DontCheckOpenGLContextThreadAffinity = 25,
|
||||
AA_CompressHighFrequencyEvents = 25,
|
||||
AA_DontCheckOpenGLContextThreadAffinity = 26,
|
||||
|
||||
// Add new attributes before this line
|
||||
AA_AttributeCount
|
||||
|
@ -239,6 +239,17 @@
|
||||
to mouse events instead. This attribute is enabled
|
||||
by default. This value has been added in Qt 5.7.
|
||||
|
||||
\value AA_CompressHighFrequencyEvents Enables compression of certain frequent events.
|
||||
On the X11 windowing system, the default value is true, which means that
|
||||
QEvent::MouseMove, QEvent::TouchUpdate, and changes in window size and
|
||||
position will be combined whenever they occur more frequently than the
|
||||
application handles them, so that they don't accumulate and overwhelm the
|
||||
application later. On other platforms, the default is false.
|
||||
(In the future, the compression feature may be implemented across platforms.)
|
||||
You can test the attribute to see whether compression is enabled.
|
||||
If your application needs to handle all events with no compression,
|
||||
you can unset this attribute. This value has been added in Qt 5.7.
|
||||
|
||||
\value AA_DontCheckOpenGLContextThreadAffinity When making a context
|
||||
current using QOpenGLContext, do not check that the
|
||||
\l{QObject#Thread Affinity}{QObject thread affinity}
|
||||
|
@ -107,7 +107,7 @@
|
||||
# define Q_PROCESSOR_ARM __TARGET_ARCH_ARM
|
||||
# elif defined(_M_ARM) && _M_ARM > 1
|
||||
# define Q_PROCESSOR_ARM _M_ARM
|
||||
# elif defined(__ARM64_ARCH_8__)
|
||||
# elif defined(__ARM64_ARCH_8__) || defined(__aarch64__)
|
||||
# define Q_PROCESSOR_ARM 8
|
||||
# elif defined(__ARM_ARCH_7__) \
|
||||
|| defined(__ARM_ARCH_7A__) \
|
||||
|
@ -793,6 +793,17 @@ QDebug &QDebug::resetFormat()
|
||||
Writes \a flag to \a stream.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn QDebug operator<<(QDebug debug, const QSharedPointer<T> &ptr)
|
||||
\relates QSharedPointer
|
||||
\since 5.7
|
||||
|
||||
Writes the pointer tracked by \a ptr into the debug object \a debug for
|
||||
debugging purposes.
|
||||
|
||||
\sa {Debugging Techniques}
|
||||
*/
|
||||
|
||||
/*!
|
||||
\class QDebugStateSaver
|
||||
\inmodule QtCore
|
||||
|
@ -51,6 +51,7 @@
|
||||
#include <QtCore/qvector.h>
|
||||
#include <QtCore/qset.h>
|
||||
#include <QtCore/qcontiguouscache.h>
|
||||
#include <QtCore/qsharedpointer.h>
|
||||
|
||||
// all these have already been included by various headers above, but don't rely on indirect includes:
|
||||
#include <vector>
|
||||
@ -330,6 +331,14 @@ inline QDebug operator<<(QDebug debug, const QContiguousCache<T> &cache)
|
||||
return debug.maybeSpace();
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline QDebug operator<<(QDebug debug, const QSharedPointer<T> &ptr)
|
||||
{
|
||||
QDebugStateSaver saver(debug);
|
||||
debug.nospace() << "QSharedPointer(" << ptr.data() << ")";
|
||||
return debug;
|
||||
}
|
||||
|
||||
Q_CORE_EXPORT void qt_QMetaEnum_flagDebugOperator(QDebug &debug, size_t sizeofT, int value);
|
||||
|
||||
template <typename Int>
|
||||
|
@ -812,7 +812,9 @@ static bool tryDriveUNCFallback(const QFileSystemEntry &fname, QFileSystemMetaDa
|
||||
#if !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;
|
||||
|
@ -551,7 +551,9 @@ QFileInfoList QFSFileEngine::drives()
|
||||
QFileInfoList ret;
|
||||
#if !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:/";
|
||||
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -1778,7 +1778,11 @@ void QStateMachinePrivate::_q_start()
|
||||
{
|
||||
Q_Q(QStateMachine);
|
||||
Q_ASSERT(state == Starting);
|
||||
foreach (QAbstractState *state, configuration) {
|
||||
// iterate over a copy, since we emit signals which may cause
|
||||
// 'configuration' to change, resulting in undefined behavior when
|
||||
// iterating at the same time:
|
||||
const auto config = configuration;
|
||||
for (QAbstractState *state : config) {
|
||||
QAbstractStatePrivate *abstractStatePrivate = QAbstractStatePrivate::get(state);
|
||||
abstractStatePrivate->active = false;
|
||||
emit state->activeChanged(false);
|
||||
|
@ -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; }
|
||||
|
||||
|
@ -56,6 +56,11 @@
|
||||
# error "Qt build is broken: qmutex_linux.cpp is being built but futex support is not wanted"
|
||||
#endif
|
||||
|
||||
#ifndef FUTEX_PRIVATE_FLAG
|
||||
# define FUTEX_PRIVATE_FLAG 128
|
||||
#endif
|
||||
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
/*
|
||||
@ -104,40 +109,6 @@ QT_BEGIN_NAMESPACE
|
||||
|
||||
static QBasicAtomicInt futexFlagSupport = Q_BASIC_ATOMIC_INITIALIZER(-1);
|
||||
|
||||
static int checkFutexPrivateSupport()
|
||||
{
|
||||
int value = 0;
|
||||
#if defined(FUTEX_PRIVATE_FLAG)
|
||||
// check if the kernel supports extra futex flags
|
||||
// FUTEX_PRIVATE_FLAG appeared in v2.6.22
|
||||
Q_STATIC_ASSERT(FUTEX_PRIVATE_FLAG != 0x80000000);
|
||||
|
||||
// try an operation that has no side-effects: wake up 42 threads
|
||||
// futex will return -1 (errno==ENOSYS) if the flag isn't supported
|
||||
// there should be no other error conditions
|
||||
value = syscall(__NR_futex, &futexFlagSupport,
|
||||
FUTEX_WAKE | FUTEX_PRIVATE_FLAG,
|
||||
42, 0, 0, 0);
|
||||
if (value != -1)
|
||||
value = FUTEX_PRIVATE_FLAG;
|
||||
else
|
||||
value = 0;
|
||||
|
||||
#else
|
||||
value = 0;
|
||||
#endif
|
||||
futexFlagSupport.store(value);
|
||||
return value;
|
||||
}
|
||||
|
||||
static inline int futexFlags()
|
||||
{
|
||||
int value = futexFlagSupport.load();
|
||||
if (Q_LIKELY(value != -1))
|
||||
return value;
|
||||
return checkFutexPrivateSupport();
|
||||
}
|
||||
|
||||
static inline int _q_futex(void *addr, int op, int val, const struct timespec *timeout) Q_DECL_NOTHROW
|
||||
{
|
||||
volatile int *int_addr = reinterpret_cast<volatile int *>(addr);
|
||||
@ -149,7 +120,7 @@ static inline int _q_futex(void *addr, int op, int val, const struct timespec *t
|
||||
|
||||
// we use __NR_futex because some libcs (like Android's bionic) don't
|
||||
// provide SYS_futex etc.
|
||||
return syscall(__NR_futex, int_addr, op | futexFlags(), val, timeout, addr2, val2);
|
||||
return syscall(__NR_futex, int_addr, op | FUTEX_PRIVATE_FLAG, val, timeout, addr2, val2);
|
||||
}
|
||||
|
||||
static inline QMutexData *dummyFutexValue()
|
||||
|
@ -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
|
||||
|
@ -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));
|
||||
|
@ -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()) {
|
||||
|
@ -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
|
||||
|
||||
|
@ -713,7 +713,7 @@ int QDateTimeParser::parseSection(const QDateTime ¤tValue, int sectionInde
|
||||
|
||||
QDTPDEBUG << "sectionValue for" << sn.name()
|
||||
<< "with text" << text << "and st" << sectiontext
|
||||
<< text.mid(index, sectionmaxsize)
|
||||
<< text.midRef(index, sectionmaxsize)
|
||||
<< index;
|
||||
|
||||
int used = 0;
|
||||
@ -743,9 +743,8 @@ int QDateTimeParser::parseSection(const QDateTime ¤tValue, int sectionInde
|
||||
QDTPDEBUGN("This should never happen (findAmPm returned %d)", ampm);
|
||||
break;
|
||||
}
|
||||
if (state != Invalid) {
|
||||
text.replace(index, used, sectiontext.left(used));
|
||||
}
|
||||
if (state != Invalid)
|
||||
text.replace(index, used, sectiontext.constData(), used);
|
||||
break; }
|
||||
case MonthSection:
|
||||
case DayOfWeekSectionShort:
|
||||
@ -764,7 +763,7 @@ int QDateTimeParser::parseSection(const QDateTime ¤tValue, int sectionInde
|
||||
|
||||
if (num != -1) {
|
||||
state = (used == sectiontext.size() ? Acceptable : Intermediate);
|
||||
text.replace(index, used, sectiontext.left(used));
|
||||
text.replace(index, used, sectiontext.constData(), used);
|
||||
} else {
|
||||
state = Intermediate;
|
||||
}
|
||||
@ -810,7 +809,7 @@ int QDateTimeParser::parseSection(const QDateTime ¤tValue, int sectionInde
|
||||
}
|
||||
}
|
||||
if (ok && tmp <= absMax) {
|
||||
QDTPDEBUG << sectiontext.left(digits) << tmp << digits;
|
||||
QDTPDEBUG << sectiontext.leftRef(digits) << tmp << digits;
|
||||
last = tmp;
|
||||
used = digits;
|
||||
break;
|
||||
@ -911,7 +910,7 @@ QDateTimeParser::StateNode QDateTimeParser::parse(QString &input, int &cursorPos
|
||||
|
||||
for (int index=0; state != Invalid && index<sectionNodesCount; ++index) {
|
||||
if (QStringRef(&input, pos, separators.at(index).size()) != separators.at(index)) {
|
||||
QDTPDEBUG << "invalid because" << input.mid(pos, separators.at(index).size())
|
||||
QDTPDEBUG << "invalid because" << input.midRef(pos, separators.at(index).size())
|
||||
<< "!=" << separators.at(index)
|
||||
<< index << pos << currentSectionIndex;
|
||||
state = Invalid;
|
||||
@ -983,7 +982,7 @@ QDateTimeParser::StateNode QDateTimeParser::parse(QString &input, int &cursorPos
|
||||
}
|
||||
|
||||
if (state != Invalid && QStringRef(&input, pos, input.size() - pos) != separators.last()) {
|
||||
QDTPDEBUG << "invalid because" << input.mid(pos)
|
||||
QDTPDEBUG << "invalid because" << input.midRef(pos)
|
||||
<< "!=" << separators.last() << pos;
|
||||
state = Invalid;
|
||||
}
|
||||
@ -1384,7 +1383,7 @@ QDateTimeParser::AmPmFinder QDateTimeParser::findAmPm(QString &str, int sectionI
|
||||
}
|
||||
if (used)
|
||||
*used = str.size();
|
||||
if (str.trimmed().isEmpty()) {
|
||||
if (QStringRef(&str).trimmed().isEmpty()) {
|
||||
return PossibleBoth;
|
||||
}
|
||||
const QLatin1Char space(' ');
|
||||
|
@ -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"
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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; }
|
||||
|
@ -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; }
|
||||
|
@ -178,7 +178,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())
|
||||
|
@ -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())
|
||||
|
@ -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());
|
||||
|
@ -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
|
||||
|
||||
|
@ -1323,17 +1323,6 @@
|
||||
compile. Use qSharedPointerConstCast to cast away the constness.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn QDebug operator<<(QDebug debug, const QSharedPointer<T> &ptr)
|
||||
\relates QSharedPointer
|
||||
\since 5.7
|
||||
|
||||
Writes the pointer tracked by \a ptr into the debug object \a debug for
|
||||
debugging purposes.
|
||||
|
||||
\sa {Debugging Techniques}
|
||||
*/
|
||||
|
||||
#include <qset.h>
|
||||
#include <qmutex.h>
|
||||
|
||||
|
@ -161,8 +161,6 @@ template <class X, class T> QSharedPointer<X> qSharedPointerObjectCast(const QWe
|
||||
|
||||
template <class X, class T> QWeakPointer<X> qWeakPointerCast(const QWeakPointer<T> &src);
|
||||
|
||||
template <class T> QDebug operator<<(QDebug debug, const QSharedPointer<T> &ptr);
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // Q_QDOC
|
||||
|
@ -62,7 +62,6 @@ QT_END_NAMESPACE
|
||||
#include <new>
|
||||
#include <QtCore/qatomic.h>
|
||||
#include <QtCore/qobject.h> // for qobject_cast
|
||||
#include <QtCore/qdebug.h>
|
||||
#if QT_DEPRECATED_SINCE(5, 6)
|
||||
#include <QtCore/qhash.h>
|
||||
#endif
|
||||
@ -883,16 +882,6 @@ inline void qSwap(QSharedPointer<T> &p1, QSharedPointer<T> &p2)
|
||||
p1.swap(p2);
|
||||
}
|
||||
|
||||
#ifndef QT_NO_DEBUG_STREAM
|
||||
template <class T>
|
||||
Q_INLINE_TEMPLATE QDebug operator<<(QDebug debug, const QSharedPointer<T> &ptr)
|
||||
{
|
||||
QDebugStateSaver saver(debug);
|
||||
debug.nospace() << "QSharedPointer(" << ptr.data() << ")";
|
||||
return debug;
|
||||
}
|
||||
#endif
|
||||
|
||||
QT_END_NAMESPACE
|
||||
namespace std {
|
||||
template <class T>
|
||||
|
@ -670,7 +670,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
|
||||
|
@ -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());
|
||||
|
@ -152,6 +152,7 @@ else:SOURCES += tools/qelapsedtimer_generic.cpp
|
||||
contains(QT_CONFIG, system-zlib) {
|
||||
include($$PWD/../../3rdparty/zlib_dependency.pri)
|
||||
} else {
|
||||
CONFIG += no_core_dep
|
||||
include($$PWD/../../3rdparty/zlib.pri)
|
||||
}
|
||||
|
||||
|
@ -23,6 +23,8 @@ win32 {
|
||||
-luser32
|
||||
}
|
||||
|
||||
DEFINES += QT_NO_FOREACH
|
||||
|
||||
QMAKE_DOCS = $$PWD/doc/qtdbus.qdocconf
|
||||
|
||||
PUB_HEADERS = qdbusargument.h \
|
||||
|
@ -19,7 +19,7 @@ sourcedirs += .. \
|
||||
../../../examples/dbus/doc/src
|
||||
excludedirs += ../../../examples/widgets/doc
|
||||
|
||||
examplesinstallpath = qtbase/dbus
|
||||
examplesinstallpath = dbus
|
||||
|
||||
depends += qtdoc qtcore
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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()
|
||||
|
@ -4,7 +4,7 @@ project = QtGui
|
||||
description = Qt GUI Reference Documentation
|
||||
version = $QT_VERSION
|
||||
|
||||
examplesinstallpath = qtbase/gui
|
||||
examplesinstallpath = gui
|
||||
|
||||
qhp.projects = QtGui
|
||||
|
||||
|
@ -138,22 +138,6 @@ QDebug operator<<(QDebug d, const QOpenGLConfig::Gpu &g)
|
||||
enum Operator { NotEqual, LessThan, LessEqualThan, Equals, GreaterThan, GreaterEqualThan };
|
||||
static const char operators[][3] = {"!=", "<", "<=", "=", ">", ">="};
|
||||
|
||||
static inline QString valueKey() { return QStringLiteral("value"); }
|
||||
static inline QString opKey() { return QStringLiteral("op"); }
|
||||
static inline QString versionKey() { return QStringLiteral("version"); }
|
||||
static inline QString releaseKey() { return QStringLiteral("release"); }
|
||||
static inline QString typeKey() { return QStringLiteral("type"); }
|
||||
static inline QString osKey() { return QStringLiteral("os"); }
|
||||
static inline QString vendorIdKey() { return QStringLiteral("vendor_id"); }
|
||||
static inline QString glVendorKey() { return QStringLiteral("gl_vendor"); }
|
||||
static inline QString deviceIdKey() { return QStringLiteral("device_id"); }
|
||||
static inline QString driverVersionKey() { return QStringLiteral("driver_version"); }
|
||||
static inline QString driverDescriptionKey() { return QStringLiteral("driver_description"); }
|
||||
static inline QString featuresKey() { return QStringLiteral("features"); }
|
||||
static inline QString idKey() { return QStringLiteral("id"); }
|
||||
static inline QString descriptionKey() { return QStringLiteral("description"); }
|
||||
static inline QString exceptionsKey() { return QStringLiteral("exceptions"); }
|
||||
|
||||
typedef QJsonArray::ConstIterator JsonArrayConstIt;
|
||||
|
||||
static inline bool contains(const QJsonArray &haystack, unsigned needle)
|
||||
@ -216,8 +200,8 @@ VersionTerm VersionTerm::fromJson(const QJsonValue &v)
|
||||
if (!v.isObject())
|
||||
return result;
|
||||
const QJsonObject o = v.toObject();
|
||||
result.number = QVersionNumber::fromString(o.value(valueKey()).toString());
|
||||
const QString opS = o.value(opKey()).toString();
|
||||
result.number = QVersionNumber::fromString(o.value(QLatin1String("value")).toString());
|
||||
const QString opS = o.value(QLatin1String("op")).toString();
|
||||
for (size_t i = 0; i < sizeof(operators) / sizeof(operators[0]); ++i) {
|
||||
if (opS == QLatin1String(operators[i])) {
|
||||
result.op = static_cast<Operator>(i);
|
||||
@ -292,9 +276,9 @@ OsTypeTerm OsTypeTerm::fromJson(const QJsonValue &v)
|
||||
if (!v.isObject())
|
||||
return result;
|
||||
const QJsonObject o = v.toObject();
|
||||
result.type = o.value(typeKey()).toString();
|
||||
result.versionTerm = VersionTerm::fromJson(o.value(versionKey()));
|
||||
result.release = o.value(releaseKey()).toArray();
|
||||
result.type = o.value(QLatin1String("type")).toString();
|
||||
result.versionTerm = VersionTerm::fromJson(o.value(QLatin1String("version")));
|
||||
result.release = o.value(QLatin1String("release")).toArray();
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -318,8 +302,8 @@ QString OsTypeTerm::hostOs()
|
||||
static QString msgSyntaxWarning(const QJsonObject &object, const QString &what)
|
||||
{
|
||||
QString result;
|
||||
QTextStream(&result) << "Id " << object.value(idKey()).toInt()
|
||||
<< " (\"" << object.value(descriptionKey()).toString()
|
||||
QTextStream(&result) << "Id " << object.value(QLatin1String("id")).toInt()
|
||||
<< " (\"" << object.value(QLatin1String("description")).toString()
|
||||
<< "\"): " << what;
|
||||
return result;
|
||||
}
|
||||
@ -333,11 +317,11 @@ static bool matches(const QJsonObject &object,
|
||||
const QString &osRelease,
|
||||
const QOpenGLConfig::Gpu &gpu)
|
||||
{
|
||||
const OsTypeTerm os = OsTypeTerm::fromJson(object.value(osKey()));
|
||||
const OsTypeTerm os = OsTypeTerm::fromJson(object.value(QLatin1String("os")));
|
||||
if (!os.isNull() && !os.matches(osName, kernelVersion, osRelease))
|
||||
return false;
|
||||
|
||||
const QJsonValue exceptionsV = object.value(exceptionsKey());
|
||||
const QJsonValue exceptionsV = object.value(QLatin1String("exceptions"));
|
||||
if (exceptionsV.isArray()) {
|
||||
const QJsonArray exceptionsA = exceptionsV.toArray();
|
||||
for (JsonArrayConstIt it = exceptionsA.constBegin(), cend = exceptionsA.constEnd(); it != cend; ++it) {
|
||||
@ -346,20 +330,20 @@ static bool matches(const QJsonObject &object,
|
||||
}
|
||||
}
|
||||
|
||||
const QJsonValue vendorV = object.value(vendorIdKey());
|
||||
const QJsonValue vendorV = object.value(QLatin1String("vendor_id"));
|
||||
if (vendorV.isString()) {
|
||||
if (gpu.vendorId != vendorV.toString().toUInt(Q_NULLPTR, /* base */ 0))
|
||||
return false;
|
||||
} else {
|
||||
if (object.contains(glVendorKey())) {
|
||||
const QByteArray glVendorV = object.value(glVendorKey()).toString().toUtf8();
|
||||
if (object.contains(QLatin1String("gl_vendor"))) {
|
||||
const QByteArray glVendorV = object.value(QLatin1String("gl_vendor")).toString().toUtf8();
|
||||
if (!gpu.glVendor.contains(glVendorV))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (gpu.deviceId) {
|
||||
const QJsonValue deviceIdV = object.value(deviceIdKey());
|
||||
const QJsonValue deviceIdV = object.value(QLatin1String("device_id"));
|
||||
switch (deviceIdV.type()) {
|
||||
case QJsonValue::Array:
|
||||
if (!contains(deviceIdV.toArray(), gpu.deviceId))
|
||||
@ -375,7 +359,7 @@ static bool matches(const QJsonObject &object,
|
||||
}
|
||||
}
|
||||
if (!gpu.driverVersion.isNull()) {
|
||||
const QJsonValue driverVersionV = object.value(driverVersionKey());
|
||||
const QJsonValue driverVersionV = object.value(QLatin1String("driver_version"));
|
||||
switch (driverVersionV.type()) {
|
||||
case QJsonValue::Object:
|
||||
if (!VersionTerm::fromJson(driverVersionV).matches(gpu.driverVersion))
|
||||
@ -392,7 +376,7 @@ static bool matches(const QJsonObject &object,
|
||||
}
|
||||
|
||||
if (!gpu.driverDescription.isEmpty()) {
|
||||
const QJsonValue driverDescriptionV = object.value(driverDescriptionKey());
|
||||
const QJsonValue driverDescriptionV = object.value(QLatin1String("driver_description"));
|
||||
if (driverDescriptionV.isString()) {
|
||||
if (!gpu.driverDescription.contains(driverDescriptionV.toString().toUtf8()))
|
||||
return false;
|
||||
@ -412,7 +396,7 @@ static bool readGpuFeatures(const QOpenGLConfig::Gpu &gpu,
|
||||
{
|
||||
result->clear();
|
||||
errorMessage->clear();
|
||||
const QJsonValue entriesV = doc.object().value(QStringLiteral("entries"));
|
||||
const QJsonValue entriesV = doc.object().value(QLatin1String("entries"));
|
||||
if (!entriesV.isArray()) {
|
||||
*errorMessage = QLatin1String("No entries read.");
|
||||
return false;
|
||||
@ -423,7 +407,7 @@ static bool readGpuFeatures(const QOpenGLConfig::Gpu &gpu,
|
||||
if (eit->isObject()) {
|
||||
const QJsonObject object = eit->toObject();
|
||||
if (matches(object, osName, kernelVersion, osRelease, gpu)) {
|
||||
const QJsonValue featuresListV = object.value(featuresKey());
|
||||
const QJsonValue featuresListV = object.value(QLatin1String("features"));
|
||||
if (featuresListV.isArray()) {
|
||||
const QJsonArray featuresListA = featuresListV.toArray();
|
||||
for (JsonArrayConstIt fit = featuresListA.constBegin(), fcend = featuresListA.constEnd(); fit != fcend; ++fit)
|
||||
|
@ -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())
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -118,9 +118,6 @@ bool QFontDef::exactMatch(const QFontDef &other) const
|
||||
QFontDatabase::parseFontName(family, this_foundry, this_family);
|
||||
QFontDatabase::parseFontName(other.family, other_foundry, other_family);
|
||||
|
||||
this_family = QFontDatabase::resolveFontFamilyAlias(this_family);
|
||||
other_family = QFontDatabase::resolveFontFamilyAlias(other_family);
|
||||
|
||||
return (styleHint == other.styleHint
|
||||
&& styleStrategy == other.styleStrategy
|
||||
&& weight == other.weight
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
@ -1578,6 +1581,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)
|
||||
@ -1585,7 +1590,6 @@ void QNetworkAccessManagerPrivate::createSession(const QNetworkConfiguration &co
|
||||
networkSessionWeakRef = networkSessionStrongRef.toWeakRef();
|
||||
|
||||
if (!networkSessionStrongRef) {
|
||||
online = false;
|
||||
|
||||
if (networkAccessible == QNetworkAccessManager::NotAccessible || !online)
|
||||
emit q->networkAccessibleChanged(QNetworkAccessManager::NotAccessible);
|
||||
@ -1601,6 +1605,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());
|
||||
}
|
||||
@ -1617,6 +1623,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();
|
||||
}
|
||||
@ -1625,46 +1634,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;
|
||||
}
|
||||
}
|
||||
@ -1675,11 +1695,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;
|
||||
@ -1688,6 +1703,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)
|
||||
|
@ -183,6 +183,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
|
||||
};
|
||||
|
||||
|
@ -152,6 +152,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);
|
||||
|
@ -4,7 +4,7 @@ project = QtNetwork
|
||||
description = Qt Network Reference Documentation
|
||||
version = $QT_VERSION
|
||||
|
||||
examplesinstallpath = qtbase/network
|
||||
examplesinstallpath = network
|
||||
|
||||
qhp.projects = QtNetwork
|
||||
|
||||
|
@ -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
|
||||
|
@ -1,7 +1,7 @@
|
||||
TARGET = QtNetwork
|
||||
QT = core-private
|
||||
|
||||
DEFINES += QT_NO_USING_NAMESPACE
|
||||
DEFINES += QT_NO_USING_NAMESPACE QT_NO_FOREACH
|
||||
#DEFINES += QLOCALSERVER_DEBUG QLOCALSOCKET_DEBUG
|
||||
#DEFINES += QNETWORKDISKCACHE_DEBUG
|
||||
#DEFINES += QSSLSOCKET_DEBUG
|
||||
|
@ -188,17 +188,26 @@ bool QHttpSocketEngine::connectToHostByName(const QString &hostname, quint16 por
|
||||
|
||||
bool QHttpSocketEngine::bind(const QHostAddress &, quint16)
|
||||
{
|
||||
qWarning("Operation is not supported");
|
||||
setError(QAbstractSocket::UnsupportedSocketOperationError,
|
||||
QLatin1String("Unsupported socket operation"));
|
||||
return false;
|
||||
}
|
||||
|
||||
bool QHttpSocketEngine::listen()
|
||||
{
|
||||
qWarning("Operation is not supported");
|
||||
setError(QAbstractSocket::UnsupportedSocketOperationError,
|
||||
QLatin1String("Unsupported socket operation"));
|
||||
return false;
|
||||
}
|
||||
|
||||
int QHttpSocketEngine::accept()
|
||||
{
|
||||
return 0;
|
||||
qWarning("Operation is not supported");
|
||||
setError(QAbstractSocket::UnsupportedSocketOperationError,
|
||||
QLatin1String("Unsupported socket operation"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
void QHttpSocketEngine::close()
|
||||
@ -251,16 +260,18 @@ qint64 QHttpSocketEngine::write(const char *data, qint64 len)
|
||||
bool QHttpSocketEngine::joinMulticastGroup(const QHostAddress &,
|
||||
const QNetworkInterface &)
|
||||
{
|
||||
qWarning("Operation is not supported");
|
||||
setError(QAbstractSocket::UnsupportedSocketOperationError,
|
||||
QLatin1String("Operation on socket is not supported"));
|
||||
QLatin1String("Unsupported socket operation"));
|
||||
return false;
|
||||
}
|
||||
|
||||
bool QHttpSocketEngine::leaveMulticastGroup(const QHostAddress &,
|
||||
const QNetworkInterface &)
|
||||
{
|
||||
qWarning("Operation is not supported");
|
||||
setError(QAbstractSocket::UnsupportedSocketOperationError,
|
||||
QLatin1String("Operation on socket is not supported"));
|
||||
QLatin1String("Unsupported socket operation"));
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -271,30 +282,39 @@ QNetworkInterface QHttpSocketEngine::multicastInterface() const
|
||||
|
||||
bool QHttpSocketEngine::setMulticastInterface(const QNetworkInterface &)
|
||||
{
|
||||
qWarning("Operation is not supported");
|
||||
setError(QAbstractSocket::UnsupportedSocketOperationError,
|
||||
QLatin1String("Operation on socket is not supported"));
|
||||
QLatin1String("Unsupported socket operation"));
|
||||
return false;
|
||||
}
|
||||
#endif // QT_NO_NETWORKINTERFACE
|
||||
|
||||
qint64 QHttpSocketEngine::readDatagram(char *, qint64, QIpPacketHeader *, PacketHeaderOptions)
|
||||
{
|
||||
return 0;
|
||||
qWarning("Operation is not supported");
|
||||
setError(QAbstractSocket::UnsupportedSocketOperationError,
|
||||
QLatin1String("Unsupported socket operation"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
qint64 QHttpSocketEngine::writeDatagram(const char *, qint64, const QIpPacketHeader &)
|
||||
{
|
||||
return 0;
|
||||
qWarning("Operation is not supported");
|
||||
setError(QAbstractSocket::UnsupportedSocketOperationError,
|
||||
QLatin1String("Unsupported socket operation"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool QHttpSocketEngine::hasPendingDatagrams() const
|
||||
{
|
||||
qWarning("Operation is not supported");
|
||||
return false;
|
||||
}
|
||||
|
||||
qint64 QHttpSocketEngine::pendingDatagramSize() const
|
||||
{
|
||||
return 0;
|
||||
qWarning("Operation is not supported");
|
||||
return -1;
|
||||
}
|
||||
#endif // QT_NO_UDPSOCKET
|
||||
|
||||
|
@ -61,7 +61,6 @@
|
||||
#if defined(QT_LOCALSOCKET_TCP)
|
||||
# include "qtcpsocket.h"
|
||||
#elif defined(Q_OS_WIN)
|
||||
# include <private/qringbuffer_p.h>
|
||||
# include "private/qwindowspipereader_p.h"
|
||||
# include "private/qwindowspipewriter_p.h"
|
||||
# include <qwineventnotifier.h>
|
||||
@ -134,7 +133,6 @@ public:
|
||||
void _q_pipeClosed();
|
||||
void _q_winError(ulong windowsError, const QString &function);
|
||||
HANDLE handle;
|
||||
QRingBuffer writeBuffer;
|
||||
QWindowsPipeWriter *pipeWriter;
|
||||
QWindowsPipeReader *pipeReader;
|
||||
QLocalSocket::LocalSocketError error;
|
||||
|
@ -107,6 +107,7 @@ QLocalSocketPrivate::QLocalSocketPrivate() : QIODevicePrivate(),
|
||||
error(QLocalSocket::UnknownSocketError),
|
||||
state(QLocalSocket::UnconnectedState)
|
||||
{
|
||||
writeBufferChunkSize = QIODEVICE_BUFFERSIZE;
|
||||
}
|
||||
|
||||
QLocalSocketPrivate::~QLocalSocketPrivate()
|
||||
@ -214,8 +215,7 @@ qint64 QLocalSocket::writeData(const char *data, qint64 len)
|
||||
Q_D(QLocalSocket);
|
||||
if (len == 0)
|
||||
return 0;
|
||||
char *dest = d->writeBuffer.reserve(len);
|
||||
memcpy(dest, data, len);
|
||||
d->writeBuffer.append(data, len);
|
||||
if (!d->pipeWriter) {
|
||||
d->pipeWriter = new QWindowsPipeWriter(d->handle, this);
|
||||
connect(d->pipeWriter, &QWindowsPipeWriter::bytesWritten,
|
||||
@ -233,7 +233,6 @@ void QLocalSocket::abort()
|
||||
if (d->pipeWriter) {
|
||||
delete d->pipeWriter;
|
||||
d->pipeWriter = 0;
|
||||
d->writeBuffer.clear();
|
||||
}
|
||||
close();
|
||||
}
|
||||
@ -291,6 +290,7 @@ void QLocalSocket::close()
|
||||
if (openMode() == NotOpen)
|
||||
return;
|
||||
|
||||
d->setWriteChannelCount(0);
|
||||
QIODevice::close();
|
||||
d->serverName = QString();
|
||||
d->fullServerName = QString();
|
||||
|
@ -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
|
||||
|
@ -154,7 +154,7 @@ public:
|
||||
qintptr socketDescriptor;
|
||||
|
||||
bool notifyOnRead, notifyOnWrite, notifyOnException;
|
||||
bool closingDown;
|
||||
QAtomicInt closingDown;
|
||||
|
||||
enum ErrorString {
|
||||
NonBlockingInitFailedErrorString,
|
||||
|
@ -213,6 +213,7 @@ bool QSslConfiguration::operator==(const QSslConfiguration &other) const
|
||||
d->preSharedKeyIdentityHint == other.d->preSharedKeyIdentityHint &&
|
||||
d->ciphers == other.d->ciphers &&
|
||||
d->ellipticCurves == other.d->ellipticCurves &&
|
||||
d->ephemeralServerKey == other.d->ephemeralServerKey &&
|
||||
d->caCertificates == other.d->caCertificates &&
|
||||
d->protocol == other.d->protocol &&
|
||||
d->peerVerifyMode == other.d->peerVerifyMode &&
|
||||
@ -254,6 +255,7 @@ bool QSslConfiguration::isNull() const
|
||||
d->caCertificates.count() == 0 &&
|
||||
d->ciphers.count() == 0 &&
|
||||
d->ellipticCurves.isEmpty() &&
|
||||
d->ephemeralServerKey.isNull() &&
|
||||
d->localCertificateChain.isEmpty() &&
|
||||
d->privateKey.isNull() &&
|
||||
d->peerCertificate.isNull() &&
|
||||
|
@ -88,6 +88,7 @@ public:
|
||||
peerSessionShared(false),
|
||||
sslOptions(QSslConfigurationPrivate::defaultSslOptions),
|
||||
sslSessionTicketLifeTimeHint(-1),
|
||||
ephemeralServerKey(),
|
||||
preSharedKeyIdentityHint(),
|
||||
nextProtocolNegotiationStatus(QSslConfiguration::NextProtocolNegotiationNone)
|
||||
{ }
|
||||
|
@ -207,7 +207,7 @@ init_context:
|
||||
QList<QSslCipher> ciphers = sslContext->sslConfiguration.ciphers();
|
||||
if (ciphers.isEmpty())
|
||||
ciphers = QSslSocketPrivate::defaultCiphers();
|
||||
foreach (const QSslCipher &cipher, ciphers) {
|
||||
for (const QSslCipher &cipher : qAsConst(ciphers)) {
|
||||
if (first)
|
||||
first = false;
|
||||
else
|
||||
|
@ -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
|
||||
|
@ -1,7 +1,8 @@
|
||||
TARGET = QtOpenGL
|
||||
QT = core-private gui-private widgets-private
|
||||
|
||||
DEFINES += QT_NO_USING_NAMESPACE
|
||||
DEFINES += QT_NO_USING_NAMESPACE QT_NO_FOREACH
|
||||
|
||||
win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x63000000
|
||||
solaris-cc*:QMAKE_CXXFLAGS_RELEASE -= -O2
|
||||
irix-cc*:QMAKE_CXXFLAGS += -no_prelink -ptused
|
||||
|
@ -4,7 +4,8 @@ CONFIG += static
|
||||
contains(QT_CONFIG, opengl):CONFIG += opengl
|
||||
contains(QT_CONFIG, opengles2):CONFIG += opengles2
|
||||
|
||||
DEFINES += QT_NO_CAST_FROM_ASCII
|
||||
DEFINES += QT_NO_CAST_FROM_ASCII QT_NO_FOREACH
|
||||
|
||||
PRECOMPILED_HEADER =
|
||||
|
||||
HEADERS = qopenglextensions.h
|
||||
|
@ -4,7 +4,7 @@ project = QtPlatformHeaders
|
||||
description = Qt Platform Headers Reference Documentation
|
||||
version = $QT_VERSION
|
||||
|
||||
examplesinstallpath = qtbase/qtplatformheaders
|
||||
examplesinstallpath = qtplatformheaders
|
||||
|
||||
qhp.projects = QtPlatformHeaders
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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
|
||||
|
@ -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)));
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user