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

Conflicts:
	configure
	src/3rdparty/double-conversion/include/double-conversion/utils.h
	src/corelib/global/qnamespace.qdoc
	src/corelib/tools/qsimd_p.h
	tests/auto/corelib/io/qfile/tst_qfile.cpp

Change-Id: I3ca1007bab5355d251c13002a18e93d81c254d34
This commit is contained in:
Liang Qi 2016-05-03 15:49:15 +02:00
commit 6357813207
177 changed files with 2500 additions and 1083 deletions

View File

@ -1,7 +1,7 @@
SOURCES = egl-x11.cpp
for(p, QMAKE_LIBDIR_EGL) {
exists($$p):LIBS += -L$$p
LIBS += -L$$p
}
!isEmpty(QMAKE_INCDIR_EGL): INCLUDEPATH += $$QMAKE_INCDIR_EGL

View File

@ -1,7 +1,7 @@
SOURCES = egl.cpp
for(p, QMAKE_LIBDIR_EGL) {
exists($$p):LIBS += -L$$p
LIBS += -L$$p
}
!isEmpty(QMAKE_INCDIR_EGL): INCLUDEPATH += $$QMAKE_INCDIR_EGL

View File

@ -5,7 +5,7 @@ CONFIG -= qt
INCLUDEPATH += $$QMAKE_INCDIR_EGL
for(p, QMAKE_LIBDIR_EGL) {
exists($$p):LIBS += -L$$p
LIBS += -L$$p
}
LIBS += -lEGL -lGLESv2 -lbcm_host

View File

@ -1,7 +1,7 @@
SOURCES = eglfs-egldevice.cpp
for(p, QMAKE_LIBDIR_EGL) {
exists($$p):LIBS += -L$$p
LIBS += -L$$p
}
INCLUDEPATH += $$QMAKE_INCDIR_EGL

View File

@ -43,6 +43,6 @@
int main(int, char **)
{
fbGetDisplayByIndex(0);
fbGetDisplay();
return 0;
}

View File

@ -1,6 +1,16 @@
SOURCES = eglfs-viv.cpp
DEFINES += LINUX=1 EGL_API_FB=1
integrity {
DEFINES += EGL_API_FB=1
} else {
DEFINES += LINUX=1 EGL_API_FB=1
}
CONFIG -= qt
LIBS += -lEGL -lGLESv2 -lGAL
for(p, QMAKE_LIBDIR_OPENGL_ES2) {
exists($$p):LIBS += -L$$p
}
!isEmpty(QMAKE_INCDIR_EGL): INCLUDEPATH += $$QMAKE_INCDIR_EGL
!isEmpty(QMAKE_LIBS_EGL): LIBS += $$QMAKE_LIBS_EGL

View File

@ -15,6 +15,7 @@ QTCONF=$9
shift 9
LFLAGS="$SYSROOT_FLAG"
INCLUDEPATH=""
CFLAGS="$SYSROOT_FLAG"
CXXFLAGS="$SYSROOT_FLAG"
MAC_ARCH_CXXFLAGS=""
MAC_ARCH_LFLAGS=""
@ -31,12 +32,14 @@ while [ "$#" -gt 0 ]; do
shift
;;
-arch)
MAC_ARCH_CFLAGS="$MAC_ARCH_CFLAGS -arch $2"
MAC_ARCH_CXXFLAGS="$MAC_ARCH_CXXFLAGS -arch $2"
MAC_ARCH_LFLAGS="$MAC_ARCH_LFLAGS -arch $2"
shift
;;
-F*|-m*|-x*)
LFLAGS="$LFLAGS \"$PARAM\""
CFLAGS="$CFLAGS \"$PARAM\""
CXXFLAGS="$CXXFLAGS \"$PARAM\""
;;
-L*|-l*|-pthread)
@ -47,10 +50,12 @@ while [ "$#" -gt 0 ]; do
INCLUDEPATH="$INCLUDEPATH \"$INC\""
;;
-f*|-D*)
CFLAGS="$CFLAGS \"$PARAM\""
CXXFLAGS="$CXXFLAGS \"$PARAM\""
;;
-Qoption)
# Two-argument form for the Sun Compiler
CFLAGS="$CFLAGS $PARAM \"$2\""
CXXFLAGS="$CXXFLAGS $PARAM \"$2\""
shift
;;
@ -72,7 +77,7 @@ test -r Makefile && $MAKE distclean >/dev/null 2>&1
# Make sure output from possible previous tests is gone
rm -f "$EXE" "${EXE}.exe"
set -- "$QMAKE" -qtconf "$QTCONF" -nocache -spec "$QMKSPEC" "CONFIG+=$QMAKE_CONFIG" "CONFIG+=android_app" "CONFIG-=debug_and_release app_bundle lib_bundle" "LIBS+=$LFLAGS" "LIBS+=$MAC_ARCH_LFLAGS" "INCLUDEPATH*=$INCLUDEPATH" "QMAKE_CXXFLAGS*=$CXXFLAGS" "QMAKE_CXXFLAGS+=$MAC_ARCH_CXXFLAGS" $QMAKE_ARGS "$SRCDIR/$TEST/$EXE.pro" -o "$OUTDIR/$TEST/Makefile"
set -- "$QMAKE" -qtconf "$QTCONF" -nocache -spec "$QMKSPEC" "CONFIG+=$QMAKE_CONFIG" "CONFIG+=android_app" "CONFIG-=debug_and_release app_bundle lib_bundle" "LIBS+=$LFLAGS" "LIBS+=$MAC_ARCH_LFLAGS" "INCLUDEPATH*=$INCLUDEPATH" "QMAKE_CFLAGS*=$CFLAGS" "QMAKE_CFLAGS+=$MAC_ARCH_CFLAGS" "QMAKE_CXXFLAGS*=$CXXFLAGS" "QMAKE_CXXFLAGS+=$MAC_ARCH_CXXFLAGS" $QMAKE_ARGS "$SRCDIR/$TEST/$EXE.pro" -o "$OUTDIR/$TEST/Makefile"
if [ "$VERBOSE" = "yes" ]; then
OUTDIR=$OUTDIR "$@" && $MAKE && SUCCESS=yes
else

View File

@ -2,7 +2,7 @@ SOURCES = opengles2.cpp
INCLUDEPATH += $$QMAKE_INCDIR_OPENGL_ES2
for(p, QMAKE_LIBDIR_OPENGL_ES2) {
exists($$p):LIBS += -L$$p
LIBS += -L$$p
}
CONFIG -= qt

View File

@ -6,7 +6,7 @@ SOURCES = opengles3.cpp
INCLUDEPATH += $$QMAKE_INCDIR_OPENGL_ES2
for(p, QMAKE_LIBDIR_OPENGL_ES2) {
exists($$p):LIBS += -L$$p
LIBS += -L$$p
}
CONFIG -= qt

View File

@ -6,7 +6,7 @@ SOURCES = opengles31.cpp
INCLUDEPATH += $$QMAKE_INCDIR_OPENGL_ES2
for(p, QMAKE_LIBDIR_OPENGL_ES2) {
exists($$p):LIBS += -L$$p
LIBS += -L$$p
}
CONFIG -= qt

View File

@ -0,0 +1,50 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the config.tests of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include <dwrite_2.h>
#include <d2d1.h>
int main(int, char**)
{
IUnknown *factory = 0;
DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED,
__uuidof(IDWriteFactory2),
&factory);
return 0;
}

View File

@ -0,0 +1,4 @@
SOURCES = directwrite2.cpp
LIBS += -ldwrite
CONFIG -= qt
CONFIG += console

14
configure vendored
View File

@ -768,6 +768,7 @@ CFG_SANITIZE_UNDEFINED=no
CFG_PCRE=auto
CFG_STDCXX=auto
CFG_DIRECTWRITE=no
CFG_DIRECTWRITE2=auto
CFG_WERROR=auto
CFG_HEADERSCLEAN=auto
CFG_QREAL=double
@ -5463,6 +5464,18 @@ elif [ "$CFG_GSTREAMER" = "1.0" ]; then
fi
fi
# Detect DirectWrite 2 support on Windows
if [ "$CFG_DIRECTWRITE" = "no" ]; then
CFG_DIRECTWRITE2=no
fi
if [ "$CFG_DIRECTWRITE2" = "auto" ]; then
if compileTest win/directwrite2 "directwrite2"; then
CFG_DIRECTWRITE2=yes
else
CFG_DIRECTWRITE2=no
fi
fi
#-------------------------------------------------------------------------------
# ask for all that hasn't been auto-detected or specified in the arguments
#-------------------------------------------------------------------------------
@ -5701,6 +5714,7 @@ fi
[ "$CFG_XINPUT2" = "yes" ] && QT_CONFIG="$QT_CONFIG xinput2"
[ "$CFG_SYSTEM_PROXIES" = "yes" ] && QT_CONFIG="$QT_CONFIG system-proxies"
[ "$CFG_DIRECTWRITE" = "yes" ] && QT_CONFIG="$QT_CONFIG directwrite"
[ "$CFG_DIRECTWRITE2" = "yes" ] && QT_CONFIG="$QT_CONFIG directwrite2"
[ '!' -z "$DEFINES" ] && QMakeVar add EXTRA_DEFINES "$DEFINES"
[ '!' -z "$INCLUDES" ] && QMakeVar add EXTRA_INCLUDEPATH "$INCLUDES"

View File

@ -69,9 +69,11 @@ MainWindow::MainWindow()
connect(textEdit->document(), &QTextDocument::contentsChanged,
this, &MainWindow::documentWasModified);
#ifndef QT_NO_SESSIONMANAGER
QGuiApplication::setFallbackSessionManagementEnabled(false);
connect(qApp, &QGuiApplication::commitDataRequest,
this, &MainWindow::commitData);
#endif
setCurrentFile(QString());
setUnifiedTitleAndToolBarOnMac(true);
@ -397,7 +399,7 @@ QString MainWindow::strippedName(const QString &fullFileName)
return QFileInfo(fullFileName).fileName();
}
//! [49]
#ifndef QT_NO_SESSIONMANAGER
void MainWindow::commitData(QSessionManager &manager)
{
if (manager.allowsInteraction()) {
@ -409,3 +411,4 @@ void MainWindow::commitData(QSessionManager &manager)
save();
}
}
#endif

View File

@ -80,7 +80,9 @@ private slots:
bool saveAs();
void about();
void documentWasModified();
#ifndef QT_NO_SESSIONMANAGER
void commitData(QSessionManager &);
#endif
private:
void createActions();

View File

@ -29,7 +29,7 @@ QMAKE_CXXFLAGS_STATIC_LIB += $$QMAKE_CFLAGS_STATIC_LIB
QMAKE_CXXFLAGS_APP += $$QMAKE_CFLAGS_APP
QMAKE_CXXFLAGS_YACC += $$QMAKE_CFLAGS_YACC
QMAKE_CXXFLAGS_HIDESYMS += $$QMAKE_CFLAGS_HIDESYMS
QMAKE_CXXFLAGS_CXX11 += --c++11
QMAKE_CXXFLAGS_CXX11 += --c++11 --thread_local_storage
QMAKE_LFLAGS += --no_commons -non_shared --link_once_templates --exceptions --stdle
QMAKE_LFLAGS_RELEASE += -Ospeed -Olink -uvfd

View File

@ -9,7 +9,7 @@ include(../angle.conf)
MAKEFILE_GENERATOR = MSBUILD
QMAKE_COMPILER = msvc
QMAKE_PLATFORM = winrt win32
CONFIG += incremental flat precompile_header autogen_precompile_source debug_and_release debug_and_release_target package_manifest rtti
CONFIG = package_manifest $$CONFIG incremental flat precompile_header autogen_precompile_source debug_and_release debug_and_release_target rtti
DEFINES += UNICODE WIN32 QT_LARGEFILE_SUPPORT Q_BYTE_ORDER=Q_LITTLE_ENDIAN \
QT_NO_PRINTER QT_NO_PRINTDIALOG # TODO: Remove when printing is re-enabled
@ -95,6 +95,9 @@ VCSOLUTION_EXTENSION = .sln
VCPROJ_KEYWORD = Qt4VSv1.0
WINRT_ASSETS_PATH = $$PWD/assets
WINRT_MANIFEST.capabilities = defaults
WINRT_MANIFEST.capabilities_device = defaults
include(../msvc-base.conf)
unset(MSC_VER)

View File

@ -0,0 +1,41 @@
# qmake configuration for the Raspberry Pi 3
include(../common/linux_device_pre.conf)
# I consider it a bug that this is required, but our EGL config.test _requires_ it
QMAKE_LFLAGS += -Wl,-rpath-link,$$[QT_SYSROOT]/opt/vc/lib
VC_LIBRARY_PATH = /opt/vc/lib
VC_INCLUDE_PATH = =/opt/vc/include
# terrible, they do not appear to resolve "=" in rpath!
VC_LINK_LINE = -L=$${VC_LIBRARY_PATH} -Wl,-rpath-link,$$[QT_SYSROOT]$${VC_LIBRARY_PATH}
QMAKE_LIBDIR_OPENGL_ES2 = =$${VC_LIBRARY_PATH}
QMAKE_LIBDIR_EGL = $$QMAKE_LIBDIR_OPENGL_ES2
QMAKE_LIBDIR_OPENVG = $$QMAKE_LIBDIR_OPENGL_ES2
QMAKE_INCDIR_EGL = \
$${VC_INCLUDE_PATH} \
$${VC_INCLUDE_PATH}/interface/vcos/pthreads \
$${VC_INCLUDE_PATH}/interface/vmcs_host/linux
QMAKE_INCDIR_OPENGL_ES2 = $${QMAKE_INCDIR_EGL}
QMAKE_LIBS_OPENGL_ES2 = $${VC_LINK_LINE} -lGLESv2
# The official opt vc EGL references GLESv2 symbols: need to link it
QMAKE_LIBS_EGL = $${VC_LINK_LINE} -lEGL -lGLESv2
# We deliberately override the existing Qt CFLAGS as they might be problematic
QMAKE_CFLAGS = -march=armv8-a+crc -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8 -pipe -Os -mthumb
QMAKE_CXXFLAGS = $$QMAKE_CFLAGS -std=c++1z
DISTRO_OPTS += hard-float
DISTRO_OPTS += deb-multi-arch
EGLFS_DEVICE_INTEGRATION= eglfs_brcm
include(../common/linux_arm_device_post.conf)
load(qt_config)

View File

@ -0,0 +1,34 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the qmake spec of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** As a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "../../linux-g++/qplatformdefs.h"

View File

@ -57,12 +57,14 @@ for(group, groups) {
}
$${group}_header.commands = $$QMAKE_QDBUSXML2CPP $$hdr_flags $$qdbusxml2cpp_option ${QMAKE_FILE_OUT}: ${QMAKE_FILE_IN}
$${group}_header.depends = $$QMAKE_QDBUSXML2CPP_EXE
$${group}_header.output = ${QMAKE_FUNC_FILE_IN_qdbusOutputBasename}_$${dbus_type}.h
$${group}_header.name = DBUSXML2CPP $${dbus_TYPE} HEADER ${QMAKE_FILE_IN}
$${group}_header.variable_out = $${GROUP}_HEADERS
$${group}_header.input = $$input_list
$${group}_source.commands = $$QMAKE_QDBUSXML2CPP -i ${QMAKE_FILE_OUT_BASE}.h $$src_flags $$qdbusxml2cpp_option :${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
$${group}_source.depends = $$QMAKE_QDBUSXML2CPP_EXE
$${group}_source.output = ${QMAKE_FUNC_FILE_IN_qdbusOutputBasename}_$${dbus_type}.cpp
$${group}_source.name = DBUSXML2CPP $${dbus_TYPE} SOURCE ${QMAKE_FILE_IN}
$${group}_source.variable_out = SOURCES
@ -70,6 +72,7 @@ for(group, groups) {
$${group}_source.depends = $$eval($${group}_header.output) # this actually belongs to the object file
$${group}_moc.commands = $$moc_header.commands
$${group}_moc.depends = $$QMAKE_MOC_EXE
$${group}_moc.output = $$moc_header.output
$${group}_moc.input = $${GROUP}_HEADERS
$${group}_moc.variable_out = GENERATED_SOURCES

View File

@ -4,5 +4,5 @@ QMAKE_CFLAGS += $$QMAKE_CFLAGS_EGL
QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_EGL
LIBS += $$QMAKE_LFLAGS_EGL
for(p, QMAKE_LIBDIR_EGL) {
exists($$p): LIBS_PRIVATE += -L$$p
LIBS_PRIVATE += -L$$p
}

View File

@ -6,7 +6,18 @@ android {
ANDROID_JAR_FILE = $$ANDROID_SDK_ROOT/platforms/$$API_VERSION_TO_USE/android.jar
!exists($$ANDROID_JAR_FILE) {
error("The Path $$ANDROID_JAR_FILE does not exist. Make sure the ANDROID_SDK_ROOT and ANDROID_API_VERSION environment variables are correctly set.")
ANDROID_API_VERSION = $$section(API_VERSION_TO_USE, -, 1, 1) # Get version number from android-XY to ensure numeric comparison
ANDROID_API_VERSIONS = $$files($$ANDROID_SDK_ROOT/platforms/*)
for (VERSION, ANDROID_API_VERSIONS) {
BASENAME = $$basename(VERSION)
BASENAME = $$section(BASENAME, -, 1, 1)
greaterThan(BASENAME, $$ANDROID_API_VERSION): ANDROID_API_VERSION = $$BASENAME
}
API_VERSION_TO_USE = android-$$ANDROID_API_VERSION
ANDROID_JAR_FILE = $$ANDROID_SDK_ROOT/platforms/$$API_VERSION_TO_USE/android.jar
}
!exists($$ANDROID_JAR_FILE) {
error("No suitable Android SDK platform found. Minimum version is $${API_VERSION_TO_USE}.")
}
JAVACLASSPATH += $$ANDROID_JAR_FILE

View File

@ -67,9 +67,9 @@ INCREDIBUILD_XGE += moc_source
INCLUDEPATH += $$absolute_path($$MOC_DIR, $$OUT_PWD)
#auto depend on moc
unix:!no_mocdepend {
moc_source.depends += $$first(QMAKE_MOC)
moc_header.depends += $$first(QMAKE_MOC)
!no_mocdepend {
moc_source.depends += $$QMAKE_MOC_EXE
moc_header.depends += $$QMAKE_MOC_EXE
}
#generate a mocclean

View File

@ -5,6 +5,7 @@ isEmpty(QGLTF_DIR): QGLTF_DIR = .
qgltf.input = QT3D_MODELS
qgltf.output = $$QGLTF_DIR/${QMAKE_FILE_BASE}.qrc
qgltf.variable_out += RESOURCES
qgltf.depends = $$QMAKE_QGLTF_EXE
qgltf.commands = $$QMAKE_QGLTF -d $$QGLTF_DIR $$QGLTF_PARAMS ${QMAKE_FILE_NAME}
silent: qgltf.commands = @echo qgltf ${QMAKE_FILE_IN} && $$qgltf.commands -s
qgltf.CONFIG += no_link

View File

@ -23,6 +23,7 @@ for (s, QLALRSOURCES) {
$${base}.input = $$invar
$${base}.output = $$QLALR_DIR/$${parser}.cpp
$${base}.variable_out = GENERATED_SOURCES
$${base}.depends = $$QMAKE_QLALR_EXE
$${base}.commands = $$QMAKE_QLALR $$QMAKE_QLALRFLAGS ${QMAKE_FILE_IN}
silent: $${base}.commands = @echo qlalr ${QMAKE_FILE_IN} && $${base}.commands
$${base}.name = QLALR ${QMAKE_FILE_IN}

View File

@ -27,7 +27,7 @@ CONFIG += relative_qt_rpath # Qt's QML plugins should be relocatable
}
isEmpty(TARGETPATH): TARGETPATH = $$eval(QT.$${CXX_MODULE}.name)
!no_cxx_module:win32:CONFIG(shared, static|shared) {
win32:CONFIG(shared, static|shared) {
# Embed a VERSIONINFO resource into the plugin's DLL.
isEmpty(VERSION): VERSION = $$MODULE_VERSION
CONFIG += skip_target_version_ext

View File

@ -141,6 +141,15 @@ for(ever) {
}
}
}
# Add capabilities as defined by modules used in the project
winrt {
MODULE_WINRT_CAPABILITIES = $$eval(QT.$${QTLIB}.winrt_capabilities)
!isEmpty(MODULE_WINRT_CAPABILITIES): \
WINRT_MANIFEST.capabilities_default += $$MODULE_WINRT_CAPABILITIES
MODULE_WINRT_CAPABILITIES_DEVICE = $$eval(QT.$${QTLIB}.winrt_capabilities_device)
!isEmpty(MODULE_WINRT_CAPABILITIES_DEVICE): \
WINRT_MANIFEST.capabilities_device_default += $$MODULE_WINRT_CAPABILITIES_DEVICE
}
}
!isEmpty(BAD_QT):error("Unknown module(s) in QT$$var_sfx: $$replace(BAD_QT, _private$, -private)")

View File

@ -73,16 +73,24 @@ defineTest(qtPrepareTool) {
isEmpty(cmd) {
cmd = $$[QT_HOST_BINS]/$$2
exists($${cmd}.pl) {
$${1}_EXE = $${cmd}.pl
cmd = perl -w $$system_path($${cmd}.pl)
} else: contains(QMAKE_HOST.os, Windows) {
$${1}_EXE = $${cmd}.exe
cmd = $$system_path($${cmd}.exe)
} else:contains(QMAKE_HOST.os, Darwin) {
BUNDLENAME = $${cmd}.app/Contents/MacOS/$$2
exists($$BUNDLENAME) {
cmd = $$BUNDLENAME
}
$${1}_EXE = $$cmd
} else {
$${1}_EXE = $$cmd
}
} else {
$${1}_EXE = $$last(cmd)
}
export($${1}_EXE)
QT_TOOL_ENV += $$eval(QT_TOOL.$${2}.envvars)
QT_TOOL_NAME = $$2
!isEmpty(3)|!isEmpty(4) {

View File

@ -104,6 +104,9 @@ MODULE_FWD_PRI = $$mod_work_pfx/qt_lib_$${MODULE_ID}.pri
"QT.$${MODULE_ID}.DEFINES = $$val_escape(MODULE_DEFINES)" \
"" \
"QT_MODULES += $$MODULE"
winrt: MODULE_PRI_CONT += \
"QT.$${MODULE_ID}.winrt_capabilities =$$join(MODULE_WINRT_CAPABILITIES, " ", " ")" \
"QT.$${MODULE_ID}.winrt_capabilities_device =$$join(MODULE_WINRT_CAPABILITIES_DEVICE, " ", " ")"
write_file($$MODULE_PRI, MODULE_PRI_CONT)|error("Aborting.")
!internal_module:!no_private_module {
module_build_type += internal_module
@ -186,6 +189,7 @@ MODULE_FWD_PRI = $$mod_work_pfx/qt_lib_$${MODULE_ID}.pri
for(var, $$list(VERSION MAJOR_VERSION MINOR_VERSION PATCH_VERSION \
name module depends run_depends plugin_types module_config CONFIG DEFINES \
priority includes bins libs frameworks libexecs plugins imports qml \
winrt_capabilities winrt_capabilities_device \
)):defined(QT.$${mod}.$$var, var):cache(QT.$${mod}.$$var, transient)
}
cache(QT_MODULES, transient)

View File

@ -33,7 +33,18 @@ win32 {
mac {
equals(TEMPLATE, lib) {
lib_bundle {
QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_TARGET}$${TARGET}.framework/$${TARGET}
!isEmpty(QMAKE_FRAMEWORK_BUNDLE_NAME): \
framework_target = $$QMAKE_FRAMEWORK_BUNDLE_NAME
else: \
framework_target = $$TARGET
QMAKE_RESOLVED_BUNDLE = $${QMAKE_RESOLVED_TARGET}$${framework_target}.framework
!shallow_bundle {
TEMP_VERSION = $$section(VERSION, ., 0, 0)
isEmpty(TEMP_VERSION):TEMP_VERSION = A
QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_BUNDLE}/Versions/$${TEMP_VERSION}/$${TARGET}
} else {
QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_BUNDLE}/$${TARGET}
}
} else {
QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_TARGET}$${LIBPREFIX}$${TARGET}
!plugin {
@ -46,7 +57,15 @@ win32 {
}
} else {
app_bundle {
QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_TARGET}$${TARGET}.app/Contents/MacOS/$${TARGET}
!isEmpty(QMAKE_APPLICATION_BUNDLE_NAME): \
app_target = $$QMAKE_APPLICATION_BUNDLE_NAME
else: \
app_target = $$TARGET
QMAKE_RESOLVED_BUNDLE = $${QMAKE_RESOLVED_TARGET}$${app_target}.app
!shallow_bundle: \
QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_BUNDLE}/Contents/MacOS/$${TARGET}
else: \
QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_BUNDLE}/$${TARGET}
} else {
QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_TARGET}$${TARGET}
}

View File

@ -103,6 +103,7 @@ rcc.clean += $$RCC_CPP $$RCC_TMP
}
rcc.depends = $$QMAKE_RCC_EXE
silent:rcc.commands = @echo rcc ${QMAKE_FILE_IN} && $$rcc.commands
else:rcc.commands ~= s/&&/$$escape_expand(\\n\\t)/g
QMAKE_EXTRA_COMPILERS += rcc

View File

@ -3,6 +3,7 @@ qtPrepareTool(QMAKE_UIC, uic, _DEP)
isEmpty(UI_DIR):UI_DIR = .
isEmpty(QMAKE_MOD_UIC):QMAKE_MOD_UIC = ui_
uic.depends = $$QMAKE_UIC_EXE
uic.commands = $$QMAKE_UIC ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
uic.depend_command = $$QMAKE_UIC_DEP -d ${QMAKE_FILE_IN}
uic.output = $$UI_DIR/$${QMAKE_MOD_UIC}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)}

View File

@ -1 +0,0 @@

View File

@ -78,7 +78,7 @@ qtPrepareTool(QMAKE_QTWAYLANDSCANNER, qtwaylandscanner)
qtwayland_client_header.name = qtwayland ${QMAKE_FILE_BASE}
qtwayland_client_header.input = WAYLANDCLIENTSOURCES
qtwayland_client_header.variable_out = HEADERS
qtwayland_client_header.depends = $${WAYLAND_CLIENT_HEADER_DEST}wayland-${QMAKE_FILE_BASE}-client-protocol$${first(QMAKE_EXT_H)}
qtwayland_client_header.depends = $$QMAKE_QTWAYLANDSCANNER_EXE $${WAYLAND_CLIENT_HEADER_DEST}wayland-${QMAKE_FILE_BASE}-client-protocol$${first(QMAKE_EXT_H)}
qtwayland_client_header.output = $${WAYLAND_CLIENT_HEADER_DEST}qwayland-${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)}
qtwayland_client_header.commands = $$QMAKE_QTWAYLANDSCANNER client-header ${QMAKE_FILE_IN} $$WAYLAND_CLIENT_INCLUDE_DIR > ${QMAKE_FILE_OUT}
silent:qtwayland_client_header.commands = @echo QtWayland client header ${QMAKE_FILE_IN} && $$qtwayland_client_header.commands
@ -87,7 +87,7 @@ QMAKE_EXTRA_COMPILERS += qtwayland_client_header
qtwayland_client_code.name = qtwayland ${QMAKE_FILE_BASE}
qtwayland_client_code.input = WAYLANDCLIENTSOURCES
qtwayland_client_code.variable_out = SOURCES
qtwayland_client_code.depends = $${WAYLAND_CLIENT_HEADER_DEST}qwayland-${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)}
qtwayland_client_code.depends = $$QMAKE_QTWAYLANDSCANNER_EXE $${WAYLAND_CLIENT_HEADER_DEST}qwayland-${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)}
qtwayland_client_code.output = qwayland-${QMAKE_FILE_BASE}.cpp
qtwayland_client_code.commands = $$QMAKE_QTWAYLANDSCANNER client-code ${QMAKE_FILE_IN} $$WAYLAND_CLIENT_INCLUDE_DIR > ${QMAKE_FILE_OUT}
silent:qtwayland_client_code.commands = @echo QtWayland client code ${QMAKE_FILE_IN} && $$qtwayland_client_code.commands
@ -96,7 +96,7 @@ QMAKE_EXTRA_COMPILERS += qtwayland_client_code
qtwayland_server_header.name = qtwayland ${QMAKE_FILE_BASE}
qtwayland_server_header.input = WAYLANDSERVERSOURCES
qtwayland_server_header.variable_out = HEADERS
qtwayland_server_header.depends = $${WAYLAND_SERVER_HEADER_DEST}wayland-${QMAKE_FILE_BASE}-server-protocol$${first(QMAKE_EXT_H)}
qtwayland_server_header.depends = $$QMAKE_QTWAYLANDSCANNER_EXE $${WAYLAND_SERVER_HEADER_DEST}wayland-${QMAKE_FILE_BASE}-server-protocol$${first(QMAKE_EXT_H)}
qtwayland_server_header.output = $${WAYLAND_SERVER_HEADER_DEST}qwayland-server-${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)}
qtwayland_server_header.commands = $$QMAKE_QTWAYLANDSCANNER server-header ${QMAKE_FILE_IN} $$WAYLAND_SERVER_INCLUDE_DIR > ${QMAKE_FILE_OUT}
silent:qtwayland_server_header.commands = @echo QtWayland server header ${QMAKE_FILE_IN} && $$qtwayland_server_header.commands
@ -105,7 +105,7 @@ QMAKE_EXTRA_COMPILERS += qtwayland_server_header
qtwayland_server_code.name = qtwayland ${QMAKE_FILE_BASE}
qtwayland_server_code.input = WAYLANDSERVERSOURCES
qtwayland_server_code.variable_out = SOURCES
qtwayland_server_code.depends = $${WAYLAND_SERVER_HEADER_DEST}qwayland-server-${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)}
qtwayland_server_code.depends = $$QMAKE_QTWAYLANDSCANNER_EXE $${WAYLAND_SERVER_HEADER_DEST}qwayland-server-${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)}
qtwayland_server_code.output = qwayland-server-${QMAKE_FILE_BASE}.cpp
qtwayland_server_code.commands = $$QMAKE_QTWAYLANDSCANNER server-code ${QMAKE_FILE_IN} $$WAYLAND_SERVER_INCLUDE_DIR > ${QMAKE_FILE_OUT}
silent:qtwayland_server_code.commands = @echo QtWayland server code ${QMAKE_FILE_IN} && $$qtwayland_server_code.commands

View File

@ -1,5 +1,6 @@
qtPrepareTool(QMAKE_DUMPCPP, dumpcpp)
dumpcpp_decl.depends = $$QMAKE_DUMPCPP_EXE
dumpcpp_decl.commands = $$QMAKE_DUMPCPP ${QMAKE_FILE_IN} -o ${QMAKE_FILE_BASE}
qaxcontainer_compat: dumpcpp_decl.commands += -compat
dumpcpp_decl.output = ${QMAKE_FILE_BASE}.h

View File

@ -112,10 +112,19 @@
# capability anymore and is assumed to be standard.
*-msvc2015: WINRT_MANIFEST.capabilities += internetClient
contains(WINRT_MANIFEST.capabilities, defaults) {
WINRT_MANIFEST.capabilities -= defaults
WINRT_MANIFEST.capabilities += $$WINRT_MANIFEST.capabilities_default
}
contains(WINRT_MANIFEST.capabilities_device, defaults) {
WINRT_MANIFEST.capabilities_device -= defaults
WINRT_MANIFEST.capabilities_device += $$WINRT_MANIFEST.capabilities_device_default
}
# Capabilities are given as a string list and may change with the configuration (network, sensors, etc.)
WINRT_MANIFEST.capabilities = $$unique(WINRT_MANIFEST.capabilities)
WINRT_MANIFEST.capabilities_device = $$unique(WINRT_MANIFEST.capabilities_device)
!isEmpty(WINRT_MANIFEST.capabilities)|!isEmpty(WINRT_MANIFEST.capabilities_device) {
MANIFEST_CAPABILITIES += "<Capabilities>"
for(CAPABILITY, WINRT_MANIFEST.capabilities): \

View File

@ -74,6 +74,9 @@
#else
#undef DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS
#endif // _WIN32
#elif defined(__ghs)
// Green Hills toolchain uses a 64bit wide floating point stack
#define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1
#else
#error Target architecture was not detected as supported by Double-Conversion.
#endif

View File

@ -153,16 +153,15 @@ public class QtActivityDelegate
m_activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
m_activity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
try {
int flags = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
flags |= View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
flags |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;
flags |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;
flags |= View.SYSTEM_UI_FLAG_FULLSCREEN;
if (Build.VERSION.SDK_INT >= 19)
if (Build.VERSION.SDK_INT >= 19) {
int flags = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
flags |= View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
flags |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;
flags |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;
flags |= View.SYSTEM_UI_FLAG_FULLSCREEN;
flags |= View.class.getDeclaredField("SYSTEM_UI_FLAG_IMMERSIVE_STICKY").getInt(null);
m_activity.getWindow().getDecorView().setSystemUiVisibility(flags | View.INVISIBLE);
m_activity.getWindow().getDecorView().setSystemUiVisibility(flags | View.INVISIBLE);
}
} catch (Exception e) {
e.printStackTrace();
}

View File

@ -55,7 +55,7 @@ public class QtActivityLoader extends QtLoader {
QtActivityLoader(QtActivity activity)
{
super(activity);
super(activity, QtActivity.class);
m_activity = activity;
}
@Override

View File

@ -133,8 +133,11 @@ public class QtApplication extends Application
break;
}
}
if (-1 == stackDeep)
return result;
final String methodName=elements[stackDeep].getMethodName();
if (-1 == stackDeep || !m_delegateMethods.containsKey(methodName))
if (!m_delegateMethods.containsKey(methodName))
return result;
for (Method m : m_delegateMethods.get(methodName)) {

View File

@ -152,9 +152,11 @@ public abstract class QtLoader {
public int m_displayDensity = -1;
private ContextWrapper m_context;
protected ComponentInfo m_contextInfo;
private Class<?> m_delegateClass;
QtLoader(ContextWrapper context) {
QtLoader(ContextWrapper context, Class<?> clazz) {
m_context = context;
m_delegateClass = clazz;
}
// Implement in subclass
@ -235,7 +237,7 @@ public abstract class QtLoader {
if (!(Boolean)prepareAppMethod.invoke(qtLoader, m_context, classLoader, loaderParams))
throw new Exception("");
QtApplication.setQtContextDelegate(m_context.getClass(), qtLoader);
QtApplication.setQtContextDelegate(m_delegateClass, qtLoader);
// now load the application library so it's accessible from this class loader
if (libName != null)

View File

@ -42,7 +42,7 @@ import android.content.pm.PackageManager;
public class QtServiceLoader extends QtLoader {
QtService m_service;
QtServiceLoader(QtService service) {
super(service);
super(service, QtService.class);
m_service = service;
}

View File

@ -1183,13 +1183,13 @@ bool qSharedBuild() Q_DECL_NOTHROW
QSysInfo::MacintoshVersion variable gives the version of the
system on which the application is run.
\value MV_9 Mac OS 9 (unsupported)
\value MV_10_0 Mac OS X 10.0 (unsupported)
\value MV_10_1 Mac OS X 10.1 (unsupported)
\value MV_10_2 Mac OS X 10.2 (unsupported)
\value MV_10_3 Mac OS X 10.3 (unsupported)
\value MV_10_4 Mac OS X 10.4 (unsupported)
\value MV_10_5 Mac OS X 10.5 (unsupported)
\value MV_9 Mac OS 9
\value MV_10_0 Mac OS X 10.0
\value MV_10_1 Mac OS X 10.1
\value MV_10_2 Mac OS X 10.2
\value MV_10_3 Mac OS X 10.3
\value MV_10_4 Mac OS X 10.4
\value MV_10_5 Mac OS X 10.5
\value MV_10_6 Mac OS X 10.6
\value MV_10_7 Mac OS X 10.7
\value MV_10_8 OS X 10.8

View File

@ -1339,7 +1339,7 @@ public:
ImPlatformData = 0x80000000,
ImQueryInput = ImCursorRectangle | ImCursorPosition | ImSurroundingText |
ImCurrentSelection | ImAnchorPosition,
ImCurrentSelection | ImAnchorRectangle | ImAnchorPosition,
ImQueryAll = 0xffffffff
};
Q_DECLARE_FLAGS(InputMethodQueries, InputMethodQuery)

View File

@ -234,6 +234,11 @@
set to true won't use the native dialogs provided by the platform.
This value has been added in Qt 5.7.
\value AA_SynthesizeMouseForUnhandledTabletEvents All tablet events
that are not accepted by the application will be translated
to mouse events instead. This attribute is enabled
by default. 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}
@ -2575,6 +2580,8 @@
\value ImTextAfterCursor The plain text after the cursor. The widget can decide how much text to return,
but \b{must} not return an empty string unless the cursor is at the end of the document.
\value ImEnterKeyType The Enter key type.
\value ImAnchorRectangle The bounding rectangle of the selection anchor.
This value has been added in Qt 5.7.
Masks:

View File

@ -117,6 +117,9 @@ static bool parseIp4Internal(IPv4Address &address, const char *ptr, bool acceptL
return false;
else if (dotCount == 3 || *endptr == '\0')
return true;
if (*endptr != '.')
return false;
++dotCount;
ptr = endptr + 1;
}

View File

@ -81,7 +81,8 @@ public:
// Returns \c true if the lock belongs to dead PID, or is old.
// The attempt to delete it will tell us if it was really stale or not, though.
bool isApparentlyStale() const;
static QString processNameByPid(qint64 pid);
// used in dbusmenu
Q_CORE_EXPORT static QString processNameByPid(qint64 pid);
#ifdef Q_OS_UNIX
static int checkFcntlWorksAfterFlock(const QString &fn);

View File

@ -148,6 +148,8 @@ static QBasicMutex fcntlLock;
static bool fcntlWorksAfterFlock(const QString &fn)
{
QMutexLocker lock(&fcntlLock);
if (fcntlOK.isDestroyed())
return QLockFilePrivate::checkFcntlWorksAfterFlock(fn);
bool *worksPtr = fcntlOK->object(fn);
if (!worksPtr) {
worksPtr = new bool(QLockFilePrivate::checkFcntlWorksAfterFlock(fn));

View File

@ -2297,8 +2297,7 @@ void QProcess::start(const QString &command, OpenMode mode)
return;
}
QString prog = args.first();
args.removeFirst();
const QString prog = args.takeFirst();
start(prog, args, mode);
}
@ -2540,8 +2539,7 @@ bool QProcess::startDetached(const QString &command)
if (args.isEmpty())
return false;
QString prog = args.first();
args.removeFirst();
const QString prog = args.takeFirst();
return QProcessPrivate::startDetached(prog, args);
}

View File

@ -1259,8 +1259,10 @@ bool QResourceFileEngine::open(QIODevice::OpenMode flags)
}
if(flags & QIODevice::WriteOnly)
return false;
if(!d->resource.isValid())
return false;
if (!d->resource.isValid()) {
d->errorString = qt_error_string(ENOENT);
return false;
}
return true;
}

View File

@ -149,7 +149,7 @@ static QCFType<CFPropertyListRef> macValue(const QVariant &value)
bool singleton = (values.count() == 1);
if (singleton) {
switch (values.first().type()) {
switch (values.constFirst().type()) {
// should be same as above (look for LIST)
case QVariant::List:
case QVariant::StringList:
@ -161,7 +161,7 @@ static QCFType<CFPropertyListRef> macValue(const QVariant &value)
}
cfkeys[numUniqueKeys] = QCFString::toCFStringRef(key);
cfvalues[numUniqueKeys] = singleton ? macValue(values.first()) : macList(values);
cfvalues[numUniqueKeys] = singleton ? macValue(values.constFirst()) : macList(values);
++numUniqueKeys;
}

View File

@ -273,7 +273,7 @@ QString QStandardPaths::displayName(StandardLocation type)
return QCoreApplication::translate("QStandardPaths", "Applications");
if (QCFType<CFURLRef> url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault,
standardLocations(type).first().toCFString(),
standardLocations(type).constFirst().toCFString(),
kCFURLPOSIXPathStyle, true)) {
QCFString name;
CFURLCopyResourcePropertyForKey(url, kCFURLLocalizedNameKey, &name, NULL);

View File

@ -58,8 +58,8 @@ QPersistentModelIndexData *QPersistentModelIndexData::create(const QModelIndex &
QPersistentModelIndexData *d = 0;
QAbstractItemModel *model = const_cast<QAbstractItemModel *>(index.model());
QHash<QModelIndex, QPersistentModelIndexData *> &indexes = model->d_func()->persistent.indexes;
const QHash<QModelIndex, QPersistentModelIndexData *>::iterator it = indexes.find(index);
if (it != indexes.end()) {
const auto it = indexes.constFind(index);
if (it != indexes.cend()) {
d = (*it);
} else {
d = new QPersistentModelIndexData(index);
@ -603,13 +603,13 @@ void QAbstractItemModelPrivate::removePersistentIndexData(QPersistentModelIndexD
}
// make sure our optimization still works
for (int i = persistent.moved.count() - 1; i >= 0; --i) {
int idx = persistent.moved[i].indexOf(data);
int idx = persistent.moved.at(i).indexOf(data);
if (idx >= 0)
persistent.moved[i].remove(idx);
}
// update the references to invalidated persistent indexes
for (int i = persistent.invalidated.count() - 1; i >= 0; --i) {
int idx = persistent.invalidated[i].indexOf(data);
int idx = persistent.invalidated.at(i).indexOf(data);
if (idx >= 0)
persistent.invalidated[i].remove(idx);
}
@ -2544,13 +2544,13 @@ bool QAbstractItemModel::decodeData(int row, int column, const QModelIndex &pare
for (int i = 0; i < rows.count(); ++i)
rowsToInsert[rows.at(i)] = 1;
for (int i = 0; i < rowsToInsert.count(); ++i) {
if (rowsToInsert[i] == 1){
if (rowsToInsert.at(i) == 1){
rowsToInsert[i] = dragRowCount;
++dragRowCount;
}
}
for (int i = 0; i < rows.count(); ++i)
rows[i] = top + rowsToInsert[rows[i]];
rows[i] = top + rowsToInsert.at(rows.at(i));
QBitArray isWrittenTo(dragRowCount * dragColumnCount);

View File

@ -863,7 +863,7 @@ void QItemSelectionModelPrivate::_q_layoutAboutToBeChanged(const QList<QPersiste
// optimization for when all indexes are selected
// (only if there is lots of items (1000) because this is not entirely correct)
if (ranges.isEmpty() && currentSelection.count() == 1) {
QItemSelectionRange range = currentSelection.first();
QItemSelectionRange range = currentSelection.constFirst();
QModelIndex parent = range.parent();
tableRowCount = model->rowCount(parent);
tableColCount = model->columnCount(parent);

View File

@ -275,7 +275,7 @@ public:
const QVector<int> &source_to_proxy, const QVector<int> &source_items,
int &proxy_low, int &proxy_high) const;
QModelIndexPairList store_persistent_indexes();
QModelIndexPairList store_persistent_indexes() const;
void update_persistent_indexes(const QModelIndexPairList &source_indexes);
void filter_about_to_be_changed(const QModelIndex &source_parent = QModelIndex());
@ -1014,9 +1014,9 @@ void QSortFilterProxyModelPrivate::build_source_to_proxy_mapping(
Maps the persistent proxy indexes to source indexes and
returns the list of source indexes.
*/
QModelIndexPairList QSortFilterProxyModelPrivate::store_persistent_indexes()
QModelIndexPairList QSortFilterProxyModelPrivate::store_persistent_indexes() const
{
Q_Q(QSortFilterProxyModel);
Q_Q(const QSortFilterProxyModel);
QModelIndexPairList source_indexes;
source_indexes.reserve(persistent.indexes.count());
for (QPersistentModelIndexData *data : qAsConst(persistent.indexes)) {

View File

@ -187,7 +187,7 @@ bool QStringListModel::setData(const QModelIndex &index, const QVariant &value,
if (index.row() >= 0 && index.row() < lst.size()
&& (role == Qt::EditRole || role == Qt::DisplayRole)) {
lst.replace(index.row(), value.toString());
emit dataChanged(index, index, QVector<int>() << role);
emit dataChanged(index, index, QVector<int>(1, role));
return true;
}
return false;

View File

@ -59,12 +59,12 @@ int appCmdShow = 0;
Q_CORE_EXPORT QString qAppFileName()
{
return QFileInfo(QCoreApplication::arguments().first()).filePath();
return QFileInfo(QCoreApplication::arguments().constFirst()).filePath();
}
QString QCoreApplicationPrivate::appName() const
{
return QFileInfo(QCoreApplication::arguments().first()).baseName();
return QFileInfo(QCoreApplication::arguments().constFirst()).baseName();
}
#else

View File

@ -143,7 +143,7 @@ static gboolean timerSourceCheckHelper(GTimerSource *src)
|| (src->processEventsFlags & QEventLoop::X11ExcludeTimers))
return false;
if (src->timerList.updateCurrentTime() < src->timerList.first()->timeout)
if (src->timerList.updateCurrentTime() < src->timerList.constFirst()->timeout)
return false;
return true;

View File

@ -591,7 +591,7 @@ int QTimerInfoList::activateTimers()
if (isEmpty())
break;
QTimerInfo *currentTimerInfo = first();
QTimerInfo *currentTimerInfo = constFirst();
if (currentTime < currentTimerInfo->timeout)
break; // no timer has expired

View File

@ -406,7 +406,7 @@ QMimeType QMimeDatabase::mimeTypeForFile(const QString &fileName, MatchMode mode
{
if (mode == MatchExtension) {
QMutexLocker locker(&d->mutex);
QStringList matches = d->mimeTypeForFileName(fileName);
const QStringList matches = d->mimeTypeForFileName(fileName);
const int matchCount = matches.count();
if (matchCount == 0) {
return d->mimeTypeForName(d->defaultMimeType());

View File

@ -205,7 +205,7 @@ bool QMimeBinaryProvider::isValid()
return false;
// We found exactly one file; is it the user-modified mimes, or a system file?
const QString foundFile = m_cacheFiles.first()->file.fileName();
const QString foundFile = m_cacheFiles.constFirst()->file.fileName();
const QString localCacheFile = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/mime/mime.cache");
return foundFile != localCacheFile;
@ -629,7 +629,7 @@ void QMimeBinaryProvider::loadMimeTypePrivate(QMimeTypePrivate &data)
// Let's assume that shared-mime-info is at least version 0.70
// Otherwise we would need 1) a version check, and 2) code for parsing patterns from the globs file.
#if 1
if (!mainPattern.isEmpty() && (data.globPatterns.isEmpty() || data.globPatterns.first() != mainPattern)) {
if (!mainPattern.isEmpty() && (data.globPatterns.isEmpty() || data.globPatterns.constFirst() != mainPattern)) {
// ensure it's first in the list of patterns
data.globPatterns.removeAll(mainPattern);
data.globPatterns.prepend(mainPattern);
@ -637,7 +637,7 @@ void QMimeBinaryProvider::loadMimeTypePrivate(QMimeTypePrivate &data)
#else
const bool globsInXml = sharedMimeInfoVersion() >= QT_VERSION_CHECK(0, 70, 0);
if (globsInXml) {
if (!mainPattern.isEmpty() && data.globPatterns.first() != mainPattern) {
if (!mainPattern.isEmpty() && data.globPatterns.constFirst() != mainPattern) {
// ensure it's first in the list of patterns
data.globPatterns.removeAll(mainPattern);
data.globPatterns.prepend(mainPattern);

View File

@ -209,6 +209,11 @@ QAbstractState *QHistoryState::defaultState() const
return d->defaultTransition ? d->defaultTransition->targetState() : Q_NULLPTR;
}
static inline bool isSoleEntry(const QList<QAbstractState*> &states, const QAbstractState * state)
{
return states.size() == 1 && states.first() == state;
}
/*!
Sets this history state's default state to be the given \a state.
\a state must be a sibling of this history state.
@ -224,9 +229,7 @@ void QHistoryState::setDefaultState(QAbstractState *state)
"to this history state's group (%p)", state, parentState());
return;
}
if (!d->defaultTransition
|| d->defaultTransition->targetStates().size() != 1
|| d->defaultTransition->targetStates().first() != state) {
if (!d->defaultTransition || !isSoleEntry(d->defaultTransition->targetStates(), state)) {
if (!d->defaultTransition || !qobject_cast<DefaultStateTransition*>(d->defaultTransition)) {
d->defaultTransition = new DefaultStateTransition(this, state);
emit defaultTransitionChanged(QHistoryState::QPrivateSignal());

View File

@ -159,9 +159,8 @@ QSignalTransition::QSignalTransition(const QObject *sender, const char *signal,
Constructs a new signal transition associated with the given \a signal of
the given \a sender object and with the given \a sourceState.
This constructor is enabled if compiler supports delegating constructor.
\sa Q_COMPILER_DELEGATING_CONSTRUCTORS
This constructor is enabled if the compiler supports delegating constructors,
as indicated by the presence of the macro Q_COMPILER_DELEGATING_CONSTRUCTORS.
*/
/*!

View File

@ -692,7 +692,7 @@ void QStateMachinePrivate::microstep(QEvent *event, const QList<QAbstractTransit
// Add "implicit" assignments for restored properties to the first
// (outermost) entered state
Q_ASSERT(!enteredStates.isEmpty());
QAbstractState *s = enteredStates.first();
QAbstractState *s = enteredStates.constFirst();
assignmentsForEnteredStates[s] << restorablesToPropertyList(pendingRestorables);
}

View File

@ -121,7 +121,7 @@ public:
void addEvent(const QPostEvent &ev) {
int priority = ev.priority;
if (isEmpty() ||
last().priority >= priority ||
constLast().priority >= priority ||
insertionOffset >= size()) {
// optimization: we can simply append if the last event in
// the queue has higher or equal priority

View File

@ -228,7 +228,7 @@ int QThreadPoolPrivate::activeThreadCount() const
void QThreadPoolPrivate::tryToStartMoreThreads()
{
// try to push tasks on the queue to any available threads
while (!queue.isEmpty() && tryStart(queue.first().first))
while (!queue.isEmpty() && tryStart(queue.constFirst().first))
queue.removeFirst();
}

View File

@ -136,7 +136,7 @@ void QWaitConditionPrivate::post(QWaitConditionEvent *wce, bool ret)
// wakeups delivered after the timeout should be forwarded to the next waiter
if (!ret && wce->wokenUp && !queue.isEmpty()) {
QWaitConditionEvent *other = queue.first();
QWaitConditionEvent *other = queue.constFirst();
SetEvent(other->event);
other->wokenUp = true;
}

View File

@ -604,41 +604,41 @@ inline bool QByteArray::contains(const QByteArray &a) const
{ return indexOf(a) != -1; }
inline bool QByteArray::contains(char c) const
{ return indexOf(c) != -1; }
inline bool operator==(const QByteArray &a1, const QByteArray &a2)
inline bool operator==(const QByteArray &a1, const QByteArray &a2) Q_DECL_NOTHROW
{ return (a1.size() == a2.size()) && (memcmp(a1.constData(), a2.constData(), a1.size())==0); }
inline bool operator==(const QByteArray &a1, const char *a2)
inline bool operator==(const QByteArray &a1, const char *a2) Q_DECL_NOTHROW
{ return a2 ? qstrcmp(a1,a2) == 0 : a1.isEmpty(); }
inline bool operator==(const char *a1, const QByteArray &a2)
inline bool operator==(const char *a1, const QByteArray &a2) Q_DECL_NOTHROW
{ return a1 ? qstrcmp(a1,a2) == 0 : a2.isEmpty(); }
inline bool operator!=(const QByteArray &a1, const QByteArray &a2)
inline bool operator!=(const QByteArray &a1, const QByteArray &a2) Q_DECL_NOTHROW
{ return !(a1==a2); }
inline bool operator!=(const QByteArray &a1, const char *a2)
inline bool operator!=(const QByteArray &a1, const char *a2) Q_DECL_NOTHROW
{ return a2 ? qstrcmp(a1,a2) != 0 : !a1.isEmpty(); }
inline bool operator!=(const char *a1, const QByteArray &a2)
inline bool operator!=(const char *a1, const QByteArray &a2) Q_DECL_NOTHROW
{ return a1 ? qstrcmp(a1,a2) != 0 : !a2.isEmpty(); }
inline bool operator<(const QByteArray &a1, const QByteArray &a2)
inline bool operator<(const QByteArray &a1, const QByteArray &a2) Q_DECL_NOTHROW
{ return qstrcmp(a1, a2) < 0; }
inline bool operator<(const QByteArray &a1, const char *a2)
inline bool operator<(const QByteArray &a1, const char *a2) Q_DECL_NOTHROW
{ return qstrcmp(a1, a2) < 0; }
inline bool operator<(const char *a1, const QByteArray &a2)
inline bool operator<(const char *a1, const QByteArray &a2) Q_DECL_NOTHROW
{ return qstrcmp(a1, a2) < 0; }
inline bool operator<=(const QByteArray &a1, const QByteArray &a2)
inline bool operator<=(const QByteArray &a1, const QByteArray &a2) Q_DECL_NOTHROW
{ return qstrcmp(a1, a2) <= 0; }
inline bool operator<=(const QByteArray &a1, const char *a2)
inline bool operator<=(const QByteArray &a1, const char *a2) Q_DECL_NOTHROW
{ return qstrcmp(a1, a2) <= 0; }
inline bool operator<=(const char *a1, const QByteArray &a2)
inline bool operator<=(const char *a1, const QByteArray &a2) Q_DECL_NOTHROW
{ return qstrcmp(a1, a2) <= 0; }
inline bool operator>(const QByteArray &a1, const QByteArray &a2)
inline bool operator>(const QByteArray &a1, const QByteArray &a2) Q_DECL_NOTHROW
{ return qstrcmp(a1, a2) > 0; }
inline bool operator>(const QByteArray &a1, const char *a2)
inline bool operator>(const QByteArray &a1, const char *a2) Q_DECL_NOTHROW
{ return qstrcmp(a1, a2) > 0; }
inline bool operator>(const char *a1, const QByteArray &a2)
inline bool operator>(const char *a1, const QByteArray &a2) Q_DECL_NOTHROW
{ return qstrcmp(a1, a2) > 0; }
inline bool operator>=(const QByteArray &a1, const QByteArray &a2)
inline bool operator>=(const QByteArray &a1, const QByteArray &a2) Q_DECL_NOTHROW
{ return qstrcmp(a1, a2) >= 0; }
inline bool operator>=(const QByteArray &a1, const char *a2)
inline bool operator>=(const QByteArray &a1, const char *a2) Q_DECL_NOTHROW
{ return qstrcmp(a1, a2) >= 0; }
inline bool operator>=(const char *a1, const QByteArray &a2)
inline bool operator>=(const char *a1, const QByteArray &a2) Q_DECL_NOTHROW
{ return qstrcmp(a1, a2) >= 0; }
#if !defined(QT_USE_QSTRINGBUILDER)
inline const QByteArray operator+(const QByteArray &a1, const QByteArray &a2)

View File

@ -901,7 +901,8 @@ QStringList QCommandLineParser::values(const QString &optionName) const
bool QCommandLineParser::isSet(const QCommandLineOption &option) const
{
// option.names() might be empty if the constructor failed
return !option.names().isEmpty() && isSet(option.names().first());
const auto names = option.names();
return !names.isEmpty() && isSet(names.first());
}
/*!
@ -919,7 +920,7 @@ bool QCommandLineParser::isSet(const QCommandLineOption &option) const
*/
QString QCommandLineParser::value(const QCommandLineOption &option) const
{
return value(option.names().first());
return value(option.names().constFirst());
}
/*!
@ -937,7 +938,7 @@ QString QCommandLineParser::value(const QCommandLineOption &option) const
*/
QStringList QCommandLineParser::values(const QCommandLineOption &option) const
{
return values(option.names().first());
return values(option.names().constFirst());
}
/*!

View File

@ -167,7 +167,7 @@ bool QDateTimeParser::setDigit(QDateTime &v, int index, int newVal) const
break;
}
if (!(node.type & (DaySection|DayOfWeekSectionShort|DayOfWeekSectionLong))) {
if (!(node.type & DaySectionMask)) {
if (day < cachedDay)
day = cachedDay;
const int max = QDate(year, month, 1).daysInMonth();
@ -633,6 +633,10 @@ int QDateTimeParser::sectionMaxSize(Section s, int count) const
case Internal:
case TimeSectionMask:
case DateSectionMask:
case HourSectionMask:
case YearSectionMask:
case DayOfWeekSectionMask:
case DaySectionMask:
qWarning("QDateTimeParser::sectionMaxSize: Invalid section %s",
SectionNode::name(s).toLatin1().constData());
@ -987,33 +991,27 @@ QDateTimeParser::StateNode QDateTimeParser::parse(QString &input, int &cursorPos
if (state != Invalid) {
if (parserType != QVariant::Time) {
if (year % 100 != year2digits) {
switch (isSet & (YearSection2Digits|YearSection)) {
case YearSection2Digits:
if (year % 100 != year2digits && (isSet & YearSection2Digits)) {
if (!(isSet & YearSection)) {
year = (year / 100) * 100;
year += year2digits;
break;
case ((uint)YearSection2Digits|(uint)YearSection): {
} else {
conflicts = true;
const SectionNode &sn = sectionNode(currentSectionIndex);
if (sn.type == YearSection2Digits) {
year = (year / 100) * 100;
year += year2digits;
}
break; }
default:
break;
}
}
const QDate date(year, month, day);
const int diff = dayofweek - date.dayOfWeek();
if (diff != 0 && state == Acceptable
&& isSet & (DayOfWeekSectionShort | DayOfWeekSectionLong)) {
if (diff != 0 && state == Acceptable && isSet & DayOfWeekSectionMask) {
if (isSet & DaySection)
conflicts = true;
const SectionNode &sn = sectionNode(currentSectionIndex);
if (sn.type & (DayOfWeekSectionShort|DayOfWeekSectionLong) || currentSectionIndex == -1) {
if (sn.type & DayOfWeekSectionMask || currentSectionIndex == -1) {
// dayofweek should be preferred
day += diff;
if (day <= 0) {
@ -1025,8 +1023,9 @@ QDateTimeParser::StateNode QDateTimeParser::parse(QString &input, int &cursorPos
<< diff << QDate(year, month, day).dayOfWeek();
}
}
bool needfixday = false;
if (sectionType(currentSectionIndex) & (DaySection|DayOfWeekSectionShort|DayOfWeekSectionLong)) {
if (sectionType(currentSectionIndex) & DaySectionMask) {
cachedDay = day;
} else if (cachedDay > day) {
day = cachedDay;
@ -1054,7 +1053,7 @@ QDateTimeParser::StateNode QDateTimeParser::parse(QString &input, int &cursorPos
const SectionNode sn = sectionNode(i);
if (sn.type & DaySection) {
input.replace(sectionPos(sn), sectionSize(i), loc.toString(day));
} else if (sn.type & (DayOfWeekSectionShort | DayOfWeekSectionLong)) {
} else if (sn.type & DayOfWeekSectionMask) {
const int dayOfWeek = QDate(year, month, day).dayOfWeek();
const QLocale::FormatType dayFormat =
(sn.type == DayOfWeekSectionShort
@ -1313,7 +1312,7 @@ int QDateTimeParser::findDay(const QString &str1, int startDay, int sectionIndex
int bestCount = 0;
if (!str1.isEmpty()) {
const SectionNode &sn = sectionNode(sectionIndex);
if (!(sn.type & (DaySection|DayOfWeekSectionShort|DayOfWeekSectionLong))) {
if (!(sn.type & DaySectionMask)) {
qWarning("QDateTimeParser::findDay Internal error");
return -1;
}

View File

@ -120,14 +120,20 @@ public:
MinuteSection = 0x00008,
Hour12Section = 0x00010,
Hour24Section = 0x00020,
TimeSectionMask = (AmPmSection|MSecSection|SecondSection|MinuteSection|Hour12Section|Hour24Section),
HourSectionMask = (Hour12Section | Hour24Section),
TimeSectionMask = (MSecSection | SecondSection | MinuteSection |
HourSectionMask | AmPmSection),
DaySection = 0x00100,
MonthSection = 0x00200,
YearSection = 0x00400,
YearSection2Digits = 0x00800,
YearSectionMask = YearSection | YearSection2Digits,
DayOfWeekSectionShort = 0x01000,
DayOfWeekSectionLong = 0x02000,
DateSectionMask = (DaySection|MonthSection|YearSection|YearSection2Digits|DayOfWeekSectionShort|DayOfWeekSectionLong),
DayOfWeekSectionMask = DayOfWeekSectionShort | DayOfWeekSectionLong,
DaySectionMask = DaySection | DayOfWeekSectionMask,
DateSectionMask = DaySectionMask | MonthSection | YearSectionMask,
Internal = 0x10000,
FirstSection = 0x20000 | Internal,
@ -138,7 +144,7 @@ public:
FirstSectionIndex = -2,
LastSectionIndex = -3,
CalendarPopupIndex = -4
}; // duplicated from qdatetimeedit.h
}; // extending qdatetimeedit.h's equivalent
Q_DECLARE_FLAGS(Sections, Section)
struct Q_CORE_EXPORT SectionNode {
@ -224,6 +230,7 @@ public:
FieldInfo fieldInfo(int index) const;
void setDefaultLocale(const QLocale &loc) { defaultLocale = loc; }
virtual QDateTime getMinimum() const;
virtual QDateTime getMaximum() const;
virtual int cursorPosition() const { return -1; }

View File

@ -444,7 +444,7 @@ struct BezierEase : public QEasingCurveFunction
void init()
{
if (_bezierCurves.last() == QPointF(1.0, 1.0)) {
if (_bezierCurves.constLast() == QPointF(1.0, 1.0)) {
_init = true;
_curveCount = _bezierCurves.count() / 3;

View File

@ -85,7 +85,8 @@ void QElapsedTimer::start() Q_DECL_NOTHROW
and then starting the timer again with start(), but it does so in one
single operation, avoiding the need to obtain the clock value twice.
Restarting the timer makes it valid again.
Calling this function on a QElapsedTimer that is invalid
results in undefined behavior.
The following example illustrates how to use this function to calibrate a
parameter to a slow operation (for example, an iteration count) so that
@ -93,7 +94,7 @@ void QElapsedTimer::start() Q_DECL_NOTHROW
\snippet qelapsedtimer/main.cpp 3
\sa start(), invalidate(), elapsed()
\sa start(), invalidate(), elapsed(), isValid()
*/
qint64 QElapsedTimer::restart() Q_DECL_NOTHROW
{
@ -106,8 +107,10 @@ qint64 QElapsedTimer::restart() Q_DECL_NOTHROW
/*! \since 4.8
Returns the number of nanoseconds since this QElapsedTimer was last
started. Calling this function in a QElapsedTimer that was invalidated
will result in undefined results.
started.
Calling this function on a QElapsedTimer that is invalid
results in undefined behavior.
On platforms that do not provide nanosecond resolution, the value returned
will be the best estimate available.
@ -121,10 +124,12 @@ qint64 QElapsedTimer::nsecsElapsed() const Q_DECL_NOTHROW
/*!
Returns the number of milliseconds since this QElapsedTimer was last
started. Calling this function in a QElapsedTimer that was invalidated
will result in undefined results.
started.
\sa start(), restart(), hasExpired(), invalidate()
Calling this function on a QElapsedTimer that is invalid
results in undefined behavior.
\sa start(), restart(), hasExpired(), isValid(), invalidate()
*/
qint64 QElapsedTimer::elapsed() const Q_DECL_NOTHROW
{
@ -172,7 +177,8 @@ qint64 QElapsedTimer::msecsTo(const QElapsedTimer &other) const Q_DECL_NOTHROW
\a other was started before this object, the returned value will be
negative. If it was started later, the returned value will be positive.
The return value is undefined if this object or \a other were invalidated.
Calling this function on or with a QElapsedTimer that is invalid
results in undefined behavior.
\sa msecsTo(), elapsed()
*/

View File

@ -1831,7 +1831,7 @@ QTime QLocale::toTime(const QString &string, const QString &format) const
QTime time;
#ifndef QT_BOOTSTRAPPED
QDateTimeParser dt(QVariant::Time, QDateTimeParser::FromString);
dt.defaultLocale = *this;
dt.setDefaultLocale(*this);
if (dt.parseFormat(format))
dt.fromString(string, 0, &time);
#else
@ -1862,7 +1862,7 @@ QDate QLocale::toDate(const QString &string, const QString &format) const
QDate date;
#ifndef QT_BOOTSTRAPPED
QDateTimeParser dt(QVariant::Date, QDateTimeParser::FromString);
dt.defaultLocale = *this;
dt.setDefaultLocale(*this);
if (dt.parseFormat(format))
dt.fromString(string, &date, 0);
#else
@ -1895,7 +1895,7 @@ QDateTime QLocale::toDateTime(const QString &string, const QString &format) cons
QDate date;
QDateTimeParser dt(QVariant::DateTime, QDateTimeParser::FromString);
dt.defaultLocale = *this;
dt.setDefaultLocale(*this);
if (dt.parseFormat(format) && dt.fromString(string, &date, &time))
return QDateTime(date, time);
#else

View File

@ -122,7 +122,7 @@ QLocale QSystemLocale::fallbackUiLocale() const
// the first part of LANGUAGE if LANGUAGE is set and has a first part:
QByteArray language = qgetenv("LANGUAGE");
if (!language.isEmpty()) {
language = language.split(':').first();
language = language.split(':').constFirst();
if (!language.isEmpty())
return QLocale(QString::fromLatin1(language));
}

View File

@ -74,14 +74,14 @@ void QRingBuffer::free(qint64 bytes)
Q_ASSERT(bytes <= bufferSize);
while (bytes > 0) {
const qint64 blockSize = buffers.first().size() - head;
const qint64 blockSize = buffers.constFirst().size() - head;
if (tailBuffer == 0 || blockSize > bytes) {
// keep a single block around if it does not exceed
// the basic block size, to avoid repeated allocations
// between uses of the buffer
if (bufferSize <= bytes) {
if (buffers.first().size() <= basicBlockSize) {
if (buffers.constFirst().size() <= basicBlockSize) {
bufferSize = 0;
head = tail = 0;
} else {
@ -114,8 +114,8 @@ char *QRingBuffer::reserve(qint64 bytes)
} else {
const qint64 newSize = bytes + tail;
// if need buffer reallocation
if (newSize > buffers.last().size()) {
if (newSize > buffers.last().capacity() && (tail >= basicBlockSize
if (newSize > buffers.constLast().size()) {
if (newSize > buffers.constLast().capacity() && (tail >= basicBlockSize
|| newSize >= MaxByteArraySize)) {
// shrink this buffer to its current size
buffers.last().resize(tail);
@ -180,7 +180,7 @@ void QRingBuffer::chop(qint64 bytes)
// the basic block size, to avoid repeated allocations
// between uses of the buffer
if (bufferSize <= bytes) {
if (buffers.first().size() <= basicBlockSize) {
if (buffers.constFirst().size() <= basicBlockSize) {
bufferSize = 0;
head = tail = 0;
} else {
@ -198,7 +198,7 @@ void QRingBuffer::chop(qint64 bytes)
bytes -= tail;
buffers.removeLast();
--tailBuffer;
tail = buffers.last().size();
tail = buffers.constLast().size();
}
}

View File

@ -5841,7 +5841,9 @@ QString QString::toUpper_helper(QString &str)
}
/*!
\obsolete Use asprintf(), arg() or QTextStream instead.
\obsolete
Use asprintf(), arg() or QTextStream instead.
*/
QString &QString::sprintf(const char *cformat, ...)
{
@ -5897,7 +5899,9 @@ QString QString::asprintf(const char *cformat, ...)
}
/*!
\obsolete Use vasprintf(), arg() or QTextStream instead.
\obsolete
Use vasprintf(), arg() or QTextStream instead.
*/
QString &QString::vsprintf(const char *cformat, va_list ap)
{
@ -10643,7 +10647,7 @@ float QStringRef::toFloat(bool *ok) const
\obsolete
\fn QString Qt::escape(const QString &plain)
\sa QString::toHtmlEscaped()
Use QString::toHtmlEscaped() instead.
*/
/*!

View File

@ -243,7 +243,7 @@ QTimeZonePrivate::Data QMacTimeZonePrivate::previousTransition(qint64 beforeMSec
}
}
if (secsList.size() >= 1)
return data(qint64(secsList.last()) * 1000);
return data(qint64(secsList.constLast()) * 1000);
else
return invalidData();
}

View File

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

View File

@ -1055,7 +1055,6 @@ QDBusConnectionPrivate::~QDBusConnectionPrivate()
qPrintable(name));
closeConnection();
rootNode.children.clear(); // free resources
qDeleteAll(cachedMetaObjects);
if (mode == ClientMode || mode == PeerMode) {
@ -1077,6 +1076,19 @@ QDBusConnectionPrivate::~QDBusConnectionPrivate()
}
}
void QDBusConnectionPrivate::disconnectObjectTree(QDBusConnectionPrivate::ObjectTreeNode &haystack)
{
QDBusConnectionPrivate::ObjectTreeNode::DataList::Iterator it = haystack.children.begin();
while (it != haystack.children.end()) {
disconnectObjectTree(*it);
it++;
}
if (haystack.obj)
haystack.obj->disconnect(this);
}
void QDBusConnectionPrivate::closeConnection()
{
QDBusWriteLocker locker(CloseConnectionAction, this);
@ -1100,6 +1112,18 @@ void QDBusConnectionPrivate::closeConnection()
}
qDeleteAll(pendingCalls);
// 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++;
}
disconnectObjectTree(rootNode);
rootNode.children.clear(); // free resources
}
void QDBusConnectionPrivate::checkThread()

View File

@ -158,7 +158,6 @@ QStringList QIconLoader::themeSearchPaths() const
}
/*!
\class QIconCacheGtkReader
\internal
Helper class that reads and looks up into the icon-theme.cache generated with
gtk-update-icon-cache. If at any point we detect a corruption in the file

View File

@ -1366,9 +1366,9 @@ void QGuiApplicationPrivate::init()
} else if (strcmp(arg, "-testability") == 0) {
loadTestability = true;
} else if (strncmp(arg, "-style=", 7) == 0) {
s = QString::fromLocal8Bit(arg + 7).toLower();
s = QString::fromLocal8Bit(arg + 7);
} else if (strcmp(arg, "-style") == 0 && i < argc - 1) {
s = QString::fromLocal8Bit(argv[++i]).toLower();
s = QString::fromLocal8Bit(argv[++i]);
} else {
argv[j++] = argv[i];
}

View File

@ -47,6 +47,10 @@
#include <qpa/qplatformintegration.h>
#include <QtCore/qloggingcategory.h>
#ifdef Q_OS_INTEGRITY
#include <EGL/egl.h>
#endif
#ifndef GL_FRAMEBUFFER_SRGB_CAPABLE_EXT
#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA
#endif

View File

@ -38,9 +38,10 @@
****************************************************************************/
#include "qoutlinemapper_p.h"
#include <private/qpainterpath_p.h>
#include "qbezier_p.h"
#include "qmath.h"
#include <private/qbezier_p.h>
#include "qpainterpath_p.h"
#include <stdlib.h>
@ -187,38 +188,26 @@ void QOutlineMapper::endOutline()
QPointF *elements = m_elements.data();
// Transform the outline
if (m_txop == QTransform::TxNone) {
// Nothing to do.
} else if (m_txop == QTransform::TxTranslate) {
for (int i = 0; i < m_elements.size(); ++i) {
QPointF &e = elements[i];
e = QPointF(e.x() + m_dx, e.y() + m_dy);
}
} else if (m_txop == QTransform::TxScale) {
for (int i = 0; i < m_elements.size(); ++i) {
QPointF &e = elements[i];
e = QPointF(m_m11 * e.x() + m_dx, m_m22 * e.y() + m_dy);
}
} else if (m_txop < QTransform::TxProject) {
for (int i = 0; i < m_elements.size(); ++i) {
QPointF &e = elements[i];
e = QPointF(m_m11 * e.x() + m_m21 * e.y() + m_dx,
m_m22 * e.y() + m_m12 * e.x() + m_dy);
}
if (m_transform.isIdentity()) {
// Nothing to do
} else if (m_transform.type() < QTransform::TxProject) {
for (int i = 0; i < m_elements.size(); ++i)
elements[i] = m_transform.map(elements[i]);
} else {
const QVectorPath vp((qreal *)elements, m_elements.size(),
m_element_types.size() ? m_element_types.data() : 0);
QPainterPath path = vp.convertToPainterPath();
path = QTransform(m_m11, m_m12, m_m13, m_m21, m_m22, m_m23, m_dx, m_dy, m_m33).map(path);
path = m_transform.map(path);
if (!(m_outline.flags & QT_FT_OUTLINE_EVEN_ODD_FILL))
path.setFillRule(Qt::WindingFill);
uint old_txop = m_txop;
m_txop = QTransform::TxNone;
if (path.isEmpty())
if (path.isEmpty()) {
m_valid = false;
else
} else {
QTransform oldTransform = m_transform;
m_transform.reset();
convertPath(path);
m_txop = old_txop;
m_transform = oldTransform;
}
return;
}
@ -387,13 +376,14 @@ void QOutlineMapper::clipElements(const QPointF *elements,
QPainterPath clipPath;
clipPath.addRect(m_clip_rect);
QPainterPath clippedPath = path.intersected(clipPath);
uint old_txop = m_txop;
m_txop = QTransform::TxNone;
if (clippedPath.isEmpty())
if (clippedPath.isEmpty()) {
m_valid = false;
else
} else {
QTransform oldTransform = m_transform;
m_transform.reset();
convertPath(clippedPath);
m_txop = old_txop;
m_transform = oldTransform;
}
m_in_clip_elements = false;
}

View File

@ -104,16 +104,7 @@ public:
*/
void setMatrix(const QTransform &m)
{
m_m11 = m.m11();
m_m12 = m.m12();
m_m13 = m.m13();
m_m21 = m.m21();
m_m22 = m.m22();
m_m23 = m.m23();
m_m33 = m.m33();
m_dx = m.dx();
m_dy = m.dy();
m_txop = m.type();
m_transform = m;
qreal scale;
qt_scaleForTransform(m, &scale);
@ -207,20 +198,10 @@ public:
QRectF controlPointRect; // only valid after endOutline()
QT_FT_Outline m_outline;
uint m_txop;
int m_subpath_start;
// Matrix
qreal m_m11;
qreal m_m12;
qreal m_m13;
qreal m_m21;
qreal m_m22;
qreal m_m23;
qreal m_m33;
qreal m_dx;
qreal m_dy;
QTransform m_transform;
qreal m_curve_threshold;

View File

@ -1345,9 +1345,9 @@ void QRasterPaintEngine::clip(const QRegion &region, Qt::ClipOperation op)
*/
///*!
// \internal
//*/
/*!
\internal
*/
void QRasterPaintEngine::fillPath(const QPainterPath &path, QSpanData *fillData)
{
#ifdef QT_DEBUG_DRAW

View File

@ -2151,7 +2151,6 @@ static QGlyphRun glyphRunWithInfo(QFontEngine *fontEngine,
QGlyphRunPrivate *d = QGlyphRunPrivate::get(glyphRun);
int rangeStart = textPosition;
logClusters += textPosition;
while (*logClusters != glyphsStart && rangeStart < textPosition + textLength) {
++logClusters;
++rangeStart;
@ -2360,9 +2359,9 @@ QList<QGlyphRun> QTextLine::glyphRuns(int from, int length) const
width,
glyphsStart + start,
glyphsStart + end,
logClusters,
iterator.itemStart,
iterator.itemLength));
logClusters + relativeFrom,
relativeFrom + si.position,
relativeTo - relativeFrom + 1));
for (int i = 0; i < subLayout.numGlyphs; ++i) {
QFixed justification = QFixed::fromFixed(subLayout.justifications[i].space_18d6);
pos.rx() += (subLayout.advances[i] + justification).toReal();
@ -2390,9 +2389,9 @@ QList<QGlyphRun> QTextLine::glyphRuns(int from, int length) const
width,
glyphsStart + start,
glyphsStart + end,
logClusters,
iterator.itemStart,
iterator.itemLength);
logClusters + relativeFrom,
relativeFrom + si.position,
relativeTo - relativeFrom + 1);
if (!glyphRun.isEmpty())
glyphRuns.append(glyphRun);
} else {
@ -2406,9 +2405,9 @@ QList<QGlyphRun> QTextLine::glyphRuns(int from, int length) const
width,
glyphsStart,
glyphsEnd,
logClusters,
iterator.itemStart,
iterator.itemLength);
logClusters + relativeFrom,
relativeFrom + si.position,
relativeTo - relativeFrom + 1);
if (!glyphRun.isEmpty())
glyphRuns.append(glyphRun);
}

View File

@ -141,10 +141,12 @@ QNetworkReplyPrivate::QNetworkReplyPrivate()
\value TooManyRedirectsError while following redirects, the maximum
limit was reached. The limit is by default set to 50 or as set by
QNetworkRequest::setMaxRedirectsAllowed().
(This value was introduced in 5.6.)
\value InsecureRedirectError while following redirects, the network
access API detected a redirect from a encrypted protocol (https) to an
unencrypted one (http).
(This value was introduced in 5.6.)
\value ProxyConnectionRefusedError the connection to the proxy
server was refused (the proxy server is not accepting requests)

View File

@ -146,11 +146,12 @@ QT_BEGIN_NAMESPACE
Replies only, type: QMetaType::QUrl (no default)
If present, it indicates that the server is redirecting the
request to a different URL. The Network Access API does not by
default follow redirections: it's up to the application to
default follow redirections: the application can
determine if the requested redirection should be allowed,
according to its security policies. However, if
QNetworkRequest::FollowRedirectsAttribute is set, then this attribute
will not be present in the reply.
according to its security policies, or it can set
QNetworkRequest::FollowRedirectsAttribute to true (in which case
the redirection will be followed and this attribute will not
be present in the reply).
The returned URL might be relative. Use QUrl::resolved()
to create an absolute URL out of it.
@ -271,6 +272,7 @@ QT_BEGIN_NAMESPACE
Indicates whether the Network Access API should automatically follow a
HTTP redirect response or not. Currently redirects that are insecure,
that is redirecting from "https" to "http" protocol, are not allowed.
(This value was introduced in 5.6.)
\value User
Special type. Additional information can be passed in

View File

@ -420,6 +420,8 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations()
if (generic) {
if (!envOK || skipGeneric <= 0)
sessionEngines.append(generic);
else
delete generic;
}
}

View File

@ -92,6 +92,7 @@ static QNetworkInterfacePrivate *interfaceFromProfile(IConnectionProfile *profil
Q_ASSERT_SUCCEEDED(hr);
if (connectivityLevel != NetworkConnectivityLevel_None)
iface->flags = QNetworkInterface::IsUp | QNetworkInterface::IsRunning;
iface->flags |= QNetworkInterface::CanBroadcast;
ComPtr<INetworkAdapter> adapter;
hr = profile->get_NetworkAdapter(&adapter);

View File

@ -47,6 +47,7 @@
#include <qurl.h>
#include <private/qsystemlibrary_p.h>
#include <qnetworkinterface.h>
#include <qdebug.h>
#include <string.h>
#include <qt_windows.h>
@ -587,8 +588,16 @@ QList<QNetworkProxy> QNetworkProxyFactory::systemProxyForQuery(const QNetworkPro
url.setScheme(QLatin1String("https"));
}
QString urlQueryString = url.toString();
if (urlQueryString.size() > 2083) {
// calls to WinHttpGetProxyForUrl with urls longer than 2083 characters
// fail with error code ERROR_INVALID_PARAMETER(87), so we truncate it
qWarning("Proxy query URL too long for windows API, try with truncated URL");
urlQueryString = url.toString().left(2083);
}
bool getProxySucceeded = ptrWinHttpGetProxyForUrl(sp->hHttpSession,
(LPCWSTR)url.toString().utf16(),
(LPCWSTR)urlQueryString.utf16(),
&sp->autoProxyOptions,
&proxyInfo);
DWORD getProxyError = GetLastError();
@ -605,7 +614,7 @@ QList<QNetworkProxy> QNetworkProxyFactory::systemProxyForQuery(const QNetworkPro
sp->autoProxyOptions.dwFlags = WINHTTP_AUTOPROXY_CONFIG_URL;
sp->autoProxyOptions.lpszAutoConfigUrl = (LPCWSTR)sp->autoConfigUrl.utf16();
getProxySucceeded = ptrWinHttpGetProxyForUrl(sp->hHttpSession,
(LPCWSTR)url.toString().utf16(),
(LPCWSTR)urlQueryString.utf16(),
&sp->autoProxyOptions,
&proxyInfo);
getProxyError = GetLastError();
@ -618,7 +627,7 @@ QList<QNetworkProxy> QNetworkProxyFactory::systemProxyForQuery(const QNetworkPro
// But now we've to enable it (http://msdn.microsoft.com/en-us/library/aa383153%28v=VS.85%29.aspx)
sp->autoProxyOptions.fAutoLogonIfChallenged = TRUE;
getProxySucceeded = ptrWinHttpGetProxyForUrl(sp->hHttpSession,
(LPCWSTR)url.toString().utf16(),
(LPCWSTR)urlQueryString.utf16(),
&sp->autoProxyOptions,
&proxyInfo);
getProxyError = GetLastError();

View File

@ -32,6 +32,10 @@ MODULE_PLUGIN_TYPES = \
ANDROID_PERMISSIONS += \
android.permission.ACCESS_NETWORK_STATE
MODULE_WINRT_CAPABILITIES = \
internetClient \
internetClientServer
MODULE_PLUGIN_TYPES = \
bearer
load(qt_module)

View File

@ -304,8 +304,10 @@ bool QNativeSocketEngine::connectToHostByName(const QString &name, quint16 port)
Q_ASSERT_SUCCEEDED(hr);
d->socketState = QAbstractSocket::ConnectingState;
hr = d->connectOp->put_Completed(Callback<IAsyncActionCompletedHandler>(
hr = QEventDispatcherWinRT::runOnXamlThread([d]() {
return d->connectOp->put_Completed(Callback<IAsyncActionCompletedHandler>(
d, &QNativeSocketEnginePrivate::handleConnectToHost).Get());
});
Q_ASSERT_SUCCEEDED(hr);
return d->socketState == QAbstractSocket::ConnectedState;
@ -315,50 +317,53 @@ bool QNativeSocketEngine::bind(const QHostAddress &address, quint16 port)
{
Q_D(QNativeSocketEngine);
HRESULT hr;
ComPtr<IHostName> hostAddress;
hr = QEventDispatcherWinRT::runOnXamlThread([address, d, port, this]() {
HRESULT hr;
ComPtr<IHostName> hostAddress;
if (address != QHostAddress::Any && address != QHostAddress::AnyIPv4 && address != QHostAddress::AnyIPv6) {
ComPtr<IHostNameFactory> hostNameFactory;
hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Networking_HostName).Get(),
&hostNameFactory);
Q_ASSERT_SUCCEEDED(hr);
const QString addressString = address.toString();
HStringReference addressRef(reinterpret_cast<LPCWSTR>(addressString.utf16()));
hr = hostNameFactory->CreateHostName(addressRef.Get(), &hostAddress);
RETURN_FALSE_IF_FAILED("QNativeSocketEngine::bind: Could not create hostname.");
}
QString portQString = port ? QString::number(port) : QString();
HStringReference portString(reinterpret_cast<LPCWSTR>(portQString.utf16()));
ComPtr<IAsyncAction> op;
if (d->socketType == QAbstractSocket::TcpSocket) {
if (!d->tcpListener) {
hr = RoActivateInstance(HString::MakeReference(RuntimeClass_Windows_Networking_Sockets_StreamSocketListener).Get(),
&d->tcpListener);
Q_ASSERT_SUCCEEDED(hr);
if (address != QHostAddress::Any && address != QHostAddress::AnyIPv4 && address != QHostAddress::AnyIPv6) {
ComPtr<IHostNameFactory> hostNameFactory;
hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Networking_HostName).Get(),
&hostNameFactory);
RETURN_HR_IF_FAILED("QNativeSocketEngine::bind: Could not obtain hostname factory");
const QString addressString = address.toString();
HStringReference addressRef(reinterpret_cast<LPCWSTR>(addressString.utf16()));
hr = hostNameFactory->CreateHostName(addressRef.Get(), &hostAddress);
RETURN_HR_IF_FAILED("QNativeSocketEngine::bind: Could not create hostname.");
}
hr = QEventDispatcherWinRT::runOnXamlThread([d]() {
return d->tcpListener->add_ConnectionReceived(
QString portQString = port ? QString::number(port) : QString();
HStringReference portString(reinterpret_cast<LPCWSTR>(portQString.utf16()));
ComPtr<IAsyncAction> op;
if (d->socketType == QAbstractSocket::TcpSocket) {
if (!d->tcpListener) {
hr = RoActivateInstance(HString::MakeReference(RuntimeClass_Windows_Networking_Sockets_StreamSocketListener).Get(),
&d->tcpListener);
RETURN_HR_IF_FAILED("QNativeSocketEngine::bind: Could not create tcp listener");
}
hr = d->tcpListener->add_ConnectionReceived(
Callback<ClientConnectedHandler>(d, &QNativeSocketEnginePrivate::handleClientConnection).Get(),
&d->connectionToken);
});
Q_ASSERT_SUCCEEDED(hr);
hr = d->tcpListener->BindEndpointAsync(hostAddress.Get(), portString.Get(), &op);
} else if (d->socketType == QAbstractSocket::UdpSocket) {
hr = d->udpSocket()->BindEndpointAsync(hostAddress.Get(), portString.Get(), &op);
}
if (hr == E_ACCESSDENIED) {
qErrnoWarning(hr, "Unable to bind socket (%s:%hu/%s). Please check your manifest capabilities.",
qPrintable(address.toString()), port, socketDescription(this).constData());
return false;
}
Q_ASSERT_SUCCEEDED(hr);
RETURN_HR_IF_FAILED("QNativeSocketEngine::bind: Could not register client connection callback");
hr = d->tcpListener->BindEndpointAsync(hostAddress.Get(), portString.Get(), &op);
} else if (d->socketType == QAbstractSocket::UdpSocket) {
hr = d->udpSocket()->BindEndpointAsync(hostAddress.Get(), portString.Get(), &op);
}
if (hr == E_ACCESSDENIED) {
qErrnoWarning(hr, "Unable to bind socket (%s:%hu/%s). Please check your manifest capabilities.",
qPrintable(address.toString()), port, socketDescription(this).constData());
return hr;
}
RETURN_HR_IF_FAILED("QNativeSocketEngine::bind: Unable to bind socket");
hr = op->put_Completed(Callback<IAsyncActionCompletedHandler>(d, &QNativeSocketEnginePrivate::handleBindCompleted).Get());
Q_ASSERT_SUCCEEDED(hr);
hr = QWinRTFunctions::await(op);
hr = op->put_Completed(Callback<IAsyncActionCompletedHandler>(d, &QNativeSocketEnginePrivate::handleBindCompleted).Get());
RETURN_HR_IF_FAILED("QNativeSocketEngine::bind: Could not register bind callback");
hr = QWinRTFunctions::await(op);
RETURN_HR_IF_FAILED("QNativeSocketEngine::bind: Could not wait for bind to finish");
return S_OK;
});
Q_ASSERT_SUCCEEDED(hr);
d->socketState = QAbstractSocket::BoundState;
@ -410,7 +415,9 @@ int QNativeSocketEngine::accept()
socketDescription(this).constData());
return -1;
}
hr = op->put_Completed(Callback<SocketReadCompletedHandler>(d, &QNativeSocketEnginePrivate::handleReadyRead).Get());
hr = QEventDispatcherWinRT::runOnXamlThread([d, op]() {
return op->put_Completed(Callback<SocketReadCompletedHandler>(d, &QNativeSocketEnginePrivate::handleReadyRead).Get());
});
if (FAILED(hr)) {
qErrnoWarning(hr, "accept(): Failed to set socket read callback (%s).",
socketDescription(this).constData());
@ -781,18 +788,22 @@ void QNativeSocketEngine::establishRead()
Q_D(QNativeSocketEngine);
HRESULT hr;
ComPtr<IInputStream> stream;
hr = d->tcpSocket()->get_InputStream(&stream);
RETURN_VOID_IF_FAILED("Failed to get socket input stream");
hr = QEventDispatcherWinRT::runOnXamlThread([d]() {
ComPtr<IInputStream> stream;
HRESULT hr = d->tcpSocket()->get_InputStream(&stream);
RETURN_HR_IF_FAILED("QNativeSocketEngine::establishRead: Failed to get socket input stream");
ComPtr<IBuffer> buffer;
hr = g->bufferFactory->Create(READ_BUFFER_SIZE, &buffer);
Q_ASSERT_SUCCEEDED(hr);
ComPtr<IBuffer> buffer;
hr = g->bufferFactory->Create(READ_BUFFER_SIZE, &buffer);
RETURN_HR_IF_FAILED("QNativeSocketEngine::establishRead: Failed to create buffer");
ComPtr<IAsyncBufferOperation> op;
hr = stream->ReadAsync(buffer.Get(), READ_BUFFER_SIZE, InputStreamOptions_Partial, &op);
RETURN_VOID_IF_FAILED("Failed to initiate socket read");
hr = op->put_Completed(Callback<SocketReadCompletedHandler>(d, &QNativeSocketEnginePrivate::handleReadyRead).Get());
ComPtr<IAsyncBufferOperation> op;
hr = stream->ReadAsync(buffer.Get(), READ_BUFFER_SIZE, InputStreamOptions_Partial, &op);
RETURN_HR_IF_FAILED("QNativeSocketEngine::establishRead: Failed to initiate socket read");
hr = op->put_Completed(Callback<SocketReadCompletedHandler>(d, &QNativeSocketEnginePrivate::handleReadyRead).Get());
RETURN_HR_IF_FAILED("QNativeSocketEngine::establishRead: Failed to register read callback");
return S_OK;
});
Q_ASSERT_SUCCEEDED(hr);
}
@ -814,7 +825,10 @@ bool QNativeSocketEnginePrivate::createNewSocket(QAbstractSocket::SocketType soc
hr = RoActivateInstance(HString::MakeReference(RuntimeClass_Windows_Networking_Sockets_DatagramSocket).Get(), &socket);
Q_ASSERT_SUCCEEDED(hr);
socketDescriptor = qintptr(socket.Detach());
hr = udpSocket()->add_MessageReceived(Callback<DatagramReceivedHandler>(this, &QNativeSocketEnginePrivate::handleNewDatagram).Get(), &connectionToken);
hr = QEventDispatcherWinRT::runOnXamlThread([this]() {
HRESULT hr = udpSocket()->add_MessageReceived(Callback<DatagramReceivedHandler>(this, &QNativeSocketEnginePrivate::handleNewDatagram).Get(), &connectionToken);
return hr;
});
Q_ASSERT_SUCCEEDED(hr);
break;
}
@ -1242,7 +1256,7 @@ HRESULT QNativeSocketEnginePrivate::handleReadyRead(IAsyncBufferOperation *async
// that the connection was closed. The socket cannot be closed here, as the subsequent read
// might fail then.
if (status == Error || status == Canceled) {
setError(QAbstractSocket::NetworkError, RemoteHostClosedErrorString);
setError(QAbstractSocket::RemoteHostClosedError, RemoteHostClosedErrorString);
socketState = QAbstractSocket::UnconnectedState;
if (notifyOnRead)
emit q->readReady();
@ -1261,7 +1275,7 @@ HRESULT QNativeSocketEnginePrivate::handleReadyRead(IAsyncBufferOperation *async
// the closing of the socket won't be communicated to the caller. So only the error is set. The
// actual socket close happens inside of read.
if (!bufferLength) {
setError(QAbstractSocket::NetworkError, RemoteHostClosedErrorString);
setError(QAbstractSocket::RemoteHostClosedError, RemoteHostClosedErrorString);
socketState = QAbstractSocket::UnconnectedState;
if (notifyOnRead)
emit q->readReady();
@ -1307,7 +1321,9 @@ HRESULT QNativeSocketEnginePrivate::handleReadyRead(IAsyncBufferOperation *async
socketDescription(q).constData());
return S_OK;
}
hr = op->put_Completed(Callback<SocketReadCompletedHandler>(this, &QNativeSocketEnginePrivate::handleReadyRead).Get());
hr = QEventDispatcherWinRT::runOnXamlThread([op, this]() {
return op->put_Completed(Callback<SocketReadCompletedHandler>(this, &QNativeSocketEnginePrivate::handleReadyRead).Get());
});
if (FAILED(hr)) {
qErrnoWarning(hr, "handleReadyRead(): Failed to set socket read callback (%s).",
socketDescription(q).constData());

View File

@ -53,13 +53,19 @@
#include <qloggingcategory.h>
#include <qplatformintegration.h>
#include <qplatformservices.h>
#include <qdbusconnectioninterface.h>
#include <private/qlockfile_p.h>
#include <private/qguiapplication_p.h>
// Defined in Windows headers which get included by qlockfile_p.h
#undef interface
QT_BEGIN_NAMESPACE
Q_LOGGING_CATEGORY(qLcTray, "qt.qpa.tray")
static const QString KDEItemFormat = QStringLiteral("org.kde.StatusNotifierItem-%1-%2");
static const QString KDEWatcherService = QStringLiteral("org.kde.StatusNotifierWatcher");
static const QString TempFileTemplate = QDir::tempPath() + QStringLiteral("/qt-trayicon-XXXXXX.png");
static const QString XdgNotificationService = QStringLiteral("org.freedesktop.Notifications");
static const QString XdgNotificationPath = QStringLiteral("/org/freedesktop/Notifications");
@ -142,9 +148,17 @@ void QDBusTrayIcon::setStatus(const QString &status)
QTemporaryFile *QDBusTrayIcon::tempIcon(const QIcon &icon)
{
// Hack for Unity, which doesn't handle icons sent across D-Bus:
// Hack for indicator-application, which doesn't handle icons sent across D-Bus:
// save the icon to a temp file and set the icon name to that filename.
static bool necessary = (QGuiApplicationPrivate::platformIntegration()->services()->desktopEnvironment().split(':').contains("UNITY"));
static bool necessity_checked = false;
static bool necessary = false;
if (!necessity_checked) {
QDBusConnection session = QDBusConnection::sessionBus();
uint pid = session.interface()->servicePid(KDEWatcherService).value();
QString processName = QLockFilePrivate::processNameByPid(pid);
necessary = processName.endsWith(QStringLiteral("indicator-application-service"));
necessity_checked = true;
}
if (!necessary)
return Q_NULLPTR;
QTemporaryFile *ret = new QTemporaryFile(TempFileTemplate, this);

View File

@ -368,6 +368,9 @@ QAndroidPlatformTheme::QAndroidPlatformTheme(QAndroidPlatformNativeInterface *an
// default in case the style has not set a font
m_systemFont = QFont(QLatin1String("Roboto"), 14.0 * 100 / 72); // keep default size the same after changing from 100 dpi to 72 dpi
// by default use native menu bar
QCoreApplication::setAttribute(Qt::AA_DontUseNativeMenuBar, false);
}
QPlatformMenuBar *QAndroidPlatformTheme::createPlatformMenuBar() const

View File

@ -170,6 +170,7 @@ static NSString *_q_NSWindowDidChangeOcclusionStateNotification = nil;
}
m_isMenuView = false;
self.focusRingType = NSFocusRingTypeNone;
}
return self;
}
@ -843,7 +844,7 @@ QT_WARNING_POP
Q_UNUSED(qtScreenPoint);
// Maintain masked state for the button for use by MouseDragged and MouseUp.
const bool masked = m_maskRegion.contains(qtWindowPoint.toPoint());
const bool masked = [self hasMask] && !m_maskRegion.contains(qtWindowPoint.toPoint());
if (masked)
m_acceptedMouseDowns &= ~button;
else
@ -949,7 +950,7 @@ QT_WARNING_POP
[self convertFromScreen:[self screenMousePoint:theEvent] toWindowPoint:&qtWindowPoint andScreenPoint:&qtScreenPoint];
Q_UNUSED(qtScreenPoint);
bool masked = m_maskRegion.contains(qtWindowPoint.toPoint());
const bool masked = [self hasMask] && !m_maskRegion.contains(qtWindowPoint.toPoint());
// Maintain masked state for the button for use by MouseDragged and Up.
if (masked)

View File

@ -1,9 +1,12 @@
TEMPLATE = subdirs
contains(QT_CONFIG, egl_x11): SUBDIRS += eglfs_x11
contains(QT_CONFIG, eglfs_gbm): SUBDIRS += eglfs_kms
contains(QT_CONFIG, eglfs_egldevice): SUBDIRS += eglfs_kms_egldevice
contains(QT_CONFIG, eglfs_gbm): SUBDIRS += eglfs_kms_support eglfs_kms
contains(QT_CONFIG, eglfs_egldevice): SUBDIRS += eglfs_kms_support eglfs_kms_egldevice
contains(QT_CONFIG, eglfs_brcm): SUBDIRS += eglfs_brcm
contains(QT_CONFIG, eglfs_mali): SUBDIRS += eglfs_mali
contains(QT_CONFIG, eglfs_viv): SUBDIRS += eglfs_viv
contains(QT_CONFIG, eglfs_viv_wl): SUBDIRS += eglfs_viv_wl
eglfs_kms_egldevice.depends = eglfs_kms_support
eglfs_kms.depends = eglfs_kms_support

View File

@ -1,31 +1,35 @@
TARGET = qeglfs-kms-integration
QT += core-private gui-private platformsupport-private eglfs_device_lib-private
PLUGIN_TYPE = egldeviceintegrations
PLUGIN_CLASS_NAME = QEglFSKmsIntegrationPlugin
load(qt_plugin)
INCLUDEPATH += $$PWD/../..
QT += core-private gui-private platformsupport-private eglfs_device_lib-private eglfs_kms_support-private
INCLUDEPATH += $$PWD/../.. $$PWD/../eglfs_kms_support
# Avoid X11 header collision
DEFINES += MESA_EGL_NO_X11_HEADERS
CONFIG += link_pkgconfig
PKGCONFIG += libdrm gbm
!contains(QT_CONFIG, no-pkg-config) {
PKGCONFIG += libdrm gbm
} else {
LIBS += -ldrm -lgbm
}
CONFIG += egl
QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
SOURCES += $$PWD/qeglfskmsmain.cpp \
$$PWD/qeglfskmsintegration.cpp \
$$PWD/qeglfskmsdevice.cpp \
$$PWD/qeglfskmsscreen.cpp \
$$PWD/qeglfskmscursor.cpp
SOURCES += $$PWD/qeglfskmsgbmmain.cpp \
$$PWD/qeglfskmsgbmintegration.cpp \
$$PWD/qeglfskmsgbmdevice.cpp \
$$PWD/qeglfskmsgbmscreen.cpp \
$$PWD/qeglfskmsgbmcursor.cpp
HEADERS += $$PWD/qeglfskmsintegration.h \
$$PWD/qeglfskmsdevice.h \
$$PWD/qeglfskmsscreen.h \
$$PWD/qeglfskmscursor.h
HEADERS += $$PWD/qeglfskmsgbmintegration.h \
$$PWD/qeglfskmsgbmdevice.h \
$$PWD/qeglfskmsgbmscreen.h \
$$PWD/qeglfskmsgbmcursor.h
OTHER_FILES += $$PWD/eglfs_kms.json
PLUGIN_TYPE = egldeviceintegrations
PLUGIN_CLASS_NAME = QEglFSKmsIntegrationPlugin
load(qt_plugin)

View File

@ -2,6 +2,7 @@
**
** Copyright (C) 2015 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
** Copyright (C) 2016 The Qt Company Ltd.
** Copyright (C) 2016 Pelagicore AG
** Contact: https://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
@ -38,9 +39,9 @@
**
****************************************************************************/
#include "qeglfskmscursor.h"
#include "qeglfskmsscreen.h"
#include "qeglfskmsdevice.h"
#include "qeglfskmsgbmcursor.h"
#include "qeglfskmsgbmscreen.h"
#include "qeglfskmsgbmdevice.h"
#include <QtCore/QJsonDocument>
#include <QtCore/QJsonObject>
@ -63,7 +64,7 @@ QT_BEGIN_NAMESPACE
Q_DECLARE_LOGGING_CATEGORY(qLcEglfsKmsDebug)
QEglFSKmsCursor::QEglFSKmsCursor(QEglFSKmsScreen *screen)
QEglFSKmsGbmCursor::QEglFSKmsGbmCursor(QEglFSKmsGbmScreen *screen)
: m_screen(screen)
, m_cursorSize(64, 64) // 64x64 is the old standard size, we now try to query the real size below
, m_bo(Q_NULLPTR)
@ -83,7 +84,7 @@ QEglFSKmsCursor::QEglFSKmsCursor(QEglFSKmsScreen *screen)
m_cursorSize.setHeight(height);
}
m_bo = gbm_bo_create(m_screen->device()->device(), m_cursorSize.width(), m_cursorSize.height(),
m_bo = gbm_bo_create(static_cast<QEglFSKmsGbmDevice *>(m_screen->device())->gbmDevice(), m_cursorSize.width(), m_cursorSize.height(),
GBM_FORMAT_ARGB8888, GBM_BO_USE_CURSOR_64X64 | GBM_BO_USE_WRITE);
if (!m_bo) {
qWarning("Could not create buffer for cursor!");
@ -98,7 +99,7 @@ QEglFSKmsCursor::QEglFSKmsCursor(QEglFSKmsScreen *screen)
setPos(QPoint(0, 0));
}
QEglFSKmsCursor::~QEglFSKmsCursor()
QEglFSKmsGbmCursor::~QEglFSKmsGbmCursor()
{
Q_FOREACH (QPlatformScreen *screen, m_screen->virtualSiblings()) {
QEglFSKmsScreen *kmsScreen = static_cast<QEglFSKmsScreen *>(screen);
@ -110,13 +111,13 @@ QEglFSKmsCursor::~QEglFSKmsCursor()
m_bo = Q_NULLPTR;
}
void QEglFSKmsCursor::pointerEvent(const QMouseEvent &event)
void QEglFSKmsGbmCursor::pointerEvent(const QMouseEvent &event)
{
setPos(event.screenPos().toPoint());
}
#ifndef QT_NO_CURSOR
void QEglFSKmsCursor::changeCursor(QCursor *windowCursor, QWindow *window)
void QEglFSKmsGbmCursor::changeCursor(QCursor *windowCursor, QWindow *window)
{
Q_UNUSED(window);
@ -171,12 +172,12 @@ void QEglFSKmsCursor::changeCursor(QCursor *windowCursor, QWindow *window)
}
#endif // QT_NO_CURSOR
QPoint QEglFSKmsCursor::pos() const
QPoint QEglFSKmsGbmCursor::pos() const
{
return m_pos;
}
void QEglFSKmsCursor::setPos(const QPoint &pos)
void QEglFSKmsGbmCursor::setPos(const QPoint &pos)
{
Q_FOREACH (QPlatformScreen *screen, m_screen->virtualSiblings()) {
QEglFSKmsScreen *kmsScreen = static_cast<QEglFSKmsScreen *>(screen);
@ -192,7 +193,7 @@ void QEglFSKmsCursor::setPos(const QPoint &pos)
}
}
void QEglFSKmsCursor::initCursorAtlas()
void QEglFSKmsGbmCursor::initCursorAtlas()
{
static QByteArray json = qgetenv("QT_QPA_EGLFS_CURSOR");
if (json.isEmpty())

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