Merge remote-tracking branch 'origin/5.15' into dev
Conflicts: src/widgets/widgets/qabstractbutton.cpp src/widgets/widgets/qbuttongroup.cpp src/widgets/widgets/qbuttongroup.h src/widgets/widgets/qsplashscreen.cpp tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp tests/benchmarks/opengl/main.cpp Needed update: src/plugins/platforms/cocoa/CMakeLists.txt Change-Id: I7be4baebb63844ec2b3e0de859ca9de1bc730bb5
This commit is contained in:
commit
efd7757154
@ -231,7 +231,6 @@ sub classNames {
|
|||||||
$line .= ";" if($line =~ m/^Q_[A-Z_0-9]*\(.*\)[\r\n]*$/); #qt macro
|
$line .= ";" if($line =~ m/^Q_[A-Z_0-9]*\(.*\)[\r\n]*$/); #qt macro
|
||||||
$line .= ";" if($line =~ m/^QT_(BEGIN|END)_HEADER[\r\n]*$/); #qt macro
|
$line .= ";" if($line =~ m/^QT_(BEGIN|END)_HEADER[\r\n]*$/); #qt macro
|
||||||
$line .= ";" if($line =~ m/^QT_(BEGIN|END)_NAMESPACE(_[A-Z]+)*[\r\n]*$/); #qt macro
|
$line .= ";" if($line =~ m/^QT_(BEGIN|END)_NAMESPACE(_[A-Z]+)*[\r\n]*$/); #qt macro
|
||||||
$line .= ";" if($line =~ m/^QT_DEPRECATED_X\(.*\)[\r\n]*$/); #qt macro
|
|
||||||
$line .= ";" if($line =~ m/^QT_MODULE\(.*\)[\r\n]*$/); # QT_MODULE macro
|
$line .= ";" if($line =~ m/^QT_MODULE\(.*\)[\r\n]*$/); # QT_MODULE macro
|
||||||
$line .= ";" if($line =~ m/^QT_WARNING_(PUSH|POP|DISABLE_\w+\(.*\))[\r\n]*$/); # qt macros
|
$line .= ";" if($line =~ m/^QT_WARNING_(PUSH|POP|DISABLE_\w+\(.*\))[\r\n]*$/); # qt macros
|
||||||
$$requires = $1 if ($line =~ m/^QT_REQUIRE_CONFIG\((.*)\);[\r\n]*$/);
|
$$requires = $1 if ($line =~ m/^QT_REQUIRE_CONFIG\((.*)\);[\r\n]*$/);
|
||||||
@ -298,6 +297,7 @@ sub classNames {
|
|||||||
|
|
||||||
if($definition) {
|
if($definition) {
|
||||||
$definition =~ s=[\n\r]==g;
|
$definition =~ s=[\n\r]==g;
|
||||||
|
$definition =~ s/QT_DEPRECATED_X\s*\(\s*".*?"\s*\)//g;
|
||||||
my @symbols;
|
my @symbols;
|
||||||
my $post_kw = qr/Q_DECL_FINAL|final|sealed/; # add here macros and keywords that go after the class-name of a class definition
|
my $post_kw = qr/Q_DECL_FINAL|final|sealed/; # add here macros and keywords that go after the class-name of a class definition
|
||||||
if($definition =~ m/^ *typedef *.*\(\*([^\)]*)\)\(.*\);$/) {
|
if($definition =~ m/^ *typedef *.*\(\*([^\)]*)\)\(.*\);$/) {
|
||||||
|
@ -24,6 +24,22 @@
|
|||||||
** $QT_END_LICENSE$
|
** $QT_END_LICENSE$
|
||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
/*!
|
||||||
|
\externalpage https://source.android.com/setup/start/build-numbers
|
||||||
|
\title Android: Build Numbers
|
||||||
|
*/
|
||||||
|
/*!
|
||||||
|
\externalpage https://developer.android.com/guide/topics/manifest/uses-feature-element
|
||||||
|
\title Android: <uses-feature>
|
||||||
|
*/
|
||||||
|
/*!
|
||||||
|
\externalpage https://developer.android.com/guide/topics/manifest/uses-permission-element
|
||||||
|
\title Android: <uses-permission>
|
||||||
|
*/
|
||||||
|
/*!
|
||||||
|
\externalpage https://developer.android.com/studio/publish/versioning#appversioning
|
||||||
|
\title Android: App Versioning
|
||||||
|
*/
|
||||||
/*!
|
/*!
|
||||||
\externalpage http://www.freedesktop.org/
|
\externalpage http://www.freedesktop.org/
|
||||||
\title freedesktop.org
|
\title freedesktop.org
|
||||||
|
@ -17,8 +17,16 @@ os_directory = $$(INTEGRITY_DIR)
|
|||||||
isEmpty(os_directory): \
|
isEmpty(os_directory): \
|
||||||
error("This qmakespec requires $INTEGRITY_DIR to be set")
|
error("This qmakespec requires $INTEGRITY_DIR to be set")
|
||||||
|
|
||||||
QMAKE_CC = cxintarm64 -bsp $$bsp_name -os_dir $$os_directory -non_shared
|
iy_build_target = $$(INTEGRITY_BUILD_TARGET)
|
||||||
QMAKE_CXX = cxintarm64 -bsp $$bsp_name -os_dir $$os_directory -non_shared
|
isEmpty(iy_build_target): \
|
||||||
|
message("This qmakespec requires $INTEGRITY_BUILD_TARGET to be set [dbg|rel|chk|cov] for Integrity versions 11.7.6 and higher")
|
||||||
|
|
||||||
|
start_name = $$(INTEGRITY_DIR)/libs/$$(INTEGRITY_BSP)/$$(INTEGRITY_BUILD_TARGET)
|
||||||
|
rtos_name= libs/$$(INTEGRITY_BSP)/$$(INTEGRITY_BUILD_TARGET)
|
||||||
|
|
||||||
|
QMAKE_CC = cxintarm64 -bsp $$bsp_name -os_dir $$os_directory -non_shared -startfile_dir=$$start_name --rtos_library_directory=$$rtos_name --rtos_library_directory=libs/arm64/$$iy_build_target
|
||||||
|
QMAKE_CXX = cxintarm64 -bsp $$bsp_name -os_dir $$os_directory -non_shared -startfile_dir=$$start_name --rtos_library_directory=$$rtos_name --rtos_library_directory=libs/arm64/$$iy_build_target
|
||||||
|
|
||||||
QMAKE_LINK = $$QMAKE_CXX
|
QMAKE_LINK = $$QMAKE_CXX
|
||||||
QMAKE_AR = $$QMAKE_CXX -archive -o
|
QMAKE_AR = $$QMAKE_CXX -archive -o
|
||||||
|
|
||||||
|
43
mkspecs/devices/integrity-armv8-SA8155P/qmake.conf
Normal file
43
mkspecs/devices/integrity-armv8-SA8155P/qmake.conf
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
#
|
||||||
|
# qmake configuration for INTEGRITY Qualcomm SA8155P ADP
|
||||||
|
#
|
||||||
|
|
||||||
|
load(device_config)
|
||||||
|
|
||||||
|
include(../../common/ghs-integrity-armv8.conf)
|
||||||
|
|
||||||
|
QT_QPA_DEFAULT_PLATFORM = eglfs
|
||||||
|
EGLFS_DEVICE_INTEGRATION = eglfs_openwfd
|
||||||
|
|
||||||
|
qc_multimedia_inc_directory = $$(QC_MULTIMEDIA_INC_DIR)
|
||||||
|
isEmpty(qc_multimedia_inc_directory): \
|
||||||
|
error("This makespec requires the environment variable QC_MULTIMEDIA_INC_DIR to be set.")
|
||||||
|
|
||||||
|
QMAKE_INCDIR += $$(QC_MULTIMEDIA_INC_DIR)
|
||||||
|
|
||||||
|
QMAKE_LIBS_EGL += -lESXEGL_Adreno -lESXGLESv2_Adreno -ladreno_utils -lGSLUser -lOSUser -lpanel -livfs -lposix -lpmem -ltzbsp -lpaged_alloc -lglnext-llvm -lopenwfd -lplanedef -llogger -lnet -lsocket -lrfs_client -lshm_client -lmmosalrfs -lmmosalfile -lOSAbstraction
|
||||||
|
|
||||||
|
QMAKE_LIBS_OPENGL_ES2 += $${QMAKE_LIBS_EGL}
|
||||||
|
|
||||||
|
QMAKE_CFLAGS += -DINTEGRITY
|
||||||
|
QMAKE_CXXFLAGS += -DINTEGRITY
|
||||||
|
|
||||||
|
QMAKE_CFLAGS += -bigswitch
|
||||||
|
QMAKE_CXXFLAGS += -bigswitch
|
||||||
|
QMAKE_LFLAGS += -bigswitch
|
||||||
|
|
||||||
|
dirs = $$(GL_INC_DIR)
|
||||||
|
isEmpty(dirs): \
|
||||||
|
error("This makespec requires the environment variable GL_INC_DIR to be set.")
|
||||||
|
|
||||||
|
QMAKE_INCDIR_EGL = $$split(dirs, $$QMAKE_DIRLIST_SEP)
|
||||||
|
QMAKE_INCDIR_OPENGL_ES2 = $$QMAKE_INCDIR_EGL
|
||||||
|
|
||||||
|
dirs = $$(GL_LIB_DIR)
|
||||||
|
isEmpty(dirs): \
|
||||||
|
error("This makespec requires the environment variable GL_LIB_DIR to be set.")
|
||||||
|
|
||||||
|
QMAKE_LIBDIR_EGL = $$split(dirs, $$QMAKE_DIRLIST_SEP)
|
||||||
|
QMAKE_LIBDIR_OPENGL_ES2 = $$QMAKE_LIBDIR_EGL
|
||||||
|
|
||||||
|
load(qt_config)
|
@ -1,9 +1,9 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2018 The Qt Company Ltd.
|
** Copyright (C) 2020 The Qt Company Ltd.
|
||||||
** Contact: https://www.qt.io/licensing/
|
** Contact: https://www.qt.io/licensing/
|
||||||
**
|
**
|
||||||
** This file is part of the plugins of the Qt Toolkit.
|
** This file is part of the qmake spec of the Qt Toolkit.
|
||||||
**
|
**
|
||||||
** $QT_BEGIN_LICENSE:LGPL$
|
** $QT_BEGIN_LICENSE:LGPL$
|
||||||
** Commercial License Usage
|
** Commercial License Usage
|
||||||
@ -37,33 +37,9 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef MESSAGES_H
|
#ifndef QPLATFORMDEFS_H
|
||||||
#define MESSAGES_H
|
#define QPLATFORMDEFS_H
|
||||||
|
|
||||||
#include <QString>
|
#include "../../common/integrity/qplatformdefs.h"
|
||||||
#include <qpa/qplatformmenu.h>
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
#endif // QPLATFORMDEFS_H
|
||||||
|
|
||||||
enum {
|
|
||||||
AboutAppMenuItem = 0,
|
|
||||||
PreferencesAppMenuItem,
|
|
||||||
ServicesAppMenuItem,
|
|
||||||
HideAppMenuItem,
|
|
||||||
HideOthersAppMenuItem,
|
|
||||||
ShowAllAppMenuItem,
|
|
||||||
QuitAppMenuItem
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
QString msgAboutQt();
|
|
||||||
|
|
||||||
QString qt_mac_applicationmenu_string(int type);
|
|
||||||
|
|
||||||
QPlatformMenuItem::MenuRole detectMenuRole(const QString &caption);
|
|
||||||
|
|
||||||
QString msgDialogButtonDiscard();
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
|
||||||
|
|
||||||
#endif // MESSAGES_H
|
|
@ -25,7 +25,8 @@ qtConfig(stack-protector-strong): CONFIG += stack_protector_strong
|
|||||||
contains(TEMPLATE, .*lib) {
|
contains(TEMPLATE, .*lib) {
|
||||||
# module and plugins
|
# module and plugins
|
||||||
unix:qtConfig(reduce_relocations): CONFIG += bsymbolic_functions
|
unix:qtConfig(reduce_relocations): CONFIG += bsymbolic_functions
|
||||||
|
}
|
||||||
|
contains(TEMPLATE, .*lib)|contains(TEMPLATE, aux) {
|
||||||
!isEmpty(_QMAKE_SUPER_CACHE_): \
|
!isEmpty(_QMAKE_SUPER_CACHE_): \
|
||||||
rplbase = $$dirname(_QMAKE_SUPER_CACHE_)/[^/][^/]*
|
rplbase = $$dirname(_QMAKE_SUPER_CACHE_)/[^/][^/]*
|
||||||
else: \
|
else: \
|
||||||
|
@ -36,7 +36,11 @@ win32 {
|
|||||||
plugin_target = $$QMAKE_PLUGIN_BUNDLE_NAME
|
plugin_target = $$QMAKE_PLUGIN_BUNDLE_NAME
|
||||||
else: \
|
else: \
|
||||||
plugin_target = $$TARGET
|
plugin_target = $$TARGET
|
||||||
QMAKE_RESOLVED_BUNDLE = $${QMAKE_RESOLVED_TARGET}$${plugin_target}.plugin
|
isEmpty(QMAKE_BUNDLE_EXTENSION): \
|
||||||
|
plugin_ext = .plugin
|
||||||
|
else: \
|
||||||
|
plugin_ext = $$QMAKE_BUNDLE_EXTENSION
|
||||||
|
QMAKE_RESOLVED_BUNDLE = $${QMAKE_RESOLVED_TARGET}$${plugin_target}$${plugin_ext}
|
||||||
!shallow_bundle: \
|
!shallow_bundle: \
|
||||||
QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_BUNDLE}/Contents/MacOS/$${TARGET}
|
QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_BUNDLE}/Contents/MacOS/$${TARGET}
|
||||||
else: \
|
else: \
|
||||||
@ -46,7 +50,11 @@ win32 {
|
|||||||
framework_target = $$QMAKE_FRAMEWORK_BUNDLE_NAME
|
framework_target = $$QMAKE_FRAMEWORK_BUNDLE_NAME
|
||||||
else: \
|
else: \
|
||||||
framework_target = $$TARGET
|
framework_target = $$TARGET
|
||||||
QMAKE_RESOLVED_BUNDLE = $${QMAKE_RESOLVED_TARGET}$${framework_target}.framework
|
isEmpty(QMAKE_BUNDLE_EXTENSION): \
|
||||||
|
framework_ext = .framework
|
||||||
|
else: \
|
||||||
|
framework_ext = $$QMAKE_BUNDLE_EXTENSION
|
||||||
|
QMAKE_RESOLVED_BUNDLE = $${QMAKE_RESOLVED_TARGET}$${framework_target}$${framework_ext}
|
||||||
!shallow_bundle {
|
!shallow_bundle {
|
||||||
TEMP_VERSION = $$section(VERSION, ., 0, 0)
|
TEMP_VERSION = $$section(VERSION, ., 0, 0)
|
||||||
isEmpty(TEMP_VERSION):TEMP_VERSION = A
|
isEmpty(TEMP_VERSION):TEMP_VERSION = A
|
||||||
|
@ -905,6 +905,187 @@
|
|||||||
to specify a list of libraries that each project needs to link against,
|
to specify a list of libraries that each project needs to link against,
|
||||||
and \c QMAKE_LIBS_X11 would be used to extend this list.
|
and \c QMAKE_LIBS_X11 would be used to extend this list.
|
||||||
|
|
||||||
|
\target ANDROID_ABI
|
||||||
|
\section1 ANDROID_ABI
|
||||||
|
|
||||||
|
\note This variable applies only to Android targets.
|
||||||
|
|
||||||
|
Specifies the Android target ABI. Valid values are: armeabi-v7a, arm64-v8a,
|
||||||
|
x86, x86_64.
|
||||||
|
|
||||||
|
\target ANDROID_ABIS
|
||||||
|
\section1 ANDROID_ABIS
|
||||||
|
|
||||||
|
\note This variable applies only to Android targets.
|
||||||
|
|
||||||
|
Specifies a list of Android target ABIs. Valid values are: armeabi-v7a,
|
||||||
|
arm64-v8a, x86, x86_64.
|
||||||
|
|
||||||
|
\badcode
|
||||||
|
qmake ANDROID_ABIS="armeabi-v7a arm64-v8a"
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
\target ANDROID_API_VERSION
|
||||||
|
\section1 ANDROID_API_VERSION
|
||||||
|
|
||||||
|
\note This variable applies only to Android targets.
|
||||||
|
|
||||||
|
Specifies the Android API level number. For more information, see
|
||||||
|
\l{Android: Build Numbers}{Android Build Numbers}.
|
||||||
|
|
||||||
|
\target ANDROID_BUNDLED_JAR_DEPENDENCIES
|
||||||
|
\section1 ANDROID_BUNDLED_JAR_DEPENDENCIES
|
||||||
|
|
||||||
|
\note This variable applies only to Android modules.
|
||||||
|
|
||||||
|
This is useful when writing a Qt module. It specifies a list of pre-bundled
|
||||||
|
dependencies used by the module in a \c .jar format, for example:
|
||||||
|
|
||||||
|
\badcode
|
||||||
|
ANDROID_BUNDLED_JAR_DEPENDENCIES += jar/QtAndroid.jar
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
\target ANDROID_DEPLOYMENT_DEPENDENCIES
|
||||||
|
\section1 ANDROID_DEPLOYMENT_DEPENDENCIES
|
||||||
|
|
||||||
|
\note This variable applies only to Android targets.
|
||||||
|
|
||||||
|
By default, \l androiddeployqt will detect the dependencies of your
|
||||||
|
application. However, since run-time usage of plugins cannot be detected,
|
||||||
|
there could be false positives, as your application might depend on any
|
||||||
|
plugin that is a potential dependency. If you want to minimize the size of
|
||||||
|
your \c APK, it's possible to override the automatic detection using the
|
||||||
|
this variable. This should contain a list of all Qt files which need to be
|
||||||
|
included, with paths relative to the Qt install root.
|
||||||
|
|
||||||
|
\note Only the Qt files specified with this variable are included. Failing
|
||||||
|
to include all the correct files can result in crashes. It's also important
|
||||||
|
to make sure the files are listed in the correct loading order. This variable
|
||||||
|
provides a way to override the automatic detection entirely, so if a library
|
||||||
|
is listed before its dependencies, it will fail to load on some devices.
|
||||||
|
|
||||||
|
\target ANDROID_DEPLOYMENT_SETTINGS_FILE
|
||||||
|
\section1 ANDROID_DEPLOYMENT_SETTINGS_FILE
|
||||||
|
|
||||||
|
\note This variable applies only to Android targets.
|
||||||
|
|
||||||
|
Specifies the path to the \c {android-deployment-settings.json} file needed
|
||||||
|
by \l androiddeployqt and \c androidtestrunner. This overrides the path to
|
||||||
|
the settings file generated by qmake, thus you have to make sure to provide
|
||||||
|
a valid settings file.
|
||||||
|
|
||||||
|
\target ANDROID_EXTRA_LIBS
|
||||||
|
\section1 ANDROID_EXTRA_LIBS
|
||||||
|
|
||||||
|
\note This variable applies only to Android targets.
|
||||||
|
|
||||||
|
A list of external libraries that will be copied into your application's
|
||||||
|
\c libs folder and loaded on start-up. This can be used, for instance,
|
||||||
|
to enable OpenSSL in your application. For more information, see
|
||||||
|
\l{Adding OpenSSL Support for Android}.
|
||||||
|
|
||||||
|
\target ANDROID_EXTRA_PLUGINS
|
||||||
|
\section1 ANDROID_EXTRA_PLUGINS
|
||||||
|
|
||||||
|
\note This variable applies only to Android targets.
|
||||||
|
|
||||||
|
Specifies different resources that your application has to bundle but that
|
||||||
|
cannot be delivered through the assets system, such as QML plugins. With this
|
||||||
|
variable, \l androiddeployqt will make sure everything is packaged and
|
||||||
|
deployed properly.
|
||||||
|
|
||||||
|
\target ANDROID_FEATURES
|
||||||
|
\section1 ANDROID_FEATURES
|
||||||
|
|
||||||
|
\note This variable applies only to Android modules.
|
||||||
|
|
||||||
|
Specifies a module's features list:
|
||||||
|
|
||||||
|
\badcode
|
||||||
|
ANDROID_FEATURES += android.hardware.location.gps
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
For more information, see \l{Android: <uses-feature>}{Android <uses-feature> Docs}.
|
||||||
|
|
||||||
|
\target ANDROID_LIB_DEPENDENCIES
|
||||||
|
\section1 ANDROID_LIB_DEPENDENCIES
|
||||||
|
|
||||||
|
\note This variable applies only to Android modules.
|
||||||
|
|
||||||
|
This is useful when writing a Qt module. It specifies a list of pre-built
|
||||||
|
dependencies used by the module, for example:
|
||||||
|
|
||||||
|
\badcode
|
||||||
|
ANDROID_LIB_DEPENDENCIES += \
|
||||||
|
plugins/libplugins_platforms_qtforandroid.so
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
\target ANDROID_MIN_SDK_VERSION
|
||||||
|
\section1 ANDROID_MIN_SDK_VERSION
|
||||||
|
|
||||||
|
\note This variable applies only to Android targets.
|
||||||
|
|
||||||
|
Specifies the minimum Android API level for the project. By default, this
|
||||||
|
variable is set to API level 21.
|
||||||
|
|
||||||
|
\target ANDROID_PACKAGE_SOURCE_DIR
|
||||||
|
\section1 ANDROID_PACKAGE_SOURCE_DIR
|
||||||
|
|
||||||
|
\note This variable applies only to Android targets.
|
||||||
|
|
||||||
|
Specifies the path for a custom Android package template. The Android package
|
||||||
|
template contains:
|
||||||
|
\list
|
||||||
|
\li AndroidManifest.xml file
|
||||||
|
\li build.gradle file and other Gradle scripts
|
||||||
|
\li res/values/libs.xml file
|
||||||
|
\endlist
|
||||||
|
|
||||||
|
The path specified by this variable can contain custom Java classes under
|
||||||
|
\c src directory. By default, the \l androiddeployqt tool copies the
|
||||||
|
application template from the Qt for Android installation path into your
|
||||||
|
project's build directory, then it copies the contents of the path specified
|
||||||
|
by this variable on top of that, overwriting any existing files. For
|
||||||
|
instance, you can make a custom \c {AndroidManifest.xml} for your application,
|
||||||
|
then place this directly into the directory specified by this variable.
|
||||||
|
|
||||||
|
\target ANDROID_PERMISSIONS
|
||||||
|
\section1 ANDROID_PERMISSIONS
|
||||||
|
|
||||||
|
\note This variable applies only to Android modules.
|
||||||
|
|
||||||
|
Specifies a module's permissions list:
|
||||||
|
|
||||||
|
\badcode
|
||||||
|
ANDROID_PERMISSIONS += android.permission.ACCESS_FINE_LOCATION
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
For more information, see \l{Android: <uses-permission>}{Android <uses-permission> Docs}.
|
||||||
|
|
||||||
|
\target ANDROID_TARGET_SDK_VERSION
|
||||||
|
\section1 ANDROID_TARGET_SDK_VERSION
|
||||||
|
|
||||||
|
\note This variable applies only to Android targets.
|
||||||
|
|
||||||
|
Specifies the target Android API level for the project. By default, this
|
||||||
|
variable is set to API level 28.
|
||||||
|
|
||||||
|
\target ANDROID_VERSION_CODE
|
||||||
|
\section1 ANDROID_VERSION_CODE
|
||||||
|
|
||||||
|
\note This variable applies only to Android targets.
|
||||||
|
|
||||||
|
Specifies the application's version number. For more information, see
|
||||||
|
\l{Android: App Versioning}{Android App Versioning}.
|
||||||
|
|
||||||
|
\target ANDROID_VERSION_NAME
|
||||||
|
\section1 ANDROID_VERSION_NAME
|
||||||
|
|
||||||
|
\note This variable applies only to Android targets.
|
||||||
|
|
||||||
|
Specifies the application's version in as a human readable string. For more
|
||||||
|
information, see \l{Android: App Versioning}{Android App Versioning}.
|
||||||
|
|
||||||
\target CONFIG
|
\target CONFIG
|
||||||
\section1 CONFIG
|
\section1 CONFIG
|
||||||
|
|
||||||
@ -1376,6 +1557,13 @@
|
|||||||
This variable is also used to specify which additional files will be
|
This variable is also used to specify which additional files will be
|
||||||
deployed to embedded devices.
|
deployed to embedded devices.
|
||||||
|
|
||||||
|
\target JAVA_HOME
|
||||||
|
\section1 JAVA_HOME
|
||||||
|
|
||||||
|
\note This variable is useful only to Android targets.
|
||||||
|
|
||||||
|
Specifies the JDK/OpenJDK installation path used for building the project.
|
||||||
|
|
||||||
\target LEXIMPLS
|
\target LEXIMPLS
|
||||||
\section1 LEXIMPLS
|
\section1 LEXIMPLS
|
||||||
|
|
||||||
|
30
src/3rdparty/sqlite/patches/0002-sqlite-Fix-CVE-2020-11655.patch
vendored
Normal file
30
src/3rdparty/sqlite/patches/0002-sqlite-Fix-CVE-2020-11655.patch
vendored
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
From fa3ea2350c0367aa7cfd796b31214e2dcf574360 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andy Shaw <andy.shaw@qt.io>
|
||||||
|
Date: Mon, 20 Apr 2020 10:43:29 +0200
|
||||||
|
Subject: [PATCH] sqlite: Fix CVE-2020-11655
|
||||||
|
|
||||||
|
This was taken from 4a302b42c7bf5e11 in SQLite, ref:
|
||||||
|
https://www3.sqlite.org/cgi/src/info/4a302b42c7bf5e11
|
||||||
|
|
||||||
|
[ChangeLog][QtSQL][sqlite] Fixed CVE-2020-11655
|
||||||
|
|
||||||
|
Change-Id: I5ead78d9ee63aa0f12f1c1014c79373728569f30
|
||||||
|
---
|
||||||
|
src/3rdparty/sqlite/sqlite3.c | 1 +
|
||||||
|
1 file changed, 1 insertion(+)
|
||||||
|
|
||||||
|
diff --git a/src/3rdparty/sqlite/sqlite3.c b/src/3rdparty/sqlite/sqlite3.c
|
||||||
|
index dfe5323a59..054be43d95 100644
|
||||||
|
--- a/src/3rdparty/sqlite/sqlite3.c
|
||||||
|
+++ b/src/3rdparty/sqlite/sqlite3.c
|
||||||
|
@@ -133226,6 +133226,7 @@ static void resetAccumulator(Parse *pParse, AggInfo *pAggInfo){
|
||||||
|
struct AggInfo_func *pFunc;
|
||||||
|
int nReg = pAggInfo->nFunc + pAggInfo->nColumn;
|
||||||
|
if( nReg==0 ) return;
|
||||||
|
+ if( pParse->nErr ) return;
|
||||||
|
#ifdef SQLITE_DEBUG
|
||||||
|
/* Verify that all AggInfo registers are within the range specified by
|
||||||
|
** AggInfo.mnReg..AggInfo.mxReg */
|
||||||
|
--
|
||||||
|
2.24.2 (Apple Git-127)
|
||||||
|
|
63
src/3rdparty/sqlite/patches/0003-sqlite-Fix-CVE-2020-11656.patch
vendored
Normal file
63
src/3rdparty/sqlite/patches/0003-sqlite-Fix-CVE-2020-11656.patch
vendored
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
From 99cdbed3bb5368ae2ec80d15635a2dd57961310c Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andy Shaw <andy.shaw@qt.io>
|
||||||
|
Date: Mon, 20 Apr 2020 10:49:57 +0200
|
||||||
|
Subject: [PATCH] sqlite: Fix CVE-2020-11656
|
||||||
|
|
||||||
|
This was taken from d09f8c3621d5f7f8 and b64674919f673602 in SQLite,
|
||||||
|
ref: https://www3.sqlite.org/cgi/src/info/d09f8c3621d5f7f8
|
||||||
|
https://www.sqlite.org/cgi/src/info/b64674919f673602
|
||||||
|
|
||||||
|
[ChangeLog][QtSQL][sqlite] Fixed CVE-2020-11656
|
||||||
|
|
||||||
|
Fixes: QTBUG-83652
|
||||||
|
Change-Id: I99bd59dc10b753ff19822c902dff1fc339d330a8
|
||||||
|
---
|
||||||
|
src/3rdparty/sqlite/sqlite3.c | 18 +++++++++++++++++-
|
||||||
|
1 file changed, 17 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/3rdparty/sqlite/sqlite3.c b/src/3rdparty/sqlite/sqlite3.c
|
||||||
|
index 054be43d95..6ff9ba42aa 100644
|
||||||
|
--- a/src/3rdparty/sqlite/sqlite3.c
|
||||||
|
+++ b/src/3rdparty/sqlite/sqlite3.c
|
||||||
|
@@ -97945,7 +97945,7 @@ static int resolveOrderByTermToExprList(
|
||||||
|
nc.nErr = 0;
|
||||||
|
db = pParse->db;
|
||||||
|
savedSuppErr = db->suppressErr;
|
||||||
|
- db->suppressErr = 1;
|
||||||
|
+ if( IN_RENAME_OBJECT==0 ) db->suppressErr = 1;
|
||||||
|
rc = sqlite3ResolveExprNames(&nc, pE);
|
||||||
|
db->suppressErr = savedSuppErr;
|
||||||
|
if( rc ) return 0;
|
||||||
|
@@ -105383,6 +105383,21 @@ static void renameWalkWith(Walker *pWalker, Select *pSelect){
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+/*
|
||||||
|
+** Unmap all tokens in the IdList object passed as the second argument.
|
||||||
|
+*/
|
||||||
|
+static void unmapColumnIdlistNames(
|
||||||
|
+ Parse *pParse,
|
||||||
|
+ IdList *pIdList
|
||||||
|
+){
|
||||||
|
+ if( pIdList ){
|
||||||
|
+ int ii;
|
||||||
|
+ for(ii=0; ii<pIdList->nId; ii++){
|
||||||
|
+ sqlite3RenameTokenRemap(pParse, 0, (void*)pIdList->a[ii].zName);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
/*
|
||||||
|
** Walker callback used by sqlite3RenameExprUnmap().
|
||||||
|
*/
|
||||||
|
@@ -105404,6 +105419,7 @@ static int renameUnmapSelectCb(Walker *pWalker, Select *p){
|
||||||
|
for(i=0; i<pSrc->nSrc; i++){
|
||||||
|
sqlite3RenameTokenRemap(pParse, 0, (void*)pSrc->a[i].zName);
|
||||||
|
if( sqlite3WalkExpr(pWalker, pSrc->a[i].pOn) ) return WRC_Abort;
|
||||||
|
+ unmapColumnIdlistNames(pParse, pSrc->a[i].pUsing);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
2.24.2 (Apple Git-127)
|
||||||
|
|
19
src/3rdparty/sqlite/sqlite3.c
vendored
19
src/3rdparty/sqlite/sqlite3.c
vendored
@ -97945,7 +97945,7 @@ static int resolveOrderByTermToExprList(
|
|||||||
nc.nErr = 0;
|
nc.nErr = 0;
|
||||||
db = pParse->db;
|
db = pParse->db;
|
||||||
savedSuppErr = db->suppressErr;
|
savedSuppErr = db->suppressErr;
|
||||||
db->suppressErr = 1;
|
if( IN_RENAME_OBJECT==0 ) db->suppressErr = 1;
|
||||||
rc = sqlite3ResolveExprNames(&nc, pE);
|
rc = sqlite3ResolveExprNames(&nc, pE);
|
||||||
db->suppressErr = savedSuppErr;
|
db->suppressErr = savedSuppErr;
|
||||||
if( rc ) return 0;
|
if( rc ) return 0;
|
||||||
@ -105383,6 +105383,21 @@ static void renameWalkWith(Walker *pWalker, Select *pSelect){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
** Unmap all tokens in the IdList object passed as the second argument.
|
||||||
|
*/
|
||||||
|
static void unmapColumnIdlistNames(
|
||||||
|
Parse *pParse,
|
||||||
|
IdList *pIdList
|
||||||
|
){
|
||||||
|
if( pIdList ){
|
||||||
|
int ii;
|
||||||
|
for(ii=0; ii<pIdList->nId; ii++){
|
||||||
|
sqlite3RenameTokenRemap(pParse, 0, (void*)pIdList->a[ii].zName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Walker callback used by sqlite3RenameExprUnmap().
|
** Walker callback used by sqlite3RenameExprUnmap().
|
||||||
*/
|
*/
|
||||||
@ -105404,6 +105419,7 @@ static int renameUnmapSelectCb(Walker *pWalker, Select *p){
|
|||||||
for(i=0; i<pSrc->nSrc; i++){
|
for(i=0; i<pSrc->nSrc; i++){
|
||||||
sqlite3RenameTokenRemap(pParse, 0, (void*)pSrc->a[i].zName);
|
sqlite3RenameTokenRemap(pParse, 0, (void*)pSrc->a[i].zName);
|
||||||
if( sqlite3WalkExpr(pWalker, pSrc->a[i].pOn) ) return WRC_Abort;
|
if( sqlite3WalkExpr(pWalker, pSrc->a[i].pOn) ) return WRC_Abort;
|
||||||
|
unmapColumnIdlistNames(pParse, pSrc->a[i].pUsing);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133226,6 +133242,7 @@ static void resetAccumulator(Parse *pParse, AggInfo *pAggInfo){
|
|||||||
struct AggInfo_func *pFunc;
|
struct AggInfo_func *pFunc;
|
||||||
int nReg = pAggInfo->nFunc + pAggInfo->nColumn;
|
int nReg = pAggInfo->nFunc + pAggInfo->nColumn;
|
||||||
if( nReg==0 ) return;
|
if( nReg==0 ) return;
|
||||||
|
if( pParse->nErr ) return;
|
||||||
#ifdef SQLITE_DEBUG
|
#ifdef SQLITE_DEBUG
|
||||||
/* Verify that all AggInfo registers are within the range specified by
|
/* Verify that all AggInfo registers are within the range specified by
|
||||||
** AggInfo.mnReg..AggInfo.mxReg */
|
** AggInfo.mnReg..AggInfo.mxReg */
|
||||||
|
@ -162,8 +162,13 @@ public class QtNative
|
|||||||
private static Uri getUriWithValidPermission(Context context, String uri, String openMode)
|
private static Uri getUriWithValidPermission(Context context, String uri, String openMode)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
Uri parsedUri = Uri.parse(uri);
|
||||||
|
String scheme = parsedUri.getScheme();
|
||||||
|
// We only want to check permissions for files and content Uris
|
||||||
|
if (scheme.compareTo("file") != 0 && scheme.compareTo("content") != 0)
|
||||||
|
return parsedUri;
|
||||||
List<UriPermission> permissions = context.getContentResolver().getPersistedUriPermissions();
|
List<UriPermission> permissions = context.getContentResolver().getPersistedUriPermissions();
|
||||||
String uriStr = Uri.parse(uri).getPath();
|
String uriStr = parsedUri.getPath();
|
||||||
|
|
||||||
for (int i = 0; i < permissions.size(); ++i) {
|
for (int i = 0; i < permissions.size(); ++i) {
|
||||||
Uri iterUri = permissions.get(i).getUri();
|
Uri iterUri = permissions.get(i).getUri();
|
||||||
|
@ -403,20 +403,28 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//! [39]
|
//! [39]
|
||||||
class QLibrary : public QObject
|
class QItemSelectionModel : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
...
|
...
|
||||||
|
enum SelectionFlag {
|
||||||
enum LoadHint {
|
NoUpdate = 0x0000,
|
||||||
ResolveAllSymbolsHint = 0x01,
|
Clear = 0x0001,
|
||||||
ExportExternalSymbolsHint = 0x02,
|
Select = 0x0002,
|
||||||
LoadArchiveMemberHint = 0x04
|
Deselect = 0x0004,
|
||||||
|
Toggle = 0x0008,
|
||||||
|
Current = 0x0010,
|
||||||
|
Rows = 0x0020,
|
||||||
|
Columns = 0x0040,
|
||||||
|
SelectCurrent = Select | Current,
|
||||||
|
ToggleCurrent = Toggle | Current,
|
||||||
|
ClearAndSelect = Clear | Select
|
||||||
};
|
};
|
||||||
Q_DECLARE_FLAGS(LoadHints, LoadHint)
|
|
||||||
Q_FLAG(LoadHint)
|
Q_DECLARE_FLAGS(SelectionFlags, SelectionFlag)
|
||||||
|
Q_FLAG(SelectionFlags)
|
||||||
...
|
...
|
||||||
}
|
}
|
||||||
//! [39]
|
//! [39]
|
||||||
|
@ -1292,6 +1292,14 @@
|
|||||||
# define QT_WARNING_DISABLE_DEPRECATED
|
# define QT_WARNING_DISABLE_DEPRECATED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef QT_IGNORE_DEPRECATIONS
|
||||||
|
#define QT_IGNORE_DEPRECATIONS(statement) \
|
||||||
|
QT_WARNING_PUSH \
|
||||||
|
QT_WARNING_DISABLE_DEPRECATED \
|
||||||
|
statement \
|
||||||
|
QT_WARNING_POP
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Proper for-scoping in MIPSpro CC
|
Proper for-scoping in MIPSpro CC
|
||||||
*/
|
*/
|
||||||
|
@ -285,7 +285,7 @@
|
|||||||
application on supported platforms, use of a session manager may be
|
application on supported platforms, use of a session manager may be
|
||||||
redundant for system services.
|
redundant for system services.
|
||||||
This attribute must be set before QGuiApplication is constructed.
|
This attribute must be set before QGuiApplication is constructed.
|
||||||
This value was added in 5.13
|
This value was added in 5.14
|
||||||
|
|
||||||
\value AA_DisableNativeVirtualKeyboard When this attribute is set, the native
|
\value AA_DisableNativeVirtualKeyboard When this attribute is set, the native
|
||||||
on-screen virtual keyboard will not be shown automatically when a
|
on-screen virtual keyboard will not be shown automatically when a
|
||||||
|
@ -76,6 +76,8 @@
|
|||||||
The following operating systems have variants:
|
The following operating systems have variants:
|
||||||
LINUX - both Q_OS_LINUX and Q_OS_ANDROID are defined when building for Android
|
LINUX - both Q_OS_LINUX and Q_OS_ANDROID are defined when building for Android
|
||||||
- only Q_OS_LINUX is defined if building for other Linux systems
|
- only Q_OS_LINUX is defined if building for other Linux systems
|
||||||
|
MACOS - both Q_OS_BSD4 and Q_OS_IOS are defined when building for iOS
|
||||||
|
- both Q_OS_BSD4 and Q_OS_MACOS are defined when building for macOS
|
||||||
FREEBSD - Q_OS_FREEBSD is defined only when building for FreeBSD with a BSD userland
|
FREEBSD - Q_OS_FREEBSD is defined only when building for FreeBSD with a BSD userland
|
||||||
- Q_OS_FREEBSD_KERNEL is always defined on FreeBSD, even if the userland is from GNU
|
- Q_OS_FREEBSD_KERNEL is always defined on FreeBSD, even if the userland is from GNU
|
||||||
*/
|
*/
|
||||||
|
@ -253,7 +253,7 @@ QInotifyFileSystemWatcherEngine::QInotifyFileSystemWatcherEngine(int fd, QObject
|
|||||||
notifier(fd, QSocketNotifier::Read, this)
|
notifier(fd, QSocketNotifier::Read, this)
|
||||||
{
|
{
|
||||||
fcntl(inotifyFd, F_SETFD, FD_CLOEXEC);
|
fcntl(inotifyFd, F_SETFD, FD_CLOEXEC);
|
||||||
connect(¬ifier, SIGNAL(activated(int)), SLOT(readFromInotify()));
|
connect(¬ifier, SIGNAL(activated(QSocketDescriptor)), SLOT(readFromInotify()));
|
||||||
}
|
}
|
||||||
|
|
||||||
QInotifyFileSystemWatcherEngine::~QInotifyFileSystemWatcherEngine()
|
QInotifyFileSystemWatcherEngine::~QInotifyFileSystemWatcherEngine()
|
||||||
|
@ -77,7 +77,7 @@ QKqueueFileSystemWatcherEngine::QKqueueFileSystemWatcherEngine(int kqfd, QObject
|
|||||||
kqfd(kqfd),
|
kqfd(kqfd),
|
||||||
notifier(kqfd, QSocketNotifier::Read, this)
|
notifier(kqfd, QSocketNotifier::Read, this)
|
||||||
{
|
{
|
||||||
connect(¬ifier, SIGNAL(activated(int)), SLOT(readFromKqueue()));
|
connect(¬ifier, SIGNAL(activated(QSocketDescriptor)), SLOT(readFromKqueue()));
|
||||||
|
|
||||||
fcntl(kqfd, F_SETFD, FD_CLOEXEC);
|
fcntl(kqfd, F_SETFD, FD_CLOEXEC);
|
||||||
}
|
}
|
||||||
|
@ -251,7 +251,7 @@ bool QProcessPrivate::openChannel(Channel &channel)
|
|||||||
channel.notifier = new QSocketNotifier(channel.pipe[1],
|
channel.notifier = new QSocketNotifier(channel.pipe[1],
|
||||||
QSocketNotifier::Write, q);
|
QSocketNotifier::Write, q);
|
||||||
channel.notifier->setEnabled(false);
|
channel.notifier->setEnabled(false);
|
||||||
QObject::connect(channel.notifier, SIGNAL(activated(int)),
|
QObject::connect(channel.notifier, SIGNAL(activated(QSocketDescriptor)),
|
||||||
q, SLOT(_q_canWrite()));
|
q, SLOT(_q_canWrite()));
|
||||||
} else {
|
} else {
|
||||||
channel.notifier = new QSocketNotifier(channel.pipe[0],
|
channel.notifier = new QSocketNotifier(channel.pipe[0],
|
||||||
@ -261,7 +261,7 @@ bool QProcessPrivate::openChannel(Channel &channel)
|
|||||||
receiver = SLOT(_q_canReadStandardOutput());
|
receiver = SLOT(_q_canReadStandardOutput());
|
||||||
else
|
else
|
||||||
receiver = SLOT(_q_canReadStandardError());
|
receiver = SLOT(_q_canReadStandardError());
|
||||||
QObject::connect(channel.notifier, SIGNAL(activated(int)),
|
QObject::connect(channel.notifier, SIGNAL(activated(QSocketDescriptor)),
|
||||||
q, receiver);
|
q, receiver);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -380,7 +380,7 @@ void QProcessPrivate::startProcess()
|
|||||||
if (threadData.loadRelaxed()->hasEventDispatcher()) {
|
if (threadData.loadRelaxed()->hasEventDispatcher()) {
|
||||||
startupSocketNotifier = new QSocketNotifier(childStartedPipe[0],
|
startupSocketNotifier = new QSocketNotifier(childStartedPipe[0],
|
||||||
QSocketNotifier::Read, q);
|
QSocketNotifier::Read, q);
|
||||||
QObject::connect(startupSocketNotifier, SIGNAL(activated(int)),
|
QObject::connect(startupSocketNotifier, SIGNAL(activated(QSocketDescriptor)),
|
||||||
q, SLOT(_q_startupNotification()));
|
q, SLOT(_q_startupNotification()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -531,7 +531,7 @@ void QProcessPrivate::startProcess()
|
|||||||
|
|
||||||
if (threadData.loadRelaxed()->eventDispatcher.loadAcquire()) {
|
if (threadData.loadRelaxed()->eventDispatcher.loadAcquire()) {
|
||||||
deathNotifier = new QSocketNotifier(forkfd, QSocketNotifier::Read, q);
|
deathNotifier = new QSocketNotifier(forkfd, QSocketNotifier::Read, q);
|
||||||
QObject::connect(deathNotifier, SIGNAL(activated(int)),
|
QObject::connect(deathNotifier, SIGNAL(activated(QSocketDescriptor)),
|
||||||
q, SLOT(_q_processDied()));
|
q, SLOT(_q_processDied()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1675,14 +1675,16 @@ bool QConfFileSettingsPrivate::readIniFile(const QByteArray &data,
|
|||||||
int sectionPosition = 0;
|
int sectionPosition = 0;
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
|
|
||||||
#if QT_CONFIG(textcodec)
|
|
||||||
// detect utf8 BOM
|
// detect utf8 BOM
|
||||||
const uchar *dd = (const uchar *)data.constData();
|
const uchar *dd = (const uchar *)data.constData();
|
||||||
if (data.size() >= 3 && dd[0] == 0xef && dd[1] == 0xbb && dd[2] == 0xbf) {
|
if (data.size() >= 3 && dd[0] == 0xef && dd[1] == 0xbb && dd[2] == 0xbf) {
|
||||||
|
#if QT_CONFIG(textcodec)
|
||||||
iniCodec = QTextCodec::codecForName("UTF-8");
|
iniCodec = QTextCodec::codecForName("UTF-8");
|
||||||
|
#else
|
||||||
|
ok = false;
|
||||||
|
#endif
|
||||||
dataPos = 3;
|
dataPos = 3;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
while (readIniLine(data, dataPos, lineStart, lineLen, equalsPos)) {
|
while (readIniLine(data, dataPos, lineStart, lineLen, equalsPos)) {
|
||||||
char ch = data.at(lineStart);
|
char ch = data.at(lineStart);
|
||||||
|
@ -50,6 +50,7 @@
|
|||||||
#include <qt_windows.h>
|
#include <qt_windows.h>
|
||||||
#include <shlobj.h>
|
#include <shlobj.h>
|
||||||
#include <intshcut.h>
|
#include <intshcut.h>
|
||||||
|
#include <qvarlengtharray.h>
|
||||||
|
|
||||||
#ifndef QT_NO_STANDARDPATHS
|
#ifndef QT_NO_STANDARDPATHS
|
||||||
|
|
||||||
@ -92,9 +93,36 @@ static inline void appendTestMode(QString &path)
|
|||||||
path += QLatin1String("/qttest");
|
path += QLatin1String("/qttest");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool isProcessLowIntegrity() {
|
||||||
|
#ifdef Q_CC_MINGW
|
||||||
|
// GetCurrentProcessToken was introduced in MinGW w64 in v7
|
||||||
|
// Disable function until Qt CI is updated
|
||||||
|
return false;
|
||||||
|
#else
|
||||||
|
HANDLE process_token = GetCurrentProcessToken(); // non-leaking pseudo-handle
|
||||||
|
|
||||||
|
QVarLengthArray<char,256> token_info_buf(256);
|
||||||
|
auto* token_info = reinterpret_cast<TOKEN_MANDATORY_LABEL*>(token_info_buf.data());
|
||||||
|
DWORD token_info_length = token_info_buf.size();
|
||||||
|
if (!GetTokenInformation(process_token, TokenIntegrityLevel, token_info, token_info_length, &token_info_length)) {
|
||||||
|
// grow bufer and retry GetTokenInformation
|
||||||
|
token_info_buf.resize(token_info_length);
|
||||||
|
token_info = reinterpret_cast<TOKEN_MANDATORY_LABEL*>(token_info_buf.data());
|
||||||
|
if (!GetTokenInformation(process_token, TokenIntegrityLevel, token_info, token_info_length, &token_info_length))
|
||||||
|
return false; // assume "normal" process
|
||||||
|
}
|
||||||
|
|
||||||
|
// The GetSidSubAuthorityCount return-code is undefined on failure, so
|
||||||
|
// there's no point in checking before dereferencing
|
||||||
|
DWORD integrity_level = *GetSidSubAuthority(token_info->Label.Sid, *GetSidSubAuthorityCount(token_info->Label.Sid) - 1);
|
||||||
|
return (integrity_level < SECURITY_MANDATORY_MEDIUM_RID);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
// Map QStandardPaths::StandardLocation to KNOWNFOLDERID of SHGetKnownFolderPath()
|
// Map QStandardPaths::StandardLocation to KNOWNFOLDERID of SHGetKnownFolderPath()
|
||||||
static GUID writableSpecialFolderId(QStandardPaths::StandardLocation type)
|
static GUID writableSpecialFolderId(QStandardPaths::StandardLocation type)
|
||||||
{
|
{
|
||||||
|
// folders for medium & high integrity processes
|
||||||
static const GUID folderIds[] = {
|
static const GUID folderIds[] = {
|
||||||
FOLDERID_Desktop, // DesktopLocation
|
FOLDERID_Desktop, // DesktopLocation
|
||||||
FOLDERID_Documents, // DocumentsLocation
|
FOLDERID_Documents, // DocumentsLocation
|
||||||
@ -114,9 +142,34 @@ static GUID writableSpecialFolderId(QStandardPaths::StandardLocation type)
|
|||||||
FOLDERID_RoamingAppData,// AppDataLocation ("Roaming" path)
|
FOLDERID_RoamingAppData,// AppDataLocation ("Roaming" path)
|
||||||
FOLDERID_LocalAppData, // AppConfigLocation ("Local" path)
|
FOLDERID_LocalAppData, // AppConfigLocation ("Local" path)
|
||||||
};
|
};
|
||||||
|
|
||||||
Q_STATIC_ASSERT(sizeof(folderIds) / sizeof(folderIds[0]) == size_t(QStandardPaths::AppConfigLocation + 1));
|
Q_STATIC_ASSERT(sizeof(folderIds) / sizeof(folderIds[0]) == size_t(QStandardPaths::AppConfigLocation + 1));
|
||||||
return size_t(type) < sizeof(folderIds) / sizeof(folderIds[0]) ? folderIds[type] : GUID();
|
|
||||||
|
// folders for low integrity processes
|
||||||
|
static const GUID folderIds_li[] = {
|
||||||
|
FOLDERID_Desktop, // DesktopLocation
|
||||||
|
FOLDERID_Documents, // DocumentsLocation
|
||||||
|
FOLDERID_Fonts, // FontsLocation
|
||||||
|
FOLDERID_Programs, // ApplicationsLocation
|
||||||
|
FOLDERID_Music, // MusicLocation
|
||||||
|
FOLDERID_Videos, // MoviesLocation
|
||||||
|
FOLDERID_Pictures, // PicturesLocation
|
||||||
|
GUID(), GUID(), // TempLocation/HomeLocation
|
||||||
|
FOLDERID_LocalAppDataLow,// AppLocalDataLocation ("Local" path), AppLocalDataLocation = DataLocation
|
||||||
|
GUID(), // CacheLocation
|
||||||
|
FOLDERID_LocalAppDataLow,// GenericDataLocation ("Local" path)
|
||||||
|
GUID(), // RuntimeLocation
|
||||||
|
FOLDERID_LocalAppDataLow,// ConfigLocation ("Local" path)
|
||||||
|
GUID(), GUID(), // DownloadLocation/GenericCacheLocation
|
||||||
|
FOLDERID_LocalAppDataLow,// GenericConfigLocation ("Local" path)
|
||||||
|
FOLDERID_RoamingAppData, // AppDataLocation ("Roaming" path)
|
||||||
|
FOLDERID_LocalAppDataLow,// AppConfigLocation ("Local" path)
|
||||||
|
};
|
||||||
|
Q_STATIC_ASSERT(sizeof(folderIds_li) == sizeof(folderIds));
|
||||||
|
|
||||||
|
static bool low_integrity_process = isProcessLowIntegrity();
|
||||||
|
if (size_t(type) < sizeof(folderIds) / sizeof(folderIds[0]))
|
||||||
|
return low_integrity_process ? folderIds_li[type] : folderIds[type];
|
||||||
|
return GUID();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convenience for SHGetKnownFolderPath().
|
// Convenience for SHGetKnownFolderPath().
|
||||||
|
@ -2768,7 +2768,7 @@ void QSortFilterProxyModel::setFilterRole(int role)
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\since 5.15
|
\since 5.15
|
||||||
\fn void QSortFilterProxyModel::recursiveFilteringEnabledChanged(int recursiveFilteringEnabled)
|
\fn void QSortFilterProxyModel::recursiveFilteringEnabledChanged(bool recursiveFilteringEnabled)
|
||||||
\brief This signal is emitted when the recursive filter setting is changed
|
\brief This signal is emitted when the recursive filter setting is changed
|
||||||
to \a recursiveFilteringEnabled.
|
to \a recursiveFilteringEnabled.
|
||||||
*/
|
*/
|
||||||
|
@ -261,7 +261,7 @@ public:
|
|||||||
bool isScriptable(const QObject *obj = nullptr) const;
|
bool isScriptable(const QObject *obj = nullptr) const;
|
||||||
bool isStored(const QObject *obj = nullptr) const;
|
bool isStored(const QObject *obj = nullptr) const;
|
||||||
#if QT_DEPRECATED_SINCE(5, 15)
|
#if QT_DEPRECATED_SINCE(5, 15)
|
||||||
QT_DEPRECATED bool isEditable(const QObject *obj = nullptr) const;
|
QT_DEPRECATED_VERSION_5_15 bool isEditable(const QObject *obj = nullptr) const;
|
||||||
#endif
|
#endif
|
||||||
bool isUser(const QObject *obj = nullptr) const;
|
bool isUser(const QObject *obj = nullptr) const;
|
||||||
bool isConstant() const;
|
bool isConstant() const;
|
||||||
|
@ -4376,16 +4376,15 @@ QDebug operator<<(QDebug dbg, const QObject *o)
|
|||||||
that values of a given enum can be used as flags and combined using the
|
that values of a given enum can be used as flags and combined using the
|
||||||
bitwise OR operator. For namespaces use \l Q_FLAG_NS() instead.
|
bitwise OR operator. For namespaces use \l Q_FLAG_NS() instead.
|
||||||
|
|
||||||
The macro must be placed after the enum declaration.
|
The macro must be placed after the enum declaration. The declaration of
|
||||||
|
the flags type is done using the \l Q_DECLARE_FLAGS() macro.
|
||||||
|
|
||||||
For example, in QLibrary, the \l{QLibrary::LoadHints}{LoadHints} flag is
|
For example, in QItemSelectionModel, the
|
||||||
|
\l{QItemSelectionModel::SelectionFlags}{SelectionFlags} flag is
|
||||||
declared in the following way:
|
declared in the following way:
|
||||||
|
|
||||||
\snippet code/src_corelib_kernel_qobject.cpp 39
|
\snippet code/src_corelib_kernel_qobject.cpp 39
|
||||||
|
|
||||||
The declaration of the flags themselves is performed in the public section
|
|
||||||
of the QLibrary class itself, using the \l Q_DECLARE_FLAGS() macro.
|
|
||||||
|
|
||||||
\note The Q_FLAG macro takes care of registering individual flag values
|
\note The Q_FLAG macro takes care of registering individual flag values
|
||||||
with the meta-object system, so it is unnecessary to use Q_ENUM()
|
with the meta-object system, so it is unnecessary to use Q_ENUM()
|
||||||
in addition to this macro.
|
in addition to this macro.
|
||||||
|
@ -37,23 +37,32 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#define BUILDING_QSOCKETNOTIFIER
|
||||||
#include "qsocketnotifier.h"
|
#include "qsocketnotifier.h"
|
||||||
|
#undef BUILDING_QSOCKETNOTIFIER
|
||||||
|
|
||||||
#include "qplatformdefs.h"
|
#include "qplatformdefs.h"
|
||||||
|
|
||||||
#include "qabstracteventdispatcher.h"
|
#include "qabstracteventdispatcher.h"
|
||||||
#include "qcoreapplication.h"
|
#include "qcoreapplication.h"
|
||||||
|
|
||||||
|
#include "qmetatype.h"
|
||||||
|
|
||||||
#include "qobject_p.h"
|
#include "qobject_p.h"
|
||||||
#include <private/qthread_p.h>
|
#include <private/qthread_p.h>
|
||||||
|
|
||||||
|
#include <QtCore/QLoggingCategory>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
Q_DECLARE_LOGGING_CATEGORY(lcSocketNotifierDeprecation)
|
||||||
|
Q_LOGGING_CATEGORY(lcSocketNotifierDeprecation, "qt.core.socketnotifier_deprecation");
|
||||||
|
|
||||||
class QSocketNotifierPrivate : public QObjectPrivate
|
class QSocketNotifierPrivate : public QObjectPrivate
|
||||||
{
|
{
|
||||||
Q_DECLARE_PUBLIC(QSocketNotifier)
|
Q_DECLARE_PUBLIC(QSocketNotifier)
|
||||||
public:
|
public:
|
||||||
qintptr sockfd;
|
QSocketDescriptor sockfd;
|
||||||
QSocketNotifier::Type sntype;
|
QSocketNotifier::Type sntype;
|
||||||
bool snenabled;
|
bool snenabled;
|
||||||
};
|
};
|
||||||
@ -143,13 +152,17 @@ QSocketNotifier::QSocketNotifier(qintptr socket, Type type, QObject *parent)
|
|||||||
: QObject(*new QSocketNotifierPrivate, parent)
|
: QObject(*new QSocketNotifierPrivate, parent)
|
||||||
{
|
{
|
||||||
Q_D(QSocketNotifier);
|
Q_D(QSocketNotifier);
|
||||||
|
|
||||||
|
qRegisterMetaType<QSocketDescriptor>();
|
||||||
|
qRegisterMetaType<QSocketNotifier::Type>();
|
||||||
|
|
||||||
d->sockfd = socket;
|
d->sockfd = socket;
|
||||||
d->sntype = type;
|
d->sntype = type;
|
||||||
d->snenabled = true;
|
d->snenabled = true;
|
||||||
|
|
||||||
auto thisThreadData = d->threadData.loadRelaxed();
|
auto thisThreadData = d->threadData.loadRelaxed();
|
||||||
|
|
||||||
if (socket < 0)
|
if (!d->sockfd.isValid())
|
||||||
qWarning("QSocketNotifier: Invalid socket specified");
|
qWarning("QSocketNotifier: Invalid socket specified");
|
||||||
else if (!thisThreadData->hasEventDispatcher())
|
else if (!thisThreadData->hasEventDispatcher())
|
||||||
qWarning("QSocketNotifier: Can only be used with threads started with QThread");
|
qWarning("QSocketNotifier: Can only be used with threads started with QThread");
|
||||||
@ -169,6 +182,11 @@ QSocketNotifier::~QSocketNotifier()
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn void QSocketNotifier::activated(int socket)
|
\fn void QSocketNotifier::activated(int socket)
|
||||||
|
\obsolete To avoid unintended truncation of the descriptor, use
|
||||||
|
the QSocketDescriptor overload of this function. If you need
|
||||||
|
compatibility with versions older than 5.15 you need to change
|
||||||
|
the slot to accept qintptr if it currently accepts an int, and
|
||||||
|
then connect using Functor-Based Connection.
|
||||||
|
|
||||||
This signal is emitted whenever the socket notifier is enabled and
|
This signal is emitted whenever the socket notifier is enabled and
|
||||||
a socket event corresponding to its \l {Type}{type} occurs.
|
a socket event corresponding to its \l {Type}{type} occurs.
|
||||||
@ -178,6 +196,18 @@ QSocketNotifier::~QSocketNotifier()
|
|||||||
\sa type(), socket()
|
\sa type(), socket()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn void QSocketNotifier::activated(QSocketDescriptor socket, QSocketNotifier::Type type)
|
||||||
|
\since 5.15
|
||||||
|
|
||||||
|
This signal is emitted whenever the socket notifier is enabled and
|
||||||
|
a socket event corresponding to its \a type occurs.
|
||||||
|
|
||||||
|
The socket identifier is passed in the \a socket parameter.
|
||||||
|
|
||||||
|
\sa type(), socket()
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Returns the socket identifier specified to the constructor.
|
Returns the socket identifier specified to the constructor.
|
||||||
@ -187,7 +217,7 @@ QSocketNotifier::~QSocketNotifier()
|
|||||||
qintptr QSocketNotifier::socket() const
|
qintptr QSocketNotifier::socket() const
|
||||||
{
|
{
|
||||||
Q_D(const QSocketNotifier);
|
Q_D(const QSocketNotifier);
|
||||||
return d->sockfd;
|
return qintptr(d->sockfd);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -230,7 +260,7 @@ bool QSocketNotifier::isEnabled() const
|
|||||||
void QSocketNotifier::setEnabled(bool enable)
|
void QSocketNotifier::setEnabled(bool enable)
|
||||||
{
|
{
|
||||||
Q_D(QSocketNotifier);
|
Q_D(QSocketNotifier);
|
||||||
if (d->sockfd < 0)
|
if (!d->sockfd.isValid())
|
||||||
return;
|
return;
|
||||||
if (d->snenabled == enable) // no change
|
if (d->snenabled == enable) // no change
|
||||||
return;
|
return;
|
||||||
@ -268,12 +298,61 @@ bool QSocketNotifier::event(QEvent *e)
|
|||||||
}
|
}
|
||||||
QObject::event(e); // will activate filters
|
QObject::event(e); // will activate filters
|
||||||
if ((e->type() == QEvent::SockAct) || (e->type() == QEvent::SockClose)) {
|
if ((e->type() == QEvent::SockAct) || (e->type() == QEvent::SockClose)) {
|
||||||
emit activated(d->sockfd, QPrivateSignal());
|
QPointer<QSocketNotifier> alive(this);
|
||||||
|
emit activated(d->sockfd, d->sntype, QPrivateSignal());
|
||||||
|
// ### Qt7: Remove emission if the activated(int) signal is removed
|
||||||
|
if (alive)
|
||||||
|
emit activated(int(qintptr(d->sockfd)), QPrivateSignal());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\class QSocketDescriptor
|
||||||
|
\inmodule QtCore
|
||||||
|
\brief A class which holds a native socket descriptor.
|
||||||
|
\internal
|
||||||
|
|
||||||
|
\ingroup network
|
||||||
|
\ingroup io
|
||||||
|
|
||||||
|
\since 5.15
|
||||||
|
|
||||||
|
QSocketDescriptor makes it easier to handle native socket
|
||||||
|
descriptors in cross-platform code.
|
||||||
|
|
||||||
|
On Windows it holds a \c {Qt::HANDLE} and on Unix it holds an \c int.
|
||||||
|
The class will implicitly convert between the class and the
|
||||||
|
native descriptor type.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn QSocketDescriptor::QSocketDescriptor(DescriptorType descriptor)
|
||||||
|
\internal
|
||||||
|
|
||||||
|
Construct a QSocketDescriptor from a native socket \a descriptor.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn QSocketDescriptor::QSocketDescriptor(qintptr descriptor)
|
||||||
|
\internal
|
||||||
|
|
||||||
|
Construct a QSocketDescriptor from a native socket \a descriptor.
|
||||||
|
|
||||||
|
\note This constructor is only available on Windows.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn Qt::HANDLE QSocketDescriptor::winHandle() const noexcept
|
||||||
|
\internal
|
||||||
|
|
||||||
|
Returns the internal handle.
|
||||||
|
|
||||||
|
\note This function is only available on Windows.
|
||||||
|
*/
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#include "moc_qsocketnotifier.cpp"
|
#include "moc_qsocketnotifier.cpp"
|
||||||
|
@ -44,6 +44,7 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
class QSocketDescriptor;
|
||||||
class QSocketNotifierPrivate;
|
class QSocketNotifierPrivate;
|
||||||
class Q_CORE_EXPORT QSocketNotifier : public QObject
|
class Q_CORE_EXPORT QSocketNotifier : public QObject
|
||||||
{
|
{
|
||||||
@ -65,7 +66,23 @@ public Q_SLOTS:
|
|||||||
void setEnabled(bool);
|
void setEnabled(bool);
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
|
#if defined(Q_MOC_RUN)
|
||||||
|
// Add default arguments during Q_MOC_RUN which makes moc generate "signals" which takes less
|
||||||
|
// parameters, but we won't actually allow emitting without all 3. This lets users use the
|
||||||
|
// string-based connect without specifying QSocketNotifier::Type as one of the parameters.
|
||||||
|
void activated(QSocketDescriptor socket, QSocketNotifier::Type activationEvent = Read,
|
||||||
|
QPrivateSignal = {});
|
||||||
|
#else
|
||||||
|
void activated(QSocketDescriptor socket, QSocketNotifier::Type activationEvent, QPrivateSignal);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ### Qt7: consider removing it.
|
||||||
|
// The old signal is compiled internally, but hidden outside of this class.
|
||||||
|
// This means the PMF-based connect(..) will automatically, on recompile, pick up the new
|
||||||
|
// version while the old-style connect(..) can query the metaobject system for this version.
|
||||||
|
#if defined(Q_MOC_RUN) || defined(BUILDING_QSOCKETNOTIFIER) || defined(Q_QDOC)
|
||||||
void activated(int socket, QPrivateSignal);
|
void activated(int socket, QPrivateSignal);
|
||||||
|
#endif
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool event(QEvent *) override;
|
bool event(QEvent *) override;
|
||||||
@ -74,6 +91,50 @@ private:
|
|||||||
Q_DISABLE_COPY(QSocketNotifier)
|
Q_DISABLE_COPY(QSocketNotifier)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class QSocketDescriptor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
#if defined(Q_OS_WIN) || defined(Q_QDOC)
|
||||||
|
using DescriptorType = Qt::HANDLE;
|
||||||
|
#define Q_DECL_CONSTEXPR_NOT_WIN
|
||||||
|
#else
|
||||||
|
using DescriptorType = int;
|
||||||
|
#define Q_DECL_CONSTEXPR_NOT_WIN Q_DECL_CONSTEXPR
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* implicit */ Q_DECL_CONSTEXPR_NOT_WIN
|
||||||
|
QSocketDescriptor(DescriptorType descriptor = DescriptorType(-1)) noexcept : sockfd(descriptor)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(Q_OS_WIN) || defined(Q_QDOC)
|
||||||
|
/* implicit */ QSocketDescriptor(qintptr desc) noexcept : sockfd(DescriptorType(desc)) {}
|
||||||
|
operator qintptr() const noexcept { return qintptr(sockfd); }
|
||||||
|
Q_DECL_CONSTEXPR Qt::HANDLE winHandle() const noexcept { return sockfd; }
|
||||||
|
#endif
|
||||||
|
Q_DECL_CONSTEXPR operator DescriptorType() const noexcept { return sockfd; }
|
||||||
|
|
||||||
|
Q_DECL_CONSTEXPR_NOT_WIN bool isValid() const noexcept { return *this != QSocketDescriptor(); }
|
||||||
|
|
||||||
|
friend Q_DECL_CONSTEXPR_NOT_WIN bool operator==(QSocketDescriptor lhs,
|
||||||
|
QSocketDescriptor rhs) noexcept
|
||||||
|
{
|
||||||
|
return lhs.sockfd == rhs.sockfd;
|
||||||
|
}
|
||||||
|
friend Q_DECL_CONSTEXPR_NOT_WIN bool operator!=(QSocketDescriptor lhs,
|
||||||
|
QSocketDescriptor rhs) noexcept
|
||||||
|
{
|
||||||
|
return lhs.sockfd != rhs.sockfd;
|
||||||
|
}
|
||||||
|
|
||||||
|
#undef Q_DECL_CONSTEXPR_NOT_WIN
|
||||||
|
|
||||||
|
private:
|
||||||
|
DescriptorType sockfd;
|
||||||
|
};
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
Q_DECLARE_METATYPE(QSocketNotifier::Type)
|
||||||
|
Q_DECLARE_METATYPE(QSocketDescriptor)
|
||||||
|
|
||||||
#endif // QSOCKETNOTIFIER_H
|
#endif // QSOCKETNOTIFIER_H
|
||||||
|
@ -188,9 +188,8 @@ public:
|
|||||||
QCborValue &operator=(const QCborValue &other);
|
QCborValue &operator=(const QCborValue &other);
|
||||||
QCborValue &operator=(QCborValue &&other) noexcept
|
QCborValue &operator=(QCborValue &&other) noexcept
|
||||||
{
|
{
|
||||||
QCborValue tmp;
|
QCborValue tmp(std::move(other));
|
||||||
qSwap(*this, tmp);
|
swap(tmp);
|
||||||
qSwap(other, *this);
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2019 The Qt Company Ltd.
|
** Copyright (C) 2020 The Qt Company Ltd.
|
||||||
** Copyright (C) 2014 Drew Parsons <dparsons@emerall.com>
|
** Copyright (C) 2014 Drew Parsons <dparsons@emerall.com>
|
||||||
** Contact: https://www.qt.io/licensing/
|
** Contact: https://www.qt.io/licensing/
|
||||||
**
|
**
|
||||||
@ -78,6 +78,26 @@ QAndroidTimeZonePrivate::~QAndroidTimeZonePrivate()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static QJNIObjectPrivate getDisplayName(QJNIObjectPrivate zone, jint style, jboolean dst,
|
||||||
|
const QLocale &locale)
|
||||||
|
{
|
||||||
|
QJNIObjectPrivate jlanguage
|
||||||
|
= QJNIObjectPrivate::fromString(QLocale::languageToString(locale.language()));
|
||||||
|
QJNIObjectPrivate jcountry
|
||||||
|
= QJNIObjectPrivate::fromString(QLocale::countryToString(locale.country()));
|
||||||
|
QJNIObjectPrivate
|
||||||
|
jvariant = QJNIObjectPrivate::fromString(QLocale::scriptToString(locale.script()));
|
||||||
|
QJNIObjectPrivate jlocale("java.util.Locale",
|
||||||
|
"(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V",
|
||||||
|
static_cast<jstring>(jlanguage.object()),
|
||||||
|
static_cast<jstring>(jcountry.object()),
|
||||||
|
static_cast<jstring>(jvariant.object()));
|
||||||
|
|
||||||
|
return zone.callObjectMethod("getDisplayName",
|
||||||
|
"(ZILjava/util/Locale;)Ljava/lang/String;",
|
||||||
|
dst, style, jlocale.object());
|
||||||
|
}
|
||||||
|
|
||||||
void QAndroidTimeZonePrivate::init(const QByteArray &ianaId)
|
void QAndroidTimeZonePrivate::init(const QByteArray &ianaId)
|
||||||
{
|
{
|
||||||
const QString iana = QString::fromUtf8(ianaId);
|
const QString iana = QString::fromUtf8(ianaId);
|
||||||
@ -99,10 +119,13 @@ void QAndroidTimeZonePrivate::init(const QByteArray &ianaId)
|
|||||||
// the zone object we got and ignore the zone if not.
|
// the zone object we got and ignore the zone if not.
|
||||||
// Try checking ianaId against getID(), getDisplayName():
|
// Try checking ianaId against getID(), getDisplayName():
|
||||||
m_id = match(androidTimeZone.callObjectMethod("getID", "()Ljava/lang/String;"));
|
m_id = match(androidTimeZone.callObjectMethod("getID", "()Ljava/lang/String;"));
|
||||||
for (int style = 1; m_id.isEmpty() && style-- > 0;) {
|
for (int style = 1; m_id.isEmpty() && style >= 0; --style) {
|
||||||
for (int dst = 1; m_id.isEmpty() && dst-- > 0;) {
|
for (int dst = 1; m_id.isEmpty() && dst >= 0; --dst) {
|
||||||
m_id = match(androidTimeZone.callObjectMethod(
|
for (int pick = 2; m_id.isEmpty() && pick >= 0; --pick) {
|
||||||
"getDisplayName", "(ZI)Ljava/lang/String;", bool(dst), style));
|
QLocale locale = (pick == 0 ? QLocale::system()
|
||||||
|
: pick == 1 ? QLocale() : QLocale::c());
|
||||||
|
m_id = match(getDisplayName(androidTimeZone, style, jboolean(dst), locale));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -124,14 +147,7 @@ QString QAndroidTimeZonePrivate::displayName(QTimeZone::TimeType timeType, QTime
|
|||||||
// treat all NameTypes as java TimeZone style LONG (value 1), except of course QTimeZone::ShortName which is style SHORT (value 0);
|
// treat all NameTypes as java TimeZone style LONG (value 1), except of course QTimeZone::ShortName which is style SHORT (value 0);
|
||||||
jint style = (nameType == QTimeZone::ShortName ? 0 : 1);
|
jint style = (nameType == QTimeZone::ShortName ? 0 : 1);
|
||||||
|
|
||||||
QJNIObjectPrivate jlanguage = QJNIObjectPrivate::fromString(QLocale::languageToString(locale.language()));
|
name = getDisplayName(androidTimeZone, style, daylightTime, locale).toString();
|
||||||
QJNIObjectPrivate jcountry = QJNIObjectPrivate::fromString(QLocale::countryToString(locale.country()));
|
|
||||||
QJNIObjectPrivate jvariant = QJNIObjectPrivate::fromString(QLocale::scriptToString(locale.script()));
|
|
||||||
QJNIObjectPrivate jlocale("java.util.Locale", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", static_cast<jstring>(jlanguage.object()), static_cast<jstring>(jcountry.object()), static_cast<jstring>(jvariant.object()));
|
|
||||||
|
|
||||||
QJNIObjectPrivate jname = androidTimeZone.callObjectMethod("getDisplayName", "(ZILjava/util/Locale;)Ljava/lang/String;", daylightTime, style, jlocale.object());
|
|
||||||
|
|
||||||
name = jname.toString();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return name;
|
return name;
|
||||||
|
@ -370,11 +370,18 @@ QDataStream &operator>>(QDataStream &stream, QLine &line)
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\enum QLineF::IntersectType
|
\enum QLineF::IntersectType
|
||||||
\obsolete Use QLineF::IntersectionType instead
|
\obsolete Use QLineF::IntersectionType instead.
|
||||||
|
|
||||||
|
\value NoIntersection
|
||||||
|
Lines do not intersect.
|
||||||
|
\value UnboundedIntersection
|
||||||
|
Lines intersect, but not within the range defined by their lengths.
|
||||||
|
\value BoundedIntersection
|
||||||
|
Lnes intersect within the range defined by their lengths.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\enum QLineF::IntersectionType
|
\typealias QLineF::IntersectionType
|
||||||
|
|
||||||
Describes the intersection between two lines.
|
Describes the intersection between two lines.
|
||||||
|
|
||||||
|
@ -173,7 +173,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
// typedefs
|
// typedefs
|
||||||
typedef QMultiHash<int, Watcher> WatcherHash;
|
typedef QMultiHash<qintptr, Watcher> WatcherHash;
|
||||||
typedef QHash<int, DBusTimeout *> TimeoutHash;
|
typedef QHash<int, DBusTimeout *> TimeoutHash;
|
||||||
typedef QVector<QDBusMessage> PendingMessageList;
|
typedef QVector<QDBusMessage> PendingMessageList;
|
||||||
|
|
||||||
@ -283,8 +283,8 @@ public slots:
|
|||||||
// public slots
|
// public slots
|
||||||
void setDispatchEnabled(bool enable);
|
void setDispatchEnabled(bool enable);
|
||||||
void doDispatch();
|
void doDispatch();
|
||||||
void socketRead(int);
|
void socketRead(qintptr);
|
||||||
void socketWrite(int);
|
void socketWrite(qintptr);
|
||||||
void objectDestroyed(QObject *o);
|
void objectDestroyed(QObject *o);
|
||||||
void relaySignal(QObject *obj, const QMetaObject *, int signalId, const QVariantList &args);
|
void relaySignal(QObject *obj, const QMetaObject *, int signalId, const QVariantList &args);
|
||||||
bool addSignalHook(const QString &key, const SignalHook &hook);
|
bool addSignalHook(const QString &key, const SignalHook &hook);
|
||||||
|
@ -1205,7 +1205,7 @@ void QDBusConnectionPrivate::doDispatch()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QDBusConnectionPrivate::socketRead(int fd)
|
void QDBusConnectionPrivate::socketRead(qintptr fd)
|
||||||
{
|
{
|
||||||
WatcherHash::ConstIterator it = watchers.constFind(fd);
|
WatcherHash::ConstIterator it = watchers.constFind(fd);
|
||||||
while (it != watchers.constEnd() && it.key() == fd) {
|
while (it != watchers.constEnd() && it.key() == fd) {
|
||||||
@ -1219,7 +1219,7 @@ void QDBusConnectionPrivate::socketRead(int fd)
|
|||||||
doDispatch();
|
doDispatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QDBusConnectionPrivate::socketWrite(int fd)
|
void QDBusConnectionPrivate::socketWrite(qintptr fd)
|
||||||
{
|
{
|
||||||
WatcherHash::ConstIterator it = watchers.constFind(fd);
|
WatcherHash::ConstIterator it = watchers.constFind(fd);
|
||||||
while (it != watchers.constEnd() && it.key() == fd) {
|
while (it != watchers.constEnd() && it.key() == fd) {
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
#include "qcolor.h"
|
#include "qcolor.h"
|
||||||
#include "qrgba64_p.h"
|
#include "qrgba64_p.h"
|
||||||
|
|
||||||
#if QT_CONFIG(thread)
|
#if QT_CONFIG(thread) && !defined(Q_OS_WASM)
|
||||||
#include "qsemaphore.h"
|
#include "qsemaphore.h"
|
||||||
#include "qthreadpool.h"
|
#include "qthreadpool.h"
|
||||||
#endif
|
#endif
|
||||||
@ -301,6 +301,30 @@ void qt_qimageScaleAARGBA_down_xy_neon(QImageScaleInfo *isi, unsigned int *dest,
|
|||||||
int dw, int dh, int dow, int sow);
|
int dw, int dh, int dow, int sow);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
static inline void multithread_pixels_function(QImageScaleInfo *isi, int dh, const T &scaleSection)
|
||||||
|
{
|
||||||
|
#if QT_CONFIG(thread) && !defined(Q_OS_WASM)
|
||||||
|
int segments = (qsizetype(isi->sh) * isi->sw) / (1<<16);
|
||||||
|
segments = std::min(segments, dh);
|
||||||
|
if (segments > 1) {
|
||||||
|
QSemaphore semaphore;
|
||||||
|
int y = 0;
|
||||||
|
for (int i = 0; i < segments; ++i) {
|
||||||
|
int yn = (dh - y) / (segments - i);
|
||||||
|
QThreadPool::globalInstance()->start([&, y, yn]() {
|
||||||
|
scaleSection(y, y + yn);
|
||||||
|
semaphore.release(1);
|
||||||
|
});
|
||||||
|
y += yn;
|
||||||
|
}
|
||||||
|
semaphore.acquire(segments);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
scaleSection(0, dh);
|
||||||
|
}
|
||||||
|
|
||||||
static void qt_qimageScaleAARGBA_up_xy(QImageScaleInfo *isi, unsigned int *dest,
|
static void qt_qimageScaleAARGBA_up_xy(QImageScaleInfo *isi, unsigned int *dest,
|
||||||
int dw, int dh, int dow, int sow)
|
int dw, int dh, int dow, int sow)
|
||||||
{
|
{
|
||||||
@ -339,25 +363,7 @@ static void qt_qimageScaleAARGBA_up_xy(QImageScaleInfo *isi, unsigned int *dest,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#if QT_CONFIG(thread)
|
multithread_pixels_function(isi, dh, scaleSection);
|
||||||
int segments = (qsizetype(isi->sh) * isi->sw) / (1<<16);
|
|
||||||
segments = std::min(segments, dh);
|
|
||||||
if (segments > 1) {
|
|
||||||
QSemaphore semaphore;
|
|
||||||
int y = 0;
|
|
||||||
for (int i = 0; i < segments; ++i) {
|
|
||||||
int yn = (dh - y) / (segments - i);
|
|
||||||
QThreadPool::globalInstance()->start([&, y, yn]() {
|
|
||||||
scaleSection(y, y + yn);
|
|
||||||
semaphore.release(1);
|
|
||||||
});
|
|
||||||
y += yn;
|
|
||||||
}
|
|
||||||
semaphore.acquire(segments);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
scaleSection(0, dh);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* scale by area sampling - with alpha */
|
/* scale by area sampling - with alpha */
|
||||||
@ -468,25 +474,7 @@ static void qt_qimageScaleAARGBA_up_x_down_y(QImageScaleInfo *isi, unsigned int
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#if QT_CONFIG(thread)
|
multithread_pixels_function(isi, dh, scaleSection);
|
||||||
int segments = (qsizetype(isi->sh) * isi->sw) / (1<<16);
|
|
||||||
segments = std::min(segments, dh);
|
|
||||||
if (segments > 1) {
|
|
||||||
QSemaphore semaphore;
|
|
||||||
int y = 0;
|
|
||||||
for (int i = 0; i < segments; ++i) {
|
|
||||||
int yn = (dh - y) / (segments - i);
|
|
||||||
QThreadPool::globalInstance()->start([&, y, yn]() {
|
|
||||||
scaleSection(y, y + yn);
|
|
||||||
semaphore.release(1);
|
|
||||||
});
|
|
||||||
y += yn;
|
|
||||||
}
|
|
||||||
semaphore.acquire(segments);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
scaleSection(0, dh);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void qt_qimageScaleAARGBA_down_x_up_y(QImageScaleInfo *isi, unsigned int *dest,
|
static void qt_qimageScaleAARGBA_down_x_up_y(QImageScaleInfo *isi, unsigned int *dest,
|
||||||
@ -528,25 +516,7 @@ static void qt_qimageScaleAARGBA_down_x_up_y(QImageScaleInfo *isi, unsigned int
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#if QT_CONFIG(thread)
|
multithread_pixels_function(isi, dh, scaleSection);
|
||||||
int segments = (qsizetype(isi->sh) * isi->sw) / (1<<16);
|
|
||||||
segments = std::min(segments, dh);
|
|
||||||
if (segments > 1) {
|
|
||||||
QSemaphore semaphore;
|
|
||||||
int y = 0;
|
|
||||||
for (int i = 0; i < segments; ++i) {
|
|
||||||
int yn = (dh - y) / (segments - i);
|
|
||||||
QThreadPool::globalInstance()->start([&, y, yn]() {
|
|
||||||
scaleSection(y, y + yn);
|
|
||||||
semaphore.release(1);
|
|
||||||
});
|
|
||||||
y += yn;
|
|
||||||
}
|
|
||||||
semaphore.acquire(segments);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
scaleSection(0, dh);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void qt_qimageScaleAARGBA_down_xy(QImageScaleInfo *isi, unsigned int *dest,
|
static void qt_qimageScaleAARGBA_down_xy(QImageScaleInfo *isi, unsigned int *dest,
|
||||||
@ -598,25 +568,7 @@ static void qt_qimageScaleAARGBA_down_xy(QImageScaleInfo *isi, unsigned int *des
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#if QT_CONFIG(thread)
|
multithread_pixels_function(isi, dh, scaleSection);
|
||||||
int segments = (qsizetype(isi->sh) * isi->sw) / (1<<16);
|
|
||||||
segments = std::min(segments, dh);
|
|
||||||
if (segments > 1) {
|
|
||||||
QSemaphore semaphore;
|
|
||||||
int y = 0;
|
|
||||||
for (int i = 0; i < segments; ++i) {
|
|
||||||
int yn = (dh - y) / (segments - i);
|
|
||||||
QThreadPool::globalInstance()->start([&, y, yn]() {
|
|
||||||
scaleSection(y, y + yn);
|
|
||||||
semaphore.release(1);
|
|
||||||
});
|
|
||||||
y += yn;
|
|
||||||
}
|
|
||||||
semaphore.acquire(segments);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
scaleSection(0, dh);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if QT_CONFIG(raster_64bit)
|
#if QT_CONFIG(raster_64bit)
|
||||||
@ -665,25 +617,7 @@ static void qt_qimageScaleRgba64_up_xy(QImageScaleInfo *isi, QRgba64 *dest,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#if QT_CONFIG(thread)
|
multithread_pixels_function(isi, dh, scaleSection);
|
||||||
int segments = (qsizetype(isi->sh) * isi->sw) / (1<<16);
|
|
||||||
segments = std::min(segments, dh);
|
|
||||||
if (segments > 1) {
|
|
||||||
QSemaphore semaphore;
|
|
||||||
int y = 0;
|
|
||||||
for (int i = 0; i < segments; ++i) {
|
|
||||||
int yn = (dh - y) / (segments - i);
|
|
||||||
QThreadPool::globalInstance()->start([&, y, yn]() {
|
|
||||||
scaleSection(y, y + yn);
|
|
||||||
semaphore.release(1);
|
|
||||||
});
|
|
||||||
y += yn;
|
|
||||||
}
|
|
||||||
semaphore.acquire(segments);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
scaleSection(0, dh);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void qt_qimageScaleRgba64(QImageScaleInfo *isi, QRgba64 *dest,
|
void qt_qimageScaleRgba64(QImageScaleInfo *isi, QRgba64 *dest,
|
||||||
@ -757,25 +691,7 @@ static void qt_qimageScaleRgba64_up_x_down_y(QImageScaleInfo *isi, QRgba64 *dest
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#if QT_CONFIG(thread)
|
multithread_pixels_function(isi, dh, scaleSection);
|
||||||
int segments = (qsizetype(isi->sh) * isi->sw) / (1<<16);
|
|
||||||
segments = std::min(segments, dh);
|
|
||||||
if (segments > 1) {
|
|
||||||
QSemaphore semaphore;
|
|
||||||
int y = 0;
|
|
||||||
for (int i = 0; i < segments; ++i) {
|
|
||||||
int yn = (dh - y) / (segments - i);
|
|
||||||
QThreadPool::globalInstance()->start([&, y, yn]() {
|
|
||||||
scaleSection(y, y + yn);
|
|
||||||
semaphore.release(1);
|
|
||||||
});
|
|
||||||
y += yn;
|
|
||||||
}
|
|
||||||
semaphore.acquire(segments);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
scaleSection(0, dh);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void qt_qimageScaleRgba64_down_x_up_y(QImageScaleInfo *isi, QRgba64 *dest,
|
static void qt_qimageScaleRgba64_down_x_up_y(QImageScaleInfo *isi, QRgba64 *dest,
|
||||||
@ -816,25 +732,7 @@ static void qt_qimageScaleRgba64_down_x_up_y(QImageScaleInfo *isi, QRgba64 *dest
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#if QT_CONFIG(thread)
|
multithread_pixels_function(isi, dh, scaleSection);
|
||||||
int segments = (qsizetype(isi->sh) * isi->sw) / (1<<16);
|
|
||||||
segments = std::min(segments, dh);
|
|
||||||
if (segments > 1) {
|
|
||||||
QSemaphore semaphore;
|
|
||||||
int y = 0;
|
|
||||||
for (int i = 0; i < segments; ++i) {
|
|
||||||
int yn = (dh - y) / (segments - i);
|
|
||||||
QThreadPool::globalInstance()->start([&, y, yn]() {
|
|
||||||
scaleSection(y, y + yn);
|
|
||||||
semaphore.release(1);
|
|
||||||
});
|
|
||||||
y += yn;
|
|
||||||
}
|
|
||||||
semaphore.acquire(segments);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
scaleSection(0, dh);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void qt_qimageScaleRgba64_down_xy(QImageScaleInfo *isi, QRgba64 *dest,
|
static void qt_qimageScaleRgba64_down_xy(QImageScaleInfo *isi, QRgba64 *dest,
|
||||||
@ -884,25 +782,7 @@ static void qt_qimageScaleRgba64_down_xy(QImageScaleInfo *isi, QRgba64 *dest,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#if QT_CONFIG(thread)
|
multithread_pixels_function(isi, dh, scaleSection);
|
||||||
int segments = (qsizetype(isi->sh) * isi->sw) / (1<<16);
|
|
||||||
segments = std::min(segments, dh);
|
|
||||||
if (segments > 1) {
|
|
||||||
QSemaphore semaphore;
|
|
||||||
int y = 0;
|
|
||||||
for (int i = 0; i < segments; ++i) {
|
|
||||||
int yn = (dh - y) / (segments - i);
|
|
||||||
QThreadPool::globalInstance()->start([&, y, yn]() {
|
|
||||||
scaleSection(y, y + yn);
|
|
||||||
semaphore.release(1);
|
|
||||||
});
|
|
||||||
y += yn;
|
|
||||||
}
|
|
||||||
semaphore.acquire(segments);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
scaleSection(0, dh);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1019,25 +899,7 @@ static void qt_qimageScaleAARGB_up_x_down_y(QImageScaleInfo *isi, unsigned int *
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#if QT_CONFIG(thread)
|
multithread_pixels_function(isi, dh, scaleSection);
|
||||||
int segments = (qsizetype(isi->sh) * isi->sw) / (1<<16);
|
|
||||||
segments = std::min(segments, dh);
|
|
||||||
if (segments > 1) {
|
|
||||||
QSemaphore semaphore;
|
|
||||||
int y = 0;
|
|
||||||
for (int i = 0; i < segments; ++i) {
|
|
||||||
int yn = (dh - y) / (segments - i);
|
|
||||||
QThreadPool::globalInstance()->start([&, y, yn]() {
|
|
||||||
scaleSection(y, y + yn);
|
|
||||||
semaphore.release(1);
|
|
||||||
});
|
|
||||||
y += yn;
|
|
||||||
}
|
|
||||||
semaphore.acquire(segments);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
scaleSection(0, dh);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void qt_qimageScaleAARGB_down_x_up_y(QImageScaleInfo *isi, unsigned int *dest,
|
static void qt_qimageScaleAARGB_down_x_up_y(QImageScaleInfo *isi, unsigned int *dest,
|
||||||
@ -1076,25 +938,7 @@ static void qt_qimageScaleAARGB_down_x_up_y(QImageScaleInfo *isi, unsigned int *
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#if QT_CONFIG(thread)
|
multithread_pixels_function(isi, dh, scaleSection);
|
||||||
int segments = (qsizetype(isi->sh) * isi->sw) / (1<<16);
|
|
||||||
segments = std::min(segments, dh);
|
|
||||||
if (segments > 1) {
|
|
||||||
QSemaphore semaphore;
|
|
||||||
int y = 0;
|
|
||||||
for (int i = 0; i < segments; ++i) {
|
|
||||||
int yn = (dh - y) / (segments - i);
|
|
||||||
QThreadPool::globalInstance()->start([&, y, yn]() {
|
|
||||||
scaleSection(y, y + yn);
|
|
||||||
semaphore.release(1);
|
|
||||||
});
|
|
||||||
y += yn;
|
|
||||||
}
|
|
||||||
semaphore.acquire(segments);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
scaleSection(0, dh);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void qt_qimageScaleAARGB_down_xy(QImageScaleInfo *isi, unsigned int *dest,
|
static void qt_qimageScaleAARGB_down_xy(QImageScaleInfo *isi, unsigned int *dest,
|
||||||
@ -1144,25 +988,7 @@ static void qt_qimageScaleAARGB_down_xy(QImageScaleInfo *isi, unsigned int *dest
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#if QT_CONFIG(thread)
|
multithread_pixels_function(isi, dh, scaleSection);
|
||||||
int segments = (qsizetype(isi->sh) * isi->sw) / (1<<16);
|
|
||||||
segments = std::min(segments, dh);
|
|
||||||
if (segments > 1) {
|
|
||||||
QSemaphore semaphore;
|
|
||||||
int y = 0;
|
|
||||||
for (int i = 0; i < segments; ++i) {
|
|
||||||
int yn = (dh - y) / (segments - i);
|
|
||||||
QThreadPool::globalInstance()->start([&, y, yn]() {
|
|
||||||
scaleSection(y, y + yn);
|
|
||||||
semaphore.release(1);
|
|
||||||
});
|
|
||||||
y += yn;
|
|
||||||
}
|
|
||||||
semaphore.acquire(segments);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
scaleSection(0, dh);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QImage qSmoothScaleImage(const QImage &src, int dw, int dh)
|
QImage qSmoothScaleImage(const QImage &src, int dw, int dh)
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
#include "qimage.h"
|
#include "qimage.h"
|
||||||
#include <private/qsimd_p.h>
|
#include <private/qsimd_p.h>
|
||||||
|
|
||||||
#if QT_CONFIG(thread)
|
#if QT_CONFIG(thread) && !defined(Q_OS_WASM)
|
||||||
#include "qsemaphore.h"
|
#include "qsemaphore.h"
|
||||||
#include "qthreadpool.h"
|
#include "qthreadpool.h"
|
||||||
#endif
|
#endif
|
||||||
@ -52,6 +52,30 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
using namespace QImageScale;
|
using namespace QImageScale;
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
static inline void multithread_pixels_function(QImageScaleInfo *isi, int dh, const T &scaleSection)
|
||||||
|
{
|
||||||
|
#if QT_CONFIG(thread) && !defined(Q_OS_WASM)
|
||||||
|
int segments = (qsizetype(isi->sh) * isi->sw) / (1<<16);
|
||||||
|
segments = std::min(segments, dh);
|
||||||
|
if (segments > 1) {
|
||||||
|
QSemaphore semaphore;
|
||||||
|
int y = 0;
|
||||||
|
for (int i = 0; i < segments; ++i) {
|
||||||
|
int yn = (dh - y) / (segments - i);
|
||||||
|
QThreadPool::globalInstance()->start([&, y, yn]() {
|
||||||
|
scaleSection(y, y + yn);
|
||||||
|
semaphore.release(1);
|
||||||
|
});
|
||||||
|
y += yn;
|
||||||
|
}
|
||||||
|
semaphore.acquire(segments);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
scaleSection(0, dh);
|
||||||
|
}
|
||||||
|
|
||||||
inline static uint32x4_t qt_qimageScaleAARGBA_helper(const unsigned int *pix, int xyap, int Cxy, int step)
|
inline static uint32x4_t qt_qimageScaleAARGBA_helper(const unsigned int *pix, int xyap, int Cxy, int step)
|
||||||
{
|
{
|
||||||
uint32x2_t vpix32 = vmov_n_u32(*pix);
|
uint32x2_t vpix32 = vmov_n_u32(*pix);
|
||||||
@ -110,25 +134,7 @@ void qt_qimageScaleAARGBA_up_x_down_y_neon(QImageScaleInfo *isi, unsigned int *d
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#if QT_CONFIG(thread)
|
multithread_pixels_function(isi, dh, scaleSection);
|
||||||
int segments = (qsizetype(isi->sh) * isi->sw) / (1<<16);
|
|
||||||
segments = std::min(segments, dh);
|
|
||||||
if (segments > 1) {
|
|
||||||
QSemaphore semaphore;
|
|
||||||
int y = 0;
|
|
||||||
for (int i = 0; i < segments; ++i) {
|
|
||||||
int yn = (dh - y) / (segments - i);
|
|
||||||
QThreadPool::globalInstance()->start([&, y, yn]() {
|
|
||||||
scaleSection(y, y + yn);
|
|
||||||
semaphore.release(1);
|
|
||||||
});
|
|
||||||
y += yn;
|
|
||||||
}
|
|
||||||
semaphore.acquire(segments);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
scaleSection(0, dh);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template<bool RGB>
|
template<bool RGB>
|
||||||
@ -170,25 +176,7 @@ void qt_qimageScaleAARGBA_down_x_up_y_neon(QImageScaleInfo *isi, unsigned int *d
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#if QT_CONFIG(thread)
|
multithread_pixels_function(isi, dh, scaleSection);
|
||||||
int segments = (qsizetype(isi->sh) * isi->sw) / (1<<16);
|
|
||||||
segments = std::min(segments, dh);
|
|
||||||
if (segments > 1) {
|
|
||||||
QSemaphore semaphore;
|
|
||||||
int y = 0;
|
|
||||||
for (int i = 0; i < segments; ++i) {
|
|
||||||
int yn = (dh - y) / (segments - i);
|
|
||||||
QThreadPool::globalInstance()->start([&, y, yn]() {
|
|
||||||
scaleSection(y, y + yn);
|
|
||||||
semaphore.release(1);
|
|
||||||
});
|
|
||||||
y += yn;
|
|
||||||
}
|
|
||||||
semaphore.acquire(segments);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
scaleSection(0, dh);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template<bool RGB>
|
template<bool RGB>
|
||||||
@ -239,25 +227,7 @@ void qt_qimageScaleAARGBA_down_xy_neon(QImageScaleInfo *isi, unsigned int *dest,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#if QT_CONFIG(thread)
|
multithread_pixels_function(isi, dh, scaleSection);
|
||||||
int segments = (qsizetype(isi->sh) * isi->sw) / (1<<16);
|
|
||||||
segments = std::min(segments, dh);
|
|
||||||
if (segments > 1) {
|
|
||||||
QSemaphore semaphore;
|
|
||||||
int y = 0;
|
|
||||||
for (int i = 0; i < segments; ++i) {
|
|
||||||
int yn = (dh - y) / (segments - i);
|
|
||||||
QThreadPool::globalInstance()->start([&, y, yn]() {
|
|
||||||
scaleSection(y, y + yn);
|
|
||||||
semaphore.release(1);
|
|
||||||
});
|
|
||||||
y += yn;
|
|
||||||
}
|
|
||||||
semaphore.acquire(segments);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
scaleSection(0, dh);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template void qt_qimageScaleAARGBA_up_x_down_y_neon<false>(QImageScaleInfo *isi, unsigned int *dest,
|
template void qt_qimageScaleAARGBA_up_x_down_y_neon<false>(QImageScaleInfo *isi, unsigned int *dest,
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
#include <private/qdrawhelper_x86_p.h>
|
#include <private/qdrawhelper_x86_p.h>
|
||||||
#include <private/qsimd_p.h>
|
#include <private/qsimd_p.h>
|
||||||
|
|
||||||
#if QT_CONFIG(thread)
|
#if QT_CONFIG(thread) && !defined(Q_OS_WASM)
|
||||||
#include "qsemaphore.h"
|
#include "qsemaphore.h"
|
||||||
#include "qthreadpool.h"
|
#include "qthreadpool.h"
|
||||||
#endif
|
#endif
|
||||||
@ -53,6 +53,30 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
using namespace QImageScale;
|
using namespace QImageScale;
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
static inline void multithread_pixels_function(QImageScaleInfo *isi, int dh, const T &scaleSection)
|
||||||
|
{
|
||||||
|
#if QT_CONFIG(thread) && !defined(Q_OS_WASM)
|
||||||
|
int segments = (qsizetype(isi->sh) * isi->sw) / (1<<16);
|
||||||
|
segments = std::min(segments, dh);
|
||||||
|
if (segments > 1) {
|
||||||
|
QSemaphore semaphore;
|
||||||
|
int y = 0;
|
||||||
|
for (int i = 0; i < segments; ++i) {
|
||||||
|
int yn = (dh - y) / (segments - i);
|
||||||
|
QThreadPool::globalInstance()->start([&, y, yn]() {
|
||||||
|
scaleSection(y, y + yn);
|
||||||
|
semaphore.release(1);
|
||||||
|
});
|
||||||
|
y += yn;
|
||||||
|
}
|
||||||
|
semaphore.acquire(segments);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
scaleSection(0, dh);
|
||||||
|
}
|
||||||
|
|
||||||
inline static __m128i Q_DECL_VECTORCALL
|
inline static __m128i Q_DECL_VECTORCALL
|
||||||
qt_qimageScaleAARGBA_helper(const unsigned int *pix, int xyap, int Cxy, int step, const __m128i vxyap, const __m128i vCxy)
|
qt_qimageScaleAARGBA_helper(const unsigned int *pix, int xyap, int Cxy, int step, const __m128i vxyap, const __m128i vCxy)
|
||||||
{
|
{
|
||||||
@ -115,25 +139,7 @@ void qt_qimageScaleAARGBA_up_x_down_y_sse4(QImageScaleInfo *isi, unsigned int *d
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#if QT_CONFIG(thread)
|
multithread_pixels_function(isi, dh, scaleSection);
|
||||||
int segments = (qsizetype(isi->sh) * isi->sw) / (1<<16);
|
|
||||||
segments = std::min(segments, dh);
|
|
||||||
if (segments > 1) {
|
|
||||||
QSemaphore semaphore;
|
|
||||||
int y = 0;
|
|
||||||
for (int i = 0; i < segments; ++i) {
|
|
||||||
int yn = (dh - y) / (segments - i);
|
|
||||||
QThreadPool::globalInstance()->start([&, y, yn]() {
|
|
||||||
scaleSection(y, y + yn);
|
|
||||||
semaphore.release(1);
|
|
||||||
});
|
|
||||||
y += yn;
|
|
||||||
}
|
|
||||||
semaphore.acquire(segments);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
scaleSection(0, dh);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template<bool RGB>
|
template<bool RGB>
|
||||||
@ -181,25 +187,7 @@ void qt_qimageScaleAARGBA_down_x_up_y_sse4(QImageScaleInfo *isi, unsigned int *d
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#if QT_CONFIG(thread)
|
multithread_pixels_function(isi, dh, scaleSection);
|
||||||
int segments = (qsizetype(isi->sh) * isi->sw) / (1<<16);
|
|
||||||
segments = std::min(segments, dh);
|
|
||||||
if (segments > 1) {
|
|
||||||
QSemaphore semaphore;
|
|
||||||
int y = 0;
|
|
||||||
for (int i = 0; i < segments; ++i) {
|
|
||||||
int yn = (dh - y) / (segments - i);
|
|
||||||
QThreadPool::globalInstance()->start([&, y, yn]() {
|
|
||||||
scaleSection(y, y + yn);
|
|
||||||
semaphore.release(1);
|
|
||||||
});
|
|
||||||
y += yn;
|
|
||||||
}
|
|
||||||
semaphore.acquire(segments);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
scaleSection(0, dh);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template<bool RGB>
|
template<bool RGB>
|
||||||
@ -249,25 +237,7 @@ void qt_qimageScaleAARGBA_down_xy_sse4(QImageScaleInfo *isi, unsigned int *dest,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#if QT_CONFIG(thread)
|
multithread_pixels_function(isi, dh, scaleSection);
|
||||||
int segments = (qsizetype(isi->sh) * isi->sw) / (1<<16);
|
|
||||||
segments = std::min(segments, dh);
|
|
||||||
if (segments > 1) {
|
|
||||||
QSemaphore semaphore;
|
|
||||||
int y = 0;
|
|
||||||
for (int i = 0; i < segments; ++i) {
|
|
||||||
int yn = (dh - y) / (segments - i);
|
|
||||||
QThreadPool::globalInstance()->start([&, y, yn]() {
|
|
||||||
scaleSection(y, y + yn);
|
|
||||||
semaphore.release(1);
|
|
||||||
});
|
|
||||||
y += yn;
|
|
||||||
}
|
|
||||||
semaphore.acquire(segments);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
scaleSection(0, dh);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template void qt_qimageScaleAARGBA_up_x_down_y_sse4<false>(QImageScaleInfo *isi, unsigned int *dest,
|
template void qt_qimageScaleAARGBA_up_x_down_y_sse4<false>(QImageScaleInfo *isi, unsigned int *dest,
|
||||||
|
@ -367,6 +367,14 @@ int QTextMarkdownWriter::writeBlock(const QTextBlock &block, bool wrap, bool ign
|
|||||||
const int ColumnLimit = 80;
|
const int ColumnLimit = 80;
|
||||||
QTextBlockFormat blockFmt = block.blockFormat();
|
QTextBlockFormat blockFmt = block.blockFormat();
|
||||||
bool missedBlankCodeBlockLine = false;
|
bool missedBlankCodeBlockLine = false;
|
||||||
|
const bool codeBlock = blockFmt.hasProperty(QTextFormat::BlockCodeFence) ||
|
||||||
|
blockFmt.stringProperty(QTextFormat::BlockCodeLanguage).length() > 0;
|
||||||
|
if (m_fencedCodeBlock && !codeBlock) {
|
||||||
|
m_stream << m_linePrefix << QString(m_wrappedLineIndent, Space)
|
||||||
|
<< m_codeBlockFence << Newline;
|
||||||
|
m_fencedCodeBlock = false;
|
||||||
|
m_codeBlockFence.clear();
|
||||||
|
}
|
||||||
if (block.textList()) { // it's a list-item
|
if (block.textList()) { // it's a list-item
|
||||||
auto fmt = block.textList()->format();
|
auto fmt = block.textList()->format();
|
||||||
const int listLevel = fmt.indent();
|
const int listLevel = fmt.indent();
|
||||||
@ -427,7 +435,7 @@ int QTextMarkdownWriter::writeBlock(const QTextBlock &block, bool wrap, bool ign
|
|||||||
} else if (blockFmt.hasProperty(QTextFormat::BlockTrailingHorizontalRulerWidth)) {
|
} else if (blockFmt.hasProperty(QTextFormat::BlockTrailingHorizontalRulerWidth)) {
|
||||||
m_stream << "- - -\n"; // unambiguous horizontal rule, not an underline under a heading
|
m_stream << "- - -\n"; // unambiguous horizontal rule, not an underline under a heading
|
||||||
return 0;
|
return 0;
|
||||||
} else if (blockFmt.hasProperty(QTextFormat::BlockCodeFence) || blockFmt.stringProperty(QTextFormat::BlockCodeLanguage).length() > 0) {
|
} else if (codeBlock) {
|
||||||
// It's important to preserve blank lines in code blocks. But blank lines in code blocks
|
// It's important to preserve blank lines in code blocks. But blank lines in code blocks
|
||||||
// inside block quotes are getting preserved anyway (along with the "> " prefix).
|
// inside block quotes are getting preserved anyway (along with the "> " prefix).
|
||||||
if (!blockFmt.hasProperty(QTextFormat::BlockQuoteLevel))
|
if (!blockFmt.hasProperty(QTextFormat::BlockQuoteLevel))
|
||||||
@ -439,16 +447,11 @@ int QTextMarkdownWriter::writeBlock(const QTextBlock &block, bool wrap, bool ign
|
|||||||
m_codeBlockFence = QString(3, fenceChar.at(0));
|
m_codeBlockFence = QString(3, fenceChar.at(0));
|
||||||
// A block quote can contain an indented code block, but not vice-versa.
|
// A block quote can contain an indented code block, but not vice-versa.
|
||||||
m_stream << m_linePrefix << QString(m_wrappedLineIndent, Space) << m_codeBlockFence
|
m_stream << m_linePrefix << QString(m_wrappedLineIndent, Space) << m_codeBlockFence
|
||||||
<< Space << blockFmt.stringProperty(QTextFormat::BlockCodeLanguage) << Newline;
|
<< blockFmt.stringProperty(QTextFormat::BlockCodeLanguage) << Newline;
|
||||||
m_fencedCodeBlock = true;
|
m_fencedCodeBlock = true;
|
||||||
}
|
}
|
||||||
|
wrap = false;
|
||||||
} else if (!blockFmt.indent()) {
|
} else if (!blockFmt.indent()) {
|
||||||
if (m_fencedCodeBlock) {
|
|
||||||
m_stream << m_linePrefix << QString(m_wrappedLineIndent, Space)
|
|
||||||
<< m_codeBlockFence << Newline;
|
|
||||||
m_fencedCodeBlock = false;
|
|
||||||
m_codeBlockFence.clear();
|
|
||||||
}
|
|
||||||
m_wrappedLineIndent = 0;
|
m_wrappedLineIndent = 0;
|
||||||
m_linePrefix.clear();
|
m_linePrefix.clear();
|
||||||
if (blockFmt.hasProperty(QTextFormat::BlockQuoteLevel)) {
|
if (blockFmt.hasProperty(QTextFormat::BlockQuoteLevel)) {
|
||||||
|
@ -185,7 +185,7 @@ bool QLocalServerPrivate::listen(const QString &requestedServerName)
|
|||||||
Q_ASSERT(!socketNotifier);
|
Q_ASSERT(!socketNotifier);
|
||||||
socketNotifier = new QSocketNotifier(listenSocket,
|
socketNotifier = new QSocketNotifier(listenSocket,
|
||||||
QSocketNotifier::Read, q);
|
QSocketNotifier::Read, q);
|
||||||
q->connect(socketNotifier, SIGNAL(activated(int)),
|
q->connect(socketNotifier, SIGNAL(activated(QSocketDescriptor)),
|
||||||
q, SLOT(_q_onNewConnection()));
|
q, SLOT(_q_onNewConnection()));
|
||||||
socketNotifier->setEnabled(maxPendingConnections > 0);
|
socketNotifier->setEnabled(maxPendingConnections > 0);
|
||||||
return true;
|
return true;
|
||||||
@ -227,7 +227,7 @@ bool QLocalServerPrivate::listen(qintptr socketDescriptor)
|
|||||||
Q_ASSERT(!socketNotifier);
|
Q_ASSERT(!socketNotifier);
|
||||||
socketNotifier = new QSocketNotifier(listenSocket,
|
socketNotifier = new QSocketNotifier(listenSocket,
|
||||||
QSocketNotifier::Read, q);
|
QSocketNotifier::Read, q);
|
||||||
q->connect(socketNotifier, SIGNAL(activated(int)),
|
q->connect(socketNotifier, SIGNAL(activated(QSocketDescriptor)),
|
||||||
q, SLOT(_q_onNewConnection()));
|
q, SLOT(_q_onNewConnection()));
|
||||||
socketNotifier->setEnabled(maxPendingConnections > 0);
|
socketNotifier->setEnabled(maxPendingConnections > 0);
|
||||||
return true;
|
return true;
|
||||||
|
@ -308,7 +308,7 @@ void QLocalSocketPrivate::_q_connectToSocket()
|
|||||||
// Try again later, all of the sockets listening are full
|
// Try again later, all of the sockets listening are full
|
||||||
if (!delayConnect) {
|
if (!delayConnect) {
|
||||||
delayConnect = new QSocketNotifier(connectingSocket, QSocketNotifier::Write, q);
|
delayConnect = new QSocketNotifier(connectingSocket, QSocketNotifier::Write, q);
|
||||||
q->connect(delayConnect, SIGNAL(activated(int)), q, SLOT(_q_connectToSocket()));
|
q->connect(delayConnect, SIGNAL(activated(QSocketDescriptor)), q, SLOT(_q_connectToSocket()));
|
||||||
}
|
}
|
||||||
if (!connectTimer) {
|
if (!connectTimer) {
|
||||||
connectTimer = new QTimer(q);
|
connectTimer = new QTimer(q);
|
||||||
|
@ -2315,7 +2315,7 @@ void QSslSocketPrivate::init()
|
|||||||
pendingClose = false;
|
pendingClose = false;
|
||||||
flushTriggered = false;
|
flushTriggered = false;
|
||||||
ocspResponses.clear();
|
ocspResponses.clear();
|
||||||
|
systemOrSslErrorDetected = false;
|
||||||
// we don't want to clear the ignoreErrorsList, so
|
// we don't want to clear the ignoreErrorsList, so
|
||||||
// that it is possible setting it before connecting
|
// that it is possible setting it before connecting
|
||||||
// ignoreErrorsList.clear();
|
// ignoreErrorsList.clear();
|
||||||
|
@ -765,10 +765,16 @@ bool QSslSocketBackendPrivate::initSslContext()
|
|||||||
void QSslSocketBackendPrivate::destroySslContext()
|
void QSslSocketBackendPrivate::destroySslContext()
|
||||||
{
|
{
|
||||||
if (ssl) {
|
if (ssl) {
|
||||||
// We do not send a shutdown alert here. Just mark the session as
|
if (!q_SSL_in_init(ssl) && !systemOrSslErrorDetected) {
|
||||||
// resumable for qhttpnetworkconnection's "optimization", otherwise
|
// We do not send a shutdown alert here. Just mark the session as
|
||||||
// OpenSSL won't start a session resumption.
|
// resumable for qhttpnetworkconnection's "optimization", otherwise
|
||||||
q_SSL_shutdown(ssl);
|
// OpenSSL won't start a session resumption.
|
||||||
|
if (q_SSL_shutdown(ssl) != 1) {
|
||||||
|
// Some error may be queued, clear it.
|
||||||
|
const auto errors = getErrorsFromOpenSsl();
|
||||||
|
Q_UNUSED(errors);
|
||||||
|
}
|
||||||
|
}
|
||||||
q_SSL_free(ssl);
|
q_SSL_free(ssl);
|
||||||
ssl = nullptr;
|
ssl = nullptr;
|
||||||
}
|
}
|
||||||
@ -1242,6 +1248,7 @@ void QSslSocketBackendPrivate::transmit()
|
|||||||
case SSL_ERROR_SSL: // error in the SSL library
|
case SSL_ERROR_SSL: // error in the SSL library
|
||||||
// we do not know exactly what the error is, nor whether we can recover from it,
|
// we do not know exactly what the error is, nor whether we can recover from it,
|
||||||
// so just return to prevent an endless loop in the outer "while" statement
|
// so just return to prevent an endless loop in the outer "while" statement
|
||||||
|
systemOrSslErrorDetected = true;
|
||||||
{
|
{
|
||||||
const ScopedBool bg(inSetAndEmitError, true);
|
const ScopedBool bg(inSetAndEmitError, true);
|
||||||
setErrorAndEmit(QAbstractSocket::SslInternalError,
|
setErrorAndEmit(QAbstractSocket::SslInternalError,
|
||||||
@ -1993,8 +2000,12 @@ void QSslSocketBackendPrivate::trySendFatalAlert()
|
|||||||
void QSslSocketBackendPrivate::disconnectFromHost()
|
void QSslSocketBackendPrivate::disconnectFromHost()
|
||||||
{
|
{
|
||||||
if (ssl) {
|
if (ssl) {
|
||||||
if (!shutdown) {
|
if (!shutdown && !q_SSL_in_init(ssl) && !systemOrSslErrorDetected) {
|
||||||
q_SSL_shutdown(ssl);
|
if (q_SSL_shutdown(ssl) != 1) {
|
||||||
|
// Some error may be queued, clear it.
|
||||||
|
const auto errors = getErrorsFromOpenSsl();
|
||||||
|
Q_UNUSED(errors);
|
||||||
|
}
|
||||||
shutdown = true;
|
shutdown = true;
|
||||||
transmit();
|
transmit();
|
||||||
}
|
}
|
||||||
|
@ -377,6 +377,7 @@ DEFINEFUNC3(void, SSL_set_bio, SSL *a, a, BIO *b, b, BIO *c, c, return, DUMMYARG
|
|||||||
DEFINEFUNC(void, SSL_set_accept_state, SSL *a, a, return, DUMMYARG)
|
DEFINEFUNC(void, SSL_set_accept_state, SSL *a, a, return, DUMMYARG)
|
||||||
DEFINEFUNC(void, SSL_set_connect_state, SSL *a, a, return, DUMMYARG)
|
DEFINEFUNC(void, SSL_set_connect_state, SSL *a, a, return, DUMMYARG)
|
||||||
DEFINEFUNC(int, SSL_shutdown, SSL *a, a, return -1, return)
|
DEFINEFUNC(int, SSL_shutdown, SSL *a, a, return -1, return)
|
||||||
|
DEFINEFUNC(int, SSL_in_init, const SSL *a, a, return 0, return)
|
||||||
DEFINEFUNC(int, SSL_get_shutdown, const SSL *ssl, ssl, return 0, return)
|
DEFINEFUNC(int, SSL_get_shutdown, const SSL *ssl, ssl, return 0, return)
|
||||||
DEFINEFUNC2(int, SSL_set_session, SSL* to, to, SSL_SESSION *session, session, return -1, return)
|
DEFINEFUNC2(int, SSL_set_session, SSL* to, to, SSL_SESSION *session, session, return -1, return)
|
||||||
DEFINEFUNC(void, SSL_SESSION_free, SSL_SESSION *ses, ses, return, DUMMYARG)
|
DEFINEFUNC(void, SSL_SESSION_free, SSL_SESSION *ses, ses, return, DUMMYARG)
|
||||||
@ -1071,6 +1072,7 @@ bool q_resolveOpenSslSymbols()
|
|||||||
RESOLVEFUNC(SSL_set_bio)
|
RESOLVEFUNC(SSL_set_bio)
|
||||||
RESOLVEFUNC(SSL_set_connect_state)
|
RESOLVEFUNC(SSL_set_connect_state)
|
||||||
RESOLVEFUNC(SSL_shutdown)
|
RESOLVEFUNC(SSL_shutdown)
|
||||||
|
RESOLVEFUNC(SSL_in_init)
|
||||||
RESOLVEFUNC(SSL_get_shutdown)
|
RESOLVEFUNC(SSL_get_shutdown)
|
||||||
RESOLVEFUNC(SSL_set_session)
|
RESOLVEFUNC(SSL_set_session)
|
||||||
RESOLVEFUNC(SSL_SESSION_free)
|
RESOLVEFUNC(SSL_SESSION_free)
|
||||||
|
@ -516,6 +516,7 @@ void q_SSL_set_bio(SSL *a, BIO *b, BIO *c);
|
|||||||
void q_SSL_set_accept_state(SSL *a);
|
void q_SSL_set_accept_state(SSL *a);
|
||||||
void q_SSL_set_connect_state(SSL *a);
|
void q_SSL_set_connect_state(SSL *a);
|
||||||
int q_SSL_shutdown(SSL *a);
|
int q_SSL_shutdown(SSL *a);
|
||||||
|
int q_SSL_in_init(const SSL *s);
|
||||||
int q_SSL_get_shutdown(const SSL *ssl);
|
int q_SSL_get_shutdown(const SSL *ssl);
|
||||||
int q_SSL_set_session(SSL *to, SSL_SESSION *session);
|
int q_SSL_set_session(SSL *to, SSL_SESSION *session);
|
||||||
void q_SSL_SESSION_free(SSL_SESSION *ses);
|
void q_SSL_SESSION_free(SSL_SESSION *ses);
|
||||||
|
@ -205,6 +205,7 @@ protected:
|
|||||||
bool verifyErrorsHaveBeenIgnored();
|
bool verifyErrorsHaveBeenIgnored();
|
||||||
bool paused;
|
bool paused;
|
||||||
bool flushTriggered;
|
bool flushTriggered;
|
||||||
|
bool systemOrSslErrorDetected = false;
|
||||||
QVector<QOcspResponse> ocspResponses;
|
QVector<QOcspResponse> ocspResponses;
|
||||||
bool handshakeInterrupted = false;
|
bool handshakeInterrupted = false;
|
||||||
};
|
};
|
||||||
|
@ -92,7 +92,7 @@ QDeviceDiscoveryUDev::QDeviceDiscoveryUDev(QDeviceTypes types, struct udev *udev
|
|||||||
m_udevMonitorFileDescriptor = udev_monitor_get_fd(m_udevMonitor);
|
m_udevMonitorFileDescriptor = udev_monitor_get_fd(m_udevMonitor);
|
||||||
|
|
||||||
m_udevSocketNotifier = new QSocketNotifier(m_udevMonitorFileDescriptor, QSocketNotifier::Read, this);
|
m_udevSocketNotifier = new QSocketNotifier(m_udevMonitorFileDescriptor, QSocketNotifier::Read, this);
|
||||||
connect(m_udevSocketNotifier, SIGNAL(activated(int)), this, SLOT(handleUDevNotification()));
|
connect(m_udevSocketNotifier, SIGNAL(activated(QSocketDescriptor)), this, SLOT(handleUDevNotification()));
|
||||||
}
|
}
|
||||||
|
|
||||||
QDeviceDiscoveryUDev::~QDeviceDiscoveryUDev()
|
QDeviceDiscoveryUDev::~QDeviceDiscoveryUDev()
|
||||||
|
@ -113,6 +113,8 @@ QEvdevMouseHandler::QEvdevMouseHandler(const QString &device, int fd, bool abs,
|
|||||||
if (m_abs)
|
if (m_abs)
|
||||||
m_abs = getHardwareMaximum();
|
m_abs = getHardwareMaximum();
|
||||||
|
|
||||||
|
detectHiResWheelSupport();
|
||||||
|
|
||||||
// socket notifier for events on the mouse device
|
// socket notifier for events on the mouse device
|
||||||
m_notify = new QSocketNotifier(m_fd, QSocketNotifier::Read, this);
|
m_notify = new QSocketNotifier(m_fd, QSocketNotifier::Read, this);
|
||||||
connect(m_notify, &QSocketNotifier::activated,
|
connect(m_notify, &QSocketNotifier::activated,
|
||||||
@ -125,6 +127,25 @@ QEvdevMouseHandler::~QEvdevMouseHandler()
|
|||||||
qt_safe_close(m_fd);
|
qt_safe_close(m_fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QEvdevMouseHandler::detectHiResWheelSupport()
|
||||||
|
{
|
||||||
|
#if defined(REL_WHEEL_HI_RES) || defined(REL_HWHEEL_HI_RES)
|
||||||
|
// Check if we can expect hires events as we will get both
|
||||||
|
// legacy and hires event and needs to know if we should
|
||||||
|
// ignore the legacy events.
|
||||||
|
unsigned char relFeatures[(REL_MAX / 8) + 1]{};
|
||||||
|
if (ioctl(m_fd, EVIOCGBIT(EV_REL, sizeof (relFeatures)), relFeatures) == -1)
|
||||||
|
return;
|
||||||
|
|
||||||
|
#if defined(REL_WHEEL_HI_RES)
|
||||||
|
m_hiResWheel = TEST_BIT(relFeatures, REL_WHEEL_HI_RES);
|
||||||
|
#endif
|
||||||
|
#if defined(REL_HWHEEL_HI_RES)
|
||||||
|
m_hiResHWheel = TEST_BIT(relFeatures, REL_HWHEEL_HI_RES);
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
// Ask touch screen hardware for information on coordinate maximums
|
// Ask touch screen hardware for information on coordinate maximums
|
||||||
// If any ioctls fail, revert to non abs mode
|
// If any ioctls fail, revert to non abs mode
|
||||||
bool QEvdevMouseHandler::getHardwareMaximum()
|
bool QEvdevMouseHandler::getHardwareMaximum()
|
||||||
@ -243,14 +264,24 @@ void QEvdevMouseHandler::readMouseData()
|
|||||||
} else if (data->code == REL_Y) {
|
} else if (data->code == REL_Y) {
|
||||||
m_y += data->value;
|
m_y += data->value;
|
||||||
posChanged = true;
|
posChanged = true;
|
||||||
} else if (data->code == ABS_WHEEL) { // vertical scroll
|
} else if (!m_hiResWheel && data->code == REL_WHEEL) {
|
||||||
// data->value: positive == up, negative == down
|
// data->value: positive == up, negative == down
|
||||||
delta.setY(120 * data->value);
|
delta.setY(120 * data->value);
|
||||||
emit handleWheelEvent(delta);
|
emit handleWheelEvent(delta);
|
||||||
} else if (data->code == ABS_THROTTLE) { // horizontal scroll
|
#ifdef REL_WHEEL_HI_RES
|
||||||
|
} else if (data->code == REL_WHEEL_HI_RES) {
|
||||||
|
delta.setY(data->value);
|
||||||
|
emit handleWheelEvent(delta);
|
||||||
|
#endif
|
||||||
|
} else if (!m_hiResHWheel && data->code == REL_HWHEEL) {
|
||||||
// data->value: positive == right, negative == left
|
// data->value: positive == right, negative == left
|
||||||
delta.setX(-120 * data->value);
|
delta.setX(-120 * data->value);
|
||||||
emit handleWheelEvent(delta);
|
emit handleWheelEvent(delta);
|
||||||
|
#ifdef REL_HWHEEL_HI_RES
|
||||||
|
} else if (data->code == REL_HWHEEL_HI_RES) {
|
||||||
|
delta.setX(-data->value);
|
||||||
|
emit handleWheelEvent(delta);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
} else if (data->type == EV_KEY && data->code == BTN_TOUCH) {
|
} else if (data->type == EV_KEY && data->code == BTN_TOUCH) {
|
||||||
// We care about touchpads only, not touchscreens -> don't map to button press.
|
// We care about touchpads only, not touchscreens -> don't map to button press.
|
||||||
|
@ -81,6 +81,7 @@ private:
|
|||||||
|
|
||||||
void sendMouseEvent();
|
void sendMouseEvent();
|
||||||
bool getHardwareMaximum();
|
bool getHardwareMaximum();
|
||||||
|
void detectHiResWheelSupport();
|
||||||
|
|
||||||
QString m_device;
|
QString m_device;
|
||||||
int m_fd;
|
int m_fd;
|
||||||
@ -89,6 +90,8 @@ private:
|
|||||||
int m_prevx = 0, m_prevy = 0;
|
int m_prevx = 0, m_prevy = 0;
|
||||||
bool m_abs;
|
bool m_abs;
|
||||||
bool m_compression;
|
bool m_compression;
|
||||||
|
bool m_hiResWheel = false;
|
||||||
|
bool m_hiResHWheel = false;
|
||||||
Qt::MouseButtons m_buttons;
|
Qt::MouseButtons m_buttons;
|
||||||
Qt::MouseButton m_button;
|
Qt::MouseButton m_button;
|
||||||
QEvent::Type m_eventType;
|
QEvent::Type m_eventType;
|
||||||
|
@ -9,7 +9,6 @@ qt_add_plugin(QCocoaIntegrationPlugin
|
|||||||
TYPE platforms
|
TYPE platforms
|
||||||
SOURCES
|
SOURCES
|
||||||
main.mm
|
main.mm
|
||||||
messages.cpp messages.h
|
|
||||||
qcocoaapplication.h qcocoaapplication.mm
|
qcocoaapplication.h qcocoaapplication.mm
|
||||||
qcocoaapplicationdelegate.h qcocoaapplicationdelegate.mm
|
qcocoaapplicationdelegate.h qcocoaapplicationdelegate.mm
|
||||||
qcocoabackingstore.h qcocoabackingstore.mm
|
qcocoabackingstore.h qcocoabackingstore.mm
|
||||||
@ -41,6 +40,8 @@ qt_add_plugin(QCocoaIntegrationPlugin
|
|||||||
qnsview.h qnsview.mm
|
qnsview.h qnsview.mm
|
||||||
qnswindow.h qnswindow.mm
|
qnswindow.h qnswindow.mm
|
||||||
qnswindowdelegate.h qnswindowdelegate.mm
|
qnswindowdelegate.h qnswindowdelegate.mm
|
||||||
|
DEFINES
|
||||||
|
QT_NO_FOREACH
|
||||||
PUBLIC_LIBRARIES
|
PUBLIC_LIBRARIES
|
||||||
${FWAppKit}
|
${FWAppKit}
|
||||||
${FWCarbon}
|
${FWCarbon}
|
||||||
|
@ -13,7 +13,6 @@ qt_add_plugin(QCocoaIntegrationPlugin
|
|||||||
TYPE platforms
|
TYPE platforms
|
||||||
SOURCES
|
SOURCES
|
||||||
main.mm
|
main.mm
|
||||||
messages.cpp messages.h
|
|
||||||
qcocoaapplication.h qcocoaapplication.mm
|
qcocoaapplication.h qcocoaapplication.mm
|
||||||
qcocoaapplicationdelegate.h qcocoaapplicationdelegate.mm
|
qcocoaapplicationdelegate.h qcocoaapplicationdelegate.mm
|
||||||
qcocoabackingstore.h qcocoabackingstore.mm
|
qcocoabackingstore.h qcocoabackingstore.mm
|
||||||
@ -45,6 +44,8 @@ qt_add_plugin(QCocoaIntegrationPlugin
|
|||||||
qnsview.h qnsview.mm
|
qnsview.h qnsview.mm
|
||||||
qnswindow.h qnswindow.mm
|
qnswindow.h qnswindow.mm
|
||||||
qnswindowdelegate.h qnswindowdelegate.mm
|
qnswindowdelegate.h qnswindowdelegate.mm
|
||||||
|
DEFINES
|
||||||
|
QT_NO_FOREACH
|
||||||
PUBLIC_LIBRARIES
|
PUBLIC_LIBRARIES
|
||||||
${FWAppKit}
|
${FWAppKit}
|
||||||
${FWCarbon}
|
${FWCarbon}
|
||||||
|
@ -31,8 +31,7 @@ SOURCES += main.mm \
|
|||||||
qcocoaintrospection.mm \
|
qcocoaintrospection.mm \
|
||||||
qcocoakeymapper.mm \
|
qcocoakeymapper.mm \
|
||||||
qcocoamimetypes.mm \
|
qcocoamimetypes.mm \
|
||||||
qiosurfacegraphicsbuffer.mm \
|
qiosurfacegraphicsbuffer.mm
|
||||||
messages.cpp
|
|
||||||
|
|
||||||
HEADERS += qcocoaintegration.h \
|
HEADERS += qcocoaintegration.h \
|
||||||
qcocoascreen.h \
|
qcocoascreen.h \
|
||||||
@ -63,7 +62,6 @@ HEADERS += qcocoaintegration.h \
|
|||||||
qcocoasystemtrayicon.h \
|
qcocoasystemtrayicon.h \
|
||||||
qcocoaintrospection.h \
|
qcocoaintrospection.h \
|
||||||
qcocoakeymapper.h \
|
qcocoakeymapper.h \
|
||||||
messages.h \
|
|
||||||
qiosurfacegraphicsbuffer.h \
|
qiosurfacegraphicsbuffer.h \
|
||||||
qcocoamimetypes.h
|
qcocoamimetypes.h
|
||||||
|
|
||||||
@ -94,6 +92,8 @@ RESOURCES += qcocoaresources.qrc
|
|||||||
|
|
||||||
LIBS += -framework AppKit -framework CoreServices -framework Carbon -framework IOKit -framework QuartzCore -framework CoreVideo -framework Metal -framework IOSurface -lcups
|
LIBS += -framework AppKit -framework CoreServices -framework Carbon -framework IOKit -framework QuartzCore -framework CoreVideo -framework Metal -framework IOSurface -lcups
|
||||||
|
|
||||||
|
DEFINES += QT_NO_FOREACH
|
||||||
|
|
||||||
QT += \
|
QT += \
|
||||||
core-private gui-private \
|
core-private gui-private \
|
||||||
clipboard_support-private theme_support-private \
|
clipboard_support-private theme_support-private \
|
||||||
|
@ -1,115 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2018 The Qt Company Ltd.
|
|
||||||
** Contact: https://www.qt.io/licensing/
|
|
||||||
**
|
|
||||||
** This file is part of the plugins 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 "messages.h"
|
|
||||||
|
|
||||||
#include <QtCore/qcoreapplication.h>
|
|
||||||
#include <QtCore/qregularexpression.h>
|
|
||||||
|
|
||||||
// Translatable messages should go into this .cpp file for them to be picked up by lupdate.
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
|
||||||
|
|
||||||
QString msgAboutQt()
|
|
||||||
{
|
|
||||||
return QCoreApplication::translate("QCocoaMenuItem", "About Qt");
|
|
||||||
}
|
|
||||||
|
|
||||||
static const char *application_menu_strings[] =
|
|
||||||
{
|
|
||||||
QT_TRANSLATE_NOOP("MAC_APPLICATION_MENU","About %1"),
|
|
||||||
QT_TRANSLATE_NOOP("MAC_APPLICATION_MENU","Preferences..."),
|
|
||||||
QT_TRANSLATE_NOOP("MAC_APPLICATION_MENU","Services"),
|
|
||||||
QT_TRANSLATE_NOOP("MAC_APPLICATION_MENU","Hide %1"),
|
|
||||||
QT_TRANSLATE_NOOP("MAC_APPLICATION_MENU","Hide Others"),
|
|
||||||
QT_TRANSLATE_NOOP("MAC_APPLICATION_MENU","Show All"),
|
|
||||||
QT_TRANSLATE_NOOP("MAC_APPLICATION_MENU","Quit %1")
|
|
||||||
};
|
|
||||||
|
|
||||||
QString qt_mac_applicationmenu_string(int type)
|
|
||||||
{
|
|
||||||
QString menuString = QString::fromLatin1(application_menu_strings[type]);
|
|
||||||
const QString translated = QCoreApplication::translate("QMenuBar", application_menu_strings[type]);
|
|
||||||
if (translated != menuString) {
|
|
||||||
return translated;
|
|
||||||
} else {
|
|
||||||
return QCoreApplication::translate("MAC_APPLICATION_MENU", application_menu_strings[type]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QPlatformMenuItem::MenuRole detectMenuRole(const QString &caption)
|
|
||||||
{
|
|
||||||
QString captionNoAmpersand(caption);
|
|
||||||
captionNoAmpersand.remove(QLatin1Char('&'));
|
|
||||||
const QString aboutString = QCoreApplication::translate("QCocoaMenuItem", "About");
|
|
||||||
if (captionNoAmpersand.startsWith(aboutString, Qt::CaseInsensitive)
|
|
||||||
|| captionNoAmpersand.endsWith(aboutString, Qt::CaseInsensitive)) {
|
|
||||||
static const QRegularExpression qtRegExp(QLatin1String("qt$"), QRegularExpression::CaseInsensitiveOption);
|
|
||||||
if (captionNoAmpersand.contains(qtRegExp))
|
|
||||||
return QPlatformMenuItem::AboutQtRole;
|
|
||||||
return QPlatformMenuItem::AboutRole;
|
|
||||||
}
|
|
||||||
if (captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Config"), Qt::CaseInsensitive)
|
|
||||||
|| captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Preference"), Qt::CaseInsensitive)
|
|
||||||
|| captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Options"), Qt::CaseInsensitive)
|
|
||||||
|| captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Setting"), Qt::CaseInsensitive)
|
|
||||||
|| captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Setup"), Qt::CaseInsensitive)) {
|
|
||||||
return QPlatformMenuItem::PreferencesRole;
|
|
||||||
}
|
|
||||||
if (captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Quit"), Qt::CaseInsensitive)
|
|
||||||
|| captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Exit"), Qt::CaseInsensitive)) {
|
|
||||||
return QPlatformMenuItem::QuitRole;
|
|
||||||
}
|
|
||||||
if (!captionNoAmpersand.compare(QCoreApplication::translate("QCocoaMenuItem", "Cut"), Qt::CaseInsensitive))
|
|
||||||
return QPlatformMenuItem::CutRole;
|
|
||||||
if (!captionNoAmpersand.compare(QCoreApplication::translate("QCocoaMenuItem", "Copy"), Qt::CaseInsensitive))
|
|
||||||
return QPlatformMenuItem::CopyRole;
|
|
||||||
if (!captionNoAmpersand.compare(QCoreApplication::translate("QCocoaMenuItem", "Paste"), Qt::CaseInsensitive))
|
|
||||||
return QPlatformMenuItem::PasteRole;
|
|
||||||
if (!captionNoAmpersand.compare(QCoreApplication::translate("QCocoaMenuItem", "Select All"), Qt::CaseInsensitive))
|
|
||||||
return QPlatformMenuItem::SelectAllRole;
|
|
||||||
return QPlatformMenuItem::NoRole;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString msgDialogButtonDiscard()
|
|
||||||
{
|
|
||||||
return QCoreApplication::translate("QCocoaTheme", "Don't Save");
|
|
||||||
}
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
|
@ -41,7 +41,7 @@
|
|||||||
|
|
||||||
#include <QtCore/qglobal.h>
|
#include <QtCore/qglobal.h>
|
||||||
|
|
||||||
#include "qt_mac_p.h"
|
#include <QtCore/private/qcore_mac_p.h>
|
||||||
|
|
||||||
#ifndef QT_NO_ACCESSIBILITY
|
#ifndef QT_NO_ACCESSIBILITY
|
||||||
|
|
||||||
|
@ -41,7 +41,8 @@
|
|||||||
#include "qcocoahelpers.h"
|
#include "qcocoahelpers.h"
|
||||||
#include "qcocoawindow.h"
|
#include "qcocoawindow.h"
|
||||||
#include "qcocoascreen.h"
|
#include "qcocoascreen.h"
|
||||||
#include "private/qaccessiblecache_p.h"
|
|
||||||
|
#include <QtGui/private/qaccessiblecache_p.h>
|
||||||
#include <QtAccessibilitySupport/private/qaccessiblebridgeutils_p.h>
|
#include <QtAccessibilitySupport/private/qaccessiblebridgeutils_p.h>
|
||||||
#include <QtGui/qaccessible.h>
|
#include <QtGui/qaccessible.h>
|
||||||
|
|
||||||
@ -547,7 +548,7 @@ static void convertLineOffset(QAccessibleTextInterface *text, int *line, int *of
|
|||||||
return nsActions;
|
return nsActions;
|
||||||
|
|
||||||
const QStringList &supportedActionNames = QAccessibleBridgeUtils::effectiveActionNames(iface);
|
const QStringList &supportedActionNames = QAccessibleBridgeUtils::effectiveActionNames(iface);
|
||||||
foreach (const QString &qtAction, supportedActionNames) {
|
for (const QString &qtAction : supportedActionNames) {
|
||||||
NSString *nsAction = QCocoaAccessible::getTranslatedAction(qtAction);
|
NSString *nsAction = QCocoaAccessible::getTranslatedAction(qtAction);
|
||||||
if (nsAction)
|
if (nsAction)
|
||||||
[nsActions addObject : nsAction];
|
[nsActions addObject : nsAction];
|
||||||
|
@ -83,8 +83,8 @@
|
|||||||
// We mean it.
|
// We mean it.
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "qglobal.h"
|
#include <qglobal.h>
|
||||||
#include "private/qcore_mac_p.h"
|
#include <QtCore/private/qcore_mac_p.h>
|
||||||
|
|
||||||
#import <AppKit/AppKit.h>
|
#import <AppKit/AppKit.h>
|
||||||
|
|
||||||
|
@ -87,7 +87,6 @@
|
|||||||
#include <qurl.h>
|
#include <qurl.h>
|
||||||
#include <qdebug.h>
|
#include <qdebug.h>
|
||||||
#include <qguiapplication.h>
|
#include <qguiapplication.h>
|
||||||
#include "qt_mac_p.h"
|
|
||||||
#include <qpa/qwindowsysteminterface.h>
|
#include <qpa/qwindowsysteminterface.h>
|
||||||
#include <qwindowdefs.h>
|
#include <qwindowdefs.h>
|
||||||
|
|
||||||
|
@ -43,6 +43,7 @@
|
|||||||
#include "qcocoahelpers.h"
|
#include "qcocoahelpers.h"
|
||||||
|
|
||||||
#include <QtCore/qmath.h>
|
#include <QtCore/qmath.h>
|
||||||
|
#include <QtGui/qpainter.h>
|
||||||
|
|
||||||
#include <QuartzCore/CATransaction.h>
|
#include <QuartzCore/CATransaction.h>
|
||||||
|
|
||||||
|
@ -73,18 +73,21 @@
|
|||||||
|
|
||||||
#include "qcocoaeventdispatcher.h"
|
#include "qcocoaeventdispatcher.h"
|
||||||
#include "qcocoawindow.h"
|
#include "qcocoawindow.h"
|
||||||
|
|
||||||
#include "qcocoahelpers.h"
|
#include "qcocoahelpers.h"
|
||||||
#include "qguiapplication.h"
|
|
||||||
#include "qevent.h"
|
#include <QtGui/qevent.h>
|
||||||
#include "qmutex.h"
|
#include <QtGui/qguiapplication.h>
|
||||||
#include "qsocketnotifier.h"
|
#include <QtGui/private/qguiapplication_p.h>
|
||||||
|
|
||||||
|
#include <QtCore/qmutex.h>
|
||||||
|
#include <QtCore/qscopeguard.h>
|
||||||
|
#include <QtCore/qsocketnotifier.h>
|
||||||
|
#include <QtCore/private/qthread_p.h>
|
||||||
|
|
||||||
#include <qpa/qplatformwindow.h>
|
#include <qpa/qplatformwindow.h>
|
||||||
#include <qpa/qplatformnativeinterface.h>
|
#include <qpa/qplatformnativeinterface.h>
|
||||||
#include "private/qthread_p.h"
|
|
||||||
#include "private/qguiapplication_p.h"
|
#include <QtCore/qdebug.h>
|
||||||
#include <qdebug.h>
|
|
||||||
#include <qscopeguard.h>
|
|
||||||
|
|
||||||
#include <AppKit/AppKit.h>
|
#include <AppKit/AppKit.h>
|
||||||
|
|
||||||
|
@ -48,7 +48,6 @@
|
|||||||
|
|
||||||
#include <qguiapplication.h>
|
#include <qguiapplication.h>
|
||||||
#include <private/qguiapplication_p.h>
|
#include <private/qguiapplication_p.h>
|
||||||
#include "qt_mac_p.h"
|
|
||||||
#include "qcocoahelpers.h"
|
#include "qcocoahelpers.h"
|
||||||
#include "qcocoaeventdispatcher.h"
|
#include "qcocoaeventdispatcher.h"
|
||||||
#include <qbuffer.h>
|
#include <qbuffer.h>
|
||||||
|
@ -50,9 +50,12 @@
|
|||||||
//
|
//
|
||||||
// We mean it.
|
// We mean it.
|
||||||
//
|
//
|
||||||
#include "qt_mac_p.h"
|
|
||||||
|
#include <AppKit/AppKit.h>
|
||||||
|
|
||||||
#include <private/qguiapplication_p.h>
|
#include <private/qguiapplication_p.h>
|
||||||
#include <QtCore/qoperatingsystemversion.h>
|
#include <QtCore/qoperatingsystemversion.h>
|
||||||
|
#include <QtCore/qloggingcategory.h>
|
||||||
#include <QtGui/qpalette.h>
|
#include <QtGui/qpalette.h>
|
||||||
#include <QtGui/qscreen.h>
|
#include <QtGui/qscreen.h>
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ class QFontEngineFT;
|
|||||||
static QCocoaIntegration::Options parseOptions(const QStringList ¶mList)
|
static QCocoaIntegration::Options parseOptions(const QStringList ¶mList)
|
||||||
{
|
{
|
||||||
QCocoaIntegration::Options options;
|
QCocoaIntegration::Options options;
|
||||||
foreach (const QString ¶m, paramList) {
|
for (const QString ¶m : paramList) {
|
||||||
#ifndef QT_NO_FREETYPE
|
#ifndef QT_NO_FREETYPE
|
||||||
if (param == QLatin1String("fontengine=freetype"))
|
if (param == QLatin1String("fontengine=freetype"))
|
||||||
options |= QCocoaIntegration::UseFreeTypeFontEngine;
|
options |= QCocoaIntegration::UseFreeTypeFontEngine;
|
||||||
|
@ -191,7 +191,7 @@ void QCocoaMenuBar::syncMenu_helper(QPlatformMenu *menu, bool menubarUpdate)
|
|||||||
QMacAutoReleasePool pool;
|
QMacAutoReleasePool pool;
|
||||||
|
|
||||||
QCocoaMenu *cocoaMenu = static_cast<QCocoaMenu *>(menu);
|
QCocoaMenu *cocoaMenu = static_cast<QCocoaMenu *>(menu);
|
||||||
Q_FOREACH (QCocoaMenuItem *item, cocoaMenu->items())
|
for (QCocoaMenuItem *item : cocoaMenu->items())
|
||||||
cocoaMenu->syncMenuItem_helper(item, menubarUpdate);
|
cocoaMenu->syncMenuItem_helper(item, menubarUpdate);
|
||||||
|
|
||||||
BOOL shouldHide = YES;
|
BOOL shouldHide = YES;
|
||||||
|
@ -53,6 +53,18 @@ Q_FORWARD_DECLARE_OBJC_CLASS(NSView);
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
enum {
|
||||||
|
AboutAppMenuItem = 0,
|
||||||
|
PreferencesAppMenuItem,
|
||||||
|
ServicesAppMenuItem,
|
||||||
|
HideAppMenuItem,
|
||||||
|
HideOthersAppMenuItem,
|
||||||
|
ShowAllAppMenuItem,
|
||||||
|
QuitAppMenuItem
|
||||||
|
};
|
||||||
|
|
||||||
|
QString qt_mac_applicationmenu_string(int type);
|
||||||
|
|
||||||
class QCocoaMenu;
|
class QCocoaMenu;
|
||||||
|
|
||||||
class QCocoaMenuObject
|
class QCocoaMenuObject
|
||||||
|
@ -45,17 +45,38 @@
|
|||||||
#include "qcocoansmenu.h"
|
#include "qcocoansmenu.h"
|
||||||
#include "qcocoamenu.h"
|
#include "qcocoamenu.h"
|
||||||
#include "qcocoamenubar.h"
|
#include "qcocoamenubar.h"
|
||||||
#include "messages.h"
|
|
||||||
#include "qcocoahelpers.h"
|
#include "qcocoahelpers.h"
|
||||||
#include "qt_mac_p.h"
|
|
||||||
#include "qcocoaapplication.h" // for custom application category
|
#include "qcocoaapplication.h" // for custom application category
|
||||||
#include "qcocoamenuloader.h"
|
#include "qcocoamenuloader.h"
|
||||||
#include <QtGui/private/qcoregraphics_p.h>
|
#include <QtGui/private/qcoregraphics_p.h>
|
||||||
|
#include <QtCore/qregularexpression.h>
|
||||||
|
|
||||||
#include <QtCore/QDebug>
|
#include <QtCore/QDebug>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
static const char *application_menu_strings[] =
|
||||||
|
{
|
||||||
|
QT_TRANSLATE_NOOP("MAC_APPLICATION_MENU","About %1"),
|
||||||
|
QT_TRANSLATE_NOOP("MAC_APPLICATION_MENU","Preferences..."),
|
||||||
|
QT_TRANSLATE_NOOP("MAC_APPLICATION_MENU","Services"),
|
||||||
|
QT_TRANSLATE_NOOP("MAC_APPLICATION_MENU","Hide %1"),
|
||||||
|
QT_TRANSLATE_NOOP("MAC_APPLICATION_MENU","Hide Others"),
|
||||||
|
QT_TRANSLATE_NOOP("MAC_APPLICATION_MENU","Show All"),
|
||||||
|
QT_TRANSLATE_NOOP("MAC_APPLICATION_MENU","Quit %1")
|
||||||
|
};
|
||||||
|
|
||||||
|
QString qt_mac_applicationmenu_string(int type)
|
||||||
|
{
|
||||||
|
QString menuString = QString::fromLatin1(application_menu_strings[type]);
|
||||||
|
const QString translated = QCoreApplication::translate("QMenuBar", application_menu_strings[type]);
|
||||||
|
if (translated != menuString) {
|
||||||
|
return translated;
|
||||||
|
} else {
|
||||||
|
return QCoreApplication::translate("MAC_APPLICATION_MENU", application_menu_strings[type]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static quint32 constructModifierMask(quint32 accel_key)
|
static quint32 constructModifierMask(quint32 accel_key)
|
||||||
{
|
{
|
||||||
quint32 ret = 0;
|
quint32 ret = 0;
|
||||||
@ -225,6 +246,40 @@ void QCocoaMenuItem::setNativeContents(WId item)
|
|||||||
m_itemView.needsDisplay = YES;
|
m_itemView.needsDisplay = YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static QPlatformMenuItem::MenuRole detectMenuRole(const QString &caption)
|
||||||
|
{
|
||||||
|
QString captionNoAmpersand(caption);
|
||||||
|
captionNoAmpersand.remove(QLatin1Char('&'));
|
||||||
|
const QString aboutString = QCoreApplication::translate("QCocoaMenuItem", "About");
|
||||||
|
if (captionNoAmpersand.startsWith(aboutString, Qt::CaseInsensitive)
|
||||||
|
|| captionNoAmpersand.endsWith(aboutString, Qt::CaseInsensitive)) {
|
||||||
|
static const QRegularExpression qtRegExp(QLatin1String("qt$"), QRegularExpression::CaseInsensitiveOption);
|
||||||
|
if (captionNoAmpersand.contains(qtRegExp))
|
||||||
|
return QPlatformMenuItem::AboutQtRole;
|
||||||
|
return QPlatformMenuItem::AboutRole;
|
||||||
|
}
|
||||||
|
if (captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Config"), Qt::CaseInsensitive)
|
||||||
|
|| captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Preference"), Qt::CaseInsensitive)
|
||||||
|
|| captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Options"), Qt::CaseInsensitive)
|
||||||
|
|| captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Setting"), Qt::CaseInsensitive)
|
||||||
|
|| captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Setup"), Qt::CaseInsensitive)) {
|
||||||
|
return QPlatformMenuItem::PreferencesRole;
|
||||||
|
}
|
||||||
|
if (captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Quit"), Qt::CaseInsensitive)
|
||||||
|
|| captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Exit"), Qt::CaseInsensitive)) {
|
||||||
|
return QPlatformMenuItem::QuitRole;
|
||||||
|
}
|
||||||
|
if (!captionNoAmpersand.compare(QCoreApplication::translate("QCocoaMenuItem", "Cut"), Qt::CaseInsensitive))
|
||||||
|
return QPlatformMenuItem::CutRole;
|
||||||
|
if (!captionNoAmpersand.compare(QCoreApplication::translate("QCocoaMenuItem", "Copy"), Qt::CaseInsensitive))
|
||||||
|
return QPlatformMenuItem::CopyRole;
|
||||||
|
if (!captionNoAmpersand.compare(QCoreApplication::translate("QCocoaMenuItem", "Paste"), Qt::CaseInsensitive))
|
||||||
|
return QPlatformMenuItem::PasteRole;
|
||||||
|
if (!captionNoAmpersand.compare(QCoreApplication::translate("QCocoaMenuItem", "Select All"), Qt::CaseInsensitive))
|
||||||
|
return QPlatformMenuItem::SelectAllRole;
|
||||||
|
return QPlatformMenuItem::NoRole;
|
||||||
|
}
|
||||||
|
|
||||||
NSMenuItem *QCocoaMenuItem::sync()
|
NSMenuItem *QCocoaMenuItem::sync()
|
||||||
{
|
{
|
||||||
if (m_isSeparator != m_native.separatorItem) {
|
if (m_isSeparator != m_native.separatorItem) {
|
||||||
@ -353,7 +408,7 @@ QString QCocoaMenuItem::mergeText()
|
|||||||
return qt_mac_applicationmenu_string(AboutAppMenuItem).arg(qt_mac_applicationName());
|
return qt_mac_applicationmenu_string(AboutAppMenuItem).arg(qt_mac_applicationName());
|
||||||
} else if (m_native== [loader aboutQtMenuItem]) {
|
} else if (m_native== [loader aboutQtMenuItem]) {
|
||||||
if (m_text == QString("About Qt"))
|
if (m_text == QString("About Qt"))
|
||||||
return msgAboutQt();
|
return QCoreApplication::translate("QCocoaMenuItem", "About Qt");
|
||||||
else
|
else
|
||||||
return m_text;
|
return m_text;
|
||||||
} else if (m_native == [loader preferencesMenuItem]) {
|
} else if (m_native == [loader preferencesMenuItem]) {
|
||||||
|
@ -39,7 +39,6 @@
|
|||||||
|
|
||||||
#include "qcocoamenuloader.h"
|
#include "qcocoamenuloader.h"
|
||||||
|
|
||||||
#include "messages.h"
|
|
||||||
#include "qcocoahelpers.h"
|
#include "qcocoahelpers.h"
|
||||||
#include "qcocoansmenu.h"
|
#include "qcocoansmenu.h"
|
||||||
#include "qcocoamenubar.h"
|
#include "qcocoamenubar.h"
|
||||||
|
@ -50,13 +50,13 @@
|
|||||||
#include <qwindow.h>
|
#include <qwindow.h>
|
||||||
#include <qpixmap.h>
|
#include <qpixmap.h>
|
||||||
#include <qpa/qplatformwindow.h>
|
#include <qpa/qplatformwindow.h>
|
||||||
#include "qsurfaceformat.h"
|
#include <QtGui/qsurfaceformat.h>
|
||||||
#ifndef QT_NO_OPENGL
|
#ifndef QT_NO_OPENGL
|
||||||
#include <qpa/qplatformopenglcontext.h>
|
#include <qpa/qplatformopenglcontext.h>
|
||||||
#include "qopenglcontext.h"
|
#include <QtGui/qopenglcontext.h>
|
||||||
#include "qcocoaglcontext.h"
|
#include "qcocoaglcontext.h"
|
||||||
#endif
|
#endif
|
||||||
#include "qguiapplication.h"
|
#include <QtGui/qguiapplication.h>
|
||||||
#include <qdebug.h>
|
#include <qdebug.h>
|
||||||
|
|
||||||
#if !defined(QT_NO_WIDGETS) && defined(QT_PRINTSUPPORT_LIB)
|
#if !defined(QT_NO_WIDGETS) && defined(QT_PRINTSUPPORT_LIB)
|
||||||
|
@ -53,7 +53,7 @@
|
|||||||
|
|
||||||
#import <AppKit/AppKit.h>
|
#import <AppKit/AppKit.h>
|
||||||
|
|
||||||
#include <qcocoahelpers.h>
|
#include "qcocoahelpers.h"
|
||||||
|
|
||||||
QT_FORWARD_DECLARE_CLASS(QCocoaMenu);
|
QT_FORWARD_DECLARE_CLASS(QCocoaMenu);
|
||||||
QT_FORWARD_DECLARE_CLASS(QCocoaMenuItem);
|
QT_FORWARD_DECLARE_CLASS(QCocoaMenuItem);
|
||||||
|
@ -55,8 +55,6 @@
|
|||||||
|
|
||||||
#ifndef QT_NO_PRINTER
|
#ifndef QT_NO_PRINTER
|
||||||
|
|
||||||
#include "qt_mac_p.h"
|
|
||||||
|
|
||||||
#include <cups/ppd.h>
|
#include <cups/ppd.h>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
@ -37,6 +37,8 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <ApplicationServices/ApplicationServices.h>
|
||||||
|
|
||||||
#include "qcocoaprintdevice.h"
|
#include "qcocoaprintdevice.h"
|
||||||
|
|
||||||
#if QT_CONFIG(mimetype)
|
#if QT_CONFIG(mimetype)
|
||||||
@ -44,6 +46,8 @@
|
|||||||
#endif
|
#endif
|
||||||
#include <qdebug.h>
|
#include <qdebug.h>
|
||||||
|
|
||||||
|
#include <QtCore/private/qcore_mac_p.h>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
#ifndef QT_NO_PRINTER
|
#ifndef QT_NO_PRINTER
|
||||||
@ -117,7 +121,7 @@ QCocoaPrintDevice::~QCocoaPrintDevice()
|
|||||||
{
|
{
|
||||||
if (m_ppd)
|
if (m_ppd)
|
||||||
ppdClose(m_ppd);
|
ppdClose(m_ppd);
|
||||||
foreach (PMPaper paper, m_macPapers)
|
for (PMPaper paper : m_macPapers)
|
||||||
PMRelease(paper);
|
PMRelease(paper);
|
||||||
// Releasing the session appears to also release the printer
|
// Releasing the session appears to also release the printer
|
||||||
if (m_session)
|
if (m_session)
|
||||||
@ -171,7 +175,7 @@ QPageSize QCocoaPrintDevice::createPageSize(const PMPaper &paper) const
|
|||||||
void QCocoaPrintDevice::loadPageSizes() const
|
void QCocoaPrintDevice::loadPageSizes() const
|
||||||
{
|
{
|
||||||
m_pageSizes.clear();
|
m_pageSizes.clear();
|
||||||
foreach (PMPaper paper, m_macPapers)
|
for (PMPaper paper : m_macPapers)
|
||||||
PMRelease(paper);
|
PMRelease(paper);
|
||||||
m_macPapers.clear();
|
m_macPapers.clear();
|
||||||
m_printableMargins.clear();
|
m_printableMargins.clear();
|
||||||
|
@ -43,8 +43,6 @@
|
|||||||
#include <qpa/qplatformprintersupport.h>
|
#include <qpa/qplatformprintersupport.h>
|
||||||
#ifndef QT_NO_PRINTER
|
#ifndef QT_NO_PRINTER
|
||||||
|
|
||||||
#include "qt_mac_p.h"
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
class QCocoaPrinterSupport : public QPlatformPrinterSupport
|
class QCocoaPrinterSupport : public QPlatformPrinterSupport
|
||||||
|
@ -41,6 +41,10 @@
|
|||||||
|
|
||||||
#ifndef QT_NO_PRINTER
|
#ifndef QT_NO_PRINTER
|
||||||
|
|
||||||
|
#include <AppKit/AppKit.h>
|
||||||
|
|
||||||
|
#include <QtCore/private/qcore_mac_p.h>
|
||||||
|
|
||||||
#include "qcocoaprintdevice.h"
|
#include "qcocoaprintdevice.h"
|
||||||
#include "qprintengine_mac_p.h"
|
#include "qprintengine_mac_p.h"
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
#include <private/qsessionmanager_p.h>
|
#include <private/qsessionmanager_p.h>
|
||||||
#include <private/qguiapplication_p.h>
|
#include <private/qguiapplication_p.h>
|
||||||
|
|
||||||
#include <qcocoasessionmanager.h>
|
#include "qcocoasessionmanager.h"
|
||||||
#include <qstring.h>
|
#include <qstring.h>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
@ -46,8 +46,8 @@
|
|||||||
|
|
||||||
#if QT_CONFIG(systemtrayicon)
|
#if QT_CONFIG(systemtrayicon)
|
||||||
|
|
||||||
#include "QtCore/qstring.h"
|
#include <QtCore/qstring.h>
|
||||||
#include "QtGui/qpa/qplatformsystemtrayicon.h"
|
#include <QtGui/qpa/qplatformsystemtrayicon.h>
|
||||||
|
|
||||||
#include "qcocoamenu.h"
|
#include "qcocoamenu.h"
|
||||||
|
|
||||||
|
@ -84,7 +84,6 @@
|
|||||||
|
|
||||||
#include "qcocoamenu.h"
|
#include "qcocoamenu.h"
|
||||||
|
|
||||||
#include "qt_mac_p.h"
|
|
||||||
#include "qcocoahelpers.h"
|
#include "qcocoahelpers.h"
|
||||||
#include "qcocoaintegration.h"
|
#include "qcocoaintegration.h"
|
||||||
#include "qcocoascreen.h"
|
#include "qcocoascreen.h"
|
||||||
@ -162,7 +161,7 @@ void QCocoaSystemTrayIcon::updateIcon(const QIcon &icon)
|
|||||||
qreal devicePixelRatio = qApp->devicePixelRatio();
|
qreal devicePixelRatio = qApp->devicePixelRatio();
|
||||||
const int maxPixmapHeight = maxImageHeight * devicePixelRatio;
|
const int maxPixmapHeight = maxImageHeight * devicePixelRatio;
|
||||||
QSize selectedSize;
|
QSize selectedSize;
|
||||||
Q_FOREACH (const QSize& size, sortByHeight(icon.availableSizes())) {
|
for (const QSize& size : sortByHeight(icon.availableSizes())) {
|
||||||
// Select a pixmap based on the height. We want the largest pixmap
|
// Select a pixmap based on the height. We want the largest pixmap
|
||||||
// with a height smaller or equal to maxPixmapHeight. The pixmap
|
// with a height smaller or equal to maxPixmapHeight. The pixmap
|
||||||
// may rectangular; assume it has a reasonable size. If there is
|
// may rectangular; assume it has a reasonable size. If there is
|
||||||
|
@ -40,7 +40,6 @@
|
|||||||
#import <AppKit/AppKit.h>
|
#import <AppKit/AppKit.h>
|
||||||
|
|
||||||
#include "qcocoatheme.h"
|
#include "qcocoatheme.h"
|
||||||
#include "messages.h"
|
|
||||||
|
|
||||||
#include <QtCore/QOperatingSystemVersion>
|
#include <QtCore/QOperatingSystemVersion>
|
||||||
#include <QtCore/QVariant>
|
#include <QtCore/QVariant>
|
||||||
@ -547,7 +546,9 @@ QVariant QCocoaTheme::themeHint(ThemeHint hint) const
|
|||||||
|
|
||||||
QString QCocoaTheme::standardButtonText(int button) const
|
QString QCocoaTheme::standardButtonText(int button) const
|
||||||
{
|
{
|
||||||
return button == QPlatformDialogHelper::Discard ? msgDialogButtonDiscard() : QPlatformTheme::standardButtonText(button);
|
return button == QPlatformDialogHelper::Discard ?
|
||||||
|
QCoreApplication::translate("QCocoaTheme", "Don't Save")
|
||||||
|
: QPlatformTheme::standardButtonText(button);
|
||||||
}
|
}
|
||||||
|
|
||||||
QKeySequence QCocoaTheme::standardButtonShortcut(int button) const
|
QKeySequence QCocoaTheme::standardButtonShortcut(int button) const
|
||||||
|
@ -51,7 +51,6 @@
|
|||||||
#endif
|
#endif
|
||||||
#include "qnsview.h"
|
#include "qnsview.h"
|
||||||
#include "qnswindow.h"
|
#include "qnswindow.h"
|
||||||
#include "qt_mac_p.h"
|
|
||||||
|
|
||||||
#if QT_CONFIG(vulkan)
|
#if QT_CONFIG(vulkan)
|
||||||
#include <MoltenVK/mvk_vulkan.h>
|
#include <MoltenVK/mvk_vulkan.h>
|
||||||
|
@ -1830,7 +1830,7 @@ qreal QCocoaWindow::devicePixelRatio() const
|
|||||||
QWindow *QCocoaWindow::childWindowAt(QPoint windowPoint)
|
QWindow *QCocoaWindow::childWindowAt(QPoint windowPoint)
|
||||||
{
|
{
|
||||||
QWindow *targetWindow = window();
|
QWindow *targetWindow = window();
|
||||||
foreach (QObject *child, targetWindow->children())
|
for (QObject *child : targetWindow->children())
|
||||||
if (QWindow *childWindow = qobject_cast<QWindow *>(child))
|
if (QWindow *childWindow = qobject_cast<QWindow *>(child))
|
||||||
if (QPlatformWindow *handle = childWindow->handle())
|
if (QPlatformWindow *handle = childWindow->handle())
|
||||||
if (handle->isExposed() && childWindow->geometry().contains(windowPoint))
|
if (handle->isExposed() && childWindow->geometry().contains(windowPoint))
|
||||||
|
@ -38,14 +38,14 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "qmacclipboard.h"
|
#include "qmacclipboard.h"
|
||||||
#include "qclipboard.h"
|
#include <QtGui/qclipboard.h>
|
||||||
#include "qguiapplication.h"
|
#include <QtGui/qguiapplication.h>
|
||||||
#include "qbitmap.h"
|
#include <QtGui/qbitmap.h>
|
||||||
#include "qdatetime.h"
|
#include <QtCore/qdatetime.h>
|
||||||
#include "qdebug.h"
|
#include <QtCore/qdebug.h>
|
||||||
#include "qguiapplication.h"
|
#include <QtGui/qguiapplication.h>
|
||||||
#include "qevent.h"
|
#include <QtGui/qevent.h>
|
||||||
#include "qurl.h"
|
#include <QtCore/qurl.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "qcocoahelpers.h"
|
#include "qcocoahelpers.h"
|
||||||
|
@ -1,129 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
|
||||||
** Contact: https://www.qt.io/licensing/
|
|
||||||
**
|
|
||||||
** This file is part of the QtGui module 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$
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (c) 2007-2008, Apple, Inc.
|
|
||||||
**
|
|
||||||
** All rights reserved.
|
|
||||||
**
|
|
||||||
** Redistribution and use in source and binary forms, with or without
|
|
||||||
** modification, are permitted provided that the following conditions are met:
|
|
||||||
**
|
|
||||||
** * Redistributions of source code must retain the above copyright notice,
|
|
||||||
** this list of conditions and the following disclaimer.
|
|
||||||
**
|
|
||||||
** * Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
** this list of conditions and the following disclaimer in the documentation
|
|
||||||
** and/or other materials provided with the distribution.
|
|
||||||
**
|
|
||||||
** * Neither the name of Apple, Inc. nor the names of its contributors
|
|
||||||
** may be used to endorse or promote products derived from this software
|
|
||||||
** without specific prior written permission.
|
|
||||||
**
|
|
||||||
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
|
||||||
** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
||||||
** PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
||||||
** LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
||||||
** NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
||||||
** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* qmacdefines_mac_p.h
|
|
||||||
* All the defines you'll ever need for Qt/Mac :-)
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* This is just many defines. Therefore it doesn't need things like:
|
|
||||||
QT_BEGIN_NAMESPACE
|
|
||||||
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
|
||||||
|
|
||||||
Yes, it is an informative comment ;-)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <QtCore/qglobal.h>
|
|
||||||
|
|
||||||
#ifdef __LP64__
|
|
||||||
typedef signed int OSStatus;
|
|
||||||
#else
|
|
||||||
typedef signed long OSStatus;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct OpaqueEventHandlerCallRef * EventHandlerCallRef;
|
|
||||||
typedef struct OpaqueEventRef * EventRef;
|
|
||||||
typedef struct OpaqueMenuRef * MenuRef;
|
|
||||||
typedef struct OpaquePasteboardRef* PasteboardRef;
|
|
||||||
typedef struct OpaqueRgnHandle * RgnHandle;
|
|
||||||
typedef const struct __HIShape *HIShapeRef;
|
|
||||||
typedef struct __HIShape *HIMutableShapeRef;
|
|
||||||
typedef struct CGRect CGRect;
|
|
||||||
typedef struct CGImage *CGImageRef;
|
|
||||||
typedef struct CGContext *CGContextRef;
|
|
||||||
typedef struct GDevice * GDPtr;
|
|
||||||
typedef GDPtr * GDHandle;
|
|
||||||
typedef struct OpaqueIconRef * IconRef;
|
|
||||||
|
|
||||||
#ifdef __OBJC__
|
|
||||||
typedef NSWindow* OSWindowRef;
|
|
||||||
typedef NSView *OSViewRef;
|
|
||||||
typedef NSMenu *OSMenuRef;
|
|
||||||
typedef NSEvent *OSEventRef;
|
|
||||||
#else
|
|
||||||
typedef void *OSWindowRef;
|
|
||||||
typedef void *OSViewRef;
|
|
||||||
typedef void *OSMenuRef;
|
|
||||||
typedef void *OSEventRef;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef PasteboardRef OSPasteboardRef;
|
|
||||||
typedef struct AEDesc AEDescList;
|
|
||||||
typedef AEDescList AERecord;
|
|
||||||
typedef AERecord AppleEvent;
|
|
||||||
|
|
||||||
#ifdef check
|
|
||||||
#undef check
|
|
||||||
#endif
|
|
@ -184,7 +184,7 @@ QCocoaTouch::getCurrentTouchPointList(NSEvent *event, bool acceptSingleTouch)
|
|||||||
if (_touchCount != _currentTouches.size()) {
|
if (_touchCount != _currentTouches.size()) {
|
||||||
// Remove all instances, and basically start from scratch:
|
// Remove all instances, and basically start from scratch:
|
||||||
touchPoints.clear();
|
touchPoints.clear();
|
||||||
foreach (QCocoaTouch *qcocoaTouch, _currentTouches) {
|
for (QCocoaTouch *qcocoaTouch : _currentTouches) {
|
||||||
if (!_updateInternalStateOnly) {
|
if (!_updateInternalStateOnly) {
|
||||||
qcocoaTouch->_touchPoint.state = Qt::TouchPointReleased;
|
qcocoaTouch->_touchPoint.state = Qt::TouchPointReleased;
|
||||||
touchPoints.insert(qcocoaTouch->_touchPoint.id, qcocoaTouch->_touchPoint);
|
touchPoints.insert(qcocoaTouch->_touchPoint.id, qcocoaTouch->_touchPoint);
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
#include <AppKit/AppKit.h>
|
#include <AppKit/AppKit.h>
|
||||||
#include <MetalKit/MetalKit.h>
|
#include <MetalKit/MetalKit.h>
|
||||||
|
|
||||||
#include "private/qcore_mac_p.h"
|
#include <QtCore/private/qcore_mac_p.h>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QCocoaWindow;
|
class QCocoaWindow;
|
||||||
|
@ -39,11 +39,11 @@
|
|||||||
|
|
||||||
// This file is included from qnsview.mm, and only used to organize the code
|
// This file is included from qnsview.mm, and only used to organize the code
|
||||||
|
|
||||||
#include <qcocoaapplicationdelegate.h>
|
#include "qcocoaapplicationdelegate.h"
|
||||||
#include <qcocoansmenu.h>
|
#include "qcocoansmenu.h"
|
||||||
#include <qcocoamenuitem.h>
|
#include "qcocoamenuitem.h"
|
||||||
#include <qcocoamenu.h>
|
#include "qcocoamenu.h"
|
||||||
#include <qcocoamenubar.h>
|
#include "qcocoamenubar.h"
|
||||||
|
|
||||||
static bool selectorIsCutCopyPaste(SEL selector)
|
static bool selectorIsCutCopyPaste(SEL selector)
|
||||||
{
|
{
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
#include <qglobal.h>
|
#include <qglobal.h>
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
#include "qt_mac_p.h"
|
#include <QtCore/private/qcore_mac_p.h>
|
||||||
|
|
||||||
#include <AppKit/AppKit.h>
|
#include <AppKit/AppKit.h>
|
||||||
|
|
||||||
|
@ -37,6 +37,9 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <AppKit/AppKit.h>
|
||||||
|
#include <CoreGraphics/CoreGraphics.h>
|
||||||
|
|
||||||
#include "qpaintengine_mac_p.h"
|
#include "qpaintengine_mac_p.h"
|
||||||
#if defined(QT_PRINTSUPPORT_LIB)
|
#if defined(QT_PRINTSUPPORT_LIB)
|
||||||
#include "qprintengine_mac_p.h"
|
#include "qprintengine_mac_p.h"
|
||||||
|
@ -51,15 +51,15 @@
|
|||||||
// We mean it.
|
// We mean it.
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "QtGui/qpaintengine.h"
|
#include <QtGui/qpaintengine.h>
|
||||||
#include "private/qpaintengine_p.h"
|
#include <QtGui/private/qpaintengine_p.h>
|
||||||
#include "private/qpolygonclipper_p.h"
|
#include <QtGui/private/qpolygonclipper_p.h>
|
||||||
#include "private/qfont_p.h"
|
#include <QtGui/private/qfont_p.h>
|
||||||
#include "QtCore/qhash.h"
|
#include <QtCore/qhash.h>
|
||||||
|
|
||||||
#include "qt_mac_p.h"
|
|
||||||
|
|
||||||
typedef struct CGColorSpace *CGColorSpaceRef;
|
typedef struct CGColorSpace *CGColorSpaceRef;
|
||||||
|
typedef struct CGContext *CGContextRef;
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
class QCoreGraphicsPaintEnginePrivate;
|
class QCoreGraphicsPaintEnginePrivate;
|
||||||
|
@ -37,6 +37,9 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <AppKit/AppKit.h>
|
||||||
|
#include <ApplicationServices/ApplicationServices.h>
|
||||||
|
|
||||||
#include "qprintengine_mac_p.h"
|
#include "qprintengine_mac_p.h"
|
||||||
#include "qcocoaprintersupport.h"
|
#include "qcocoaprintersupport.h"
|
||||||
#include <quuid.h>
|
#include <quuid.h>
|
||||||
@ -44,6 +47,7 @@
|
|||||||
#include <QtCore/qcoreapplication.h>
|
#include <QtCore/qcoreapplication.h>
|
||||||
#include <QtCore/qdebug.h>
|
#include <QtCore/qdebug.h>
|
||||||
|
|
||||||
|
#include <QtCore/private/qcore_mac_p.h>
|
||||||
|
|
||||||
#ifndef QT_NO_PRINTER
|
#ifndef QT_NO_PRINTER
|
||||||
|
|
||||||
@ -485,7 +489,7 @@ void QMacPrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant &va
|
|||||||
int bestResolution = 0;
|
int bestResolution = 0;
|
||||||
int dpi = value.toInt();
|
int dpi = value.toInt();
|
||||||
int bestDistance = INT_MAX;
|
int bestDistance = INT_MAX;
|
||||||
foreach (int resolution, d->m_printDevice->supportedResolutions()) {
|
for (int resolution : d->m_printDevice->supportedResolutions()) {
|
||||||
if (dpi == resolution) {
|
if (dpi == resolution) {
|
||||||
bestResolution = resolution;
|
bestResolution = resolution;
|
||||||
break;
|
break;
|
||||||
@ -758,7 +762,7 @@ QVariant QMacPrintEngine::property(PrintEnginePropertyKey key) const
|
|||||||
}
|
}
|
||||||
case PPK_SupportedResolutions: {
|
case PPK_SupportedResolutions: {
|
||||||
QList<QVariant> list;
|
QList<QVariant> list;
|
||||||
foreach (int resolution, d->m_printDevice->supportedResolutions())
|
for (int resolution : d->m_printDevice->supportedResolutions())
|
||||||
list << resolution;
|
list << resolution;
|
||||||
ret = list;
|
ret = list;
|
||||||
break;
|
break;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"Name": "Cocoa Platform Plugin",
|
"Name": "Cocoa Platform Plugin",
|
||||||
"QDocModule": "qtgui",
|
"QDocModule": "qtgui",
|
||||||
"QtUsage": "Code used in the Qt Platform Abstraction (QPA) for macOS.",
|
"QtUsage": "Code used in the Qt Platform Abstraction (QPA) for macOS.",
|
||||||
"Files": "qcocoaapplication.h qcocoaapplication.mm qcocoaapplicationdelegate.h qcocoaapplicationdelegate.mm qcocoaeventdispatcher.h qcocoaeventdispatcher.mm qcocoaintrospection.h qcocoaintrospection.mm qcocoasystemtrayicon.mm qmacdefines_mac.h",
|
"Files": "qcocoaapplication.h qcocoaapplication.mm qcocoaapplicationdelegate.h qcocoaapplicationdelegate.mm qcocoaeventdispatcher.h qcocoaeventdispatcher.mm qcocoaintrospection.h qcocoaintrospection.mm qcocoasystemtrayicon.mm",
|
||||||
|
|
||||||
"Description": "Allows Qt to integrate into Apple's Cocoa API.",
|
"Description": "Allows Qt to integrate into Apple's Cocoa API.",
|
||||||
"LicenseId": "BSD-3-Clause",
|
"LicenseId": "BSD-3-Clause",
|
||||||
|
@ -1,127 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
|
||||||
** Contact: https://www.qt.io/licensing/
|
|
||||||
**
|
|
||||||
** This file is part of the QtGui module 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$
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#ifndef QT_MAC_P_H
|
|
||||||
#define QT_MAC_P_H
|
|
||||||
|
|
||||||
//
|
|
||||||
// W A R N I N G
|
|
||||||
// -------------
|
|
||||||
//
|
|
||||||
// This file is not part of the Qt API. It exists purely as an
|
|
||||||
// implementation detail. This header file may change from version to
|
|
||||||
// version without notice, or even be removed.
|
|
||||||
//
|
|
||||||
// We mean it.
|
|
||||||
//
|
|
||||||
|
|
||||||
#ifdef __OBJC__
|
|
||||||
#include <AppKit/AppKit.h>
|
|
||||||
#include <objc/runtime.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "qmacdefines_mac.h"
|
|
||||||
|
|
||||||
#include <CoreServices/CoreServices.h>
|
|
||||||
|
|
||||||
#include "QtCore/qglobal.h"
|
|
||||||
#include "QtCore/qvariant.h"
|
|
||||||
#include "QtCore/qmimedata.h"
|
|
||||||
#include "QtCore/qpointer.h"
|
|
||||||
#include "QtCore/qloggingcategory.h"
|
|
||||||
#include "private/qcore_mac_p.h"
|
|
||||||
|
|
||||||
|
|
||||||
#include "QtGui/qpainter.h"
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
|
||||||
class QWidget;
|
|
||||||
class QDragMoveEvent;
|
|
||||||
|
|
||||||
// Simple class to manage short-lived regions
|
|
||||||
class QMacSmartQuickDrawRegion
|
|
||||||
{
|
|
||||||
RgnHandle qdRgn;
|
|
||||||
Q_DISABLE_COPY(QMacSmartQuickDrawRegion)
|
|
||||||
public:
|
|
||||||
explicit QMacSmartQuickDrawRegion(RgnHandle rgn) : qdRgn(rgn) {}
|
|
||||||
~QMacSmartQuickDrawRegion() {
|
|
||||||
extern void qt_mac_dispose_rgn(RgnHandle); // qregion_mac.cpp
|
|
||||||
qt_mac_dispose_rgn(qdRgn);
|
|
||||||
}
|
|
||||||
operator RgnHandle() {
|
|
||||||
return qdRgn;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
class QMacInternalPasteboardMime;
|
|
||||||
class QMimeData;
|
|
||||||
|
|
||||||
|
|
||||||
extern QPaintDevice *qt_mac_safe_pdev; //qapplication_mac.cpp
|
|
||||||
|
|
||||||
extern OSWindowRef qt_mac_window_for(const QWidget*); //qwidget_mac.mm
|
|
||||||
extern OSViewRef qt_mac_nativeview_for(const QWidget *); //qwidget_mac.mm
|
|
||||||
extern QPoint qt_mac_nativeMapFromParent(const QWidget *child, const QPoint &pt); //qwidget_mac.mm
|
|
||||||
|
|
||||||
#ifdef check
|
|
||||||
# undef check
|
|
||||||
#endif
|
|
||||||
|
|
||||||
struct QMacDndAnswerRecord {
|
|
||||||
QRect rect;
|
|
||||||
Qt::KeyboardModifiers modifiers;
|
|
||||||
Qt::MouseButtons buttons;
|
|
||||||
Qt::DropAction lastAction;
|
|
||||||
unsigned int lastOperation;
|
|
||||||
void clear() {
|
|
||||||
rect = QRect();
|
|
||||||
modifiers = Qt::NoModifier;
|
|
||||||
buttons = Qt::NoButton;
|
|
||||||
lastAction = Qt::IgnoreAction;
|
|
||||||
lastOperation = 0;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
extern QMacDndAnswerRecord qt_mac_dnd_answer_rec;
|
|
||||||
void qt_mac_copy_answer_rect(const QDragMoveEvent &event);
|
|
||||||
bool qt_mac_mouse_inside_answer_rect(QPoint mouse);
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
|
||||||
|
|
||||||
#endif // QT_MAC_P_H
|
|
@ -83,7 +83,7 @@ QOpenWFDDevice::QOpenWFDDevice(QOpenWFDIntegration *integration, WFDint device_e
|
|||||||
|
|
||||||
int fd = wfdDeviceEventGetFD(mDevice,mEvent);
|
int fd = wfdDeviceEventGetFD(mDevice,mEvent);
|
||||||
mEventSocketNotifier = new QSocketNotifier(fd,QSocketNotifier::Read,this);
|
mEventSocketNotifier = new QSocketNotifier(fd,QSocketNotifier::Read,this);
|
||||||
connect(mEventSocketNotifier,SIGNAL(activated(int)),SLOT(readEvents()));
|
connect(mEventSocketNotifier,SIGNAL(activated(QSocketDescriptor)),SLOT(readEvents()));
|
||||||
|
|
||||||
mCommitedDevice = true;
|
mCommitedDevice = true;
|
||||||
commit(WFD_COMMIT_ENTIRE_DEVICE, handle());
|
commit(WFD_COMMIT_ENTIRE_DEVICE, handle());
|
||||||
|
@ -96,7 +96,7 @@ void QQnxButtonEventNotifier::start()
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_readNotifier = new QSocketNotifier(m_fd, QSocketNotifier::Read);
|
m_readNotifier = new QSocketNotifier(m_fd, QSocketNotifier::Read);
|
||||||
QObject::connect(m_readNotifier, SIGNAL(activated(int)), this, SLOT(updateButtonStates()));
|
QObject::connect(m_readNotifier, SIGNAL(activated(QSocketDescriptor)), this, SLOT(updateButtonStates()));
|
||||||
|
|
||||||
qButtonDebug("successfully connected to Navigator. fd = %d", m_fd);
|
qButtonDebug("successfully connected to Navigator. fd = %d", m_fd);
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,7 @@ void QQnxNavigatorEventNotifier::start()
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_readNotifier = new QSocketNotifier(m_fd, QSocketNotifier::Read);
|
m_readNotifier = new QSocketNotifier(m_fd, QSocketNotifier::Read);
|
||||||
connect(m_readNotifier, SIGNAL(activated(int)), this, SLOT(readData()));
|
connect(m_readNotifier, SIGNAL(activated(QSocketDescriptor)), this, SLOT(readData()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQnxNavigatorEventNotifier::parsePPS(const QByteArray &ppsData, QByteArray &msg, QByteArray &dat, QByteArray &id)
|
void QQnxNavigatorEventNotifier::parsePPS(const QByteArray &ppsData, QByteArray &msg, QByteArray &dat, QByteArray &id)
|
||||||
|
@ -143,7 +143,7 @@ bool QQnxVirtualKeyboardPps::connect()
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
m_readNotifier = new QSocketNotifier(m_fd, QSocketNotifier::Read);
|
m_readNotifier = new QSocketNotifier(m_fd, QSocketNotifier::Read);
|
||||||
QObject::connect(m_readNotifier, SIGNAL(activated(int)), this, SLOT(ppsDataReady()));
|
QObject::connect(m_readNotifier, SIGNAL(activated(QSocketDescriptor)), this, SLOT(ppsDataReady()));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -195,7 +195,7 @@ void QWasmEventDispatcher::wakeUp()
|
|||||||
#ifdef EMSCRIPTEN_HAS_ASYNC_RUN_IN_MAIN_RUNTIME_THREAD
|
#ifdef EMSCRIPTEN_HAS_ASYNC_RUN_IN_MAIN_RUNTIME_THREAD
|
||||||
if (!emscripten_is_main_runtime_thread())
|
if (!emscripten_is_main_runtime_thread())
|
||||||
if (m_hasMainLoop)
|
if (m_hasMainLoop)
|
||||||
emscripten_async_run_in_main_runtime_thread_(EM_FUNC_SIG_VI, (void*)(&QWasmEventDispatcher::mainThreadWakeUp), this);
|
emscripten_async_run_in_main_runtime_thread_(EM_FUNC_SIG_VI, (void*)(&QWasmEventDispatcher::mainThreadWakeUp), this);
|
||||||
#endif
|
#endif
|
||||||
QEventDispatcherUNIX::wakeUp();
|
QEventDispatcherUNIX::wakeUp();
|
||||||
}
|
}
|
||||||
|
@ -1401,6 +1401,11 @@ void QWindowsWindow::fireExpose(const QRegion ®ion, bool force)
|
|||||||
QWindowSystemInterface::handleExposeEvent(window(), region);
|
QWindowSystemInterface::handleExposeEvent(window(), region);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QWindowsWindow::fireFullExpose(bool force)
|
||||||
|
{
|
||||||
|
fireExpose(QRect(QPoint(0, 0), m_data.geometry.size()), force);
|
||||||
|
}
|
||||||
|
|
||||||
void QWindowsWindow::destroyWindow()
|
void QWindowsWindow::destroyWindow()
|
||||||
{
|
{
|
||||||
qCDebug(lcQpaWindows) << __FUNCTION__ << this << window() << m_data.hwnd;
|
qCDebug(lcQpaWindows) << __FUNCTION__ << this << window() << m_data.hwnd;
|
||||||
@ -1561,7 +1566,7 @@ void QWindowsWindow::setVisible(bool visible)
|
|||||||
// over the rendering of the window
|
// over the rendering of the window
|
||||||
// There is nobody waiting for this, so we don't need to flush afterwards.
|
// There is nobody waiting for this, so we don't need to flush afterwards.
|
||||||
if (isLayered())
|
if (isLayered())
|
||||||
fireExpose(QRect(0, 0, win->width(), win->height()));
|
fireFullExpose();
|
||||||
// QTBUG-44928, QTBUG-7386: This is to resolve the problem where popups are
|
// QTBUG-44928, QTBUG-7386: This is to resolve the problem where popups are
|
||||||
// opened from the system tray and not being implicitly activated
|
// opened from the system tray and not being implicitly activated
|
||||||
|
|
||||||
@ -1904,12 +1909,13 @@ void QWindowsWindow::handleResized(int wParam)
|
|||||||
handleWindowStateChange(m_windowState | Qt::WindowMinimized);
|
handleWindowStateChange(m_windowState | Qt::WindowMinimized);
|
||||||
return;
|
return;
|
||||||
case SIZE_MAXIMIZED:
|
case SIZE_MAXIMIZED:
|
||||||
|
handleGeometryChange();
|
||||||
if (!testFlag(WithinSetStyle) && !testFlag(WithinSetGeometry))
|
if (!testFlag(WithinSetStyle) && !testFlag(WithinSetGeometry))
|
||||||
handleWindowStateChange(Qt::WindowMaximized | (isFullScreen_sys() ? Qt::WindowFullScreen
|
handleWindowStateChange(Qt::WindowMaximized | (isFullScreen_sys() ? Qt::WindowFullScreen
|
||||||
: Qt::WindowNoState));
|
: Qt::WindowNoState));
|
||||||
handleGeometryChange();
|
|
||||||
break;
|
break;
|
||||||
case SIZE_RESTORED:
|
case SIZE_RESTORED:
|
||||||
|
handleGeometryChange();
|
||||||
if (!testFlag(WithinSetStyle) && !testFlag(WithinSetGeometry)) {
|
if (!testFlag(WithinSetStyle) && !testFlag(WithinSetGeometry)) {
|
||||||
if (isFullScreen_sys())
|
if (isFullScreen_sys())
|
||||||
handleWindowStateChange(
|
handleWindowStateChange(
|
||||||
@ -1918,7 +1924,6 @@ void QWindowsWindow::handleResized(int wParam)
|
|||||||
else if (m_windowState != Qt::WindowNoState && !testFlag(MaximizeToFullScreen))
|
else if (m_windowState != Qt::WindowNoState && !testFlag(MaximizeToFullScreen))
|
||||||
handleWindowStateChange(Qt::WindowNoState);
|
handleWindowStateChange(Qt::WindowNoState);
|
||||||
}
|
}
|
||||||
handleGeometryChange();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1966,7 +1971,7 @@ void QWindowsWindow::handleGeometryChange()
|
|||||||
&& m_data.geometry.size() != previousGeometry.size() // Exclude plain move
|
&& m_data.geometry.size() != previousGeometry.size() // Exclude plain move
|
||||||
// One dimension grew -> Windows will send expose, no need to synthesize.
|
// One dimension grew -> Windows will send expose, no need to synthesize.
|
||||||
&& !(m_data.geometry.width() > previousGeometry.width() || m_data.geometry.height() > previousGeometry.height())) {
|
&& !(m_data.geometry.width() > previousGeometry.width() || m_data.geometry.height() > previousGeometry.height())) {
|
||||||
fireExpose(QRect(QPoint(0, 0), m_data.geometry.size()), true);
|
fireFullExpose(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool wasSync = testFlag(SynchronousGeometryChangeEvent);
|
const bool wasSync = testFlag(SynchronousGeometryChangeEvent);
|
||||||
@ -2165,7 +2170,7 @@ void QWindowsWindow::handleWindowStateChange(Qt::WindowStates state)
|
|||||||
QWindow *w = window();
|
QWindow *w = window();
|
||||||
bool exposeEventsSent = false;
|
bool exposeEventsSent = false;
|
||||||
if (isLayered()) {
|
if (isLayered()) {
|
||||||
fireExpose(QRegion(0, 0, w->width(), w->height()));
|
fireFullExpose();
|
||||||
exposeEventsSent = true;
|
exposeEventsSent = true;
|
||||||
}
|
}
|
||||||
const QWindowList allWindows = QGuiApplication::allWindows();
|
const QWindowList allWindows = QGuiApplication::allWindows();
|
||||||
@ -2173,7 +2178,7 @@ void QWindowsWindow::handleWindowStateChange(Qt::WindowStates state)
|
|||||||
if (child != w && child->isVisible() && child->transientParent() == w) {
|
if (child != w && child->isVisible() && child->transientParent() == w) {
|
||||||
QWindowsWindow *platformWindow = QWindowsWindow::windowsWindowOf(child);
|
QWindowsWindow *platformWindow = QWindowsWindow::windowsWindowOf(child);
|
||||||
if (platformWindow && platformWindow->isLayered()) {
|
if (platformWindow && platformWindow->isLayered()) {
|
||||||
platformWindow->fireExpose(QRegion(0, 0, child->width(), child->height()));
|
platformWindow->fireFullExpose();
|
||||||
exposeEventsSent = true;
|
exposeEventsSent = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2287,8 +2292,10 @@ void QWindowsWindow::setWindowState_sys(Qt::WindowStates newState)
|
|||||||
if (!screen)
|
if (!screen)
|
||||||
screen = QGuiApplication::primaryScreen();
|
screen = QGuiApplication::primaryScreen();
|
||||||
// That area of the virtual desktop might not be covered by a screen anymore.
|
// That area of the virtual desktop might not be covered by a screen anymore.
|
||||||
if (!screen->geometry().intersects(m_savedFrameGeometry))
|
if (const auto platformScreen = screen->handle()) {
|
||||||
m_savedFrameGeometry.moveTo(screen->geometry().topLeft());
|
if (!platformScreen->geometry().intersects(m_savedFrameGeometry))
|
||||||
|
m_savedFrameGeometry.moveTo(platformScreen->geometry().topLeft());
|
||||||
|
}
|
||||||
|
|
||||||
if (newState & Qt::WindowMinimized) {
|
if (newState & Qt::WindowMinimized) {
|
||||||
setMinimizedGeometry(m_data.hwnd, m_savedFrameGeometry);
|
setMinimizedGeometry(m_data.hwnd, m_savedFrameGeometry);
|
||||||
|
@ -373,6 +373,7 @@ private:
|
|||||||
void handleWindowStateChange(Qt::WindowStates state);
|
void handleWindowStateChange(Qt::WindowStates state);
|
||||||
inline void destroyIcon();
|
inline void destroyIcon();
|
||||||
void fireExpose(const QRegion ®ion, bool force=false);
|
void fireExpose(const QRegion ®ion, bool force=false);
|
||||||
|
void fireFullExpose(bool force=false);
|
||||||
void calculateFullFrameMargins();
|
void calculateFullFrameMargins();
|
||||||
|
|
||||||
mutable QWindowsWindowData m_data;
|
mutable QWindowsWindowData m_data;
|
||||||
|
@ -61,11 +61,11 @@ public:
|
|||||||
QSmSocketReceiver(int socket)
|
QSmSocketReceiver(int socket)
|
||||||
{
|
{
|
||||||
QSocketNotifier* sn = new QSocketNotifier(socket, QSocketNotifier::Read, this);
|
QSocketNotifier* sn = new QSocketNotifier(socket, QSocketNotifier::Read, this);
|
||||||
connect(sn, SIGNAL(activated(int)), this, SLOT(socketActivated(int)));
|
connect(sn, SIGNAL(activated(QSocketDescriptor)), this, SLOT(socketActivated()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
void socketActivated(int);
|
void socketActivated();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -327,7 +327,7 @@ static void sm_saveYourselfPhase2Callback(SmcConn smcConn, SmPointer clientData)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void QSmSocketReceiver::socketActivated(int)
|
void QSmSocketReceiver::socketActivated()
|
||||||
{
|
{
|
||||||
IceProcessMessages(SmcGetIceConnection(smcConnection), nullptr, nullptr);
|
IceProcessMessages(SmcGetIceConnection(smcConnection), nullptr, nullptr);
|
||||||
}
|
}
|
||||||
|
@ -279,7 +279,7 @@ void QPSQLDriverPrivate::checkPendingNotifications() const
|
|||||||
Q_Q(const QPSQLDriver);
|
Q_Q(const QPSQLDriver);
|
||||||
if (seid.size() && !pendingNotifyCheck) {
|
if (seid.size() && !pendingNotifyCheck) {
|
||||||
pendingNotifyCheck = true;
|
pendingNotifyCheck = true;
|
||||||
QMetaObject::invokeMethod(const_cast<QPSQLDriver*>(q), "_q_handleNotification", Qt::QueuedConnection, Q_ARG(int,0));
|
QMetaObject::invokeMethod(const_cast<QPSQLDriver*>(q), "_q_handleNotification", Qt::QueuedConnection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1246,7 +1246,7 @@ void QPSQLDriver::close()
|
|||||||
|
|
||||||
d->seid.clear();
|
d->seid.clear();
|
||||||
if (d->sn) {
|
if (d->sn) {
|
||||||
disconnect(d->sn, SIGNAL(activated(int)), this, SLOT(_q_handleNotification(int)));
|
disconnect(d->sn, SIGNAL(activated(QSocketDescriptor)), this, SLOT(_q_handleNotification()));
|
||||||
delete d->sn;
|
delete d->sn;
|
||||||
d->sn = nullptr;
|
d->sn = nullptr;
|
||||||
}
|
}
|
||||||
@ -1603,7 +1603,7 @@ bool QPSQLDriver::subscribeToNotification(const QString &name)
|
|||||||
|
|
||||||
if (!d->sn) {
|
if (!d->sn) {
|
||||||
d->sn = new QSocketNotifier(socket, QSocketNotifier::Read);
|
d->sn = new QSocketNotifier(socket, QSocketNotifier::Read);
|
||||||
connect(d->sn, SIGNAL(activated(int)), this, SLOT(_q_handleNotification(int)));
|
connect(d->sn, SIGNAL(activated(QSocketDescriptor)), this, SLOT(_q_handleNotification()));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
qWarning("QPSQLDriver::subscribeToNotificationImplementation: PQsocket didn't return a valid socket to listen on");
|
qWarning("QPSQLDriver::subscribeToNotificationImplementation: PQsocket didn't return a valid socket to listen on");
|
||||||
@ -1639,7 +1639,7 @@ bool QPSQLDriver::unsubscribeFromNotification(const QString &name)
|
|||||||
d->seid.removeAll(name);
|
d->seid.removeAll(name);
|
||||||
|
|
||||||
if (d->seid.isEmpty()) {
|
if (d->seid.isEmpty()) {
|
||||||
disconnect(d->sn, SIGNAL(activated(int)), this, SLOT(_q_handleNotification(int)));
|
disconnect(d->sn, SIGNAL(activated(QSocketDescriptor)), this, SLOT(_q_handleNotification()));
|
||||||
delete d->sn;
|
delete d->sn;
|
||||||
d->sn = nullptr;
|
d->sn = nullptr;
|
||||||
}
|
}
|
||||||
@ -1653,7 +1653,7 @@ QStringList QPSQLDriver::subscribedToNotifications() const
|
|||||||
return d->seid;
|
return d->seid;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QPSQLDriver::_q_handleNotification(int)
|
void QPSQLDriver::_q_handleNotification()
|
||||||
{
|
{
|
||||||
Q_D(QPSQLDriver);
|
Q_D(QPSQLDriver);
|
||||||
d->pendingNotifyCheck = false;
|
d->pendingNotifyCheck = false;
|
||||||
|
@ -130,7 +130,7 @@ protected:
|
|||||||
bool rollbackTransaction() override;
|
bool rollbackTransaction() override;
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void _q_handleNotification(int);
|
void _q_handleNotification();
|
||||||
};
|
};
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
@ -439,11 +439,10 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
// rcc uses a QHash to store files in the resource system.
|
// rcc uses a QHash to store files in the resource system.
|
||||||
// we must force a certain hash order when testing or tst_rcc will fail, see QTBUG-25078
|
// we must force a certain hash order when testing or tst_rcc will fail, see QTBUG-25078
|
||||||
if (Q_UNLIKELY(!qEnvironmentVariableIsEmpty("QT_RCC_TEST"))) {
|
// similar requirements exist for reproducibly builds.
|
||||||
qSetGlobalQHashSeed(0);
|
qSetGlobalQHashSeed(0);
|
||||||
if (qGlobalQHashSeed() != 0)
|
if (qGlobalQHashSeed() != 0)
|
||||||
qFatal("Cannot force QHash seed for testing as requested");
|
qWarning("Cannot force QHash seed");
|
||||||
}
|
|
||||||
|
|
||||||
return QT_PREPEND_NAMESPACE(runRcc)(argc, argv);
|
return QT_PREPEND_NAMESPACE(runRcc)(argc, argv);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
** Copyright (C) 2020 The Qt Company Ltd.
|
||||||
** Contact: https://www.qt.io/licensing/
|
** Contact: https://www.qt.io/licensing/
|
||||||
**
|
**
|
||||||
** This file is part of the QtWidgets module of the Qt Toolkit.
|
** This file is part of the QtWidgets module of the Qt Toolkit.
|
||||||
@ -413,8 +413,11 @@ void QAbstractButtonPrivate::emitClicked()
|
|||||||
QPointer<QAbstractButton> guard(q);
|
QPointer<QAbstractButton> guard(q);
|
||||||
emit q->clicked(checked);
|
emit q->clicked(checked);
|
||||||
#if QT_CONFIG(buttongroup)
|
#if QT_CONFIG(buttongroup)
|
||||||
if (guard && group)
|
if (guard && group) {
|
||||||
emit group->buttonClicked(q);
|
emit group->idClicked(group->id(q));
|
||||||
|
if (guard && group)
|
||||||
|
emit group->buttonClicked(q);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -424,8 +427,11 @@ void QAbstractButtonPrivate::emitPressed()
|
|||||||
QPointer<QAbstractButton> guard(q);
|
QPointer<QAbstractButton> guard(q);
|
||||||
emit q->pressed();
|
emit q->pressed();
|
||||||
#if QT_CONFIG(buttongroup)
|
#if QT_CONFIG(buttongroup)
|
||||||
if (guard && group)
|
if (guard && group) {
|
||||||
emit group->buttonPressed(q);
|
emit group->idPressed(group->id(q));
|
||||||
|
if (guard && group)
|
||||||
|
emit group->buttonPressed(q);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -435,8 +441,11 @@ void QAbstractButtonPrivate::emitReleased()
|
|||||||
QPointer<QAbstractButton> guard(q);
|
QPointer<QAbstractButton> guard(q);
|
||||||
emit q->released();
|
emit q->released();
|
||||||
#if QT_CONFIG(buttongroup)
|
#if QT_CONFIG(buttongroup)
|
||||||
if (guard && group)
|
if (guard && group) {
|
||||||
emit group->buttonReleased(q);
|
emit group->idReleased(group->id(q));
|
||||||
|
if (guard && group)
|
||||||
|
emit group->buttonReleased(q);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -446,8 +455,11 @@ void QAbstractButtonPrivate::emitToggled(bool checked)
|
|||||||
QPointer<QAbstractButton> guard(q);
|
QPointer<QAbstractButton> guard(q);
|
||||||
emit q->toggled(checked);
|
emit q->toggled(checked);
|
||||||
#if QT_CONFIG(buttongroup)
|
#if QT_CONFIG(buttongroup)
|
||||||
if (guard && group)
|
if (guard && group) {
|
||||||
emit group->buttonToggled(q, checked);
|
emit group->idToggled(group->id(q), checked);
|
||||||
|
if (guard && group)
|
||||||
|
emit group->buttonToggled(q, checked);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
** Copyright (C) 2020 The Qt Company Ltd.
|
||||||
** Contact: https://www.qt.io/licensing/
|
** Contact: https://www.qt.io/licensing/
|
||||||
**
|
**
|
||||||
** This file is part of the QtWidgets module of the Qt Toolkit.
|
** This file is part of the QtWidgets module of the Qt Toolkit.
|
||||||
@ -162,6 +162,16 @@ void QButtonGroup::setExclusive(bool exclusive)
|
|||||||
\sa checkedButton(), QAbstractButton::clicked()
|
\sa checkedButton(), QAbstractButton::clicked()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn void QButtonGroup::idClicked(int id)
|
||||||
|
\since 5.15
|
||||||
|
|
||||||
|
This signal is emitted when a button with the given \a id is
|
||||||
|
clicked.
|
||||||
|
|
||||||
|
\sa checkedButton(), QAbstractButton::clicked()
|
||||||
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn void QButtonGroup::buttonPressed(QAbstractButton *button)
|
\fn void QButtonGroup::buttonPressed(QAbstractButton *button)
|
||||||
\since 4.2
|
\since 4.2
|
||||||
@ -171,6 +181,16 @@ void QButtonGroup::setExclusive(bool exclusive)
|
|||||||
\sa QAbstractButton::pressed()
|
\sa QAbstractButton::pressed()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn void QButtonGroup::idPressed(int id)
|
||||||
|
\since 5.15
|
||||||
|
|
||||||
|
This signal is emitted when a button with the given \a id is
|
||||||
|
pressed down.
|
||||||
|
|
||||||
|
\sa QAbstractButton::pressed()
|
||||||
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn void QButtonGroup::buttonReleased(QAbstractButton *button)
|
\fn void QButtonGroup::buttonReleased(QAbstractButton *button)
|
||||||
\since 4.2
|
\since 4.2
|
||||||
@ -180,6 +200,16 @@ void QButtonGroup::setExclusive(bool exclusive)
|
|||||||
\sa QAbstractButton::released()
|
\sa QAbstractButton::released()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn void QButtonGroup::idReleased(int id)
|
||||||
|
\since 5.15
|
||||||
|
|
||||||
|
This signal is emitted when a button with the given \a id is
|
||||||
|
released.
|
||||||
|
|
||||||
|
\sa QAbstractButton::released()
|
||||||
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn void QButtonGroup::buttonToggled(QAbstractButton *button, bool checked)
|
\fn void QButtonGroup::buttonToggled(QAbstractButton *button, bool checked)
|
||||||
\since 5.2
|
\since 5.2
|
||||||
@ -190,6 +220,15 @@ void QButtonGroup::setExclusive(bool exclusive)
|
|||||||
\sa QAbstractButton::toggled()
|
\sa QAbstractButton::toggled()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn void QButtonGroup::idToggled(int id, bool checked)
|
||||||
|
\since 5.15
|
||||||
|
|
||||||
|
This signal is emitted when a button with the given \a id is toggled.
|
||||||
|
\a checked is true if the button is checked, or false if the button is unchecked.
|
||||||
|
|
||||||
|
\sa QAbstractButton::toggled()
|
||||||
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Adds the given \a button to the button group. If \a id is -1,
|
Adds the given \a button to the button group. If \a id is -1,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
** Copyright (C) 2020 The Qt Company Ltd.
|
||||||
** Contact: https://www.qt.io/licensing/
|
** Contact: https://www.qt.io/licensing/
|
||||||
**
|
**
|
||||||
** This file is part of the QtWidgets module of the Qt Toolkit.
|
** This file is part of the QtWidgets module of the Qt Toolkit.
|
||||||
@ -81,6 +81,10 @@ Q_SIGNALS:
|
|||||||
void buttonPressed(QAbstractButton *);
|
void buttonPressed(QAbstractButton *);
|
||||||
void buttonReleased(QAbstractButton *);
|
void buttonReleased(QAbstractButton *);
|
||||||
void buttonToggled(QAbstractButton *, bool);
|
void buttonToggled(QAbstractButton *, bool);
|
||||||
|
void idClicked(int);
|
||||||
|
void idPressed(int);
|
||||||
|
void idReleased(int);
|
||||||
|
void idToggled(int, bool);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(QButtonGroup)
|
Q_DISABLE_COPY(QButtonGroup)
|
||||||
|
@ -47,8 +47,10 @@ Q_FORWARD_DECLARE_OBJC_CLASS(NSView);
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
#if QT_DEPRECATED_SINCE(5, 15)
|
||||||
class QMacCocoaViewContainerPrivate;
|
class QMacCocoaViewContainerPrivate;
|
||||||
class Q_WIDGETS_EXPORT QMacCocoaViewContainer : public QWidget
|
class QT_DEPRECATED_X("Use QWindow::fromWinId and QWidget::createWindowContainer instead")
|
||||||
|
Q_WIDGETS_EXPORT QMacCocoaViewContainer : public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
@ -61,6 +63,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
Q_DECLARE_PRIVATE(QMacCocoaViewContainer)
|
Q_DECLARE_PRIVATE(QMacCocoaViewContainer)
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user