Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I04afffdce6b78856d0301eb583f21d334c7466b0
This commit is contained in:
commit
ec5e692c1c
@ -941,7 +941,7 @@ foreach my $lib (@modules_to_sync) {
|
|||||||
my %master_contents = ();
|
my %master_contents = ();
|
||||||
|
|
||||||
#remove the old files
|
#remove the old files
|
||||||
if($remove_stale) {
|
if ($remove_stale && !$minimal) {
|
||||||
my %injections = ();
|
my %injections = ();
|
||||||
for my $p (keys %inject_headers) {
|
for my $p (keys %inject_headers) {
|
||||||
next unless ($p =~ /^\Q$dir\E(\/|$)/);
|
next unless ($p =~ /^\Q$dir\E(\/|$)/);
|
||||||
|
@ -121,8 +121,7 @@ defineReplace(qtConfFunc_licenseCheck) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
!$$hasCommercial: \
|
!$$hasCommercial: \
|
||||||
qtConfFatalError("No license files and no licheck executables found." \
|
qtConfFatalError("No license files. Cannot proceed. Try re-installing Qt.")
|
||||||
"Cannot proceed. Try re-installing Qt.")
|
|
||||||
commercial = yes
|
commercial = yes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1318,6 +1317,7 @@ defineTest(createConfigStatus) {
|
|||||||
cont = \
|
cont = \
|
||||||
"$$system_quote($$system_path($$cfg)$$ext) -redo %*"
|
"$$system_quote($$system_path($$cfg)$$ext) -redo %*"
|
||||||
} else {
|
} else {
|
||||||
|
!contains(cfg, .*/.*): cfg = ./$$cfg
|
||||||
cont = \
|
cont = \
|
||||||
"$${LITERAL_HASH}!/bin/sh" \
|
"$${LITERAL_HASH}!/bin/sh" \
|
||||||
"exec $$system_quote($$cfg) -redo \"$@\""
|
"exec $$system_quote($$cfg) -redo \"$@\""
|
||||||
|
@ -4,9 +4,7 @@ load(device_config)
|
|||||||
isEmpty(DEFAULT_ANDROID_NDK_ROOT): return()
|
isEmpty(DEFAULT_ANDROID_NDK_ROOT): return()
|
||||||
|
|
||||||
NDK_ROOT = $$(ANDROID_NDK_ROOT)
|
NDK_ROOT = $$(ANDROID_NDK_ROOT)
|
||||||
!exists($$NDK_ROOT) {
|
isEmpty(NDK_ROOT): NDK_ROOT = $$DEFAULT_ANDROID_NDK_ROOT
|
||||||
NDK_ROOT = $$DEFAULT_ANDROID_NDK_ROOT
|
|
||||||
}
|
|
||||||
|
|
||||||
NDK_HOST = $$(ANDROID_NDK_HOST)
|
NDK_HOST = $$(ANDROID_NDK_HOST)
|
||||||
isEmpty(NDK_HOST): NDK_HOST = $$DEFAULT_ANDROID_NDK_HOST
|
isEmpty(NDK_HOST): NDK_HOST = $$DEFAULT_ANDROID_NDK_HOST
|
||||||
@ -69,10 +67,6 @@ CONFIG += $$ANDROID_PLATFORM
|
|||||||
QMAKE_CFLAGS = -D__ANDROID_API__=$$replace(ANDROID_PLATFORM, "android-", "")
|
QMAKE_CFLAGS = -D__ANDROID_API__=$$replace(ANDROID_PLATFORM, "android-", "")
|
||||||
|
|
||||||
ANDROID_PLATFORM_ROOT_PATH = $$NDK_ROOT/platforms/$$ANDROID_PLATFORM/arch-$$ANDROID_ARCHITECTURE/
|
ANDROID_PLATFORM_ROOT_PATH = $$NDK_ROOT/platforms/$$ANDROID_PLATFORM/arch-$$ANDROID_ARCHITECTURE/
|
||||||
ANDROID_PLATFORM_PATH = $$ANDROID_PLATFORM_ROOT_PATH/usr
|
|
||||||
|
|
||||||
equals(ANDROID_TARGET_ARCH, x86_64)|equals(ANDROID_TARGET_ARCH, mips64): \
|
|
||||||
QMAKE_ANDROID_PLATFORM_LIBDIR = $${QMAKE_ANDROID_PLATFORM_LIBDIR}64
|
|
||||||
|
|
||||||
CROSS_COMPILE = $$NDK_TOOLCHAIN_PATH/bin/$$NDK_TOOLS_PREFIX-
|
CROSS_COMPILE = $$NDK_TOOLCHAIN_PATH/bin/$$NDK_TOOLS_PREFIX-
|
||||||
|
|
||||||
|
@ -69,7 +69,6 @@ QMAKE_LIBDIR_OPENGL =
|
|||||||
|
|
||||||
QMAKE_LINK_SHLIB = $$QMAKE_LINK
|
QMAKE_LINK_SHLIB = $$QMAKE_LINK
|
||||||
QMAKE_LFLAGS = --sysroot=$$ANDROID_PLATFORM_ROOT_PATH
|
QMAKE_LFLAGS = --sysroot=$$ANDROID_PLATFORM_ROOT_PATH
|
||||||
QMAKE_RPATHLINK = $$QMAKE_ANDROID_PLATFORM_LIBDIR
|
|
||||||
QMAKE_LFLAGS_APP = -Wl,--no-undefined -Wl,-z,noexecstack -shared
|
QMAKE_LFLAGS_APP = -Wl,--no-undefined -Wl,-z,noexecstack -shared
|
||||||
QMAKE_LFLAGS_SHLIB = -Wl,--no-undefined -Wl,-z,noexecstack -shared
|
QMAKE_LFLAGS_SHLIB = -Wl,--no-undefined -Wl,-z,noexecstack -shared
|
||||||
QMAKE_LFLAGS_PLUGIN = $$QMAKE_LFLAGS_SHLIB
|
QMAKE_LFLAGS_PLUGIN = $$QMAKE_LFLAGS_SHLIB
|
||||||
|
@ -17,5 +17,15 @@
|
|||||||
"list-features": "void",
|
"list-features": "void",
|
||||||
"list-libraries": "void"
|
"list-libraries": "void"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"testTypeDependencies": {
|
||||||
|
"library": [ "library-paths" ]
|
||||||
|
},
|
||||||
|
|
||||||
|
"features": {
|
||||||
|
"library-paths": {
|
||||||
|
"output": [ "libraryPaths" ]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1156,7 +1156,7 @@ defineTest(qtConfSetupTestTypeDeps) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
defineTest(qtConfEnsureTestTypeDeps) {
|
defineTest(qtConfEnsureTestTypeDepsOne) {
|
||||||
depsn = $${currentConfig}.testTypeDependencies.$${1}._KEYS_
|
depsn = $${currentConfig}.testTypeDependencies.$${1}._KEYS_
|
||||||
!isEmpty($$depsn) {
|
!isEmpty($$depsn) {
|
||||||
for (dep, $$depsn) {
|
for (dep, $$depsn) {
|
||||||
@ -1170,12 +1170,18 @@ defineTest(qtConfEnsureTestTypeDeps) {
|
|||||||
fwdsn = $${currentConfig}.testTypeForwards.$${1}
|
fwdsn = $${currentConfig}.testTypeForwards.$${1}
|
||||||
!isEmpty($$fwdsn) {
|
!isEmpty($$fwdsn) {
|
||||||
for (fwd, $$fwdsn): \
|
for (fwd, $$fwdsn): \
|
||||||
qtConfEnsureTestTypeDeps($$fwd)
|
qtConfEnsureTestTypeDepsOne($$fwd)
|
||||||
$$fwdsn =
|
$$fwdsn =
|
||||||
export($$fwdsn)
|
export($$fwdsn)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defineTest(qtConfEnsureTestTypeDeps) {
|
||||||
|
qtConfEnsureTestTypeDepsOne($$1)
|
||||||
|
currentConfig = config.builtins
|
||||||
|
qtConfEnsureTestTypeDepsOne($$1)
|
||||||
|
}
|
||||||
|
|
||||||
defineTest(qtRunSingleTest) {
|
defineTest(qtRunSingleTest) {
|
||||||
tpfx = $${currentConfig}.tests.$${1}
|
tpfx = $${currentConfig}.tests.$${1}
|
||||||
defined($${tpfx}.result, var): \
|
defined($${tpfx}.result, var): \
|
||||||
@ -1660,6 +1666,11 @@ defineTest(qtConfCheckErrors) {
|
|||||||
# output generation
|
# output generation
|
||||||
#
|
#
|
||||||
|
|
||||||
|
defineTest(qtConfOutput_libraryPaths) {
|
||||||
|
qtLog("Global lib dirs: [$$val_escape(EXTRA_LIBDIR)] [$$val_escape(QMAKE_DEFAULT_LIBDIRS)]")
|
||||||
|
qtLog("Global inc dirs: [$$val_escape(EXTRA_INCLUDEPATH)] [$$val_escape(QMAKE_DEFAULT_INCDIRS)]")
|
||||||
|
}
|
||||||
|
|
||||||
# qtConfOutputVar(modifier, output, name, value)
|
# qtConfOutputVar(modifier, output, name, value)
|
||||||
defineTest(qtConfOutputVar) {
|
defineTest(qtConfOutputVar) {
|
||||||
modifier = $$1
|
modifier = $$1
|
||||||
@ -2028,6 +2039,9 @@ for(ever) {
|
|||||||
}
|
}
|
||||||
configsToProcess = $$subconfigs $$configsToProcess
|
configsToProcess = $$subconfigs $$configsToProcess
|
||||||
}
|
}
|
||||||
|
# 'builtins' is used for command line parsing and test type dependency
|
||||||
|
# injection, but its features must not be processed regularly.
|
||||||
|
allModuleConfigs = $$member(allConfigs, 1, -1)
|
||||||
|
|
||||||
QMAKE_SAVED_ARGS = $$QMAKE_EXTRA_ARGS
|
QMAKE_SAVED_ARGS = $$QMAKE_EXTRA_ARGS
|
||||||
QMAKE_REDO_CONFIG = false
|
QMAKE_REDO_CONFIG = false
|
||||||
@ -2036,7 +2050,7 @@ qtConfCheckErrors()
|
|||||||
|
|
||||||
!isEmpty(config.input.list-features) {
|
!isEmpty(config.input.list-features) {
|
||||||
all_ft =
|
all_ft =
|
||||||
for (currentConfig, allConfigs) {
|
for (currentConfig, allModuleConfigs) {
|
||||||
for (k, $${currentConfig}.features._KEYS_) {
|
for (k, $${currentConfig}.features._KEYS_) {
|
||||||
pp = $$eval($${currentConfig}.features.$${k}.purpose)
|
pp = $$eval($${currentConfig}.features.$${k}.purpose)
|
||||||
!isEmpty(pp) {
|
!isEmpty(pp) {
|
||||||
@ -2056,7 +2070,7 @@ qtConfCheckErrors()
|
|||||||
|
|
||||||
!isEmpty(config.input.list-libraries) {
|
!isEmpty(config.input.list-libraries) {
|
||||||
logn()
|
logn()
|
||||||
for (currentConfig, allConfigs) {
|
for (currentConfig, allModuleConfigs) {
|
||||||
!isEmpty($${currentConfig}.exports._KEYS_) {
|
!isEmpty($${currentConfig}.exports._KEYS_) {
|
||||||
!isEmpty($${currentConfig}.module): \
|
!isEmpty($${currentConfig}.module): \
|
||||||
logn($$eval($${currentConfig}.module):)
|
logn($$eval($${currentConfig}.module):)
|
||||||
@ -2093,7 +2107,7 @@ qtLog("Command line: $$qtSystemQuote($$QMAKE_SAVED_ARGS)")
|
|||||||
$$QMAKE_REDO_CONFIG: \
|
$$QMAKE_REDO_CONFIG: \
|
||||||
qtLog("config.opt: $$qtSystemQuote($$QMAKE_EXTRA_REDO_ARGS)")
|
qtLog("config.opt: $$qtSystemQuote($$QMAKE_EXTRA_REDO_ARGS)")
|
||||||
|
|
||||||
for (currentConfig, allConfigs) {
|
for (currentConfig, allModuleConfigs) {
|
||||||
qtConfSetModuleName()
|
qtConfSetModuleName()
|
||||||
qtConfSetupModuleOutputs()
|
qtConfSetupModuleOutputs()
|
||||||
# do early checks, mainly to validate the command line
|
# do early checks, mainly to validate the command line
|
||||||
@ -2137,7 +2151,7 @@ CONFIG += qt_conf_tests_allowed
|
|||||||
logn()
|
logn()
|
||||||
logn("Running configuration tests...")
|
logn("Running configuration tests...")
|
||||||
|
|
||||||
for (currentConfig, allConfigs) {
|
for (currentConfig, allModuleConfigs) {
|
||||||
tdir = $$eval($${currentConfig}.testDir)
|
tdir = $$eval($${currentConfig}.testDir)
|
||||||
isEmpty(tdir): tdir = config.tests
|
isEmpty(tdir): tdir = config.tests
|
||||||
QMAKE_CONFIG_TESTS_DIR = $$absolute_path($$tdir, $$eval($${currentConfig}.dir))
|
QMAKE_CONFIG_TESTS_DIR = $$absolute_path($$tdir, $$eval($${currentConfig}.dir))
|
||||||
@ -2201,7 +2215,7 @@ qtConfPrintReport()
|
|||||||
logn()
|
logn()
|
||||||
logn("Qt is now configured for building. Just run '$$QMAKE_MAKE_NAME'.")
|
logn("Qt is now configured for building. Just run '$$QMAKE_MAKE_NAME'.")
|
||||||
pfx = $$[QT_INSTALL_PREFIX]
|
pfx = $$[QT_INSTALL_PREFIX]
|
||||||
equals(pfx, $$[QT_INSTALL_PREFIX/get]) {
|
exists($$pfx/.qmake.cache) {
|
||||||
logn("Once everything is built, Qt is installed.")
|
logn("Once everything is built, Qt is installed.")
|
||||||
logn("You should NOT run '$$QMAKE_MAKE_NAME install'.")
|
logn("You should NOT run '$$QMAKE_MAKE_NAME install'.")
|
||||||
logn("Note that this build cannot be deployed to other machines or devices.")
|
logn("Note that this build cannot be deployed to other machines or devices.")
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
|
|
||||||
qt_depends = $$resolve_depends(QT, "QT.")
|
|
||||||
equals(TEMPLATE, app):contains(qt_depends, gui(-private)?) {
|
|
||||||
LIBS *= -L$$[QT_INSTALL_PLUGINS/get]/platforms
|
|
||||||
|
|
||||||
lib_name = wasm
|
|
||||||
lib_path_and_base = $$[QT_INSTALL_PLUGINS/get]/platforms/lib$${lib_name}$$qtPlatformTargetSuffix()
|
|
||||||
LIBS += -l$${lib_name}$$qtPlatformTargetSuffix() $$fromfile($${lib_path_and_base}.prl, QMAKE_PRL_LIBS)
|
|
||||||
}
|
|
||||||
|
|
||||||
load(qt)
|
|
||||||
|
|
@ -5,34 +5,7 @@
|
|||||||
# Afterwards, they can override the default template by assigning their template to WINRT_MANIFEST.
|
# Afterwards, they can override the default template by assigning their template to WINRT_MANIFEST.
|
||||||
#
|
#
|
||||||
# All subkeys in WINRT_MANIFEST will be replaced if defined/found, so new variables can be easily
|
# All subkeys in WINRT_MANIFEST will be replaced if defined/found, so new variables can be easily
|
||||||
# added. The following keys have default values and are present in the default templates:
|
# added.
|
||||||
# WINRT_MANIFEST: The name of the input manifest file. Defaults to a file defined by the mkspec.
|
|
||||||
# WINRT_MANIFEST.target: The name of the target (.exe). Defaults to TARGET.
|
|
||||||
# WINRT_MANIFEST.identity: The unique ID of the app. Defaults to reusing the existing generated manifest's UUID, or generates a new UUID if none is present.
|
|
||||||
# WINRT_MANIFEST.name: The name of the package as displayed to the user. Defaults to TARGET.
|
|
||||||
# WINRT_MANIFEST.architecture: The target architecture. Defaults to VCPROJ_ARCH.
|
|
||||||
# WINRT_MANIFEST.version: The version number of the package. Defaults to "1.0.0.0".
|
|
||||||
# WINRT_MANIFEST.publisher: Display name of the publisher. Defaults to "Default publisher display name".
|
|
||||||
# WINRT_MANIFEST.publisher_id: The publisher's distinguished name (default: CN=MyCN).
|
|
||||||
# WINRT_MANIFEST.phone_product_id: The GUID of the product. Defaults to the value of WINRT_MANIFEST.identity. (Windows Phone only)
|
|
||||||
# WINRT_MANIFEST.phone_publisher_id: The GUID of the publisher. Defaults to an invalid GUID. (Windows Phone only)
|
|
||||||
# WINRT_MANIFEST.description: Package description. Defaults to "Default package description".
|
|
||||||
# WINRT_MANIFEST.background: Tile background color. Defaults to "green".
|
|
||||||
# WINRT_MANIFEST.foreground: Tile foreground (text) color (Windows 8/RT only). Defaults to "light".
|
|
||||||
# WINRT_MANIFEST.logo_store: Logo image file for Windows Store. Default provided by the mkspec.
|
|
||||||
# WINRT_MANIFEST.logo_small: Small logo image file. Default provided by the mkspec.
|
|
||||||
# WINRT_MANIFEST.logo_medium: Medium logo image file. Default provided by the mkspec.
|
|
||||||
# WINRT_MANIFEST.logo_large: Large logo image file. Default provided by the mkspec.
|
|
||||||
# WINRT_MANIFEST.splash_screen: Splash screen image file. Default provided by the mkspec.
|
|
||||||
# WINRT_MANIFEST.rotation_preference: Orientation specification. Default is empty. (portrait, landscape, landscapeFlipped)
|
|
||||||
# WINRT_MANIFEST.iconic_tile_icon: Image file for the "iconic" tile template icon. Default provided by the mkspec.
|
|
||||||
# WINRT_MANIFEST.iconic_tile_small: Image file for the small "iconic" tile template logo. Default provided by the mkspec.
|
|
||||||
# WINRT_MANIFEST.default_language: Specifies the default language of the application
|
|
||||||
# WINRT_MANIFEST.capabilities: Specifies capabilities to add to the capability list.
|
|
||||||
# WINRT_MANIFEST.capabilities_device: Specifies device capabilities to add to the capability list. (location, webcam...)
|
|
||||||
# WINRT_MANIFEST.dependencies: Specifies dependencies required by the package.
|
|
||||||
# WINRT_MANIFEST.minVersion: Specifies the minimum required Windows version to run the package. Defaults to %UCRTVersion%
|
|
||||||
# WINRT_MANIFEST.maxVersionTested: Specifies the maximum Windows version the package has been tested against. Defaults to WINRT_MANIFEST.minVersion
|
|
||||||
|
|
||||||
# The manifest is generated for each build pass for normal apps, and only once for vcapps.
|
# The manifest is generated for each build pass for normal apps, and only once for vcapps.
|
||||||
# - Normal apps have their package root directory in the same place as the target (one for each build pass).
|
# - Normal apps have their package root directory in the same place as the target (one for each build pass).
|
||||||
|
@ -6,7 +6,6 @@ include(../common/ghs-integrity-armv7.conf)
|
|||||||
|
|
||||||
DEFINES += QT_STATICPLUGIN
|
DEFINES += QT_STATICPLUGIN
|
||||||
|
|
||||||
QTPLUGIN.platforms += qeglfs qeglfs-viv-integration
|
|
||||||
QT_QPA_DEFAULT_PLATFORM = eglfs
|
QT_QPA_DEFAULT_PLATFORM = eglfs
|
||||||
|
|
||||||
QMAKE_LIBS_EGL += -lEGL -lGAL -lVSC -lGLSLC -lGLESv2 -lfbdev -livfs
|
QMAKE_LIBS_EGL += -lEGL -lGAL -lVSC -lGLSLC -lGLESv2 -lfbdev -livfs
|
||||||
|
@ -5,5 +5,3 @@
|
|||||||
include(../common/ghs-integrity-armv7.conf)
|
include(../common/ghs-integrity-armv7.conf)
|
||||||
|
|
||||||
DEFINES += QT_STATICPLUGIN
|
DEFINES += QT_STATICPLUGIN
|
||||||
|
|
||||||
QTPLUGIN.platforms += integrityfb
|
|
||||||
|
@ -11,7 +11,6 @@ DEFINES += INTEGRITY
|
|||||||
# parameter types as Symbian. The parameter types are defined in eglplatform.h.
|
# parameter types as Symbian. The parameter types are defined in eglplatform.h.
|
||||||
DEFINES += __WINSCW__
|
DEFINES += __WINSCW__
|
||||||
|
|
||||||
QTPLUGIN.platforms += qeglfs
|
|
||||||
QT_QPA_DEFAULT_PLATFORM = eglfs
|
QT_QPA_DEFAULT_PLATFORM = eglfs
|
||||||
|
|
||||||
QMAKE_LIBS_EGL += -lEGL -lIMGegl -lsrv_um -lsrv_init -lpvrWSEGL_WM -lncg_usr.a -lmmgr_usr -lwm_usr -lprr_usr
|
QMAKE_LIBS_EGL += -lEGL -lIMGegl -lsrv_um -lsrv_init -lpvrWSEGL_WM -lncg_usr.a -lmmgr_usr -lwm_usr -lprr_usr
|
||||||
|
@ -6,5 +6,3 @@ include(../common/ghs-integrity-x86.conf)
|
|||||||
|
|
||||||
QMAKE_CFLAGS += -cpu=Corei
|
QMAKE_CFLAGS += -cpu=Corei
|
||||||
DEFINES += QT_STATICPLUGIN
|
DEFINES += QT_STATICPLUGIN
|
||||||
|
|
||||||
QTPLUGIN.platforms += integrityfb
|
|
||||||
|
@ -12,11 +12,6 @@ EMTERP_FLAGS = \
|
|||||||
-s ASSERTIONS=1 \
|
-s ASSERTIONS=1 \
|
||||||
--profiling-funcs
|
--profiling-funcs
|
||||||
|
|
||||||
EMCC_COMMON_CFLAGS = \
|
|
||||||
-s USE_LIBPNG=1 \
|
|
||||||
-s USE_FREETYPE=1 \
|
|
||||||
-s USE_ZLIB=1
|
|
||||||
|
|
||||||
EMCC_COMMON_LFLAGS = \
|
EMCC_COMMON_LFLAGS = \
|
||||||
-s WASM=1 \
|
-s WASM=1 \
|
||||||
-s FULL_ES2=1 \
|
-s FULL_ES2=1 \
|
||||||
@ -28,6 +23,8 @@ EMCC_COMMON_LFLAGS = \
|
|||||||
-s \"BINARYEN_METHOD=\'native-wasm\'\" \
|
-s \"BINARYEN_METHOD=\'native-wasm\'\" \
|
||||||
-s \"BINARYEN_TRAP_MODE=\'clamp\'\"
|
-s \"BINARYEN_TRAP_MODE=\'clamp\'\"
|
||||||
|
|
||||||
|
# The -s arguments can also be used with release builds,
|
||||||
|
# but are here in debug for clarity.
|
||||||
EMCC_COMMON_LFLAGS_DEBUG = \
|
EMCC_COMMON_LFLAGS_DEBUG = \
|
||||||
$$EMCC_COMMON_LFLAGS \
|
$$EMCC_COMMON_LFLAGS \
|
||||||
-s ASSERTIONS=2 \
|
-s ASSERTIONS=2 \
|
||||||
@ -38,17 +35,11 @@ EMCC_COMMON_LFLAGS_DEBUG = \
|
|||||||
# -s SOCKET_DEBUG \ #print out socket,network data transfer
|
# -s SOCKET_DEBUG \ #print out socket,network data transfer
|
||||||
-s GL_DEBUG=1
|
-s GL_DEBUG=1
|
||||||
|
|
||||||
# the -s arguments can also be used with release builds
|
|
||||||
# but here in debug for clarity
|
|
||||||
|
|
||||||
QMAKE_COMPILER += emscripten
|
QMAKE_COMPILER += emscripten
|
||||||
|
|
||||||
QMAKE_CC = emcc
|
QMAKE_CC = emcc
|
||||||
QMAKE_CXX = em++
|
QMAKE_CXX = em++
|
||||||
|
|
||||||
QMAKE_CFLAGS += $$EMCC_COMMON_CFLAGS
|
|
||||||
QMAKE_CXXFLAGS += $$EMCC_COMMON_CFLAGS
|
|
||||||
|
|
||||||
# Practical debugging setup:
|
# Practical debugging setup:
|
||||||
# "-g4" preserves function names for stack traces
|
# "-g4" preserves function names for stack traces
|
||||||
# "-Os" produces reasonably sized binaries
|
# "-Os" produces reasonably sized binaries
|
||||||
@ -63,8 +54,8 @@ QMAKE_CXXFLAGS_RELEASE += -O3
|
|||||||
QMAKE_CFLAGS_RELEASE -= -O2
|
QMAKE_CFLAGS_RELEASE -= -O2
|
||||||
QMAKE_CFLAGS_RELEASE += -O3
|
QMAKE_CFLAGS_RELEASE += -O3
|
||||||
QMAKE_LFLAGS_RELEASE += -O3
|
QMAKE_LFLAGS_RELEASE += -O3
|
||||||
MAKE_CFLAGS_OPTIMIZE += -O3
|
QMAKE_CFLAGS_OPTIMIZE += -O3
|
||||||
MAKE_CFLAGS_OPTIMIZE_FULL += -Oz
|
QMAKE_CFLAGS_OPTIMIZE_FULL += -Oz
|
||||||
|
|
||||||
QMAKE_LINK = $$QMAKE_CXX
|
QMAKE_LINK = $$QMAKE_CXX
|
||||||
QMAKE_LINK_SHLIB = $$QMAKE_CXX
|
QMAKE_LINK_SHLIB = $$QMAKE_CXX
|
||||||
@ -84,7 +75,4 @@ QMAKE_EXTENSION_STATICLIB = a # llvm bitcode
|
|||||||
QMAKE_AR = emar cqs
|
QMAKE_AR = emar cqs
|
||||||
QMAKE_DISTCLEAN += *.html *.js *.wasm
|
QMAKE_DISTCLEAN += *.html *.js *.wasm
|
||||||
|
|
||||||
QT_QPA_DEFAULT_PLATFORM = wasm
|
|
||||||
|
|
||||||
QTPLUGIN.platforms = wasm
|
|
||||||
load(qt_config)
|
load(qt_config)
|
||||||
|
@ -55,7 +55,7 @@ defineTest(qtConfTest_qpaDefaultPlatform) {
|
|||||||
else: qnx: name = qnx
|
else: qnx: name = qnx
|
||||||
else: integrity: name = integrityfb
|
else: integrity: name = integrityfb
|
||||||
else: haiku: name = haiku
|
else: haiku: name = haiku
|
||||||
else: wasm: name = webassembly
|
else: wasm: name = wasm
|
||||||
else: name = xcb
|
else: name = xcb
|
||||||
|
|
||||||
$${1}.value = $$name
|
$${1}.value = $$name
|
||||||
|
@ -686,11 +686,7 @@ _hb_qt_font_create(QFontEngine *fe)
|
|||||||
const int x_ppem = (fe->fontDef.pixelSize * fe->fontDef.stretch) / 100;
|
const int x_ppem = (fe->fontDef.pixelSize * fe->fontDef.stretch) / 100;
|
||||||
|
|
||||||
hb_font_set_funcs(font, hb_qt_get_font_funcs(), (void *)fe, NULL);
|
hb_font_set_funcs(font, hb_qt_get_font_funcs(), (void *)fe, NULL);
|
||||||
#ifdef Q_OS_MAC
|
|
||||||
hb_font_set_scale(font, QFixed(x_ppem).value(), QFixed(y_ppem).value());
|
|
||||||
#else
|
|
||||||
hb_font_set_scale(font, QFixed(x_ppem).value(), -QFixed(y_ppem).value());
|
hb_font_set_scale(font, QFixed(x_ppem).value(), -QFixed(y_ppem).value());
|
||||||
#endif
|
|
||||||
hb_font_set_ppem(font, x_ppem, y_ppem);
|
hb_font_set_ppem(font, x_ppem, y_ppem);
|
||||||
|
|
||||||
return font;
|
return font;
|
||||||
|
@ -38,6 +38,7 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "qbytearray.h"
|
||||||
#include "qset.h"
|
#include "qset.h"
|
||||||
#include "qnetworkinterface.h"
|
#include "qnetworkinterface.h"
|
||||||
#include "qnetworkinterface_p.h"
|
#include "qnetworkinterface_p.h"
|
||||||
@ -500,7 +501,7 @@ static QList<QNetworkInterfacePrivate *> createInterfaces(ifaddrs *rawList)
|
|||||||
iface->flags = convertFlags(ptr->ifa_flags);
|
iface->flags = convertFlags(ptr->ifa_flags);
|
||||||
iface->hardwareAddress = iface->makeHwAddress(sdl->sdl_alen, (uchar*)LLADDR(sdl));
|
iface->hardwareAddress = iface->makeHwAddress(sdl->sdl_alen, (uchar*)LLADDR(sdl));
|
||||||
|
|
||||||
strlcpy(mediareq.ifm_name, ptr->ifa_name, sizeof(mediareq.ifm_name));
|
qstrncpy(mediareq.ifm_name, ptr->ifa_name, sizeof(mediareq.ifm_name));
|
||||||
iface->type = probeIfType(openSocket(socket), sdl->sdl_type, &mediareq);
|
iface->type = probeIfType(openSocket(socket), sdl->sdl_type, &mediareq);
|
||||||
iface->mtu = getMtu(socket, &req);
|
iface->mtu = getMtu(socket, &req);
|
||||||
}
|
}
|
||||||
@ -524,7 +525,7 @@ static void getAddressExtraInfo(QNetworkAddressEntry *entry, struct sockaddr *sa
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
|
qstrncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
|
||||||
|
|
||||||
// get flags
|
// get flags
|
||||||
ifr.ifr_addr = *reinterpret_cast<struct sockaddr_in6 *>(sa);
|
ifr.ifr_addr = *reinterpret_cast<struct sockaddr_in6 *>(sa);
|
||||||
|
@ -131,7 +131,6 @@ public:
|
|||||||
#elif defined(Q_OS_WIN)
|
#elif defined(Q_OS_WIN)
|
||||||
~QLocalSocketPrivate();
|
~QLocalSocketPrivate();
|
||||||
void destroyPipeHandles();
|
void destroyPipeHandles();
|
||||||
void setErrorString(const QString &function);
|
|
||||||
void _q_canWrite();
|
void _q_canWrite();
|
||||||
void _q_pipeClosed();
|
void _q_pipeClosed();
|
||||||
void _q_winError(ulong windowsError, const QString &function);
|
void _q_winError(ulong windowsError, const QString &function);
|
||||||
|
@ -50,12 +50,6 @@ void QLocalSocketPrivate::init()
|
|||||||
q->connect(pipeReader, SIGNAL(winError(ulong,QString)), SLOT(_q_winError(ulong,QString)));
|
q->connect(pipeReader, SIGNAL(winError(ulong,QString)), SLOT(_q_winError(ulong,QString)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void QLocalSocketPrivate::setErrorString(const QString &function)
|
|
||||||
{
|
|
||||||
DWORD windowsError = GetLastError();
|
|
||||||
_q_winError(windowsError, function);
|
|
||||||
}
|
|
||||||
|
|
||||||
void QLocalSocketPrivate::_q_winError(ulong windowsError, const QString &function)
|
void QLocalSocketPrivate::_q_winError(ulong windowsError, const QString &function)
|
||||||
{
|
{
|
||||||
Q_Q(QLocalSocket);
|
Q_Q(QLocalSocket);
|
||||||
@ -127,7 +121,8 @@ void QLocalSocket::connectToServer(OpenMode openMode)
|
|||||||
{
|
{
|
||||||
Q_D(QLocalSocket);
|
Q_D(QLocalSocket);
|
||||||
if (state() == ConnectedState || state() == ConnectingState) {
|
if (state() == ConnectedState || state() == ConnectingState) {
|
||||||
setErrorString(tr("Trying to connect while connection is in progress"));
|
d->error = OperationError;
|
||||||
|
d->errorString = tr("Trying to connect while connection is in progress");
|
||||||
emit error(QLocalSocket::OperationError);
|
emit error(QLocalSocket::OperationError);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -137,8 +132,8 @@ void QLocalSocket::connectToServer(OpenMode openMode)
|
|||||||
d->state = ConnectingState;
|
d->state = ConnectingState;
|
||||||
emit stateChanged(d->state);
|
emit stateChanged(d->state);
|
||||||
if (d->serverName.isEmpty()) {
|
if (d->serverName.isEmpty()) {
|
||||||
d->error = QLocalSocket::ServerNotFoundError;
|
d->error = ServerNotFoundError;
|
||||||
setErrorString(QLocalSocket::tr("%1: Invalid name").arg(QLatin1String("QLocalSocket::connectToServer")));
|
d->errorString = tr("%1: Invalid name").arg(QLatin1String("QLocalSocket::connectToServer"));
|
||||||
d->state = UnconnectedState;
|
d->state = UnconnectedState;
|
||||||
emit error(d->error);
|
emit error(d->error);
|
||||||
emit stateChanged(d->state);
|
emit stateChanged(d->state);
|
||||||
@ -177,7 +172,8 @@ void QLocalSocket::connectToServer(OpenMode openMode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (localSocket == INVALID_HANDLE_VALUE) {
|
if (localSocket == INVALID_HANDLE_VALUE) {
|
||||||
d->setErrorString(QLatin1String("QLocalSocket::connectToServer"));
|
const DWORD winError = GetLastError();
|
||||||
|
d->_q_winError(winError, QLatin1String("QLocalSocket::connectToServer"));
|
||||||
d->fullServerName = QString();
|
d->fullServerName = QString();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -161,7 +161,9 @@ DEFINEFUNC(void, OPENSSL_sk_free, OPENSSL_STACK *a, a, return, DUMMYARG)
|
|||||||
DEFINEFUNC2(void *, OPENSSL_sk_value, OPENSSL_STACK *a, a, int b, b, return nullptr, return)
|
DEFINEFUNC2(void *, OPENSSL_sk_value, OPENSSL_STACK *a, a, int b, b, return nullptr, return)
|
||||||
DEFINEFUNC(int, SSL_session_reused, SSL *a, a, return 0, return)
|
DEFINEFUNC(int, SSL_session_reused, SSL *a, a, return 0, return)
|
||||||
DEFINEFUNC2(unsigned long, SSL_CTX_set_options, SSL_CTX *ctx, ctx, unsigned long op, op, return 0, return)
|
DEFINEFUNC2(unsigned long, SSL_CTX_set_options, SSL_CTX *ctx, ctx, unsigned long op, op, return 0, return)
|
||||||
|
#ifdef TLS1_3_VERSION
|
||||||
DEFINEFUNC2(int, SSL_CTX_set_ciphersuites, SSL_CTX *ctx, ctx, const char *str, str, return 0, return)
|
DEFINEFUNC2(int, SSL_CTX_set_ciphersuites, SSL_CTX *ctx, ctx, const char *str, str, return 0, return)
|
||||||
|
#endif
|
||||||
DEFINEFUNC3(size_t, SSL_get_client_random, SSL *a, a, unsigned char *out, out, size_t outlen, outlen, return 0, return)
|
DEFINEFUNC3(size_t, SSL_get_client_random, SSL *a, a, unsigned char *out, out, size_t outlen, outlen, return 0, return)
|
||||||
DEFINEFUNC3(size_t, SSL_SESSION_get_master_key, const SSL_SESSION *ses, ses, unsigned char *out, out, size_t outlen, outlen, return 0, return)
|
DEFINEFUNC3(size_t, SSL_SESSION_get_master_key, const SSL_SESSION *ses, ses, unsigned char *out, out, size_t outlen, outlen, return 0, return)
|
||||||
DEFINEFUNC6(int, CRYPTO_get_ex_new_index, int class_index, class_index, long argl, argl, void *argp, argp, CRYPTO_EX_new *new_func, new_func, CRYPTO_EX_dup *dup_func, dup_func, CRYPTO_EX_free *free_func, free_func, return -1, return)
|
DEFINEFUNC6(int, CRYPTO_get_ex_new_index, int class_index, class_index, long argl, argl, void *argp, argp, CRYPTO_EX_new *new_func, new_func, CRYPTO_EX_dup *dup_func, dup_func, CRYPTO_EX_free *free_func, free_func, return -1, return)
|
||||||
|
@ -358,8 +358,9 @@ static void convertLineOffset(QAccessibleTextInterface *text, int *line, int *of
|
|||||||
return [NSValue valueWithRange: NSMakeRange(0, 0)];
|
return [NSValue valueWithRange: NSMakeRange(0, 0)];
|
||||||
} else if ([attribute isEqualToString:NSAccessibilityVisibleCharacterRangeAttribute]) {
|
} else if ([attribute isEqualToString:NSAccessibilityVisibleCharacterRangeAttribute]) {
|
||||||
// FIXME This is not correct and may impact performance for big texts
|
// FIXME This is not correct and may impact performance for big texts
|
||||||
return [NSValue valueWithRange: NSMakeRange(0, iface->textInterface()->characterCount())];
|
if (QAccessibleTextInterface *text = iface->textInterface())
|
||||||
|
return [NSValue valueWithRange: NSMakeRange(0, text->characterCount())];
|
||||||
|
return [NSValue valueWithRange: NSMakeRange(0, iface->text(QAccessible::Name).length())];
|
||||||
} else if ([attribute isEqualToString:NSAccessibilityInsertionPointLineNumberAttribute]) {
|
} else if ([attribute isEqualToString:NSAccessibilityInsertionPointLineNumberAttribute]) {
|
||||||
if (QAccessibleTextInterface *text = iface->textInterface()) {
|
if (QAccessibleTextInterface *text = iface->textInterface()) {
|
||||||
int position = text->cursorPosition();
|
int position = text->cursorPosition();
|
||||||
|
@ -898,34 +898,36 @@ void QCocoaWindow::raise()
|
|||||||
qCDebug(lcQpaWindow) << "QCocoaWindow::raise" << window();
|
qCDebug(lcQpaWindow) << "QCocoaWindow::raise" << window();
|
||||||
|
|
||||||
// ### handle spaces (see Qt 4 raise_sys in qwidget_mac.mm)
|
// ### handle spaces (see Qt 4 raise_sys in qwidget_mac.mm)
|
||||||
if (!isContentView())
|
if (isContentView()) {
|
||||||
return;
|
|
||||||
|
|
||||||
if (m_view.window.visible) {
|
if (m_view.window.visible) {
|
||||||
{
|
{
|
||||||
// Clean up autoreleased temp objects from orderFront immediately.
|
// Clean up auto-released temp objects from orderFront immediately.
|
||||||
// Failure to do so has been observed to cause leaks also beyond any outer
|
// Failure to do so has been observed to cause leaks also beyond any outer
|
||||||
// autorelease pool (for example around a complete QWindow
|
// autorelease pool (for example around a complete QWindow
|
||||||
// construct-show-raise-hide-delete cyle), counter to expected autoreleasepool
|
// construct-show-raise-hide-delete cycle), counter to expected autoreleasepool
|
||||||
// behavior.
|
// behavior.
|
||||||
QMacAutoReleasePool pool;
|
QMacAutoReleasePool pool;
|
||||||
[m_view.window orderFront:m_view.window];
|
[m_view.window orderFront:m_view.window];
|
||||||
}
|
}
|
||||||
static bool raiseProcess = qt_mac_resolveOption(true, "QT_MAC_SET_RAISE_PROCESS");
|
static bool raiseProcess = qt_mac_resolveOption(true, "QT_MAC_SET_RAISE_PROCESS");
|
||||||
if (raiseProcess) {
|
if (raiseProcess)
|
||||||
[NSApp activateIgnoringOtherApps:YES];
|
[NSApp activateIgnoringOtherApps:YES];
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
[m_view.superview addSubview:m_view positioned:NSWindowAbove relativeTo:nil];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QCocoaWindow::lower()
|
void QCocoaWindow::lower()
|
||||||
{
|
{
|
||||||
qCDebug(lcQpaWindow) << "QCocoaWindow::lower" << window();
|
qCDebug(lcQpaWindow) << "QCocoaWindow::lower" << window();
|
||||||
if (!isContentView())
|
|
||||||
return;
|
|
||||||
|
|
||||||
|
if (isContentView()) {
|
||||||
if (m_view.window.visible)
|
if (m_view.window.visible)
|
||||||
[m_view.window orderBack:m_view.window];
|
[m_view.window orderBack:m_view.window];
|
||||||
|
} else {
|
||||||
|
[m_view.superview addSubview:m_view positioned:NSWindowBelow relativeTo:nil];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QCocoaWindow::isExposed() const
|
bool QCocoaWindow::isExposed() const
|
||||||
|
@ -68,6 +68,8 @@
|
|||||||
// Private interface
|
// Private interface
|
||||||
@interface QT_MANGLE_NAMESPACE(QNSView) ()
|
@interface QT_MANGLE_NAMESPACE(QNSView) ()
|
||||||
- (BOOL)isTransparentForUserInput;
|
- (BOOL)isTransparentForUserInput;
|
||||||
|
@property (assign) NSView* previousSuperview;
|
||||||
|
@property (assign) NSWindow* previousWindow;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface QT_MANGLE_NAMESPACE(QNSView) (Drawing) <CALayerDelegate>
|
@interface QT_MANGLE_NAMESPACE(QNSView) (Drawing) <CALayerDelegate>
|
||||||
@ -153,6 +155,9 @@
|
|||||||
self.focusRingType = NSFocusRingTypeNone;
|
self.focusRingType = NSFocusRingTypeNone;
|
||||||
self.cursor = nil;
|
self.cursor = nil;
|
||||||
|
|
||||||
|
self.previousSuperview = nil;
|
||||||
|
self.previousWindow = nil;
|
||||||
|
|
||||||
[self initDrawing];
|
[self initDrawing];
|
||||||
[self registerDragTypes];
|
[self registerDragTypes];
|
||||||
|
|
||||||
@ -195,8 +200,40 @@
|
|||||||
return description;
|
return description;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ----------------------------- Re-parenting ---------------------------------
|
||||||
|
|
||||||
|
- (void)removeFromSuperview
|
||||||
|
{
|
||||||
|
QMacAutoReleasePool pool;
|
||||||
|
[super removeFromSuperview];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)viewWillMoveToSuperview:(NSView *)newSuperview
|
||||||
|
{
|
||||||
|
Q_ASSERT(!self.previousSuperview);
|
||||||
|
self.previousSuperview = self.superview;
|
||||||
|
|
||||||
|
if (newSuperview == self.superview)
|
||||||
|
qCDebug(lcQpaWindow) << "Re-ordering" << self << "inside" << self.superview;
|
||||||
|
else
|
||||||
|
qCDebug(lcQpaWindow) << "Re-parenting" << self << "from" << self.superview << "to" << newSuperview;
|
||||||
|
}
|
||||||
|
|
||||||
- (void)viewDidMoveToSuperview
|
- (void)viewDidMoveToSuperview
|
||||||
{
|
{
|
||||||
|
auto cleanup = qScopeGuard([&] { self.previousSuperview = nil; });
|
||||||
|
|
||||||
|
if (self.superview == self.previousSuperview) {
|
||||||
|
qCDebug(lcQpaWindow) << "Done re-ordering" << self << "new index:"
|
||||||
|
<< [self.superview.subviews indexOfObject:self];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
qCDebug(lcQpaWindow) << "Done re-parenting" << self << "into" << self.superview;
|
||||||
|
|
||||||
|
// Note: at this point the view's window property hasn't been updated to match the window
|
||||||
|
// of the new superview. We have to wait for viewDidMoveToWindow for that to be reflected.
|
||||||
|
|
||||||
if (!m_platformWindow)
|
if (!m_platformWindow)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -210,6 +247,36 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)viewWillMoveToWindow:(NSWindow *)newWindow
|
||||||
|
{
|
||||||
|
Q_ASSERT(!self.previousWindow);
|
||||||
|
self.previousWindow = self.window;
|
||||||
|
|
||||||
|
// This callback is documented to be called also when a view is just moved between
|
||||||
|
// subviews in the same NSWindow, so we're not necessarily moving between NSWindows.
|
||||||
|
if (newWindow == self.window)
|
||||||
|
return;
|
||||||
|
|
||||||
|
qCDebug(lcQpaWindow) << "Moving" << self << "from" << self.window << "to" << newWindow;
|
||||||
|
|
||||||
|
// Note: at this point the superview has already been updated, so we know which view inside
|
||||||
|
// the new window the view will be a child of.
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)viewDidMoveToWindow
|
||||||
|
{
|
||||||
|
auto cleanup = qScopeGuard([&] { self.previousWindow = nil; });
|
||||||
|
|
||||||
|
// This callback is documented to be called also when a view is just moved between
|
||||||
|
// subviews in the same NSWindow, so we're not necessarily moving between NSWindows.
|
||||||
|
if (self.window == self.previousWindow)
|
||||||
|
return;
|
||||||
|
|
||||||
|
qCDebug(lcQpaWindow) << "Done moving" << self << "to" << self.window;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
- (QWindow *)topLevelWindow
|
- (QWindow *)topLevelWindow
|
||||||
{
|
{
|
||||||
if (!m_platformWindow)
|
if (!m_platformWindow)
|
||||||
@ -239,12 +306,6 @@
|
|||||||
// viewDidUnhide so no reason to override it here.
|
// viewDidUnhide so no reason to override it here.
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)removeFromSuperview
|
|
||||||
{
|
|
||||||
QMacAutoReleasePool pool;
|
|
||||||
[super removeFromSuperview];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (BOOL)isTransparentForUserInput
|
- (BOOL)isTransparentForUserInput
|
||||||
{
|
{
|
||||||
return m_platformWindow->window() &&
|
return m_platformWindow->window() &&
|
||||||
|
@ -307,7 +307,7 @@
|
|||||||
{
|
{
|
||||||
Q_UNUSED(textInputContextKeyboardSelectionDidChangeNotification)
|
Q_UNUSED(textInputContextKeyboardSelectionDidChangeNotification)
|
||||||
if (([NSApp keyWindow] == self.window) && self.window.firstResponder == self) {
|
if (([NSApp keyWindow] == self.window) && self.window.firstResponder == self) {
|
||||||
QCocoaInputContext *ic = qobject_cast<QCocoaInputContext *>(QCocoaIntegration::instance()->inputContext());
|
if (QCocoaInputContext *ic = qobject_cast<QCocoaInputContext *>(QCocoaIntegration::instance()->inputContext()))
|
||||||
ic->updateLocale();
|
ic->updateLocale();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -313,7 +313,6 @@ static void qt_mac_draw_pattern(void *info, CGContextRef c)
|
|||||||
}
|
}
|
||||||
pat->image = qt_mac_create_imagemask(pm, pm.rect());
|
pat->image = qt_mac_create_imagemask(pm, pm.rect());
|
||||||
CGImageRelease(swatch);
|
CGImageRelease(swatch);
|
||||||
CGContextRelease(pm_ctx);
|
|
||||||
w *= QMACPATTERN_MASK_MULTIPLIER;
|
w *= QMACPATTERN_MASK_MULTIPLIER;
|
||||||
h *= QMACPATTERN_MASK_MULTIPLIER;
|
h *= QMACPATTERN_MASK_MULTIPLIER;
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
TARGET = wasm
|
TARGET = qwasm
|
||||||
CONFIG += static plugin
|
CONFIG += static plugin
|
||||||
QT += \
|
QT += \
|
||||||
core-private gui-private \
|
core-private gui-private \
|
||||||
|
@ -38,9 +38,6 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#if QT_CONFIG(library)
|
|
||||||
#include <QLibrary>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "qxcbwindow.h"
|
#include "qxcbwindow.h"
|
||||||
#include "qxcbscreen.h"
|
#include "qxcbscreen.h"
|
||||||
@ -61,10 +58,6 @@
|
|||||||
|
|
||||||
#include "qxcbglintegration.h"
|
#include "qxcbglintegration.h"
|
||||||
|
|
||||||
#if !defined(QT_STATIC) && QT_CONFIG(dlopen)
|
|
||||||
#include <dlfcn.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
typedef GLXContext (*glXCreateContextAttribsARBProc)(Display*, GLXFBConfig, GLXContext, Bool, const int*);
|
typedef GLXContext (*glXCreateContextAttribsARBProc)(Display*, GLXFBConfig, GLXContext, Bool, const int*);
|
||||||
@ -627,41 +620,7 @@ void QGLXContext::swapBuffers(QPlatformSurface *surface)
|
|||||||
|
|
||||||
QFunctionPointer QGLXContext::getProcAddress(const char *procName)
|
QFunctionPointer QGLXContext::getProcAddress(const char *procName)
|
||||||
{
|
{
|
||||||
#ifdef QT_STATIC
|
return glXGetProcAddress(reinterpret_cast<const GLubyte *>(procName));
|
||||||
return glXGetProcAddressARB(reinterpret_cast<const GLubyte *>(procName));
|
|
||||||
#else
|
|
||||||
typedef void *(*qt_glXGetProcAddressARB)(const GLubyte *);
|
|
||||||
static qt_glXGetProcAddressARB glXGetProcAddressARB = 0;
|
|
||||||
static bool resolved = false;
|
|
||||||
|
|
||||||
if (resolved && !glXGetProcAddressARB)
|
|
||||||
return 0;
|
|
||||||
if (!glXGetProcAddressARB) {
|
|
||||||
QList<QByteArray> glxExt = QByteArray(glXGetClientString(m_display, GLX_EXTENSIONS)).split(' ');
|
|
||||||
if (glxExt.contains("GLX_ARB_get_proc_address")) {
|
|
||||||
#if QT_CONFIG(dlopen)
|
|
||||||
void *handle = dlopen(NULL, RTLD_LAZY);
|
|
||||||
if (handle) {
|
|
||||||
glXGetProcAddressARB = (qt_glXGetProcAddressARB) dlsym(handle, "glXGetProcAddressARB");
|
|
||||||
dlclose(handle);
|
|
||||||
}
|
|
||||||
if (!glXGetProcAddressARB)
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
#if QT_CONFIG(library)
|
|
||||||
QLibrary lib(QLatin1String("GL"));
|
|
||||||
if (!lib.load())
|
|
||||||
lib.setFileNameAndVersion(QLatin1String("GL"), 1);
|
|
||||||
glXGetProcAddressARB = (qt_glXGetProcAddressARB) lib.resolve("glXGetProcAddressARB");
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
}
|
|
||||||
resolved = true;
|
|
||||||
}
|
|
||||||
if (!glXGetProcAddressARB)
|
|
||||||
return 0;
|
|
||||||
return (void (*)())glXGetProcAddressARB(reinterpret_cast<const GLubyte *>(procName));
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QSurfaceFormat QGLXContext::format() const
|
QSurfaceFormat QGLXContext::format() const
|
||||||
|
@ -1832,8 +1832,9 @@ void QMessageBox::aboutQt(QWidget *parent, const QString &title)
|
|||||||
"<h3>About Qt</h3>"
|
"<h3>About Qt</h3>"
|
||||||
"<p>This program uses Qt version %1.</p>"
|
"<p>This program uses Qt version %1.</p>"
|
||||||
).arg(QLatin1String(QT_VERSION_STR));
|
).arg(QLatin1String(QT_VERSION_STR));
|
||||||
QString translatedTextAboutQtText;
|
//: Leave this text untranslated or include a verbatim copy of it below
|
||||||
translatedTextAboutQtText = QMessageBox::tr(
|
//: and note that it is the authoritative version in case of doubt.
|
||||||
|
const QString translatedTextAboutQtText = QMessageBox::tr(
|
||||||
"<p>Qt is a C++ toolkit for cross-platform application "
|
"<p>Qt is a C++ toolkit for cross-platform application "
|
||||||
"development.</p>"
|
"development.</p>"
|
||||||
"<p>Qt provides single-source portability across all major desktop "
|
"<p>Qt provides single-source portability across all major desktop "
|
||||||
|
@ -607,20 +607,20 @@ void QGraphicsProxyWidgetPrivate::setWidget_helper(QWidget *newWidget, bool auto
|
|||||||
for (QGraphicsItem *child : childItems) {
|
for (QGraphicsItem *child : childItems) {
|
||||||
if (child->d_ptr->isProxyWidget()) {
|
if (child->d_ptr->isProxyWidget()) {
|
||||||
QGraphicsProxyWidget *childProxy = static_cast<QGraphicsProxyWidget *>(child);
|
QGraphicsProxyWidget *childProxy = static_cast<QGraphicsProxyWidget *>(child);
|
||||||
QWidget * parent = childProxy->widget();
|
QWidget *parent = childProxy->widget();
|
||||||
while (parent->parentWidget() != 0) {
|
while (parent && parent->parentWidget()) {
|
||||||
if (parent == widget)
|
if (parent == widget)
|
||||||
break;
|
break;
|
||||||
parent = parent->parentWidget();
|
parent = parent->parentWidget();
|
||||||
}
|
}
|
||||||
if (!childProxy->widget() || parent != widget)
|
if (!childProxy->widget() || parent != widget)
|
||||||
continue;
|
continue;
|
||||||
childProxy->setWidget(0);
|
childProxy->setWidget(nullptr);
|
||||||
delete childProxy;
|
delete childProxy;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
widget = 0;
|
widget = nullptr;
|
||||||
#ifndef QT_NO_CURSOR
|
#ifndef QT_NO_CURSOR
|
||||||
q->unsetCursor();
|
q->unsetCursor();
|
||||||
#endif
|
#endif
|
||||||
|
@ -1775,7 +1775,6 @@ void QWidgetPrivate::createTLExtra()
|
|||||||
x->posIncludesFrame = 0;
|
x->posIncludesFrame = 0;
|
||||||
x->sizeAdjusted = false;
|
x->sizeAdjusted = false;
|
||||||
x->inTopLevelResize = false;
|
x->inTopLevelResize = false;
|
||||||
x->inRepaint = false;
|
|
||||||
x->embedded = 0;
|
x->embedded = 0;
|
||||||
x->window = 0;
|
x->window = 0;
|
||||||
x->shareContext = 0;
|
x->shareContext = 0;
|
||||||
@ -6596,22 +6595,27 @@ QWidget *QWidgetPrivate::deepestFocusProxy() const
|
|||||||
return focusProxy;
|
return focusProxy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline bool isEmbedded(const QWindow *w)
|
||||||
|
{
|
||||||
|
const auto platformWindow = w->handle();
|
||||||
|
return platformWindow && platformWindow->isEmbedded();
|
||||||
|
}
|
||||||
|
|
||||||
void QWidgetPrivate::setFocus_sys()
|
void QWidgetPrivate::setFocus_sys()
|
||||||
{
|
{
|
||||||
Q_Q(QWidget);
|
Q_Q(QWidget);
|
||||||
// Embedded native widget may have taken the focus; get it back to toplevel
|
// Embedded native widget may have taken the focus; get it back to toplevel
|
||||||
// if that is the case (QTBUG-25852)
|
// if that is the case (QTBUG-25852)
|
||||||
const QWidget *topLevel = q->window();
|
// Do not activate in case the popup menu opens another application (QTBUG-70810)
|
||||||
// Do not activate in case the popup menu opens another application (QTBUG-70810).
|
// unless the application is embedded (QTBUG-71991).
|
||||||
if (QGuiApplication::applicationState() == Qt::ApplicationActive
|
if (QWindow *nativeWindow = q->testAttribute(Qt::WA_WState_Created) ? q->window()->windowHandle() : nullptr) {
|
||||||
&& topLevel->windowType() != Qt::Popup) {
|
if (nativeWindow->type() != Qt::Popup && nativeWindow != QGuiApplication::focusWindow()
|
||||||
if (QWindow *nativeWindow = q->window()->windowHandle()) {
|
&& (QGuiApplication::applicationState() == Qt::ApplicationActive
|
||||||
if (nativeWindow != QGuiApplication::focusWindow()
|
|| QCoreApplication::testAttribute(Qt::AA_PluginApplication)
|
||||||
&& q->testAttribute(Qt::WA_WState_Created)) {
|
|| isEmbedded(nativeWindow))) {
|
||||||
nativeWindow->requestActivate();
|
nativeWindow->requestActivate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// updates focus_child on parent widgets to point into this widget
|
// updates focus_child on parent widgets to point into this widget
|
||||||
@ -11036,11 +11040,8 @@ void QWidgetPrivate::repaint(T r)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
QTLWExtra *tlwExtra = q->window()->d_func()->maybeTopData();
|
QTLWExtra *tlwExtra = q->window()->d_func()->maybeTopData();
|
||||||
if (tlwExtra && !tlwExtra->inTopLevelResize && tlwExtra->backingStore) {
|
if (tlwExtra && !tlwExtra->inTopLevelResize && tlwExtra->backingStore)
|
||||||
tlwExtra->inRepaint = true;
|
|
||||||
tlwExtra->backingStoreTracker->markDirty(r, q, QWidgetBackingStore::UpdateNow);
|
tlwExtra->backingStoreTracker->markDirty(r, q, QWidgetBackingStore::UpdateNow);
|
||||||
tlwExtra->inRepaint = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -190,7 +190,6 @@ struct QTLWExtra {
|
|||||||
uint posIncludesFrame : 1;
|
uint posIncludesFrame : 1;
|
||||||
uint sizeAdjusted : 1;
|
uint sizeAdjusted : 1;
|
||||||
uint inTopLevelResize : 1;
|
uint inTopLevelResize : 1;
|
||||||
uint inRepaint : 1;
|
|
||||||
uint embedded : 1;
|
uint embedded : 1;
|
||||||
|
|
||||||
// *************************** Platform specific values (bit fields first) **********
|
// *************************** Platform specific values (bit fields first) **********
|
||||||
|
@ -227,6 +227,12 @@ QWindowContainer::QWindowContainer(QWindow *embeddedWindow, QWidget *parent, Qt:
|
|||||||
embeddedWindow->setSurfaceType(QSurface::RasterGLSurface);
|
embeddedWindow->setSurfaceType(QSurface::RasterGLSurface);
|
||||||
|
|
||||||
d->window = embeddedWindow;
|
d->window = embeddedWindow;
|
||||||
|
|
||||||
|
QString windowName = d->window->objectName();
|
||||||
|
if (windowName.isEmpty())
|
||||||
|
windowName = QString::fromUtf8(d->window->metaObject()->className());
|
||||||
|
d->fakeParent.setObjectName(windowName + "ContainerFakeParent");
|
||||||
|
|
||||||
d->window->setParent(&d->fakeParent);
|
d->window->setParent(&d->fakeParent);
|
||||||
setAcceptDrops(true);
|
setAcceptDrops(true);
|
||||||
|
|
||||||
|
@ -488,7 +488,10 @@ void QLineEdit::setClearButtonEnabled(bool enable)
|
|||||||
QAction *clearAction = new QAction(d->clearButtonIcon(), QString(), this);
|
QAction *clearAction = new QAction(d->clearButtonIcon(), QString(), this);
|
||||||
clearAction->setEnabled(!isReadOnly());
|
clearAction->setEnabled(!isReadOnly());
|
||||||
clearAction->setObjectName(QLatin1String(clearButtonActionNameC));
|
clearAction->setObjectName(QLatin1String(clearButtonActionNameC));
|
||||||
d->addAction(clearAction, 0, QLineEdit::TrailingPosition, QLineEditPrivate::SideWidgetClearButton | QLineEditPrivate::SideWidgetFadeInWithText);
|
|
||||||
|
int flags = QLineEditPrivate::SideWidgetClearButton | QLineEditPrivate::SideWidgetFadeInWithText;
|
||||||
|
auto widgetAction = d->addAction(clearAction, nullptr, QLineEdit::TrailingPosition, flags);
|
||||||
|
widgetAction->setVisible(!text().isEmpty());
|
||||||
} else {
|
} else {
|
||||||
QAction *clearAction = findChild<QAction *>(QLatin1String(clearButtonActionNameC));
|
QAction *clearAction = findChild<QAction *>(QLatin1String(clearButtonActionNameC));
|
||||||
Q_ASSERT(clearAction);
|
Q_ASSERT(clearAction);
|
||||||
|
@ -392,9 +392,47 @@ void QLineEditIconButton::setOpacity(qreal value)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if QT_CONFIG(animation)
|
#if QT_CONFIG(animation)
|
||||||
|
bool QLineEditIconButton::shouldHideWithText() const
|
||||||
|
{
|
||||||
|
return m_hideWithText;
|
||||||
|
}
|
||||||
|
|
||||||
|
void QLineEditIconButton::setHideWithText(bool hide)
|
||||||
|
{
|
||||||
|
m_hideWithText = hide;
|
||||||
|
}
|
||||||
|
|
||||||
|
void QLineEditIconButton::onAnimationFinished()
|
||||||
|
{
|
||||||
|
if (shouldHideWithText() && isVisible() && !m_wasHidden) {
|
||||||
|
hide();
|
||||||
|
|
||||||
|
// Invalidate previous geometry to take into account new size of side widgets
|
||||||
|
if (auto le = lineEditPrivate())
|
||||||
|
le->updateGeometry_helper(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void QLineEditIconButton::animateShow(bool visible)
|
||||||
|
{
|
||||||
|
m_wasHidden = visible;
|
||||||
|
|
||||||
|
if (shouldHideWithText() && !isVisible()) {
|
||||||
|
show();
|
||||||
|
|
||||||
|
// Invalidate previous geometry to take into account new size of side widgets
|
||||||
|
if (auto le = lineEditPrivate())
|
||||||
|
le->updateGeometry_helper(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
startOpacityAnimation(visible ? 1.0 : 0.0);
|
||||||
|
}
|
||||||
|
|
||||||
void QLineEditIconButton::startOpacityAnimation(qreal endValue)
|
void QLineEditIconButton::startOpacityAnimation(qreal endValue)
|
||||||
{
|
{
|
||||||
QPropertyAnimation *animation = new QPropertyAnimation(this, QByteArrayLiteral("opacity"));
|
QPropertyAnimation *animation = new QPropertyAnimation(this, QByteArrayLiteral("opacity"));
|
||||||
|
connect(animation, &QPropertyAnimation::finished, this, &QLineEditIconButton::onAnimationFinished);
|
||||||
|
|
||||||
animation->setDuration(160);
|
animation->setDuration(160);
|
||||||
animation->setEndValue(endValue);
|
animation->setEndValue(endValue);
|
||||||
animation->start(QAbstractAnimation::DeleteWhenStopped);
|
animation->start(QAbstractAnimation::DeleteWhenStopped);
|
||||||
@ -409,6 +447,16 @@ void QLineEditIconButton::updateCursor()
|
|||||||
}
|
}
|
||||||
#endif // QT_CONFIG(toolbutton)
|
#endif // QT_CONFIG(toolbutton)
|
||||||
|
|
||||||
|
#if QT_CONFIG(animation) && QT_CONFIG(toolbutton)
|
||||||
|
static void displayWidgets(const QLineEditPrivate::SideWidgetEntryList &widgets, bool display)
|
||||||
|
{
|
||||||
|
for (const auto &e : widgets) {
|
||||||
|
if (e.flags & QLineEditPrivate::SideWidgetFadeInWithText)
|
||||||
|
static_cast<QLineEditIconButton *>(e.widget)->animateShow(display);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void QLineEditPrivate::_q_textChanged(const QString &text)
|
void QLineEditPrivate::_q_textChanged(const QString &text)
|
||||||
{
|
{
|
||||||
if (hasSideWidgets()) {
|
if (hasSideWidgets()) {
|
||||||
@ -416,15 +464,9 @@ void QLineEditPrivate::_q_textChanged(const QString &text)
|
|||||||
if (!newTextSize || !lastTextSize) {
|
if (!newTextSize || !lastTextSize) {
|
||||||
lastTextSize = newTextSize;
|
lastTextSize = newTextSize;
|
||||||
#if QT_CONFIG(animation) && QT_CONFIG(toolbutton)
|
#if QT_CONFIG(animation) && QT_CONFIG(toolbutton)
|
||||||
const bool fadeIn = newTextSize > 0;
|
const bool display = newTextSize > 0;
|
||||||
for (const SideWidgetEntry &e : leadingSideWidgets) {
|
displayWidgets(leadingSideWidgets, display);
|
||||||
if (e.flags & SideWidgetFadeInWithText)
|
displayWidgets(trailingSideWidgets, display);
|
||||||
static_cast<QLineEditIconButton *>(e.widget)->animateShow(fadeIn);
|
|
||||||
}
|
|
||||||
for (const SideWidgetEntry &e : trailingSideWidgets) {
|
|
||||||
if (e.flags & SideWidgetFadeInWithText)
|
|
||||||
static_cast<QLineEditIconButton *>(e.widget)->animateShow(fadeIn);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -541,8 +583,15 @@ QWidget *QLineEditPrivate::addAction(QAction *newAction, QAction *before, QLineE
|
|||||||
QLineEditIconButton *toolButton = new QLineEditIconButton(q);
|
QLineEditIconButton *toolButton = new QLineEditIconButton(q);
|
||||||
toolButton->setIcon(newAction->icon());
|
toolButton->setIcon(newAction->icon());
|
||||||
toolButton->setOpacity(lastTextSize > 0 || !(flags & SideWidgetFadeInWithText) ? 1 : 0);
|
toolButton->setOpacity(lastTextSize > 0 || !(flags & SideWidgetFadeInWithText) ? 1 : 0);
|
||||||
if (flags & SideWidgetClearButton)
|
if (flags & SideWidgetClearButton) {
|
||||||
QObject::connect(toolButton, SIGNAL(clicked()), q, SLOT(_q_clearButtonClicked()));
|
QObject::connect(toolButton, SIGNAL(clicked()), q, SLOT(_q_clearButtonClicked()));
|
||||||
|
|
||||||
|
#if QT_CONFIG(animation)
|
||||||
|
// The clear button is handled only by this widget. The button should be really
|
||||||
|
// shown/hidden in order to calculate size hints correctly.
|
||||||
|
toolButton->setHideWithText(true);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
toolButton->setDefaultAction(newAction);
|
toolButton->setDefaultAction(newAction);
|
||||||
w = toolButton;
|
w = toolButton;
|
||||||
#else
|
#else
|
||||||
@ -606,33 +655,26 @@ void QLineEditPrivate::removeAction(QAction *action)
|
|||||||
#endif // QT_CONFIG(action)
|
#endif // QT_CONFIG(action)
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool isSideWidgetVisible(const QLineEditPrivate::SideWidgetEntry &e)
|
static int effectiveTextMargin(int defaultMargin, const QLineEditPrivate::SideWidgetEntryList &widgets,
|
||||||
|
const QLineEditPrivate::SideWidgetParameters ¶meters)
|
||||||
{
|
{
|
||||||
return e.widget->isVisible();
|
if (widgets.empty())
|
||||||
|
return defaultMargin;
|
||||||
|
|
||||||
|
return defaultMargin + (parameters.margin + parameters.widgetWidth) *
|
||||||
|
int(std::count_if(widgets.begin(), widgets.end(),
|
||||||
|
[](const QLineEditPrivate::SideWidgetEntry &e) {
|
||||||
|
return e.widget->isVisibleTo(e.widget->parentWidget()); }));
|
||||||
}
|
}
|
||||||
|
|
||||||
int QLineEditPrivate::effectiveLeftTextMargin() const
|
int QLineEditPrivate::effectiveLeftTextMargin() const
|
||||||
{
|
{
|
||||||
int result = leftTextMargin;
|
return effectiveTextMargin(leftTextMargin, leftSideWidgetList(), sideWidgetParameters());
|
||||||
if (!leftSideWidgetList().empty()) {
|
|
||||||
const SideWidgetParameters p = sideWidgetParameters();
|
|
||||||
result += (p.margin + p.widgetWidth)
|
|
||||||
* int(std::count_if(leftSideWidgetList().begin(), leftSideWidgetList().end(),
|
|
||||||
isSideWidgetVisible));
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int QLineEditPrivate::effectiveRightTextMargin() const
|
int QLineEditPrivate::effectiveRightTextMargin() const
|
||||||
{
|
{
|
||||||
int result = rightTextMargin;
|
return effectiveTextMargin(rightTextMargin, rightSideWidgetList(), sideWidgetParameters());
|
||||||
if (!rightSideWidgetList().empty()) {
|
|
||||||
const SideWidgetParameters p = sideWidgetParameters();
|
|
||||||
result += (p.margin + p.widgetWidth)
|
|
||||||
* int(std::count_if(rightSideWidgetList().begin(), rightSideWidgetList().end(),
|
|
||||||
isSideWidgetVisible));
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -90,7 +90,10 @@ public:
|
|||||||
qreal opacity() const { return m_opacity; }
|
qreal opacity() const { return m_opacity; }
|
||||||
void setOpacity(qreal value);
|
void setOpacity(qreal value);
|
||||||
#if QT_CONFIG(animation)
|
#if QT_CONFIG(animation)
|
||||||
void animateShow(bool visible) { startOpacityAnimation(visible ? 1.0 : 0.0); }
|
void animateShow(bool visible);
|
||||||
|
|
||||||
|
bool shouldHideWithText() const;
|
||||||
|
void setHideWithText(bool hide);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -100,6 +103,10 @@ protected:
|
|||||||
private slots:
|
private slots:
|
||||||
void updateCursor();
|
void updateCursor();
|
||||||
|
|
||||||
|
#if QT_CONFIG(animation)
|
||||||
|
void onAnimationFinished();
|
||||||
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#if QT_CONFIG(animation)
|
#if QT_CONFIG(animation)
|
||||||
void startOpacityAnimation(qreal endValue);
|
void startOpacityAnimation(qreal endValue);
|
||||||
@ -107,6 +114,12 @@ private:
|
|||||||
QLineEditPrivate *lineEditPrivate() const;
|
QLineEditPrivate *lineEditPrivate() const;
|
||||||
|
|
||||||
qreal m_opacity;
|
qreal m_opacity;
|
||||||
|
|
||||||
|
#if QT_CONFIG(animation)
|
||||||
|
bool m_hideWithText = false;
|
||||||
|
bool m_wasHidden = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
};
|
};
|
||||||
#endif // QT_CONFIG(toolbutton)
|
#endif // QT_CONFIG(toolbutton)
|
||||||
|
|
||||||
|
@ -12,10 +12,10 @@ DEFINES += QT_NO_FOREACH
|
|||||||
|
|
||||||
qtConfig(debug_and_release): CONFIG += build_all
|
qtConfig(debug_and_release): CONFIG += build_all
|
||||||
|
|
||||||
win32-msvc*:QMAKE_CFLAGS_DEBUG -= -Zi
|
msvc: QMAKE_CFLAGS_DEBUG -= -Zi
|
||||||
win32-msvc*:QMAKE_CXXFLAGS_DEBUG -= -Zi
|
msvc: QMAKE_CXXFLAGS_DEBUG -= -Zi
|
||||||
win32-msvc*:QMAKE_CFLAGS_DEBUG *= -Z7
|
msvc: QMAKE_CFLAGS_DEBUG *= -Z7
|
||||||
win32-msvc*:QMAKE_CXXFLAGS_DEBUG *= -Z7
|
msvc: QMAKE_CXXFLAGS_DEBUG *= -Z7
|
||||||
mingw: DEFINES += QT_NEEDS_QMAIN
|
mingw: DEFINES += QT_NEEDS_QMAIN
|
||||||
|
|
||||||
winrt {
|
winrt {
|
||||||
|
@ -10,7 +10,7 @@ msvc|winrt {
|
|||||||
# Prevents "fatal error C1128: number of sections exceeded object file format limit".
|
# Prevents "fatal error C1128: number of sections exceeded object file format limit".
|
||||||
QMAKE_CXXFLAGS += /bigobj
|
QMAKE_CXXFLAGS += /bigobj
|
||||||
# Reduce compile time
|
# Reduce compile time
|
||||||
win32-msvc2012|winrt {
|
winrt {
|
||||||
QMAKE_CXXFLAGS_RELEASE -= -O2
|
QMAKE_CXXFLAGS_RELEASE -= -O2
|
||||||
QMAKE_CFLAGS_RELEASE -= -O2
|
QMAKE_CFLAGS_RELEASE -= -O2
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ TARGET = mylib
|
|||||||
DESTDIR = ../
|
DESTDIR = ../
|
||||||
QT = core
|
QT = core
|
||||||
|
|
||||||
win32-msvc: DEFINES += WIN32_MSVC
|
msvc: DEFINES += WIN32_MSVC
|
||||||
|
|
||||||
# This project is testdata for tst_qlibrary
|
# This project is testdata for tst_qlibrary
|
||||||
target.path = $$[QT_INSTALL_TESTS]/tst_qlibrary
|
target.path = $$[QT_INSTALL_TESTS]/tst_qlibrary
|
||||||
|
@ -7,7 +7,7 @@ DESTDIR = ../
|
|||||||
VERSION = 2
|
VERSION = 2
|
||||||
QT = core
|
QT = core
|
||||||
|
|
||||||
win32-msvc: DEFINES += WIN32_MSVC
|
msvc: DEFINES += WIN32_MSVC
|
||||||
|
|
||||||
# Force a copy of the library to have an extension that is non-standard.
|
# Force a copy of the library to have an extension that is non-standard.
|
||||||
# We want to test if we can load a shared library with *any* filename...
|
# We want to test if we can load a shared library with *any* filename...
|
||||||
|
@ -7,7 +7,7 @@ DESTDIR = ../bin
|
|||||||
winrt:include(../winrt.pri)
|
winrt:include(../winrt.pri)
|
||||||
QT = core
|
QT = core
|
||||||
|
|
||||||
win32-msvc: DEFINES += WIN32_MSVC
|
msvc: DEFINES += WIN32_MSVC
|
||||||
|
|
||||||
# This is testdata for the tst_qpluginloader test.
|
# This is testdata for the tst_qpluginloader test.
|
||||||
target.path = $$[QT_INSTALL_TESTS]/tst_qpluginloader/bin
|
target.path = $$[QT_INSTALL_TESTS]/tst_qpluginloader/bin
|
||||||
|
@ -5,7 +5,7 @@ SOURCES = tst_qdatetime.cpp
|
|||||||
|
|
||||||
# For some reason using optimization here triggers a compiler issue, which causes an exception
|
# For some reason using optimization here triggers a compiler issue, which causes an exception
|
||||||
# However, the code is correct
|
# However, the code is correct
|
||||||
win32-msvc|win32-msvc9x {
|
msvc {
|
||||||
!build_pass:message ( "Compiler issue, removing -O1 flag" )
|
!build_pass:message ( "Compiler issue, removing -O1 flag" )
|
||||||
QMAKE_CFLAGS_RELEASE -= -O1
|
QMAKE_CFLAGS_RELEASE -= -O1
|
||||||
QMAKE_CXXFLAGS_RELEASE -= -O1
|
QMAKE_CXXFLAGS_RELEASE -= -O1
|
||||||
|
@ -140,6 +140,7 @@ private slots:
|
|||||||
void palettePropagation();
|
void palettePropagation();
|
||||||
void fontPropagation();
|
void fontPropagation();
|
||||||
void dontCrashWhenDie();
|
void dontCrashWhenDie();
|
||||||
|
void dontCrashNoParent();
|
||||||
void createProxyForChildWidget();
|
void createProxyForChildWidget();
|
||||||
#ifndef QT_NO_CONTEXTMENU
|
#ifndef QT_NO_CONTEXTMENU
|
||||||
void actionsContextMenu();
|
void actionsContextMenu();
|
||||||
@ -2964,6 +2965,20 @@ void tst_QGraphicsProxyWidget::dontCrashWhenDie()
|
|||||||
qDeleteAll(QApplication::topLevelWidgets());
|
qDeleteAll(QApplication::topLevelWidgets());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void tst_QGraphicsProxyWidget::dontCrashNoParent() // QTBUG-15442
|
||||||
|
{
|
||||||
|
QGraphicsProxyWidget *parent(new QGraphicsProxyWidget);
|
||||||
|
QGraphicsProxyWidget *child(new QGraphicsProxyWidget);
|
||||||
|
QScopedPointer<QLabel> label0(new QLabel);
|
||||||
|
QScopedPointer<QLabel> label1(new QLabel);
|
||||||
|
|
||||||
|
child->setParentItem(parent);
|
||||||
|
// Set the first label as the proxied widget.
|
||||||
|
parent->setWidget(label0.data());
|
||||||
|
// If we attempt to change the proxied widget we get a crash.
|
||||||
|
parent->setWidget(label1.data());
|
||||||
|
}
|
||||||
|
|
||||||
void tst_QGraphicsProxyWidget::createProxyForChildWidget()
|
void tst_QGraphicsProxyWidget::createProxyForChildWidget()
|
||||||
{
|
{
|
||||||
QGraphicsScene scene;
|
QGraphicsScene scene;
|
||||||
|
@ -4451,10 +4451,11 @@ void tst_QLineEdit::clearButtonVisibleAfterSettingText_QTBUG_45518()
|
|||||||
QTRY_VERIFY(clearButton->opacity() > 0);
|
QTRY_VERIFY(clearButton->opacity() > 0);
|
||||||
QTRY_COMPARE(clearButton->cursor().shape(), Qt::ArrowCursor);
|
QTRY_COMPARE(clearButton->cursor().shape(), Qt::ArrowCursor);
|
||||||
|
|
||||||
QTest::mouseClick(clearButton, Qt::LeftButton, 0, clearButton->rect().center());
|
QTest::mouseClick(clearButton, Qt::LeftButton, nullptr, clearButton->rect().center());
|
||||||
QTRY_COMPARE(edit.text(), QString());
|
QTRY_COMPARE(edit.text(), QString());
|
||||||
|
|
||||||
QTRY_COMPARE(clearButton->opacity(), qreal(0));
|
QTRY_COMPARE(clearButton->opacity(), qreal(0));
|
||||||
|
QVERIFY(clearButton->isHidden());
|
||||||
QTRY_COMPARE(clearButton->cursor().shape(), clearButton->parentWidget()->cursor().shape());
|
QTRY_COMPARE(clearButton->cursor().shape(), clearButton->parentWidget()->cursor().shape());
|
||||||
|
|
||||||
edit.setClearButtonEnabled(false);
|
edit.setClearButtonEnabled(false);
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
#include <qlineedit.h>
|
#include <qlineedit.h>
|
||||||
#include <qkeysequence.h>
|
#include <qkeysequence.h>
|
||||||
#include <qmenu.h>
|
#include <qmenu.h>
|
||||||
|
#include <qlabel.h>
|
||||||
#include <private/qtoolbarextension_p.h>
|
#include <private/qtoolbarextension_p.h>
|
||||||
|
|
||||||
QT_FORWARD_DECLARE_CLASS(QAction)
|
QT_FORWARD_DECLARE_CLASS(QAction)
|
||||||
@ -80,6 +81,8 @@ private slots:
|
|||||||
|
|
||||||
void task191727_layout();
|
void task191727_layout();
|
||||||
void task197996_visibility();
|
void task197996_visibility();
|
||||||
|
|
||||||
|
void extraCpuConsumption(); // QTBUG-54676
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -1098,5 +1101,81 @@ void tst_QToolBar::task197996_visibility()
|
|||||||
QTRY_VERIFY(toolBar->widgetForAction(pAction)->isVisible());
|
QTRY_VERIFY(toolBar->widgetForAction(pAction)->isVisible());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class ShowHideEventCounter : public QObject
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
using QObject::QObject;
|
||||||
|
|
||||||
|
bool eventFilter(QObject *watched, QEvent *event) override
|
||||||
|
{
|
||||||
|
if (qobject_cast<QLineEdit*>(watched) && !event->spontaneous()) {
|
||||||
|
if (event->type() == QEvent::Show)
|
||||||
|
++m_showEventsCount;
|
||||||
|
|
||||||
|
if (event->type() == QEvent::Hide)
|
||||||
|
++m_hideEventsCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
return QObject::eventFilter(watched, event);
|
||||||
|
}
|
||||||
|
|
||||||
|
uint showEventsCount() const { return m_showEventsCount; }
|
||||||
|
uint hideEventsCount() const { return m_hideEventsCount; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
uint m_showEventsCount = 0;
|
||||||
|
uint m_hideEventsCount = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
void tst_QToolBar::extraCpuConsumption()
|
||||||
|
{
|
||||||
|
QMainWindow mainWindow;
|
||||||
|
|
||||||
|
auto tb = new QToolBar(&mainWindow);
|
||||||
|
tb->setMovable(false);
|
||||||
|
|
||||||
|
auto extensions = tb->findChildren<QToolBarExtension *>();
|
||||||
|
QVERIFY(!extensions.isEmpty());
|
||||||
|
|
||||||
|
auto extensionButton = extensions.at(0);
|
||||||
|
QVERIFY(extensionButton);
|
||||||
|
|
||||||
|
tb->addWidget(new QLabel("Lorem ipsum dolor sit amet"));
|
||||||
|
|
||||||
|
auto le = new QLineEdit;
|
||||||
|
le->setClearButtonEnabled(true);
|
||||||
|
le->setText("Lorem ipsum");
|
||||||
|
tb->addWidget(le);
|
||||||
|
|
||||||
|
mainWindow.addToolBar(tb);
|
||||||
|
mainWindow.show();
|
||||||
|
QVERIFY(QTest::qWaitForWindowActive(&mainWindow));
|
||||||
|
|
||||||
|
auto eventCounter = new ShowHideEventCounter(&mainWindow);
|
||||||
|
le->installEventFilter(eventCounter);
|
||||||
|
|
||||||
|
auto defaultSize = mainWindow.size();
|
||||||
|
|
||||||
|
// Line edit should be hidden now and extension button should be displayed
|
||||||
|
for (double p = 0.7; extensionButton->isHidden() || qFuzzyCompare(p, 0.); p -= 0.01) {
|
||||||
|
mainWindow.resize(int(defaultSize.width() * p), defaultSize.height());
|
||||||
|
}
|
||||||
|
QVERIFY(!extensionButton->isHidden());
|
||||||
|
|
||||||
|
// Line edit should be visible, but smaller
|
||||||
|
for (double p = 0.75; !extensionButton->isHidden() || qFuzzyCompare(p, 1.); p += 0.01) {
|
||||||
|
mainWindow.resize(int(defaultSize.width() * p), defaultSize.height());
|
||||||
|
}
|
||||||
|
QVERIFY(extensionButton->isHidden());
|
||||||
|
|
||||||
|
// Dispatch all pending events
|
||||||
|
qApp->sendPostedEvents();
|
||||||
|
qApp->processEvents();
|
||||||
|
|
||||||
|
QCOMPARE(eventCounter->showEventsCount(), eventCounter->hideEventsCount());
|
||||||
|
QCOMPARE(eventCounter->showEventsCount(), uint(1));
|
||||||
|
QCOMPARE(eventCounter->hideEventsCount(), uint(1));
|
||||||
|
}
|
||||||
|
|
||||||
QTEST_MAIN(tst_QToolBar)
|
QTEST_MAIN(tst_QToolBar)
|
||||||
#include "tst_qtoolbar.moc"
|
#include "tst_qtoolbar.moc"
|
||||||
|
Loading…
Reference in New Issue
Block a user