Compare commits
170 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
8959c5055a | ||
|
6375c935a5 | ||
|
5f8ca97f51 | ||
|
3e0bcaeea2 | ||
|
c9d597f5db | ||
|
6588b46c82 | ||
|
0e0db3eefd | ||
|
4cd2ff8226 | ||
|
453aaf5759 | ||
|
bd4d7145d8 | ||
|
806e4e619c | ||
|
ce0e4ca6fe | ||
|
5430116ed3 | ||
|
ee95cb90c4 | ||
|
8bb365b0c5 | ||
|
a997b85d63 | ||
|
617625ab04 | ||
|
d50bb03157 | ||
|
9eb84657bc | ||
|
92d73eb9d5 | ||
|
3408df40a7 | ||
|
afa36328a5 | ||
|
bbb284cd70 | ||
|
4a4d11c178 | ||
|
35fe0a0b6f | ||
|
c750468766 | ||
|
282ce8fbbc | ||
|
17eb1432b0 | ||
|
65db00df78 | ||
|
59db97fdaf | ||
|
da96dfdacc | ||
|
7e7f7daa2b | ||
|
5f6304b313 | ||
|
43e249cba8 | ||
|
afdb96e70c | ||
|
78dd82396a | ||
|
ee5570b40e | ||
|
12b91f97e3 | ||
|
8e7ddf261e | ||
|
5f758f7af6 | ||
|
cf1a20df70 | ||
|
da212685ee | ||
|
536856f99e | ||
|
cdb7967d43 | ||
|
f5cee4ae8c | ||
|
e3fcc5403c | ||
|
00ecb3b6f5 | ||
|
da9ac3bf1d | ||
|
f0d89ec153 | ||
|
355619c2a3 | ||
|
2d2dd3aa2e | ||
|
d6fb65adb0 | ||
|
6b77b43b1a | ||
|
2b0ec367c7 | ||
|
ee0cb525cd | ||
|
53b144f757 | ||
|
64ce22c61e | ||
|
b5e05f32e6 | ||
|
603e0710af | ||
|
42b0903c34 | ||
|
7f2f005d4f | ||
|
1256098113 | ||
|
e9a941053f | ||
|
64407cc9ce | ||
|
4d644342ad | ||
|
db28f1912c | ||
|
afafe577fa | ||
|
33cd01395a | ||
|
0ebe6718a1 | ||
|
5fc456bfe2 | ||
|
1c82a674bb | ||
|
a9f1f7f41f | ||
|
aecd1b9ed7 | ||
|
5af219f287 | ||
|
7b22740749 | ||
|
4bda2a17b5 | ||
|
57baa91ec2 | ||
|
4235f0587b | ||
|
a0ab39b24b | ||
|
b6a3f29c10 | ||
|
e9c0dcb0f1 | ||
|
e1d874a71b | ||
|
d7b80c9c9b | ||
|
af519f5d8a | ||
|
1e844fbf23 | ||
|
3f72e55bca | ||
|
75e575e18f | ||
|
3a5cb14dd3 | ||
|
52a1447842 | ||
|
32c17c4598 | ||
|
417a5bcbb6 | ||
|
dbd9f64174 | ||
|
2d55125018 | ||
|
fdc070c3b0 | ||
|
5564f91b6b | ||
|
1e3eb1203a | ||
|
e7a9bb77fe | ||
|
4c47bbc805 | ||
|
3bd9eeda59 | ||
|
deda96666d | ||
|
15d3c67c1b | ||
|
f417776a36 | ||
|
2770bb4927 | ||
|
a1c1dda418 | ||
|
fcd76f6d24 | ||
|
bff88a1391 | ||
|
5380da9cc0 | ||
|
9ff93f75c0 | ||
|
a01e8d0d5c | ||
|
5641329229 | ||
|
cdb2b134bc | ||
|
217d7e4fbf | ||
|
20dfcf4c59 | ||
|
8447cd262f | ||
|
3df9be0f96 | ||
|
999dbe5734 | ||
|
488e218604 | ||
|
1d9432cf79 | ||
|
b695743b7e | ||
|
40fd01f4a0 | ||
|
2fc3c10d76 | ||
|
e40d85403f | ||
|
1dbbad44d7 | ||
|
6874de0e50 | ||
|
023e36e0e7 | ||
|
a4db2f7313 | ||
|
33f8d08343 | ||
|
ddd53192d3 | ||
|
fe7a4b7bf8 | ||
|
e359fc7ec5 | ||
|
ad55e57c6e | ||
|
0beddaa99f | ||
|
3f42b65818 | ||
|
8ff03d14cc | ||
|
fe777849c9 | ||
|
2ee633a17a | ||
|
728daaf384 | ||
|
88c7f0250a | ||
|
5ded95d659 | ||
|
a66e8de68c | ||
|
f35f45642c | ||
|
c39a3edb50 | ||
|
17f5cdd39e | ||
|
c617cc9593 | ||
|
b01b4b1e40 | ||
|
88977389d3 | ||
|
3915e017e7 | ||
|
43d8bf3c28 | ||
|
2fb5bd9669 | ||
|
0b69f2f7ab | ||
|
641422686d | ||
|
3afa63c30c | ||
|
eae538fa06 | ||
|
ef015fb9b8 | ||
|
878a505853 | ||
|
17c5224184 | ||
|
de505a9c78 | ||
|
d12cdac9bd | ||
|
98ac864cab | ||
|
03d478d5a9 | ||
|
856dcf7f7b | ||
|
a276ce6208 | ||
|
44913432ce | ||
|
895d921619 | ||
|
91225ad81e | ||
|
924b8dd584 | ||
|
121f5105fd | ||
|
84a6c4ca6e | ||
|
46c82ac228 | ||
|
9237cdf98f |
@ -21,25 +21,31 @@
|
|||||||
# ``DB2::DB2``
|
# ``DB2::DB2``
|
||||||
# The db2 client library
|
# The db2 client library
|
||||||
|
|
||||||
|
if(NOT DEFINED DB2_ROOT)
|
||||||
|
if(DEFINED ENV{DB2_ROOT})
|
||||||
|
set(DB2_ROOT "$ENV{DB2_ROOT}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
if (NOT DEFINED DB2_INCLUDE_DIR)
|
if (NOT DEFINED DB2_INCLUDE_DIR)
|
||||||
find_path(DB2_INCLUDE_DIR
|
find_path(DB2_INCLUDE_DIR
|
||||||
NAMES sqlcli1.h
|
NAMES sqlcli1.h
|
||||||
HINTS ENV DB2_HOME
|
HINTS "${DB2_ROOT}" ENV DB2_HOME
|
||||||
PATH_SUFFIXES include)
|
PATH_SUFFIXES include)
|
||||||
else()
|
else()
|
||||||
find_path(DB2_INCLUDE_DIR
|
find_path(DB2_INCLUDE_DIR
|
||||||
NAMES sqlcli1.h
|
NAMES sqlcli1.h
|
||||||
HINTS ${DB2_INCLUDE_DIR})
|
HINTS "${DB2_INCLUDE_DIR}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (NOT DEFINED DB2_LIBRARY_DIR)
|
if (NOT DEFINED DB2_LIBRARY_DIR)
|
||||||
find_library(DB2_LIBRARY
|
find_library(DB2_LIBRARY
|
||||||
NAMES db2
|
NAMES db2 db2cli64
|
||||||
HINTS ENV DB2LIB)
|
HINTS "${DB2_ROOT}" ENV DB2LIB)
|
||||||
else()
|
else()
|
||||||
find_library(DB2_LIBRARY
|
find_library(DB2_LIBRARY
|
||||||
NAMES db2
|
NAMES db2
|
||||||
HINTS ${DB2_LIBRARY_DIR})
|
HINTS "${DB2_LIBRARY_DIR}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
include(FindPackageHandleStandardArgs)
|
||||||
|
@ -37,16 +37,7 @@ if (OpenGL_FOUND)
|
|||||||
set(__opengl_fw_path "-framework OpenGL")
|
set(__opengl_fw_path "-framework OpenGL")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_library(WrapOpenGL_AGL NAMES AGL)
|
|
||||||
if(WrapOpenGL_AGL)
|
|
||||||
set(__opengl_agl_fw_path "${WrapOpenGL_AGL}")
|
|
||||||
endif()
|
|
||||||
if(NOT __opengl_agl_fw_path)
|
|
||||||
set(__opengl_agl_fw_path "-framework AGL")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
target_link_libraries(WrapOpenGL::WrapOpenGL INTERFACE ${__opengl_fw_path})
|
target_link_libraries(WrapOpenGL::WrapOpenGL INTERFACE ${__opengl_fw_path})
|
||||||
target_link_libraries(WrapOpenGL::WrapOpenGL INTERFACE ${__opengl_agl_fw_path})
|
|
||||||
else()
|
else()
|
||||||
target_link_libraries(WrapOpenGL::WrapOpenGL INTERFACE OpenGL::GL)
|
target_link_libraries(WrapOpenGL::WrapOpenGL INTERFACE OpenGL::GL)
|
||||||
endif()
|
endif()
|
||||||
|
@ -166,6 +166,9 @@ function(qt_manual_moc result)
|
|||||||
set(metatypes_byproducts "${outfile}.json")
|
set(metatypes_byproducts "${outfile}.json")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
_qt_internal_get_moc_compiler_flavor_flags(flavor_flags)
|
||||||
|
list(APPEND moc_parameters ${flavor_flags})
|
||||||
|
|
||||||
if (TARGET Qt::Platform)
|
if (TARGET Qt::Platform)
|
||||||
get_target_property(_abi_tag Qt::Platform qt_libcpp_abi_tag)
|
get_target_property(_abi_tag Qt::Platform qt_libcpp_abi_tag)
|
||||||
if (_abi_tag)
|
if (_abi_tag)
|
||||||
|
@ -55,13 +55,40 @@ qt_install(FILES
|
|||||||
DESTINATION "${__build_internals_install_dir}"
|
DESTINATION "${__build_internals_install_dir}"
|
||||||
COMPONENT Devel
|
COMPONENT Devel
|
||||||
)
|
)
|
||||||
|
|
||||||
|
qt_path_join(__build_internals_standalone_test_template_path
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}"
|
||||||
|
"cmake/QtBuildInternals/${__build_internals_standalone_test_template_dir}")
|
||||||
|
|
||||||
qt_copy_or_install(
|
qt_copy_or_install(
|
||||||
DIRECTORY
|
DIRECTORY "${__build_internals_standalone_test_template_path}"
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/QtBuildInternals/${__build_internals_standalone_test_template_dir}"
|
|
||||||
DESTINATION "${__build_internals_install_dir}")
|
DESTINATION "${__build_internals_install_dir}")
|
||||||
|
|
||||||
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS
|
# In prefix builds we also need to copy the files into the build dir.
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/QtBuildInternals/${__build_internals_standalone_test_template_dir}/CMakeLists.txt")
|
if(QT_WILL_INSTALL)
|
||||||
|
file(COPY "${__build_internals_standalone_test_template_path}"
|
||||||
|
DESTINATION "${__build_internals_install_dir}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(__build_internals_extra_files
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/QtBuildInternals/QtBuildInternalsHelpers.cmake"
|
||||||
|
)
|
||||||
|
|
||||||
|
qt_copy_or_install(
|
||||||
|
FILES ${__build_internals_extra_files}
|
||||||
|
DESTINATION "${__build_internals_install_dir}")
|
||||||
|
|
||||||
|
# In prefix builds we also need to copy the files into the build dir.
|
||||||
|
if(QT_WILL_INSTALL)
|
||||||
|
foreach(__build_internals_file ${__build_internals_extra_files})
|
||||||
|
file(COPY "${__build_internals_file}" DESTINATION "${__build_internals_install_dir}")
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
_qt_internal_append_cmake_configure_depends(
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/QtBuildInternals/${__build_internals_standalone_test_template_dir}/CMakeLists.txt"
|
||||||
|
${__build_internals_extra_files}
|
||||||
|
)
|
||||||
|
|
||||||
qt_internal_create_toolchain_file()
|
qt_internal_create_toolchain_file()
|
||||||
|
|
||||||
|
@ -137,7 +137,7 @@ macro(qt_internal_qtbase_install_mkspecs)
|
|||||||
LIST_DIRECTORIES TRUE
|
LIST_DIRECTORIES TRUE
|
||||||
"${PROJECT_SOURCE_DIR}/mkspecs/*")
|
"${PROJECT_SOURCE_DIR}/mkspecs/*")
|
||||||
foreach(entry IN LISTS mkspecs_subdirs)
|
foreach(entry IN LISTS mkspecs_subdirs)
|
||||||
if (IS_DIRECTORY ${entry})
|
if(IS_DIRECTORY ${entry})
|
||||||
qt_copy_or_install(DIRECTORY "${entry}"
|
qt_copy_or_install(DIRECTORY "${entry}"
|
||||||
DESTINATION ${mkspecs_install_dir}
|
DESTINATION ${mkspecs_install_dir}
|
||||||
USE_SOURCE_PERMISSIONS)
|
USE_SOURCE_PERMISSIONS)
|
||||||
@ -145,16 +145,21 @@ macro(qt_internal_qtbase_install_mkspecs)
|
|||||||
qt_copy_or_install(FILES "${entry}"
|
qt_copy_or_install(FILES "${entry}"
|
||||||
DESTINATION ${mkspecs_install_dir})
|
DESTINATION ${mkspecs_install_dir})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# In prefix builds we also need to copy the files into the build dir.
|
||||||
|
if(QT_WILL_INSTALL)
|
||||||
|
file(COPY "${entry}" DESTINATION "${mkspecs_install_dir}")
|
||||||
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
function(qt_internal_qtbase_install_wayland_files)
|
function(qt_internal_qtbase_install_wayland_files)
|
||||||
qt_path_join(wlprotocols_build_dir
|
qt_path_join(wlprotocols_build_dir
|
||||||
${QT_BUILD_DIR}
|
${QT_BUILD_DIR}
|
||||||
${INSTALL_SHAREDIR}/qt6/wayland/protocols)
|
${INSTALL_QT_SHAREDIR}/wayland/protocols)
|
||||||
qt_path_join(wlprotocols_install_dir
|
qt_path_join(wlprotocols_install_dir
|
||||||
${QT_INSTALL_DIR}
|
${QT_INSTALL_DIR}
|
||||||
${INSTALL_SHAREDIR}/qt6/wayland/protocols)
|
${INSTALL_QT_SHAREDIR}/wayland/protocols)
|
||||||
|
|
||||||
file(GLOB wlprotocols_subdirs
|
file(GLOB wlprotocols_subdirs
|
||||||
LIST_DIRECTORIES TRUE
|
LIST_DIRECTORIES TRUE
|
||||||
@ -178,10 +183,10 @@ function(qt_internal_qtbase_install_wayland_files)
|
|||||||
|
|
||||||
qt_path_join(wlextensions_build_dir
|
qt_path_join(wlextensions_build_dir
|
||||||
${QT_BUILD_DIR}
|
${QT_BUILD_DIR}
|
||||||
${INSTALL_SHAREDIR}/qt6/wayland/extensions)
|
${INSTALL_QT_SHAREDIR}/wayland/extensions)
|
||||||
qt_path_join(wlextensions_install_dir
|
qt_path_join(wlextensions_install_dir
|
||||||
${QT_INSTALL_DIR}
|
${QT_INSTALL_DIR}
|
||||||
${INSTALL_SHAREDIR}/qt6/wayland/extensions)
|
${INSTALL_QT_SHAREDIR}/wayland/extensions)
|
||||||
|
|
||||||
file(GLOB wlextensions_subdirs
|
file(GLOB wlextensions_subdirs
|
||||||
LIST_DIRECTORIES TRUE
|
LIST_DIRECTORIES TRUE
|
||||||
|
@ -34,6 +34,23 @@ endmacro()
|
|||||||
|
|
||||||
macro(qt_internal_top_level_setup_after_project)
|
macro(qt_internal_top_level_setup_after_project)
|
||||||
qt_internal_top_level_setup_testing()
|
qt_internal_top_level_setup_testing()
|
||||||
|
qt_internal_top_level_setup_cmake_and_export_namespace()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
# Setting QT_CMAKE_EXPORT_NAMESPACE in the top-level scope is needed for any deferred call that is
|
||||||
|
# run on the top-level scope (CMAKE_BINARY_DIR).
|
||||||
|
macro(qt_internal_top_level_setup_cmake_and_export_namespace)
|
||||||
|
# Include the file that defines qt_internal_setup_cmake_and_export_namespace.
|
||||||
|
# We don't try to call find_package(QtBuildInternals) because that has a lot more side
|
||||||
|
# effects.
|
||||||
|
set(__qt6_build_internals_helpers_path
|
||||||
|
"${__qt6_qtbase_src_path}/cmake/QtBuildInternals/QtBuildInternalsHelpers.cmake")
|
||||||
|
if(NOT EXISTS "${__qt6_build_internals_helpers_path}")
|
||||||
|
message(FATAL_ERROR "Required file does not exist: '${__qt6_build_internals_helpers_path}'")
|
||||||
|
endif()
|
||||||
|
include("${__qt6_build_internals_helpers_path}")
|
||||||
|
|
||||||
|
qt_internal_setup_cmake_and_export_namespace()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
macro(qt_internal_top_level_setup_testing)
|
macro(qt_internal_top_level_setup_testing)
|
||||||
|
@ -555,11 +555,54 @@ function(qt_configure_add_report_error error)
|
|||||||
qt_configure_add_report_entry(TYPE ERROR MESSAGE "${error}" CONDITION TRUE ${ARGN})
|
qt_configure_add_report_entry(TYPE ERROR MESSAGE "${error}" CONDITION TRUE ${ARGN})
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
# Goes through each token in given in `CONDITION` or `COMPILE_TESTS_TO_SHOW_ON_ERROR`, checks if
|
||||||
|
# the token starts with TEST_ which means it represents a Qt compile test, queries its
|
||||||
|
# compile output if available, and appends it to `out_var`.
|
||||||
|
# The compile output for a test is only available on first configuration, because we don't cache it
|
||||||
|
# across cmake invocations.
|
||||||
|
function(qt_internal_get_try_compile_output_from_tests_in_condition out_var)
|
||||||
|
set(opt_args "")
|
||||||
|
set(single_args "")
|
||||||
|
set(multi_args
|
||||||
|
CONDITION
|
||||||
|
COMPILE_TESTS_TO_SHOW_ON_ERROR
|
||||||
|
)
|
||||||
|
cmake_parse_arguments(PARSE_ARGV 1 arg "${opt_args}" "${single_args}" "${multi_args}")
|
||||||
|
_qt_internal_validate_all_args_are_parsed(arg)
|
||||||
|
|
||||||
|
set(content "")
|
||||||
|
|
||||||
|
foreach(token IN LISTS arg_CONDITION arg_COMPILE_TESTS_TO_SHOW_ON_ERROR)
|
||||||
|
if(token MATCHES "TEST_(.+)")
|
||||||
|
set(name "${CMAKE_MATCH_1}")
|
||||||
|
get_cmake_property(try_compile_output _qt_run_config_compile_test_output_${name})
|
||||||
|
|
||||||
|
if(try_compile_output)
|
||||||
|
string(APPEND content "\n TEST_${name} output: \n\n${try_compile_output}")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
continue()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
if(content)
|
||||||
|
string(PREPEND content "\n Compile test outputs:\n")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(${out_var} "${content}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
function(qt_configure_process_add_report_entry)
|
function(qt_configure_process_add_report_entry)
|
||||||
cmake_parse_arguments(PARSE_ARGV 0 arg
|
set(opt_args "")
|
||||||
""
|
set(single_args
|
||||||
"TYPE;MESSAGE"
|
TYPE
|
||||||
"CONDITION")
|
MESSAGE
|
||||||
|
)
|
||||||
|
set(multi_args
|
||||||
|
CONDITION
|
||||||
|
COMPILE_TESTS_TO_SHOW_ON_ERROR
|
||||||
|
)
|
||||||
|
cmake_parse_arguments(PARSE_ARGV 0 arg "${opt_args}" "${single_args}" "${multi_args}")
|
||||||
_qt_internal_validate_all_args_are_parsed(arg)
|
_qt_internal_validate_all_args_are_parsed(arg)
|
||||||
|
|
||||||
set(possible_types NOTE WARNING ERROR FATAL_ERROR)
|
set(possible_types NOTE WARNING ERROR FATAL_ERROR)
|
||||||
@ -591,6 +634,23 @@ function(qt_configure_process_add_report_entry)
|
|||||||
|
|
||||||
if("${arg_CONDITION}" STREQUAL "" OR condition_result)
|
if("${arg_CONDITION}" STREQUAL "" OR condition_result)
|
||||||
set(new_report "${prefix}${arg_MESSAGE}")
|
set(new_report "${prefix}${arg_MESSAGE}")
|
||||||
|
|
||||||
|
set(compile_test_args "")
|
||||||
|
if(arg_CONDITION)
|
||||||
|
list(APPEND compile_test_args CONDITION ${arg_CONDITION})
|
||||||
|
endif()
|
||||||
|
if(arg_COMPILE_TESTS_TO_SHOW_ON_ERROR)
|
||||||
|
list(APPEND compile_test_args
|
||||||
|
COMPILE_TESTS_TO_SHOW_ON_ERROR ${arg_COMPILE_TESTS_TO_SHOW_ON_ERROR})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
qt_internal_get_try_compile_output_from_tests_in_condition(extra_output
|
||||||
|
${compile_test_args}
|
||||||
|
)
|
||||||
|
if(extra_output)
|
||||||
|
string(APPEND new_report "\n${extra_output}")
|
||||||
|
endif()
|
||||||
|
|
||||||
string(APPEND "${contents_var}" "\n${new_report}")
|
string(APPEND "${contents_var}" "\n${new_report}")
|
||||||
|
|
||||||
if(arg_TYPE STREQUAL "ERROR" OR arg_TYPE STREQUAL "FATAL_ERROR")
|
if(arg_TYPE STREQUAL "ERROR" OR arg_TYPE STREQUAL "FATAL_ERROR")
|
||||||
|
@ -11,18 +11,7 @@ if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/QtBuildInternalsExtra.cmake")
|
|||||||
include(${CMAKE_CURRENT_LIST_DIR}/QtBuildInternalsExtra.cmake)
|
include(${CMAKE_CURRENT_LIST_DIR}/QtBuildInternalsExtra.cmake)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
macro(qt_internal_setup_cmake_and_export_namespace)
|
include(${CMAKE_CURRENT_LIST_DIR}/QtBuildInternalsHelpers.cmake)
|
||||||
# The variables might have already been set in QtBuildInternalsExtra.cmake if the file is
|
|
||||||
# included while building a new module and not QtBase. In that case, stop overriding the value.
|
|
||||||
if(NOT INSTALL_CMAKE_NAMESPACE)
|
|
||||||
set(INSTALL_CMAKE_NAMESPACE "Qt${PROJECT_VERSION_MAJOR}"
|
|
||||||
CACHE STRING "CMake namespace [Qt${PROJECT_VERSION_MAJOR}]")
|
|
||||||
endif()
|
|
||||||
if(NOT QT_CMAKE_EXPORT_NAMESPACE)
|
|
||||||
set(QT_CMAKE_EXPORT_NAMESPACE "Qt${PROJECT_VERSION_MAJOR}"
|
|
||||||
CACHE STRING "CMake namespace used when exporting targets [Qt${PROJECT_VERSION_MAJOR}]")
|
|
||||||
endif()
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
macro(qt_set_up_build_internals_paths)
|
macro(qt_set_up_build_internals_paths)
|
||||||
# Set up the paths for the cmake modules located in the prefix dir. Prepend, so the paths are
|
# Set up the paths for the cmake modules located in the prefix dir. Prepend, so the paths are
|
||||||
|
15
cmake/QtBuildInternals/QtBuildInternalsHelpers.cmake
Normal file
15
cmake/QtBuildInternals/QtBuildInternalsHelpers.cmake
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# Copyright (C) 2025 The Qt Company Ltd.
|
||||||
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
|
macro(qt_internal_setup_cmake_and_export_namespace)
|
||||||
|
# The variables might have already been set in QtBuildInternalsExtra.cmake if the file is
|
||||||
|
# included while building a new module and not QtBase. In that case, stop overriding the value.
|
||||||
|
if(NOT INSTALL_CMAKE_NAMESPACE)
|
||||||
|
set(INSTALL_CMAKE_NAMESPACE "Qt${PROJECT_VERSION_MAJOR}"
|
||||||
|
CACHE STRING "CMake namespace [Qt${PROJECT_VERSION_MAJOR}]")
|
||||||
|
endif()
|
||||||
|
if(NOT QT_CMAKE_EXPORT_NAMESPACE)
|
||||||
|
set(QT_CMAKE_EXPORT_NAMESPACE "Qt${PROJECT_VERSION_MAJOR}"
|
||||||
|
CACHE STRING "CMake namespace used when exporting targets [Qt${PROJECT_VERSION_MAJOR}]")
|
||||||
|
endif()
|
||||||
|
endmacro()
|
@ -161,6 +161,8 @@ macro(qt_internal_setup_configure_install_paths)
|
|||||||
qt_configure_process_path(INSTALL_LIBDIR "lib" "Libraries [PREFIX/lib]")
|
qt_configure_process_path(INSTALL_LIBDIR "lib" "Libraries [PREFIX/lib]")
|
||||||
qt_configure_process_path(INSTALL_MKSPECSDIR "mkspecs" "Mkspecs files [PREFIX/mkspecs]")
|
qt_configure_process_path(INSTALL_MKSPECSDIR "mkspecs" "Mkspecs files [PREFIX/mkspecs]")
|
||||||
qt_configure_process_path(INSTALL_SHAREDIR "share" "Share files [PREFIX/share]")
|
qt_configure_process_path(INSTALL_SHAREDIR "share" "Share files [PREFIX/share]")
|
||||||
|
qt_configure_process_path(INSTALL_QT_SHAREDIR "${INSTALL_SHAREDIR}/qt6"
|
||||||
|
"Qt namespaced sharedir [SHAREDIR/qt6]")
|
||||||
qt_configure_process_path(INSTALL_ARCHDATADIR "." "Arch-dependent data [PREFIX]")
|
qt_configure_process_path(INSTALL_ARCHDATADIR "." "Arch-dependent data [PREFIX]")
|
||||||
qt_configure_process_path(INSTALL_PLUGINSDIR
|
qt_configure_process_path(INSTALL_PLUGINSDIR
|
||||||
"${INSTALL_ARCHDATADIR}/plugins"
|
"${INSTALL_ARCHDATADIR}/plugins"
|
||||||
|
@ -243,6 +243,135 @@ function(qt_feature_alias alias_feature)
|
|||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
# Create a deprecated feature
|
||||||
|
#
|
||||||
|
# Synopsis
|
||||||
|
#
|
||||||
|
# qt_feature_deprecated(<feature>
|
||||||
|
# REMOVE_BY <version>
|
||||||
|
# [MESSAGE <string>] [VALUE <val>]
|
||||||
|
# [PRIVATE | PUBLIC]
|
||||||
|
# [LABEL <string>] [PURPOSE <string>] [SECTION <string>]
|
||||||
|
# )
|
||||||
|
#
|
||||||
|
# Arguments
|
||||||
|
#
|
||||||
|
# `<feature>`
|
||||||
|
# The feature to be created.
|
||||||
|
#
|
||||||
|
# `REMOVE_BY`
|
||||||
|
# Qt version when this feature is going to be removed
|
||||||
|
#
|
||||||
|
# `MESSAGE`
|
||||||
|
# Additional deprecation message to be printed.
|
||||||
|
#
|
||||||
|
# `VALUE`
|
||||||
|
# Value of the `QT_FEATURE_<feature>` that this is forced to. If undefined,
|
||||||
|
# `QT_FEATURE_<feature>` is not populated
|
||||||
|
#
|
||||||
|
# `LABEL`, `PURPOSE`, `SECTION`, `PRIVATE`, `PUBLIC`
|
||||||
|
# Same as in `qt_feature`
|
||||||
|
function(qt_feature_deprecated feature)
|
||||||
|
set(option_args
|
||||||
|
PRIVATE
|
||||||
|
PUBLIC
|
||||||
|
)
|
||||||
|
set(single_args
|
||||||
|
REMOVE_BY
|
||||||
|
MESSAGE
|
||||||
|
VALUE
|
||||||
|
LABEL
|
||||||
|
PURPOSE
|
||||||
|
SECTION
|
||||||
|
)
|
||||||
|
set(multi_args "")
|
||||||
|
|
||||||
|
cmake_parse_arguments(PARSE_ARGV 1 arg "${option_args}" "${single_args}" "${multi_args}")
|
||||||
|
_qt_internal_validate_all_args_are_parsed(arg)
|
||||||
|
|
||||||
|
if(NOT arg_REMOVE_BY)
|
||||||
|
message(FATAL_ERROR "qt_feature_deprecated requires REMOVE_BY keyword")
|
||||||
|
elseif(PROJECT_VERSION VERSION_GREATER_EQUAL arg_REMOVE_BY)
|
||||||
|
message(FATAL_ERROR
|
||||||
|
"Deprecated feature ${feature} must be removed before Qt version ${arg_REMOVE_BY}"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(original_name "${feature}")
|
||||||
|
qt_feature_normalize_name("${feature}" feature)
|
||||||
|
|
||||||
|
# Check if the values were manually passed
|
||||||
|
if(DEFINED FEATURE_${feature})
|
||||||
|
set(deprecation_msg "FEATURE_${feature} is deprecated. ")
|
||||||
|
if(arg_VALUE)
|
||||||
|
string(APPEND deprecation_msg "The value is always: ${arg_VALUE}")
|
||||||
|
else()
|
||||||
|
string(APPEND deprecation_msg "The value is not used.")
|
||||||
|
endif()
|
||||||
|
if(arg_MESSAGE)
|
||||||
|
string(APPEND deprecation_msg "\n${arg_MESSAGE}")
|
||||||
|
endif()
|
||||||
|
qt_configure_add_report_entry(RECORD_ON_FEATURE_EVALUATION TYPE WARNING
|
||||||
|
MESSAGE "${deprecation_msg}")
|
||||||
|
unset(FEATURE_${feature} CACHE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Make sure the `QT_FEATURE_*` value is set/unset accordingly
|
||||||
|
unset(err_msg)
|
||||||
|
if(arg_VALUE)
|
||||||
|
if(DEFINED QT_FEATURE_${feature} AND NOT QT_FEATURE_${feature} STREQUAL arg_VALUE)
|
||||||
|
string(CONCAT err_msg
|
||||||
|
"QT_FEATURE_${feature} was manually set to ${QT_FEATURE_${feature}}, but"
|
||||||
|
"the only supported value is: ${arg_VALUE}\n"
|
||||||
|
"Overwriting QT_FEATURE_${feature} cache to ${arg_VALUE}"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
set(QT_FEATURE_${feature} "${arg_VALUE}" CACHE INTERNAL
|
||||||
|
"Deprecated: Always ${arg_VALUE}. ${arg_MESSAGE}"
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
if(DEFINED QT_FEATURE_${feature})
|
||||||
|
string(CONCAT msg
|
||||||
|
"QT_FEATURE_${feature} was manually set to ${QT_FEATURE_${feature}}, but"
|
||||||
|
"the value must **NOT** be set.\n"
|
||||||
|
"Unsetting QT_FEATURE_${feature} cache"
|
||||||
|
)
|
||||||
|
unset(QT_FEATURE_${feature} CACHE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Emit the error message if we have an unexpected `QT_FEATURE_*`
|
||||||
|
if(err_msg)
|
||||||
|
if(arg_MESSAGE)
|
||||||
|
string(APPEND err_msg "\n${arg_MESSAGE}")
|
||||||
|
endif()
|
||||||
|
qt_configure_add_report_error("${err_msg}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Register the feature as a normal feature
|
||||||
|
set(forward_args "")
|
||||||
|
foreach(arg IN ITEMS LABEL PURPOSE SECTION)
|
||||||
|
if(arg_${arg})
|
||||||
|
list(APPEND forward_args ${arg} "${arg_${arg}}")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
set(_QT_FEATURE_DEFINITION_${feature} ${forward_args} PARENT_SCOPE)
|
||||||
|
|
||||||
|
# Do the feature register
|
||||||
|
if (arg_PUBLIC)
|
||||||
|
list(APPEND __QtFeature_public_features "${feature}")
|
||||||
|
set(__QtFeature_public_features ${__QtFeature_public_features} PARENT_SCOPE)
|
||||||
|
endif()
|
||||||
|
if (arg_PRIVATE)
|
||||||
|
list(APPEND __QtFeature_private_features "${feature}")
|
||||||
|
set(__QtFeature_private_features ${__QtFeature_private_features} PARENT_SCOPE)
|
||||||
|
endif()
|
||||||
|
if (NOT arg_PUBLIC AND NOT arg_PRIVATE)
|
||||||
|
list(APPEND __QtFeature_internal_features "${feature}")
|
||||||
|
set(__QtFeature_internal_features ${__QtFeature_internal_features} PARENT_SCOPE)
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
function(qt_evaluate_to_boolean expressionVar)
|
function(qt_evaluate_to_boolean expressionVar)
|
||||||
if(${${expressionVar}})
|
if(${${expressionVar}})
|
||||||
set(${expressionVar} ON PARENT_SCOPE)
|
set(${expressionVar} ON PARENT_SCOPE)
|
||||||
@ -1472,17 +1601,9 @@ function(qt_run_config_compile_test name)
|
|||||||
set(_save_CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
|
set(_save_CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
|
||||||
set(CMAKE_REQUIRED_LIBRARIES "${arg_LIBRARIES}")
|
set(CMAKE_REQUIRED_LIBRARIES "${arg_LIBRARIES}")
|
||||||
|
|
||||||
# OUTPUT_VARIABLE is an internal undocumented variable of check_cxx_source_compiles
|
_qt_internal_get_check_cxx_source_compiles_out_var(try_compile_output extra_args)
|
||||||
# since 3.23. Allow an opt out in case this breaks in the future.
|
|
||||||
set(try_compile_output "")
|
|
||||||
set(output_var "")
|
|
||||||
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.23"
|
|
||||||
AND NOT QT_INTERNAL_NO_TRY_COMPILE_OUTPUT_VARIABLE)
|
|
||||||
set(output_var OUTPUT_VARIABLE try_compile_output)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
check_cxx_source_compiles(
|
check_cxx_source_compiles(
|
||||||
"${arg_UNPARSED_ARGUMENTS} ${arg_CODE}" HAVE_${name} ${output_var}
|
"${arg_UNPARSED_ARGUMENTS} ${arg_CODE}" HAVE_${name} ${extra_args}
|
||||||
)
|
)
|
||||||
set(CMAKE_REQUIRED_LIBRARIES "${_save_CMAKE_REQUIRED_LIBRARIES}")
|
set(CMAKE_REQUIRED_LIBRARIES "${_save_CMAKE_REQUIRED_LIBRARIES}")
|
||||||
|
|
||||||
@ -1495,7 +1616,14 @@ function(qt_run_config_compile_test name)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Note this is assigned to the parent scope, and is not a CACHE var, which means the value is
|
||||||
|
# only available on first configuration.
|
||||||
set(TEST_${name}_OUTPUT "${try_compile_output}" PARENT_SCOPE)
|
set(TEST_${name}_OUTPUT "${try_compile_output}" PARENT_SCOPE)
|
||||||
|
|
||||||
|
# Story the compile output for a test in a global property. It will only be available on first
|
||||||
|
# configuration, because we don't cache it across cmake invocations.
|
||||||
|
set_property(GLOBAL PROPERTY _qt_run_config_compile_test_output_${name} "${try_compile_output}")
|
||||||
|
|
||||||
set(TEST_${name} "${HAVE_${name}}" CACHE INTERNAL "${arg_LABEL}")
|
set(TEST_${name} "${HAVE_${name}}" CACHE INTERNAL "${arg_LABEL}")
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
@ -166,13 +166,15 @@ function(qt_internal_add_link_flags_no_undefined target)
|
|||||||
set(previous_CMAKE_REQUIRED_LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS})
|
set(previous_CMAKE_REQUIRED_LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS})
|
||||||
|
|
||||||
set(CMAKE_REQUIRED_LINK_OPTIONS "-Wl,-undefined,error")
|
set(CMAKE_REQUIRED_LINK_OPTIONS "-Wl,-undefined,error")
|
||||||
check_cxx_source_compiles("int main() {}" HAVE_DASH_UNDEFINED_SYMBOLS)
|
_qt_internal_get_check_cxx_source_compiles_out_var(test_output_undefined_error extra_args)
|
||||||
|
check_cxx_source_compiles("int main() {}" HAVE_DASH_UNDEFINED_SYMBOLS ${extra_args})
|
||||||
if(HAVE_DASH_UNDEFINED_SYMBOLS)
|
if(HAVE_DASH_UNDEFINED_SYMBOLS)
|
||||||
set(no_undefined_flag "-Wl,-undefined,error")
|
set(no_undefined_flag "-Wl,-undefined,error")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(CMAKE_REQUIRED_LINK_OPTIONS "-Wl,--no-undefined")
|
set(CMAKE_REQUIRED_LINK_OPTIONS "-Wl,--no-undefined")
|
||||||
check_cxx_source_compiles("int main() {}" HAVE_DASH_DASH_NO_UNDEFINED)
|
_qt_internal_get_check_cxx_source_compiles_out_var(test_output_no_undefined extra_args)
|
||||||
|
check_cxx_source_compiles("int main() {}" HAVE_DASH_DASH_NO_UNDEFINED ${extra_args})
|
||||||
if(HAVE_DASH_DASH_NO_UNDEFINED)
|
if(HAVE_DASH_DASH_NO_UNDEFINED)
|
||||||
set(no_undefined_flag "-Wl,--no-undefined")
|
set(no_undefined_flag "-Wl,--no-undefined")
|
||||||
endif()
|
endif()
|
||||||
@ -180,7 +182,10 @@ function(qt_internal_add_link_flags_no_undefined target)
|
|||||||
set(CMAKE_REQUIRED_LINK_OPTIONS ${previous_CMAKE_REQUIRED_LINK_OPTIONS})
|
set(CMAKE_REQUIRED_LINK_OPTIONS ${previous_CMAKE_REQUIRED_LINK_OPTIONS})
|
||||||
|
|
||||||
if (NOT HAVE_DASH_UNDEFINED_SYMBOLS AND NOT HAVE_DASH_DASH_NO_UNDEFINED)
|
if (NOT HAVE_DASH_UNDEFINED_SYMBOLS AND NOT HAVE_DASH_DASH_NO_UNDEFINED)
|
||||||
message(FATAL_ERROR "Platform linker doesn't support erroring upon encountering undefined symbols. Target:\"${target}\".")
|
message(FATAL_ERROR
|
||||||
|
"Platform linker doesn't support erroring upon encountering undefined symbols. "
|
||||||
|
"Target:\"${target}\". "
|
||||||
|
"Test errors: \n ${test_output_undefined_error} \n ${test_output_no_undefined}")
|
||||||
endif()
|
endif()
|
||||||
target_link_options("${target}" PRIVATE "${no_undefined_flag}")
|
target_link_options("${target}" PRIVATE "${no_undefined_flag}")
|
||||||
endif()
|
endif()
|
||||||
|
@ -19,6 +19,7 @@ set(@var_prefix@EXAMPLESDIR "@INSTALL_EXAMPLESDIR@")
|
|||||||
set(@var_prefix@TESTSDIR "@INSTALL_TESTSDIR@")
|
set(@var_prefix@TESTSDIR "@INSTALL_TESTSDIR@")
|
||||||
set(@var_prefix@DESCRIPTIONSDIR "@INSTALL_DESCRIPTIONSDIR@")
|
set(@var_prefix@DESCRIPTIONSDIR "@INSTALL_DESCRIPTIONSDIR@")
|
||||||
set(@var_prefix@SHAREDIR "@INSTALL_SHAREDIR@")
|
set(@var_prefix@SHAREDIR "@INSTALL_SHAREDIR@")
|
||||||
|
set(@var_prefix@QT_SHAREDIR "@INSTALL_QT_SHAREDIR@")
|
||||||
set(@var_prefix@QMAKE_MKSPEC "@QT_QMAKE_TARGET_MKSPEC@")
|
set(@var_prefix@QMAKE_MKSPEC "@QT_QMAKE_TARGET_MKSPEC@")
|
||||||
set(@var_prefix@ARCH "@TEST_architecture_arch@")
|
set(@var_prefix@ARCH "@TEST_architecture_arch@")
|
||||||
set(@var_prefix@SUBARCHS "@TEST_subarch_result@")
|
set(@var_prefix@SUBARCHS "@TEST_subarch_result@")
|
||||||
|
@ -16,3 +16,4 @@ set(QT@PROJECT_VERSION_MAJOR@_INSTALL_TESTS "@INSTALL_TESTSDIR@")
|
|||||||
set(QT@PROJECT_VERSION_MAJOR@_INSTALL_TRANSLATIONS "@INSTALL_TRANSLATIONSDIR@")
|
set(QT@PROJECT_VERSION_MAJOR@_INSTALL_TRANSLATIONS "@INSTALL_TRANSLATIONSDIR@")
|
||||||
set(QT@PROJECT_VERSION_MAJOR@_INSTALL_DESCRIPTIONSDIR "@INSTALL_DESCRIPTIONSDIR@")
|
set(QT@PROJECT_VERSION_MAJOR@_INSTALL_DESCRIPTIONSDIR "@INSTALL_DESCRIPTIONSDIR@")
|
||||||
set(QT@PROJECT_VERSION_MAJOR@_INSTALL_SHAREDIR "@INSTALL_SHAREDIR@")
|
set(QT@PROJECT_VERSION_MAJOR@_INSTALL_SHAREDIR "@INSTALL_SHAREDIR@")
|
||||||
|
set(QT@PROJECT_VERSION_MAJOR@_INSTALL_QT_SHAREDIR "@INSTALL_QT_SHAREDIR@")
|
||||||
|
@ -807,7 +807,7 @@ set(QT_ALLOW_MISSING_TOOLS_PACKAGES TRUE)")
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Make sure touched extra cmake files cause a reconfigure, so they get re-copied.
|
# Make sure touched extra cmake files cause a reconfigure, so they get re-copied.
|
||||||
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${cmake_file}")
|
_qt_internal_append_cmake_configure_depends("${cmake_file}")
|
||||||
endforeach()
|
endforeach()
|
||||||
list(APPEND extra_cmake_includes ${arg_EXTRA_CMAKE_INCLUDES})
|
list(APPEND extra_cmake_includes ${arg_EXTRA_CMAKE_INCLUDES})
|
||||||
|
|
||||||
|
@ -65,9 +65,17 @@ function(qt_generate_prl_file target install_dir)
|
|||||||
set(prefix_for_final_prl_name "$<TARGET_FILE_PREFIX:${target}>")
|
set(prefix_for_final_prl_name "$<TARGET_FILE_PREFIX:${target}>")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# For frameworks, the prl file should be placed under the Resources subdir.
|
# For macOS frameworks, the prl file should be placed under the Resources subdir.
|
||||||
|
# For iOS, visionOS, watchOS, tvOS, there is no Resources subdir, and the contents needs to
|
||||||
|
# be placed directly in the framework root, as described at
|
||||||
|
# https://developer.apple.com/documentation/bundleresources/placing-content-in-a-bundle?language=objc
|
||||||
get_target_property(is_framework ${target} FRAMEWORK)
|
get_target_property(is_framework ${target} FRAMEWORK)
|
||||||
if(is_framework)
|
if(APPLE AND (NOT CMAKE_SYSTEM_NAME OR CMAKE_SYSTEM_NAME STREQUAL "Darwin"))
|
||||||
|
set(is_macos TRUE)
|
||||||
|
else()
|
||||||
|
set(is_macos FALSE)
|
||||||
|
endif()
|
||||||
|
if(is_framework AND is_macos)
|
||||||
get_target_property(fw_version ${target} FRAMEWORK_VERSION)
|
get_target_property(fw_version ${target} FRAMEWORK_VERSION)
|
||||||
string(APPEND prefix_for_final_prl_name "Versions/${fw_version}/Resources/")
|
string(APPEND prefix_for_final_prl_name "Versions/${fw_version}/Resources/")
|
||||||
endif()
|
endif()
|
||||||
|
@ -231,8 +231,31 @@ function(qt_feature feature)
|
|||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(qt_feature_alias feature)
|
function(qt_feature_alias feature)
|
||||||
|
cmake_parse_arguments(arg "NEGATE" "PURPOSE;SECTION;MESSAGE;ALIAS_OF_FEATURE;ALIAS_OF_CACHE" ""
|
||||||
|
${ARGN})
|
||||||
set_property(GLOBAL APPEND PROPERTY COMMANDLINE_KNOWN_FEATURES "${feature}")
|
set_property(GLOBAL APPEND PROPERTY COMMANDLINE_KNOWN_FEATURES "${feature}")
|
||||||
# TODO: Alias features are not listed, but neither are features without PURPOSE.
|
# Mark the feature as aliased
|
||||||
|
set(alias_note "alias of ")
|
||||||
|
if(arg_NEGATE)
|
||||||
|
string(APPEND alias_note "NOT ")
|
||||||
|
endif()
|
||||||
|
if(arg_ALIAS_OF_FEATURE)
|
||||||
|
string(APPEND alias_note "${arg_ALIAS_OF_FEATURE} Feature")
|
||||||
|
else()
|
||||||
|
string(APPEND alias_note "${arg_ALIAS_OF_CACHE} Cache")
|
||||||
|
endif()
|
||||||
|
set(arg_PURPOSE "(${alias_note}) ${arg_PURPOSE}")
|
||||||
|
set_property(GLOBAL PROPERTY COMMANDLINE_FEATURE_PURPOSE_${feature} "${arg_PURPOSE}")
|
||||||
|
set_property(GLOBAL PROPERTY COMMANDLINE_FEATURE_SECTION_${feature} "${arg_SECTION}")
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(qt_feature_deprecated feature)
|
||||||
|
cmake_parse_arguments(arg "" "PURPOSE;SECTION;MESSAGE" "" ${ARGN})
|
||||||
|
set_property(GLOBAL APPEND PROPERTY COMMANDLINE_KNOWN_FEATURES "${feature}")
|
||||||
|
# Mark the feature as deprecated
|
||||||
|
set(arg_PURPOSE "(DEPRECATED) ${arg_PURPOSE} ${arg_MESSAGE}")
|
||||||
|
set_property(GLOBAL PROPERTY COMMANDLINE_FEATURE_PURPOSE_${feature} "${arg_PURPOSE}")
|
||||||
|
set_property(GLOBAL PROPERTY COMMANDLINE_FEATURE_SECTION_${feature} "${arg_SECTION}")
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(find_package)
|
function(find_package)
|
||||||
|
@ -811,19 +811,50 @@ endif()")
|
|||||||
set(${out_var} "${assignments}" PARENT_SCOPE)
|
set(${out_var} "${assignments}" PARENT_SCOPE)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
# Returns the active apple sdk name that was either explicitly set by the user via QT_APPLE_SDK or
|
||||||
|
# or CMAKE_OSX_SYSROOT, or return the default approximated value, based on what CMake does
|
||||||
|
# internally.
|
||||||
|
#
|
||||||
|
# TODO: Handle case when CMAKE_OSX_SYSROOT is set to an sdk path, from which we need to retrieve the
|
||||||
|
# sdk name.
|
||||||
function(_qt_internal_get_apple_sdk_name out_var)
|
function(_qt_internal_get_apple_sdk_name out_var)
|
||||||
set(sdk_name "")
|
if(NOT APPLE)
|
||||||
if(APPLE)
|
set(${out_var} "" PARENT_SCOPE)
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL iOS)
|
return()
|
||||||
set(sdk_name "iphoneos")
|
|
||||||
elseif(CMAKE_SYSTEM_NAME STREQUAL visionOS)
|
|
||||||
set(sdk_name "xros")
|
|
||||||
else()
|
|
||||||
# Default to macOS
|
|
||||||
set(sdk_name "macosx")
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
set(${out_var} "${sdk_name}" PARENT_SCOPE)
|
|
||||||
|
# If CMake or the user has set an explicit sdk name, consider it.
|
||||||
|
if(QT_APPLE_SDK)
|
||||||
|
set(explicit_sdk_name "${QT_APPLE_SDK}")
|
||||||
|
elseif(CMAKE_OSX_SYSROOT)
|
||||||
|
set(explicit_sdk_name "${CMAKE_OSX_SYSROOT}")
|
||||||
|
else()
|
||||||
|
set(explicit_sdk_name "")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(output_sdk_name "")
|
||||||
|
|
||||||
|
# Detect (or check if already set) that the sdk name is one that Qt knows about.
|
||||||
|
if(CMAKE_SYSTEM_NAME STREQUAL iOS)
|
||||||
|
if(explicit_sdk_name STREQUAL "iphoneos" OR explicit_sdk_name STREQUAL "iphonesimulator")
|
||||||
|
set(output_sdk_name "${explicit_sdk_name}")
|
||||||
|
else()
|
||||||
|
# Default case.
|
||||||
|
set(output_sdk_name "iphoneos")
|
||||||
|
endif()
|
||||||
|
elseif(CMAKE_SYSTEM_NAME STREQUAL visionOS)
|
||||||
|
if(explicit_sdk_name STREQUAL "xros" OR explicit_sdk_name STREQUAL "xrsimulator")
|
||||||
|
set(output_sdk_name "${explicit_sdk_name}")
|
||||||
|
else()
|
||||||
|
# Default case.
|
||||||
|
set(output_sdk_name "xros")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
# Default case.
|
||||||
|
set(output_sdk_name "macosx")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(${out_var} "${output_sdk_name}" PARENT_SCOPE)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(_qt_internal_execute_xcrun out_var)
|
function(_qt_internal_execute_xcrun out_var)
|
||||||
|
@ -174,6 +174,21 @@ function(__qt_internal_prefix_paths_to_roots out_var prefix_paths)
|
|||||||
set("${out_var}" "${result}" PARENT_SCOPE)
|
set("${out_var}" "${result}" PARENT_SCOPE)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
function(_qt_internal_get_check_cxx_source_compiles_out_var out_output_var out_func_args)
|
||||||
|
# This just resets the output var in the parent scope to an empty string.
|
||||||
|
set(${out_output_var} "" PARENT_SCOPE)
|
||||||
|
|
||||||
|
# OUTPUT_VARIABLE is an internal undocumented variable of check_cxx_source_compiles
|
||||||
|
# since 3.23. Allow an opt out in case this breaks in the future.
|
||||||
|
set(extra_func_args "")
|
||||||
|
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.23"
|
||||||
|
AND NOT QT_INTERNAL_NO_TRY_COMPILE_OUTPUT_VARIABLE)
|
||||||
|
set(extra_func_args OUTPUT_VARIABLE ${out_output_var})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(${out_func_args} "${extra_func_args}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
# This function gets all targets below this directory
|
# This function gets all targets below this directory
|
||||||
#
|
#
|
||||||
# Multi-value Arguments:
|
# Multi-value Arguments:
|
||||||
@ -941,3 +956,27 @@ function(_qt_internal_is_c_identifier out_var value)
|
|||||||
set(${out_var} "FALSE" PARENT_SCOPE)
|
set(${out_var} "FALSE" PARENT_SCOPE)
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
# Makes appending of the CMake configure time dependencies unique.
|
||||||
|
function(_qt_internal_append_cmake_configure_depends)
|
||||||
|
get_property(configure_depends DIRECTORY PROPERTY CMAKE_CONFIGURE_DEPENDS)
|
||||||
|
foreach(path IN LISTS ARGN)
|
||||||
|
get_filename_component(abs_path "${path}" REALPATH)
|
||||||
|
if(NOT "${abs_path}" IN_LIST configure_depends)
|
||||||
|
list(APPEND configure_depends "${abs_path}")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
set_property(DIRECTORY PROPERTY CMAKE_CONFIGURE_DEPENDS "${configure_depends}")
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(_qt_internal_get_moc_compiler_flavor_flags out_var)
|
||||||
|
set(flags "")
|
||||||
|
if(WIN32)
|
||||||
|
list(APPEND flags -DWIN32)
|
||||||
|
endif()
|
||||||
|
if(MSVC)
|
||||||
|
list(APPEND flags --compiler-flavor=msvc)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(${out_var} "${flags}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
@ -432,8 +432,7 @@ function(_qt_internal_sbom_end_project)
|
|||||||
|
|
||||||
# Add configure-time dependency on project attribution files.
|
# Add configure-time dependency on project attribution files.
|
||||||
get_property(attribution_files GLOBAL PROPERTY _qt_internal_project_attribution_files)
|
get_property(attribution_files GLOBAL PROPERTY _qt_internal_project_attribution_files)
|
||||||
list(REMOVE_DUPLICATES attribution_files)
|
_qt_internal_append_cmake_configure_depends(${attribution_files})
|
||||||
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${attribution_files}")
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
# Automatically begins sbom generation for a qt git repo unless QT_SKIP_SBOM_AUTO_PROJECT is TRUE.
|
# Automatically begins sbom generation for a qt git repo unless QT_SKIP_SBOM_AUTO_PROJECT is TRUE.
|
||||||
|
@ -195,9 +195,11 @@ function(qt_internal_extend_target target)
|
|||||||
${private_visibility_option} ${arg_LINK_OPTIONS})
|
${private_visibility_option} ${arg_LINK_OPTIONS})
|
||||||
|
|
||||||
if(NOT is_interface_lib)
|
if(NOT is_interface_lib)
|
||||||
|
_qt_internal_get_moc_compiler_flavor_flags(flavor_flags)
|
||||||
set_property(TARGET "${target}" APPEND PROPERTY
|
set_property(TARGET "${target}" APPEND PROPERTY
|
||||||
AUTOMOC_MOC_OPTIONS "${arg_MOC_OPTIONS}"
|
AUTOMOC_MOC_OPTIONS "${arg_MOC_OPTIONS}" ${flavor_flags}
|
||||||
)
|
)
|
||||||
|
|
||||||
# Plugin types associated to a module
|
# Plugin types associated to a module
|
||||||
if(NOT "x${arg_PLUGIN_TYPES}" STREQUAL "x")
|
if(NOT "x${arg_PLUGIN_TYPES}" STREQUAL "x")
|
||||||
qt_internal_add_plugin_types("${target}" "${arg_PLUGIN_TYPES}")
|
qt_internal_add_plugin_types("${target}" "${arg_PLUGIN_TYPES}")
|
||||||
|
@ -93,6 +93,19 @@ instructions:
|
|||||||
- type: EnvironmentVariable
|
- type: EnvironmentVariable
|
||||||
variableName: DESTDIR
|
variableName: DESTDIR
|
||||||
variableValue: ""
|
variableValue: ""
|
||||||
|
- type: SignPackage
|
||||||
|
directory: "{{.InstallRoot}}/{{.AgentWorkingDir}}"
|
||||||
|
maxTimeInSeconds: 1200
|
||||||
|
maxTimeBetweenOutput: 1200
|
||||||
|
enable_if:
|
||||||
|
condition: and
|
||||||
|
conditions:
|
||||||
|
- condition: property
|
||||||
|
property: host.os
|
||||||
|
equals_value: Windows
|
||||||
|
- condition: property
|
||||||
|
property: features
|
||||||
|
contains_value: Packaging
|
||||||
- type: UploadArtifact
|
- type: UploadArtifact
|
||||||
archiveDirectory: "{{.InstallRoot}}/{{.AgentWorkingDir}}"
|
archiveDirectory: "{{.InstallRoot}}/{{.AgentWorkingDir}}"
|
||||||
transferType: UploadModuleBuildArtifact
|
transferType: UploadModuleBuildArtifact
|
||||||
|
@ -83,6 +83,19 @@ instructions:
|
|||||||
- type: EnvironmentVariable
|
- type: EnvironmentVariable
|
||||||
variableName: DESTDIR
|
variableName: DESTDIR
|
||||||
variableValue: ""
|
variableValue: ""
|
||||||
|
- type: SignPackage
|
||||||
|
directory: "{{.InstallRoot}}/{{.AgentWorkingDir}}"
|
||||||
|
maxTimeInSeconds: 1200
|
||||||
|
maxTimeBetweenOutput: 1200
|
||||||
|
enable_if:
|
||||||
|
condition: and
|
||||||
|
conditions:
|
||||||
|
- condition: property
|
||||||
|
property: host.os
|
||||||
|
equals_value: Windows
|
||||||
|
- condition: property
|
||||||
|
property: features
|
||||||
|
contains_value: Packaging
|
||||||
- type: UploadArtifact
|
- type: UploadArtifact
|
||||||
archiveDirectory: "{{.InstallRoot}}/{{.AgentWorkingDir}}"
|
archiveDirectory: "{{.InstallRoot}}/{{.AgentWorkingDir}}"
|
||||||
transferType: UploadModuleBuildArtifact
|
transferType: UploadModuleBuildArtifact
|
||||||
|
@ -1441,17 +1441,16 @@ https://github.com/llvm/llvm-project/issues/53520
|
|||||||
]=]
|
]=]
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
string(CONCAT error_message
|
string(CONCAT x86_intrin_error_message
|
||||||
"x86 intrinsics support missing. Check your compiler settings.\n"
|
"x86 intrinsics support missing. Check your compiler settings.\n"
|
||||||
"If this is an error, report at https://bugreports.qt.io with your compiler ID and "
|
"If this is a problem for you, report at https://bugreports.qt.io with your compiler ID and "
|
||||||
"version, and this output:\n"
|
"version, and the TEST_x86intrin compile test output.\n"
|
||||||
"\n"
|
|
||||||
"${TEST_x86intrin_OUTPUT}"
|
|
||||||
)
|
)
|
||||||
qt_configure_add_report_entry(
|
qt_configure_add_report_entry(
|
||||||
TYPE ERROR
|
TYPE ERROR
|
||||||
CONDITION (NOT QT_FEATURE_x86intrin)
|
CONDITION (NOT QT_FEATURE_x86intrin)
|
||||||
MESSAGE "${error_message}"
|
COMPILE_TESTS_TO_SHOW_ON_ERROR TEST_x86intrin
|
||||||
|
MESSAGE "${x86_intrin_error_message}"
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
@ -19,7 +19,7 @@ foreach(dir global config)
|
|||||||
# dependencies should be set up in that case (coarsness, use install vs build dirs,
|
# dependencies should be set up in that case (coarsness, use install vs build dirs,
|
||||||
# etc).
|
# etc).
|
||||||
file(GLOB_RECURSE files LIST_DIRECTORIES FALSE "${dir}/*")
|
file(GLOB_RECURSE files LIST_DIRECTORIES FALSE "${dir}/*")
|
||||||
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${files})
|
_qt_internal_append_cmake_configure_depends(${files})
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
@ -74,6 +74,10 @@ table td {
|
|||||||
padding: 6px 10px 6px 10px;
|
padding: 6px 10px 6px 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
table.qmlname {
|
||||||
|
width: 75%;
|
||||||
|
}
|
||||||
|
|
||||||
table.qmlname td {
|
table.qmlname td {
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
margin-left: 6px;
|
margin-left: 6px;
|
||||||
|
@ -479,6 +479,10 @@ table, pre, .LegaleseLeft {
|
|||||||
margin: 0px
|
margin: 0px
|
||||||
}
|
}
|
||||||
|
|
||||||
|
table.qmlname {
|
||||||
|
width: 75%;
|
||||||
|
}
|
||||||
|
|
||||||
.LegaleseLeft {
|
.LegaleseLeft {
|
||||||
font-family: monospace;
|
font-family: monospace;
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
at run time. The QRhiWidget subclass is prepared to handle the changing
|
at run time. The QRhiWidget subclass is prepared to handle the changing
|
||||||
sample count correctly.
|
sample count correctly.
|
||||||
|
|
||||||
\li Forcing an \l{QRhiWidget::explicitSize}{explicitly specified backing
|
\li Forcing an \l{QRhiWidget::fixedColorBufferSize}{explicitly specified backing
|
||||||
texture size} can be toggled dynamically and controlled with a slider
|
texture size} can be toggled dynamically and controlled with a slider
|
||||||
between 16x16 up to 512x512 pixels.
|
between 16x16 up to 512x512 pixels.
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@
|
|||||||
\c{renderTarget()->pixelSize()} or \c{colorTexture()->pixelSize()}
|
\c{renderTarget()->pixelSize()} or \c{colorTexture()->pixelSize()}
|
||||||
always gives the latest, up-to-date size in pixels. What this example is
|
always gives the latest, up-to-date size in pixels. What this example is
|
||||||
not prepared for is changing
|
not prepared for is changing
|
||||||
\l{QRhiWidget::textureFormat}{texture formats} and
|
\l{QRhiWidget::colorBufferFormat}{color buffer formats} and
|
||||||
\l{QRhiWidget::sampleCount}{multisample settings}
|
\l{QRhiWidget::sampleCount}{multisample settings}
|
||||||
since it only ever uses the defaults (RGBA8 and no multisample antialiasing).
|
since it only ever uses the defaults (RGBA8 and no multisample antialiasing).
|
||||||
|
|
||||||
|
@ -18,8 +18,7 @@ QMAKE_LIBDIR =
|
|||||||
|
|
||||||
# sdk.prf will prefix the proper SDK sysroot
|
# sdk.prf will prefix the proper SDK sysroot
|
||||||
QMAKE_INCDIR_OPENGL = \
|
QMAKE_INCDIR_OPENGL = \
|
||||||
/System/Library/Frameworks/OpenGL.framework/Headers \
|
/System/Library/Frameworks/OpenGL.framework/Headers
|
||||||
/System/Library/Frameworks/AGL.framework/Headers/
|
|
||||||
|
|
||||||
QMAKE_FIX_RPATH = install_name_tool -id
|
QMAKE_FIX_RPATH = install_name_tool -id
|
||||||
|
|
||||||
@ -30,7 +29,7 @@ QMAKE_LFLAGS_REL_RPATH =
|
|||||||
QMAKE_REL_RPATH_BASE = @loader_path
|
QMAKE_REL_RPATH_BASE = @loader_path
|
||||||
|
|
||||||
QMAKE_LIBS_DYNLOAD =
|
QMAKE_LIBS_DYNLOAD =
|
||||||
QMAKE_LIBS_OPENGL = -framework OpenGL -framework AGL
|
QMAKE_LIBS_OPENGL = -framework OpenGL
|
||||||
QMAKE_LIBS_THREAD =
|
QMAKE_LIBS_THREAD =
|
||||||
|
|
||||||
QMAKE_INCDIR_WAYLAND =
|
QMAKE_INCDIR_WAYLAND =
|
||||||
|
4
src/3rdparty/sqlite/qt_attribution.json
vendored
4
src/3rdparty/sqlite/qt_attribution.json
vendored
@ -7,10 +7,10 @@
|
|||||||
|
|
||||||
"Description": "SQLite is a small C library that implements a self-contained, embeddable, zero-configuration SQL database engine.",
|
"Description": "SQLite is a small C library that implements a self-contained, embeddable, zero-configuration SQL database engine.",
|
||||||
"Homepage": "https://www.sqlite.org/",
|
"Homepage": "https://www.sqlite.org/",
|
||||||
"Version": "3.49.2",
|
"Version": "3.50.1",
|
||||||
"PURL": "pkg:github/sqlite/sqlite@version-$<VERSION>",
|
"PURL": "pkg:github/sqlite/sqlite@version-$<VERSION>",
|
||||||
"CPE": "cpe:2.3:a:sqlite:sqlite:$<VERSION>:*:*:*:*:*:*:*",
|
"CPE": "cpe:2.3:a:sqlite:sqlite:$<VERSION>:*:*:*:*:*:*:*",
|
||||||
"DownloadLocation": "https://www.sqlite.org/2025/sqlite-amalgamation-3490200.zip",
|
"DownloadLocation": "https://www.sqlite.org/2025/sqlite-amalgamation-3500100.zip",
|
||||||
"License": "SQLite Blessing",
|
"License": "SQLite Blessing",
|
||||||
"LicenseId": "blessing",
|
"LicenseId": "blessing",
|
||||||
"Copyright": "The authors disclaim copyright to the source code. However, a license can be obtained if needed."
|
"Copyright": "The authors disclaim copyright to the source code. However, a license can be obtained if needed."
|
||||||
|
4284
src/3rdparty/sqlite/sqlite3.c
vendored
4284
src/3rdparty/sqlite/sqlite3.c
vendored
File diff suppressed because it is too large
Load Diff
146
src/3rdparty/sqlite/sqlite3.h
vendored
146
src/3rdparty/sqlite/sqlite3.h
vendored
@ -133,7 +133,7 @@ extern "C" {
|
|||||||
**
|
**
|
||||||
** Since [version 3.6.18] ([dateof:3.6.18]),
|
** Since [version 3.6.18] ([dateof:3.6.18]),
|
||||||
** SQLite source code has been stored in the
|
** SQLite source code has been stored in the
|
||||||
** <a href="http://www.fossil-scm.org/">Fossil configuration management
|
** <a href="http://fossil-scm.org/">Fossil configuration management
|
||||||
** system</a>. ^The SQLITE_SOURCE_ID macro evaluates to
|
** system</a>. ^The SQLITE_SOURCE_ID macro evaluates to
|
||||||
** a string which identifies a particular check-in of SQLite
|
** a string which identifies a particular check-in of SQLite
|
||||||
** within its configuration management system. ^The SQLITE_SOURCE_ID
|
** within its configuration management system. ^The SQLITE_SOURCE_ID
|
||||||
@ -146,9 +146,9 @@ extern "C" {
|
|||||||
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
|
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
|
||||||
** [sqlite_version()] and [sqlite_source_id()].
|
** [sqlite_version()] and [sqlite_source_id()].
|
||||||
*/
|
*/
|
||||||
#define SQLITE_VERSION "3.49.2"
|
#define SQLITE_VERSION "3.50.1"
|
||||||
#define SQLITE_VERSION_NUMBER 3049002
|
#define SQLITE_VERSION_NUMBER 3050001
|
||||||
#define SQLITE_SOURCE_ID "2025-05-07 10:39:52 17144570b0d96ae63cd6f3edca39e27ebd74925252bbaf6723bcb2f6b4861fb1"
|
#define SQLITE_SOURCE_ID "2025-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** CAPI3REF: Run-Time Library Version Numbers
|
** CAPI3REF: Run-Time Library Version Numbers
|
||||||
@ -1163,6 +1163,12 @@ struct sqlite3_io_methods {
|
|||||||
** the value that M is to be set to. Before returning, the 32-bit signed
|
** the value that M is to be set to. Before returning, the 32-bit signed
|
||||||
** integer is overwritten with the previous value of M.
|
** integer is overwritten with the previous value of M.
|
||||||
**
|
**
|
||||||
|
** <li>[[SQLITE_FCNTL_BLOCK_ON_CONNECT]]
|
||||||
|
** The [SQLITE_FCNTL_BLOCK_ON_CONNECT] opcode is used to configure the
|
||||||
|
** VFS to block when taking a SHARED lock to connect to a wal mode database.
|
||||||
|
** This is used to implement the functionality associated with
|
||||||
|
** SQLITE_SETLK_BLOCK_ON_CONNECT.
|
||||||
|
**
|
||||||
** <li>[[SQLITE_FCNTL_DATA_VERSION]]
|
** <li>[[SQLITE_FCNTL_DATA_VERSION]]
|
||||||
** The [SQLITE_FCNTL_DATA_VERSION] opcode is used to detect changes to
|
** The [SQLITE_FCNTL_DATA_VERSION] opcode is used to detect changes to
|
||||||
** a database file. The argument is a pointer to a 32-bit unsigned integer.
|
** a database file. The argument is a pointer to a 32-bit unsigned integer.
|
||||||
@ -1259,6 +1265,7 @@ struct sqlite3_io_methods {
|
|||||||
#define SQLITE_FCNTL_CKSM_FILE 41
|
#define SQLITE_FCNTL_CKSM_FILE 41
|
||||||
#define SQLITE_FCNTL_RESET_CACHE 42
|
#define SQLITE_FCNTL_RESET_CACHE 42
|
||||||
#define SQLITE_FCNTL_NULL_IO 43
|
#define SQLITE_FCNTL_NULL_IO 43
|
||||||
|
#define SQLITE_FCNTL_BLOCK_ON_CONNECT 44
|
||||||
|
|
||||||
/* deprecated names */
|
/* deprecated names */
|
||||||
#define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE
|
#define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE
|
||||||
@ -1989,13 +1996,16 @@ struct sqlite3_mem_methods {
|
|||||||
**
|
**
|
||||||
** [[SQLITE_CONFIG_LOOKASIDE]] <dt>SQLITE_CONFIG_LOOKASIDE</dt>
|
** [[SQLITE_CONFIG_LOOKASIDE]] <dt>SQLITE_CONFIG_LOOKASIDE</dt>
|
||||||
** <dd> ^(The SQLITE_CONFIG_LOOKASIDE option takes two arguments that determine
|
** <dd> ^(The SQLITE_CONFIG_LOOKASIDE option takes two arguments that determine
|
||||||
** the default size of lookaside memory on each [database connection].
|
** the default size of [lookaside memory] on each [database connection].
|
||||||
** The first argument is the
|
** The first argument is the
|
||||||
** size of each lookaside buffer slot and the second is the number of
|
** size of each lookaside buffer slot ("sz") and the second is the number of
|
||||||
** slots allocated to each database connection.)^ ^(SQLITE_CONFIG_LOOKASIDE
|
** slots allocated to each database connection ("cnt").)^
|
||||||
** sets the <i>default</i> lookaside size. The [SQLITE_DBCONFIG_LOOKASIDE]
|
** ^(SQLITE_CONFIG_LOOKASIDE sets the <i>default</i> lookaside size.
|
||||||
** option to [sqlite3_db_config()] can be used to change the lookaside
|
** The [SQLITE_DBCONFIG_LOOKASIDE] option to [sqlite3_db_config()] can
|
||||||
** configuration on individual connections.)^ </dd>
|
** be used to change the lookaside configuration on individual connections.)^
|
||||||
|
** The [-DSQLITE_DEFAULT_LOOKASIDE] option can be used to change the
|
||||||
|
** default lookaside configuration at compile-time.
|
||||||
|
** </dd>
|
||||||
**
|
**
|
||||||
** [[SQLITE_CONFIG_PCACHE2]] <dt>SQLITE_CONFIG_PCACHE2</dt>
|
** [[SQLITE_CONFIG_PCACHE2]] <dt>SQLITE_CONFIG_PCACHE2</dt>
|
||||||
** <dd> ^(The SQLITE_CONFIG_PCACHE2 option takes a single argument which is
|
** <dd> ^(The SQLITE_CONFIG_PCACHE2 option takes a single argument which is
|
||||||
@ -2232,31 +2242,50 @@ struct sqlite3_mem_methods {
|
|||||||
** [[SQLITE_DBCONFIG_LOOKASIDE]]
|
** [[SQLITE_DBCONFIG_LOOKASIDE]]
|
||||||
** <dt>SQLITE_DBCONFIG_LOOKASIDE</dt>
|
** <dt>SQLITE_DBCONFIG_LOOKASIDE</dt>
|
||||||
** <dd> The SQLITE_DBCONFIG_LOOKASIDE option is used to adjust the
|
** <dd> The SQLITE_DBCONFIG_LOOKASIDE option is used to adjust the
|
||||||
** configuration of the lookaside memory allocator within a database
|
** configuration of the [lookaside memory allocator] within a database
|
||||||
** connection.
|
** connection.
|
||||||
** The arguments to the SQLITE_DBCONFIG_LOOKASIDE option are <i>not</i>
|
** The arguments to the SQLITE_DBCONFIG_LOOKASIDE option are <i>not</i>
|
||||||
** in the [DBCONFIG arguments|usual format].
|
** in the [DBCONFIG arguments|usual format].
|
||||||
** The SQLITE_DBCONFIG_LOOKASIDE option takes three arguments, not two,
|
** The SQLITE_DBCONFIG_LOOKASIDE option takes three arguments, not two,
|
||||||
** so that a call to [sqlite3_db_config()] that uses SQLITE_DBCONFIG_LOOKASIDE
|
** so that a call to [sqlite3_db_config()] that uses SQLITE_DBCONFIG_LOOKASIDE
|
||||||
** should have a total of five parameters.
|
** should have a total of five parameters.
|
||||||
** ^The first argument (the third parameter to [sqlite3_db_config()] is a
|
** <ol>
|
||||||
|
** <li><p>The first argument ("buf") is a
|
||||||
** pointer to a memory buffer to use for lookaside memory.
|
** pointer to a memory buffer to use for lookaside memory.
|
||||||
** ^The first argument after the SQLITE_DBCONFIG_LOOKASIDE verb
|
** The first argument may be NULL in which case SQLite will allocate the
|
||||||
** may be NULL in which case SQLite will allocate the
|
** lookaside buffer itself using [sqlite3_malloc()].
|
||||||
** lookaside buffer itself using [sqlite3_malloc()]. ^The second argument is the
|
** <li><P>The second argument ("sz") is the
|
||||||
** size of each lookaside buffer slot. ^The third argument is the number of
|
** size of each lookaside buffer slot. Lookaside is disabled if "sz"
|
||||||
** slots. The size of the buffer in the first argument must be greater than
|
** is less than 8. The "sz" argument should be a multiple of 8 less than
|
||||||
** or equal to the product of the second and third arguments. The buffer
|
** 65536. If "sz" does not meet this constraint, it is reduced in size until
|
||||||
** must be aligned to an 8-byte boundary. ^If the second argument to
|
** it does.
|
||||||
** SQLITE_DBCONFIG_LOOKASIDE is not a multiple of 8, it is internally
|
** <li><p>The third argument ("cnt") is the number of slots. Lookaside is disabled
|
||||||
** rounded down to the next smaller multiple of 8. ^(The lookaside memory
|
** if "cnt"is less than 1. The "cnt" value will be reduced, if necessary, so
|
||||||
|
** that the product of "sz" and "cnt" does not exceed 2,147,418,112. The "cnt"
|
||||||
|
** parameter is usually chosen so that the product of "sz" and "cnt" is less
|
||||||
|
** than 1,000,000.
|
||||||
|
** </ol>
|
||||||
|
** <p>If the "buf" argument is not NULL, then it must
|
||||||
|
** point to a memory buffer with a size that is greater than
|
||||||
|
** or equal to the product of "sz" and "cnt".
|
||||||
|
** The buffer must be aligned to an 8-byte boundary.
|
||||||
|
** The lookaside memory
|
||||||
** configuration for a database connection can only be changed when that
|
** configuration for a database connection can only be changed when that
|
||||||
** connection is not currently using lookaside memory, or in other words
|
** connection is not currently using lookaside memory, or in other words
|
||||||
** when the "current value" returned by
|
** when the value returned by [SQLITE_DBSTATUS_LOOKASIDE_USED] is zero.
|
||||||
** [sqlite3_db_status](D,[SQLITE_DBSTATUS_LOOKASIDE_USED],...) is zero.
|
|
||||||
** Any attempt to change the lookaside memory configuration when lookaside
|
** Any attempt to change the lookaside memory configuration when lookaside
|
||||||
** memory is in use leaves the configuration unchanged and returns
|
** memory is in use leaves the configuration unchanged and returns
|
||||||
** [SQLITE_BUSY].)^</dd>
|
** [SQLITE_BUSY].
|
||||||
|
** If the "buf" argument is NULL and an attempt
|
||||||
|
** to allocate memory based on "sz" and "cnt" fails, then
|
||||||
|
** lookaside is silently disabled.
|
||||||
|
** <p>
|
||||||
|
** The [SQLITE_CONFIG_LOOKASIDE] configuration option can be used to set the
|
||||||
|
** default lookaside configuration at initialization. The
|
||||||
|
** [-DSQLITE_DEFAULT_LOOKASIDE] option can be used to set the default lookaside
|
||||||
|
** configuration at compile-time. Typical values for lookaside are 1200 for
|
||||||
|
** "sz" and 40 to 100 for "cnt".
|
||||||
|
** </dd>
|
||||||
**
|
**
|
||||||
** [[SQLITE_DBCONFIG_ENABLE_FKEY]]
|
** [[SQLITE_DBCONFIG_ENABLE_FKEY]]
|
||||||
** <dt>SQLITE_DBCONFIG_ENABLE_FKEY</dt>
|
** <dt>SQLITE_DBCONFIG_ENABLE_FKEY</dt>
|
||||||
@ -2993,6 +3022,44 @@ SQLITE_API int sqlite3_busy_handler(sqlite3*,int(*)(void*,int),void*);
|
|||||||
*/
|
*/
|
||||||
SQLITE_API int sqlite3_busy_timeout(sqlite3*, int ms);
|
SQLITE_API int sqlite3_busy_timeout(sqlite3*, int ms);
|
||||||
|
|
||||||
|
/*
|
||||||
|
** CAPI3REF: Set the Setlk Timeout
|
||||||
|
** METHOD: sqlite3
|
||||||
|
**
|
||||||
|
** This routine is only useful in SQLITE_ENABLE_SETLK_TIMEOUT builds. If
|
||||||
|
** the VFS supports blocking locks, it sets the timeout in ms used by
|
||||||
|
** eligible locks taken on wal mode databases by the specified database
|
||||||
|
** handle. In non-SQLITE_ENABLE_SETLK_TIMEOUT builds, or if the VFS does
|
||||||
|
** not support blocking locks, this function is a no-op.
|
||||||
|
**
|
||||||
|
** Passing 0 to this function disables blocking locks altogether. Passing
|
||||||
|
** -1 to this function requests that the VFS blocks for a long time -
|
||||||
|
** indefinitely if possible. The results of passing any other negative value
|
||||||
|
** are undefined.
|
||||||
|
**
|
||||||
|
** Internally, each SQLite database handle store two timeout values - the
|
||||||
|
** busy-timeout (used for rollback mode databases, or if the VFS does not
|
||||||
|
** support blocking locks) and the setlk-timeout (used for blocking locks
|
||||||
|
** on wal-mode databases). The sqlite3_busy_timeout() method sets both
|
||||||
|
** values, this function sets only the setlk-timeout value. Therefore,
|
||||||
|
** to configure separate busy-timeout and setlk-timeout values for a single
|
||||||
|
** database handle, call sqlite3_busy_timeout() followed by this function.
|
||||||
|
**
|
||||||
|
** Whenever the number of connections to a wal mode database falls from
|
||||||
|
** 1 to 0, the last connection takes an exclusive lock on the database,
|
||||||
|
** then checkpoints and deletes the wal file. While it is doing this, any
|
||||||
|
** new connection that tries to read from the database fails with an
|
||||||
|
** SQLITE_BUSY error. Or, if the SQLITE_SETLK_BLOCK_ON_CONNECT flag is
|
||||||
|
** passed to this API, the new connection blocks until the exclusive lock
|
||||||
|
** has been released.
|
||||||
|
*/
|
||||||
|
SQLITE_API int sqlite3_setlk_timeout(sqlite3*, int ms, int flags);
|
||||||
|
|
||||||
|
/*
|
||||||
|
** CAPI3REF: Flags for sqlite3_setlk_timeout()
|
||||||
|
*/
|
||||||
|
#define SQLITE_SETLK_BLOCK_ON_CONNECT 0x01
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** CAPI3REF: Convenience Routines For Running Queries
|
** CAPI3REF: Convenience Routines For Running Queries
|
||||||
** METHOD: sqlite3
|
** METHOD: sqlite3
|
||||||
@ -5108,7 +5175,7 @@ SQLITE_API const void *sqlite3_column_decltype16(sqlite3_stmt*,int);
|
|||||||
** other than [SQLITE_ROW] before any subsequent invocation of
|
** other than [SQLITE_ROW] before any subsequent invocation of
|
||||||
** sqlite3_step(). Failure to reset the prepared statement using
|
** sqlite3_step(). Failure to reset the prepared statement using
|
||||||
** [sqlite3_reset()] would result in an [SQLITE_MISUSE] return from
|
** [sqlite3_reset()] would result in an [SQLITE_MISUSE] return from
|
||||||
** sqlite3_step(). But after [version 3.6.23.1] ([dateof:3.6.23.1],
|
** sqlite3_step(). But after [version 3.6.23.1] ([dateof:3.6.23.1]),
|
||||||
** sqlite3_step() began
|
** sqlite3_step() began
|
||||||
** calling [sqlite3_reset()] automatically in this circumstance rather
|
** calling [sqlite3_reset()] automatically in this circumstance rather
|
||||||
** than returning [SQLITE_MISUSE]. This is not considered a compatibility
|
** than returning [SQLITE_MISUSE]. This is not considered a compatibility
|
||||||
@ -7004,6 +7071,8 @@ SQLITE_API int sqlite3_autovacuum_pages(
|
|||||||
**
|
**
|
||||||
** ^The second argument is a pointer to the function to invoke when a
|
** ^The second argument is a pointer to the function to invoke when a
|
||||||
** row is updated, inserted or deleted in a rowid table.
|
** row is updated, inserted or deleted in a rowid table.
|
||||||
|
** ^The update hook is disabled by invoking sqlite3_update_hook()
|
||||||
|
** with a NULL pointer as the second parameter.
|
||||||
** ^The first argument to the callback is a copy of the third argument
|
** ^The first argument to the callback is a copy of the third argument
|
||||||
** to sqlite3_update_hook().
|
** to sqlite3_update_hook().
|
||||||
** ^The second callback argument is one of [SQLITE_INSERT], [SQLITE_DELETE],
|
** ^The second callback argument is one of [SQLITE_INSERT], [SQLITE_DELETE],
|
||||||
@ -11486,9 +11555,10 @@ SQLITE_API void sqlite3session_table_filter(
|
|||||||
** is inserted while a session object is enabled, then later deleted while
|
** is inserted while a session object is enabled, then later deleted while
|
||||||
** the same session object is disabled, no INSERT record will appear in the
|
** the same session object is disabled, no INSERT record will appear in the
|
||||||
** changeset, even though the delete took place while the session was disabled.
|
** changeset, even though the delete took place while the session was disabled.
|
||||||
** Or, if one field of a row is updated while a session is disabled, and
|
** Or, if one field of a row is updated while a session is enabled, and
|
||||||
** another field of the same row is updated while the session is enabled, the
|
** then another field of the same row is updated while the session is disabled,
|
||||||
** resulting changeset will contain an UPDATE change that updates both fields.
|
** the resulting changeset will contain an UPDATE change that updates both
|
||||||
|
** fields.
|
||||||
*/
|
*/
|
||||||
SQLITE_API int sqlite3session_changeset(
|
SQLITE_API int sqlite3session_changeset(
|
||||||
sqlite3_session *pSession, /* Session object */
|
sqlite3_session *pSession, /* Session object */
|
||||||
@ -11560,8 +11630,9 @@ SQLITE_API sqlite3_int64 sqlite3session_changeset_size(sqlite3_session *pSession
|
|||||||
** database zFrom the contents of the two compatible tables would be
|
** database zFrom the contents of the two compatible tables would be
|
||||||
** identical.
|
** identical.
|
||||||
**
|
**
|
||||||
** It an error if database zFrom does not exist or does not contain the
|
** Unless the call to this function is a no-op as described above, it is an
|
||||||
** required compatible table.
|
** error if database zFrom does not exist or does not contain the required
|
||||||
|
** compatible table.
|
||||||
**
|
**
|
||||||
** If the operation is successful, SQLITE_OK is returned. Otherwise, an SQLite
|
** If the operation is successful, SQLITE_OK is returned. Otherwise, an SQLite
|
||||||
** error code. In this case, if argument pzErrMsg is not NULL, *pzErrMsg
|
** error code. In this case, if argument pzErrMsg is not NULL, *pzErrMsg
|
||||||
@ -11696,7 +11767,7 @@ SQLITE_API int sqlite3changeset_start_v2(
|
|||||||
** The following flags may passed via the 4th parameter to
|
** The following flags may passed via the 4th parameter to
|
||||||
** [sqlite3changeset_start_v2] and [sqlite3changeset_start_v2_strm]:
|
** [sqlite3changeset_start_v2] and [sqlite3changeset_start_v2_strm]:
|
||||||
**
|
**
|
||||||
** <dt>SQLITE_CHANGESETAPPLY_INVERT <dd>
|
** <dt>SQLITE_CHANGESETSTART_INVERT <dd>
|
||||||
** Invert the changeset while iterating through it. This is equivalent to
|
** Invert the changeset while iterating through it. This is equivalent to
|
||||||
** inverting a changeset using sqlite3changeset_invert() before applying it.
|
** inverting a changeset using sqlite3changeset_invert() before applying it.
|
||||||
** It is an error to specify this flag with a patchset.
|
** It is an error to specify this flag with a patchset.
|
||||||
@ -12011,19 +12082,6 @@ SQLITE_API int sqlite3changeset_concat(
|
|||||||
void **ppOut /* OUT: Buffer containing output changeset */
|
void **ppOut /* OUT: Buffer containing output changeset */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
** CAPI3REF: Upgrade the Schema of a Changeset/Patchset
|
|
||||||
*/
|
|
||||||
SQLITE_API int sqlite3changeset_upgrade(
|
|
||||||
sqlite3 *db,
|
|
||||||
const char *zDb,
|
|
||||||
int nIn, const void *pIn, /* Input changeset */
|
|
||||||
int *pnOut, void **ppOut /* OUT: Inverse of input */
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** CAPI3REF: Changegroup Handle
|
** CAPI3REF: Changegroup Handle
|
||||||
**
|
**
|
||||||
|
7
src/3rdparty/sqlite/update_sqlite.sh
vendored
7
src/3rdparty/sqlite/update_sqlite.sh
vendored
@ -7,8 +7,8 @@
|
|||||||
# sqlite.c and sqlite.h and updates qt_attribution.json
|
# sqlite.c and sqlite.h and updates qt_attribution.json
|
||||||
|
|
||||||
version_maj=3
|
version_maj=3
|
||||||
version_min=49
|
version_min=50
|
||||||
version_patch=2
|
version_patch=1
|
||||||
year=2025
|
year=2025
|
||||||
|
|
||||||
version=${version_maj}.${version_min}.${version_patch}
|
version=${version_maj}.${version_min}.${version_patch}
|
||||||
@ -40,3 +40,6 @@ sed -i qt_attribution.json -e "s#\"DownloadLocation\": \".*\"#\"DownloadLocation
|
|||||||
#cleanup
|
#cleanup
|
||||||
rm -rf ${fn}
|
rm -rf ${fn}
|
||||||
rm -rf ${fn}.zip
|
rm -rf ${fn}.zip
|
||||||
|
|
||||||
|
#stage
|
||||||
|
git add qt_attribution.json sqlite3.c sqlite3.h update_sqlite.sh
|
||||||
|
@ -18,6 +18,7 @@ import android.view.View;
|
|||||||
import android.view.WindowInsets;
|
import android.view.WindowInsets;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
import android.view.WindowManager.LayoutParams;
|
import android.view.WindowManager.LayoutParams;
|
||||||
|
import android.view.WindowMetrics;
|
||||||
import android.view.WindowInsetsController;
|
import android.view.WindowInsetsController;
|
||||||
import android.view.Window;
|
import android.view.Window;
|
||||||
|
|
||||||
@ -284,16 +285,18 @@ class QtDisplayManager
|
|||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
Context displayContext = context.createDisplayContext(display);
|
Context displayContext = context.createDisplayContext(display);
|
||||||
Context windowsContext = displayContext.createWindowContext(
|
WindowManager windowManager = displayContext.getSystemService(WindowManager.class);
|
||||||
WindowManager.LayoutParams.TYPE_APPLICATION, null);
|
if (windowManager != null) {
|
||||||
WindowManager windowManager = (WindowManager) windowsContext.getSystemService(
|
WindowMetrics metrics = windowManager.getCurrentWindowMetrics();
|
||||||
Context.WINDOW_SERVICE);
|
Rect areaBounds = metrics.getBounds();
|
||||||
Rect bounds = windowManager.getMaximumWindowMetrics().getBounds();
|
return new Size(areaBounds.width(), areaBounds.height());
|
||||||
return new Size(bounds.width(), bounds.height());
|
} else {
|
||||||
} catch (SecurityException e) {
|
Log.e(QtTAG, "getDisplaySize(): WindowManager null, display ID" + display.getDisplayId());
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
Log.e(QtTAG, "Failed to retrieve display metrics with " + e);
|
Log.e(QtTAG, "Failed to retrieve display metrics with " + e);
|
||||||
return new Size(0, 0);
|
|
||||||
}
|
}
|
||||||
|
return new Size(0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,6 +66,7 @@ class QtInputConnection extends BaseInputConnection
|
|||||||
|
|
||||||
private static final String QtTAG = "QtInputConnection";
|
private static final String QtTAG = "QtInputConnection";
|
||||||
|
|
||||||
|
private boolean m_duringBatchEdit = false;
|
||||||
private final QtInputConnectionListener m_qtInputConnectionListener;
|
private final QtInputConnectionListener m_qtInputConnectionListener;
|
||||||
|
|
||||||
class HideKeyboardRunnable implements Runnable {
|
class HideKeyboardRunnable implements Runnable {
|
||||||
@ -105,10 +106,12 @@ class QtInputConnection extends BaseInputConnection
|
|||||||
|
|
||||||
private void setClosing(boolean closing)
|
private void setClosing(boolean closing)
|
||||||
{
|
{
|
||||||
if (closing)
|
if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
|
||||||
m_view.postDelayed(new HideKeyboardRunnable(), KEYBOARD_CHECK_DELAY_MS);
|
if (closing)
|
||||||
else if (m_qtInputConnectionListener != null)
|
m_view.postDelayed(new HideKeyboardRunnable(), KEYBOARD_CHECK_DELAY_MS);
|
||||||
m_qtInputConnectionListener.onSetClosing(false);
|
else if (m_qtInputConnectionListener != null)
|
||||||
|
m_qtInputConnectionListener.onSetClosing(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QtInputConnection(QtEditText targetView, QtInputConnectionListener listener)
|
QtInputConnection(QtEditText targetView, QtInputConnectionListener listener)
|
||||||
@ -122,7 +125,7 @@ class QtInputConnection extends BaseInputConnection
|
|||||||
|
|
||||||
void restartImmInput()
|
void restartImmInput()
|
||||||
{
|
{
|
||||||
if (QtNativeInputConnection.fullscreenMode()) {
|
if (QtNativeInputConnection.fullscreenMode() && !m_duringBatchEdit) {
|
||||||
if (m_imm != null)
|
if (m_imm != null)
|
||||||
m_imm.restartInput(m_view);
|
m_imm.restartInput(m_view);
|
||||||
}
|
}
|
||||||
@ -133,6 +136,7 @@ class QtInputConnection extends BaseInputConnection
|
|||||||
public boolean beginBatchEdit()
|
public boolean beginBatchEdit()
|
||||||
{
|
{
|
||||||
setClosing(false);
|
setClosing(false);
|
||||||
|
m_duringBatchEdit = true;
|
||||||
return QtNativeInputConnection.beginBatchEdit();
|
return QtNativeInputConnection.beginBatchEdit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -149,7 +153,12 @@ class QtInputConnection extends BaseInputConnection
|
|||||||
public boolean endBatchEdit()
|
public boolean endBatchEdit()
|
||||||
{
|
{
|
||||||
setClosing(false);
|
setClosing(false);
|
||||||
return QtNativeInputConnection.endBatchEdit();
|
boolean ret = QtNativeInputConnection.endBatchEdit();
|
||||||
|
if (m_duringBatchEdit) {
|
||||||
|
m_duringBatchEdit = false;
|
||||||
|
restartImmInput();
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -19,7 +19,10 @@ import android.view.KeyEvent;
|
|||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.view.WindowInsets;
|
import android.view.WindowInsets;
|
||||||
import android.view.WindowInsets.Type;
|
import android.view.WindowInsets.Type;
|
||||||
|
import android.view.WindowInsetsAnimationController;
|
||||||
|
import android.view.WindowInsetsAnimationControlListener;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
|
import android.view.View;
|
||||||
import android.view.ViewTreeObserver;
|
import android.view.ViewTreeObserver;
|
||||||
import android.view.inputmethod.InputMethodManager;
|
import android.view.inputmethod.InputMethodManager;
|
||||||
|
|
||||||
@ -88,6 +91,18 @@ class QtInputDelegate implements QtInputConnection.QtInputConnectionListener, Qt
|
|||||||
m_imm = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE);
|
m_imm = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||||
if (m_imm == null)
|
if (m_imm == null)
|
||||||
Log.w(TAG, "getSystemService() returned a null InputMethodManager instance");
|
Log.w(TAG, "getSystemService() returned a null InputMethodManager instance");
|
||||||
|
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||||
|
View rootView = activity.getWindow().getDecorView();
|
||||||
|
rootView.setOnApplyWindowInsetsListener(new View.OnApplyWindowInsetsListener() {
|
||||||
|
@Override
|
||||||
|
public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {
|
||||||
|
if (m_keyboardIsVisible != insets.isVisible(WindowInsets.Type.ime()))
|
||||||
|
setKeyboardVisibility_internal(!m_keyboardIsVisible, System.nanoTime());
|
||||||
|
return insets;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private final ViewTreeObserver.OnGlobalLayoutListener keyboardListener =
|
private final ViewTreeObserver.OnGlobalLayoutListener keyboardListener =
|
||||||
@ -104,7 +119,7 @@ class QtInputDelegate implements QtInputConnection.QtInputConnectionListener, Qt
|
|||||||
if (m_keyboardTransitionInProgress == state || m_currentEditText == null)
|
if (m_keyboardTransitionInProgress == state || m_currentEditText == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_keyboardTransitionInProgress= state;
|
m_keyboardTransitionInProgress = state;
|
||||||
ViewTreeObserver observer = m_currentEditText.getViewTreeObserver();
|
ViewTreeObserver observer = m_currentEditText.getViewTreeObserver();
|
||||||
if (state)
|
if (state)
|
||||||
observer.addOnGlobalLayoutListener(keyboardListener);
|
observer.addOnGlobalLayoutListener(keyboardListener);
|
||||||
@ -127,6 +142,57 @@ class QtInputDelegate implements QtInputConnection.QtInputConnectionListener, Qt
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void showKeyboard(Activity activity,
|
||||||
|
final int x, final int y, final int width, final int height,
|
||||||
|
final int inputHints, final int enterKeyType)
|
||||||
|
{
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||||
|
activity.getWindow().getInsetsController().controlWindowInsetsAnimation(
|
||||||
|
WindowInsets.Type.ime(), -1, null, null,
|
||||||
|
new WindowInsetsAnimationControlListener() {
|
||||||
|
@Override
|
||||||
|
public void onCancelled(WindowInsetsAnimationController controller) { }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onReady(WindowInsetsAnimationController controller, int types) { }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFinished(WindowInsetsAnimationController controller) {
|
||||||
|
QtNativeInputConnection.updateCursorPosition();
|
||||||
|
if (m_softInputMode == 0)
|
||||||
|
probeForKeyboardHeight(activity, x, y, width, height,
|
||||||
|
inputHints, enterKeyType);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
activity.getWindow().getInsetsController().show(Type.ime());
|
||||||
|
} else {
|
||||||
|
if (m_imm == null)
|
||||||
|
return;
|
||||||
|
m_imm.showSoftInput(m_currentEditText, 0, new ResultReceiver(new Handler()) {
|
||||||
|
@Override
|
||||||
|
@SuppressWarnings("fallthrough")
|
||||||
|
protected void onReceiveResult(int resultCode, Bundle resultData) {
|
||||||
|
switch (resultCode) {
|
||||||
|
case InputMethodManager.RESULT_SHOWN:
|
||||||
|
QtNativeInputConnection.updateCursorPosition();
|
||||||
|
//FALLTHROUGH
|
||||||
|
case InputMethodManager.RESULT_UNCHANGED_SHOWN:
|
||||||
|
setKeyboardVisibility(true, System.nanoTime());
|
||||||
|
if (m_softInputMode == 0) {
|
||||||
|
probeForKeyboardHeight(activity,
|
||||||
|
x, y, width, height, inputHints, enterKeyType);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case InputMethodManager.RESULT_HIDDEN:
|
||||||
|
case InputMethodManager.RESULT_UNCHANGED_HIDDEN:
|
||||||
|
setKeyboardVisibility(false, System.nanoTime());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void showSoftwareKeyboard(Activity activity,
|
public void showSoftwareKeyboard(Activity activity,
|
||||||
final int x, final int y, final int width, final int height,
|
final int x, final int y, final int width, final int height,
|
||||||
@ -146,30 +212,7 @@ class QtInputDelegate implements QtInputConnection.QtInputConnectionListener, Qt
|
|||||||
m_currentEditText.setLayoutParams(new QtLayout.LayoutParams(width, height, x, y));
|
m_currentEditText.setLayoutParams(new QtLayout.LayoutParams(width, height, x, y));
|
||||||
m_currentEditText.requestFocus();
|
m_currentEditText.requestFocus();
|
||||||
m_currentEditText.postDelayed(() -> {
|
m_currentEditText.postDelayed(() -> {
|
||||||
if (m_imm == null)
|
showKeyboard(activity, x, y, width, height, inputHints, enterKeyType);
|
||||||
return;
|
|
||||||
m_imm.showSoftInput(m_currentEditText, 0, new ResultReceiver(new Handler()) {
|
|
||||||
@Override
|
|
||||||
@SuppressWarnings("fallthrough")
|
|
||||||
protected void onReceiveResult(int resultCode, Bundle resultData) {
|
|
||||||
switch (resultCode) {
|
|
||||||
case InputMethodManager.RESULT_SHOWN:
|
|
||||||
QtNativeInputConnection.updateCursorPosition();
|
|
||||||
//FALLTHROUGH
|
|
||||||
case InputMethodManager.RESULT_UNCHANGED_SHOWN:
|
|
||||||
setKeyboardVisibility(true, System.nanoTime());
|
|
||||||
if (m_softInputMode == 0) {
|
|
||||||
probeForKeyboardHeight(activity,
|
|
||||||
x, y, width, height, inputHints, enterKeyType);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case InputMethodManager.RESULT_HIDDEN:
|
|
||||||
case InputMethodManager.RESULT_UNCHANGED_HIDDEN:
|
|
||||||
setKeyboardVisibility(false, System.nanoTime());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (m_currentEditText.m_optionsChanged) {
|
if (m_currentEditText.m_optionsChanged) {
|
||||||
m_imm.restartInput(m_currentEditText);
|
m_imm.restartInput(m_currentEditText);
|
||||||
m_currentEditText.m_optionsChanged = false;
|
m_currentEditText.m_optionsChanged = false;
|
||||||
@ -228,22 +271,31 @@ class QtInputDelegate implements QtInputConnection.QtInputConnectionListener, Qt
|
|||||||
if (m_imm == null || m_currentEditText == null)
|
if (m_imm == null || m_currentEditText == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_imm.hideSoftInputFromWindow(m_currentEditText.getWindowToken(), 0,
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||||
new ResultReceiver(new Handler()) {
|
Activity activity = QtNative.activity();
|
||||||
@Override
|
if (activity == null) {
|
||||||
protected void onReceiveResult(int resultCode, Bundle resultData) {
|
Log.w(TAG, "hideSoftwareKeyboard: The activity reference is null");
|
||||||
switch (resultCode) {
|
return;
|
||||||
case InputMethodManager.RESULT_SHOWN:
|
}
|
||||||
case InputMethodManager.RESULT_UNCHANGED_SHOWN:
|
activity.getWindow().getInsetsController().hide(Type.ime());
|
||||||
setKeyboardVisibility(true, System.nanoTime());
|
} else {
|
||||||
break;
|
m_imm.hideSoftInputFromWindow(m_currentEditText.getWindowToken(), 0,
|
||||||
case InputMethodManager.RESULT_HIDDEN:
|
new ResultReceiver(new Handler()) {
|
||||||
case InputMethodManager.RESULT_UNCHANGED_HIDDEN:
|
@Override
|
||||||
setKeyboardVisibility(false, System.nanoTime());
|
protected void onReceiveResult(int resultCode, Bundle resultData) {
|
||||||
break;
|
switch (resultCode) {
|
||||||
|
case InputMethodManager.RESULT_SHOWN:
|
||||||
|
case InputMethodManager.RESULT_UNCHANGED_SHOWN:
|
||||||
|
setKeyboardVisibility(true, System.nanoTime());
|
||||||
|
break;
|
||||||
|
case InputMethodManager.RESULT_HIDDEN:
|
||||||
|
case InputMethodManager.RESULT_UNCHANGED_HIDDEN:
|
||||||
|
setKeyboardVisibility(false, System.nanoTime());
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -269,22 +321,17 @@ class QtInputDelegate implements QtInputConnection.QtInputConnectionListener, Qt
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isKeyboardHidden = true;
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
|
||||||
|
|
||||||
if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
|
|
||||||
Rect r = new Rect();
|
Rect r = new Rect();
|
||||||
activity.getWindow().getDecorView().getWindowVisibleDisplayFrame(r);
|
activity.getWindow().getDecorView().getWindowVisibleDisplayFrame(r);
|
||||||
DisplayMetrics metrics = new DisplayMetrics();
|
DisplayMetrics metrics = new DisplayMetrics();
|
||||||
QtDisplayManager.getDisplay(activity).getMetrics(metrics);
|
QtDisplayManager.getDisplay(activity).getMetrics(metrics);
|
||||||
int screenHeight = metrics.heightPixels;
|
int screenHeight = metrics.heightPixels;
|
||||||
final int kbHeight = screenHeight - r.bottom;
|
final int kbHeight = screenHeight - r.bottom;
|
||||||
isKeyboardHidden = kbHeight < screenHeight * KEYBOARD_TO_SCREEN_RATIO;
|
return kbHeight < screenHeight * KEYBOARD_TO_SCREEN_RATIO;
|
||||||
} else {
|
|
||||||
WindowInsets w = activity.getWindow().getDecorView().getRootWindowInsets();
|
|
||||||
isKeyboardHidden = !w.isVisible(Type.ime());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return isKeyboardHidden;
|
return !m_keyboardIsVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -331,6 +378,14 @@ class QtInputDelegate implements QtInputConnection.QtInputConnectionListener, Qt
|
|||||||
}
|
}
|
||||||
|
|
||||||
void setKeyboardVisibility(boolean visibility, long timeStamp)
|
void setKeyboardVisibility(boolean visibility, long timeStamp)
|
||||||
|
{
|
||||||
|
// Since API 30 keyboard visibility changes are tracked by OnApplyWindowInsetsListener.
|
||||||
|
// There are no manual changes anymore
|
||||||
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R)
|
||||||
|
setKeyboardVisibility_internal(visibility, timeStamp);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setKeyboardVisibility_internal(boolean visibility, long timeStamp)
|
||||||
{
|
{
|
||||||
if (m_showHideTimeStamp > timeStamp)
|
if (m_showHideTimeStamp > timeStamp)
|
||||||
return;
|
return;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
// Copyright (C) 2023 The Qt Company Ltd.
|
// Copyright (C) 2023 The Qt Company Ltd.
|
||||||
// Copyright (c) 2019, BogDan Vatra <bogdan@kde.org>
|
// Copyright (c) 2019, BogDan Vatra <bogdan@kde.org>
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||||
|
// Qt-Security score:significant reason:trusted-data-only
|
||||||
|
|
||||||
package org.qtproject.qt.android;
|
package org.qtproject.qt.android;
|
||||||
|
|
||||||
|
@ -75,57 +75,27 @@ class QtWindow extends QtLayout implements QtSurfaceInterface {
|
|||||||
});
|
});
|
||||||
m_gestureDetector.setIsLongpressEnabled(true);
|
m_gestureDetector.setIsLongpressEnabled(true);
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
@UsedFromNativeCode
|
if (getContext() instanceof QtActivityBase) {
|
||||||
void registerSafeAreaMarginsListner(boolean isTopLevel, boolean isSameWindowAndScreenSize)
|
setOnApplyWindowInsetsListener((view, insets) -> {
|
||||||
{
|
Insets safeInsets;
|
||||||
if (!(getContext() instanceof QtActivityBase))
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||||
return;
|
int types = WindowInsets.Type.displayCutout() | WindowInsets.Type.systemBars();
|
||||||
|
safeInsets = insets.getInsets(types);
|
||||||
setOnApplyWindowInsetsListener((view, insets) -> {
|
} else {
|
||||||
Insets safeInsets = getSafeInsets(view, insets);
|
safeInsets = getSafeInsetsPreAndroidR(view, insets);
|
||||||
safeAreaMarginsChanged(safeInsets, getId());
|
}
|
||||||
return getConsumedInsets(insets);
|
QtNative.runAction(() -> safeAreaMarginsChanged(safeInsets, getId()));
|
||||||
});
|
return insets;
|
||||||
|
|
||||||
// NOTE: if the window size fits the screen geometry (i.e. edge-to-edge case),
|
|
||||||
// assume this window is the main window and initialize its safe margins with
|
|
||||||
// the insets of the decor view.
|
|
||||||
if (isTopLevel && isSameWindowAndScreenSize) {
|
|
||||||
QtNative.runAction(() -> {
|
|
||||||
// NOTE: The callback onApplyWindowInsetsListener() is not being triggered during
|
|
||||||
// startup, so this is a Workaround to get the safe area margins at startup.
|
|
||||||
// Initially, set the root view insets to the current window, then if the insets
|
|
||||||
// change later, we can rely on setOnApplyWindowInsetsListener() being called.
|
|
||||||
View decorView = ((Activity) getContext()).getWindow().getDecorView();
|
|
||||||
WindowInsets rootInsets = decorView.getRootWindowInsets();
|
|
||||||
Insets rootSafeInsets = getSafeInsets(decorView, rootInsets);
|
|
||||||
safeAreaMarginsChanged(rootSafeInsets, getId());
|
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
QtNative.runAction(() -> requestApplyInsets());
|
QtNative.runAction(() -> requestApplyInsets());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
WindowInsets getConsumedInsets(WindowInsets insets)
|
Insets getSafeInsetsPreAndroidR(View view, WindowInsets insets)
|
||||||
{
|
{
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R)
|
|
||||||
return WindowInsets.CONSUMED;
|
|
||||||
else
|
|
||||||
return insets.consumeSystemWindowInsets();
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
Insets getSafeInsets(View view, WindowInsets insets)
|
|
||||||
{
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
|
||||||
int types = WindowInsets.Type.displayCutout() | WindowInsets.Type.systemBars();
|
|
||||||
return insets.getInsets(types);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Android R and older
|
|
||||||
int left = 0;
|
int left = 0;
|
||||||
int top = 0;
|
int top = 0;
|
||||||
int right = 0;
|
int right = 0;
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
// Copyright (C) 2017 BogDan Vatra <bogdan@kde.org>
|
// Copyright (C) 2017 BogDan Vatra <bogdan@kde.org>
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||||
// Qt-Security score:critical reason:data-parser
|
|
||||||
|
|
||||||
package org.qtproject.qt.android.extras;
|
package org.qtproject.qt.android.extras;
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ apply plugin: qtGradlePluginType
|
|||||||
dependencies {
|
dependencies {
|
||||||
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
||||||
//noinspection GradleDependency
|
//noinspection GradleDependency
|
||||||
implementation 'androidx.core:core:1.13.1'
|
implementation 'androidx.core:core:1.16.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
@ -58,6 +58,7 @@ android {
|
|||||||
|
|
||||||
tasks.withType(JavaCompile) {
|
tasks.withType(JavaCompile) {
|
||||||
options.incremental = true
|
options.incremental = true
|
||||||
|
options.compilerArgs += ['-Xlint:all']
|
||||||
}
|
}
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
|
@ -97,10 +97,11 @@
|
|||||||
|
|
||||||
\section3 Using Member Functions
|
\section3 Using Member Functions
|
||||||
|
|
||||||
QtConcurrent::run() also accepts pointers to member functions. The first
|
QtConcurrent::run() also accepts pointers to member functions.
|
||||||
argument must be either a const reference or a pointer to an instance of
|
In Qt 6, the first argument must be the pointer to the member function,
|
||||||
the class. Passing by const reference is useful when calling const member
|
followed by either a const reference or a pointer to an instance of the
|
||||||
functions; passing by pointer is useful for calling non-const member
|
class. Passing a const reference is useful when calling const member
|
||||||
|
functions; passing a pointer is useful for calling non-const member
|
||||||
functions that modify the instance.
|
functions that modify the instance.
|
||||||
|
|
||||||
For example, calling QByteArray::split() (a const member function) in a
|
For example, calling QByteArray::split() (a const member function) in a
|
||||||
|
@ -1459,17 +1459,8 @@ function(_qt_internal_configure_android_multiabi_target target)
|
|||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
get_target_property(target_abis ${target} QT_ANDROID_ABIS)
|
_qt_internal_android_get_target_abis(android_abis ${target})
|
||||||
if(target_abis)
|
if(NOT android_abis)
|
||||||
# Use target-specific Qt for Android ABIs.
|
|
||||||
set(android_abis ${target_abis})
|
|
||||||
elseif(QT_ANDROID_BUILD_ALL_ABIS)
|
|
||||||
# Use autodetected Qt for Android ABIs.
|
|
||||||
set(android_abis ${QT_DEFAULT_ANDROID_ABIS})
|
|
||||||
elseif(QT_ANDROID_ABIS)
|
|
||||||
# Use project-wide Qt for Android ABIs.
|
|
||||||
set(android_abis ${QT_ANDROID_ABIS})
|
|
||||||
else()
|
|
||||||
# User have an empty list of Qt for Android ABIs.
|
# User have an empty list of Qt for Android ABIs.
|
||||||
message(FATAL_ERROR
|
message(FATAL_ERROR
|
||||||
"The list of Android ABIs is empty, when building ${target}.\n"
|
"The list of Android ABIs is empty, when building ${target}.\n"
|
||||||
@ -1831,5 +1822,23 @@ function(_qt_internal_android_get_deployment_type_option out_var release_flag de
|
|||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
function(_qt_internal_android_get_target_abis out_abis target)
|
||||||
|
get_target_property(target_abis ${target} QT_ANDROID_ABIS)
|
||||||
|
if(target_abis)
|
||||||
|
# Use target-specific Qt for Android ABIs.
|
||||||
|
set(android_abis ${target_abis})
|
||||||
|
elseif(QT_ANDROID_BUILD_ALL_ABIS)
|
||||||
|
# Use autodetected Qt for Android ABIs.
|
||||||
|
set(android_abis ${QT_DEFAULT_ANDROID_ABIS})
|
||||||
|
elseif(QT_ANDROID_ABIS)
|
||||||
|
# Use project-wide Qt for Android ABIs.
|
||||||
|
set(android_abis ${QT_ANDROID_ABIS})
|
||||||
|
else()
|
||||||
|
set(android_abis "")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(${out_abis} "${android_abis}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
set(QT_INTERNAL_ANDROID_TARGET_BUILD_DIR_SUPPORT ON CACHE INTERNAL
|
set(QT_INTERNAL_ANDROID_TARGET_BUILD_DIR_SUPPORT ON CACHE INTERNAL
|
||||||
"Indicates that Qt supports per-target Android build directories")
|
"Indicates that Qt supports per-target Android build directories")
|
||||||
|
@ -67,12 +67,8 @@ macro(_qt_internal_get_moc_flags _moc_flags)
|
|||||||
set(${_moc_flags} ${${_moc_flags}} "-D${_current}")
|
set(${_moc_flags} ${${_moc_flags}} "-D${_current}")
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
if(WIN32)
|
_qt_internal_get_moc_compiler_flavor_flags(flavor_flags)
|
||||||
set(${_moc_flags} ${${_moc_flags}} -DWIN32)
|
set(${_moc_flags} ${${_moc_flags}} ${flavor_flags})
|
||||||
endif()
|
|
||||||
if (MSVC)
|
|
||||||
set(${_moc_flags} ${${_moc_flags}} --compiler-flavor=msvc)
|
|
||||||
endif()
|
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
# helper macro to set up a moc rule
|
# helper macro to set up a moc rule
|
||||||
@ -96,6 +92,9 @@ function(_qt_internal_create_moc_command infile outfile moc_flags moc_options
|
|||||||
set(${out_json_file} "${extra_output_files}" PARENT_SCOPE)
|
set(${out_json_file} "${extra_output_files}" PARENT_SCOPE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
_qt_internal_get_moc_compiler_flavor_flags(flavor_flags)
|
||||||
|
list(APPEND _moc_parameters ${flavor_flags})
|
||||||
|
|
||||||
if(moc_target)
|
if(moc_target)
|
||||||
set(_moc_parameters_file ${_moc_parameters_file}$<$<BOOL:$<CONFIG>>:_$<CONFIG>>)
|
set(_moc_parameters_file ${_moc_parameters_file}$<$<BOOL:$<CONFIG>>:_$<CONFIG>>)
|
||||||
set(targetincludes "$<TARGET_PROPERTY:${moc_target},INCLUDE_DIRECTORIES>")
|
set(targetincludes "$<TARGET_PROPERTY:${moc_target},INCLUDE_DIRECTORIES>")
|
||||||
@ -832,12 +831,16 @@ function(qt6_finalize_target target)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
get_target_property(is_immediately_finalized "${target}" _qt_is_immediately_finalized)
|
||||||
|
get_target_property(uses_automoc ${target} AUTOMOC)
|
||||||
|
if(uses_automoc)
|
||||||
|
_qt_internal_get_moc_compiler_flavor_flags(flavor_flags)
|
||||||
|
set_property(TARGET "${target}" APPEND PROPERTY AUTOMOC_MOC_OPTIONS ${flavor_flags})
|
||||||
|
endif()
|
||||||
if(target_type STREQUAL "SHARED_LIBRARY" OR
|
if(target_type STREQUAL "SHARED_LIBRARY" OR
|
||||||
target_type STREQUAL "STATIC_LIBRARY" OR
|
target_type STREQUAL "STATIC_LIBRARY" OR
|
||||||
target_type STREQUAL "MODULE_LIBRARY" OR
|
target_type STREQUAL "MODULE_LIBRARY" OR
|
||||||
target_type STREQUAL "OBJECT_LIBRARY")
|
target_type STREQUAL "OBJECT_LIBRARY")
|
||||||
get_target_property(is_immediately_finalized "${target}" _qt_is_immediately_finalized)
|
|
||||||
get_target_property(uses_automoc ${target} AUTOMOC)
|
|
||||||
if(uses_automoc AND NOT is_immediately_finalized)
|
if(uses_automoc AND NOT is_immediately_finalized)
|
||||||
qt6_extract_metatypes(${target})
|
qt6_extract_metatypes(${target})
|
||||||
endif()
|
endif()
|
||||||
|
@ -1276,7 +1276,7 @@ int QAbstractAnimation::currentLoopTime() const
|
|||||||
\brief the current time and progress of the animation
|
\brief the current time and progress of the animation
|
||||||
|
|
||||||
This property describes the animation's current time. You can change the
|
This property describes the animation's current time. You can change the
|
||||||
current time by calling setCurrentTime, or you can call start() and let
|
current time by calling setCurrentTime(), or you can call start() and let
|
||||||
the animation run, setting the current time automatically as the animation
|
the animation run, setting the current time automatically as the animation
|
||||||
progresses.
|
progresses.
|
||||||
|
|
||||||
@ -1428,8 +1428,7 @@ void QAbstractAnimation::pause()
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
Resumes the animation after it was paused. When the animation is resumed,
|
Resumes the animation after it was paused. When the animation is resumed,
|
||||||
it emits the resumed() and stateChanged() signals. The currenttime is not
|
it emits the stateChanged() signal. The currentTime property is not changed.
|
||||||
changed.
|
|
||||||
|
|
||||||
\sa start(), pause(), state()
|
\sa start(), pause(), state()
|
||||||
*/
|
*/
|
||||||
|
@ -243,7 +243,7 @@ void QPropertyAnimation::updateCurrentValue(const QVariant &value)
|
|||||||
/*!
|
/*!
|
||||||
\reimp
|
\reimp
|
||||||
|
|
||||||
If the startValue is not defined when the state of the animation changes from Stopped to Running,
|
If the \l{QVariantAnimation::}{startValue} is not defined when the state of the animation changes from Stopped to Running,
|
||||||
the current property value is used as the initial value for the animation.
|
the current property value is used as the initial value for the animation.
|
||||||
*/
|
*/
|
||||||
void QPropertyAnimation::updateState(QAbstractAnimation::State newState,
|
void QPropertyAnimation::updateState(QAbstractAnimation::State newState,
|
||||||
|
@ -338,7 +338,7 @@ QVariantAnimation::~QVariantAnimation()
|
|||||||
elastic effect on the values of the interpolated variant.
|
elastic effect on the values of the interpolated variant.
|
||||||
|
|
||||||
QVariantAnimation will use the QEasingCurve::valueForProgress() to
|
QVariantAnimation will use the QEasingCurve::valueForProgress() to
|
||||||
transform the "normalized progress" (currentTime / totalDuration)
|
transform the "normalized progress" (currentTime() / totalDuration())
|
||||||
of the animation into the effective progress actually
|
of the animation into the effective progress actually
|
||||||
used by the animation. It is this effective progress that will be
|
used by the animation. It is this effective progress that will be
|
||||||
the progress when interpolated() is called. Also, the steps in the
|
the progress when interpolated() is called. Also, the steps in the
|
||||||
|
@ -1461,6 +1461,8 @@ QNoDebug QMessageLogger::noDebug() const noexcept
|
|||||||
return QNoDebug();
|
return QNoDebug();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#include "qmutex.h" // removed, previously-inline API
|
||||||
|
|
||||||
#include "qstring.h" // inlined API
|
#include "qstring.h" // inlined API
|
||||||
|
|
||||||
// #include "qotherheader.h"
|
// #include "qotherheader.h"
|
||||||
|
@ -1262,7 +1262,7 @@ qt_configure_add_report_entry(
|
|||||||
)
|
)
|
||||||
qt_configure_add_report_entry(
|
qt_configure_add_report_entry(
|
||||||
TYPE ERROR
|
TYPE ERROR
|
||||||
MESSAGE "detected a std::atomic implementation that fails for function pointers. Please apply the patch corresponding to your Standard Library vendor, found in qtbase/config.tests/atomicfptr"
|
MESSAGE "detected a std::atomic implementation that fails for function pointers."
|
||||||
CONDITION NOT TEST_atomicfptr
|
CONDITION NOT TEST_atomicfptr
|
||||||
)
|
)
|
||||||
qt_configure_add_report_entry(
|
qt_configure_add_report_entry(
|
||||||
|
@ -9,11 +9,10 @@ target_link_libraries(corelib_snippets PRIVATE
|
|||||||
Qt::Core
|
Qt::Core
|
||||||
)
|
)
|
||||||
|
|
||||||
if (TARGET Qt::Widgets)
|
qt_internal_extend_target(corelib_snippets CONDITION QT_FEATURE_widgets
|
||||||
target_link_libraries(corelib_snippets PRIVATE
|
LIBRARIES
|
||||||
Qt::Widgets
|
Qt::Widgets
|
||||||
)
|
)
|
||||||
endif()
|
|
||||||
|
|
||||||
if ("${CMAKE_CXX_COMPILE_FEATURES}" MATCHES "cxx_std_23")
|
if ("${CMAKE_CXX_COMPILE_FEATURES}" MATCHES "cxx_std_23")
|
||||||
set_property(TARGET corelib_snippets PROPERTY CXX_STANDARD 23)
|
set_property(TARGET corelib_snippets PROPERTY CXX_STANDARD 23)
|
||||||
|
@ -139,7 +139,7 @@
|
|||||||
|
|
||||||
To achieve locking of the shared memory segment, applications will need to
|
To achieve locking of the shared memory segment, applications will need to
|
||||||
deploy their own mechanisms. One way may be to use \l QLockFile. Another
|
deploy their own mechanisms. One way may be to use \l QLockFile. Another
|
||||||
and less costly solution is to use QBasicAtomicInteger or \c{std::atomic} in
|
and less costly solution is to use QAtomicInteger or \c{std::atomic} in
|
||||||
a pre-determined offset in the segment itself. Higher-level locking
|
a pre-determined offset in the segment itself. Higher-level locking
|
||||||
primitives may be available on some operating systems; for example, on
|
primitives may be available on some operating systems; for example, on
|
||||||
Linux, applications can set the "pshared" flag in the mutex attribute
|
Linux, applications can set the "pshared" flag in the mutex attribute
|
||||||
|
@ -181,8 +181,8 @@ static bool isFatalCountDown(const char *varname, QBasicAtomicInt &n)
|
|||||||
return v == ImmediatelyFatal;
|
return v == ImmediatelyFatal;
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_CONSTINIT static QBasicAtomicInt fatalCriticalsCount = {};
|
Q_CONSTINIT static QBasicAtomicInt fatalCriticalsCount = Q_BASIC_ATOMIC_INITIALIZER(0);
|
||||||
Q_CONSTINIT static QBasicAtomicInt fatalWarningsCount = {};
|
Q_CONSTINIT static QBasicAtomicInt fatalWarningsCount = Q_BASIC_ATOMIC_INITIALIZER(0);
|
||||||
static bool isFatal(QtMsgType msgType)
|
static bool isFatal(QtMsgType msgType)
|
||||||
{
|
{
|
||||||
switch (msgType){
|
switch (msgType){
|
||||||
|
@ -576,6 +576,12 @@ const QOperatingSystemVersionBase QOperatingSystemVersion::MacOSVentura;
|
|||||||
\since 6.8
|
\since 6.8
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\variable QOperatingSystemVersion::MacOSTahoe
|
||||||
|
\brief a version corresponding to macOS Tahoe (version 26).
|
||||||
|
\since 6.10
|
||||||
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\variable QOperatingSystemVersion::AndroidJellyBean
|
\variable QOperatingSystemVersion::AndroidJellyBean
|
||||||
\brief a version corresponding to Android Jelly Bean (version 4.1, API level 16).
|
\brief a version corresponding to Android Jelly Bean (version 4.1, API level 16).
|
||||||
|
@ -144,6 +144,7 @@ public:
|
|||||||
// ### Qt7: Regroup with the rest below
|
// ### Qt7: Regroup with the rest below
|
||||||
static constexpr QOperatingSystemVersionBase MacOSSonoma { QOperatingSystemVersionBase::MacOS, 14, 0 };
|
static constexpr QOperatingSystemVersionBase MacOSSonoma { QOperatingSystemVersionBase::MacOS, 14, 0 };
|
||||||
static constexpr QOperatingSystemVersionBase MacOSSequoia { QOperatingSystemVersionBase::MacOS, 15, 0 };
|
static constexpr QOperatingSystemVersionBase MacOSSequoia { QOperatingSystemVersionBase::MacOS, 15, 0 };
|
||||||
|
static constexpr QOperatingSystemVersionBase MacOSTahoe { QOperatingSystemVersionBase::MacOS, 26, 0 };
|
||||||
static constexpr QOperatingSystemVersionBase Android14 { QOperatingSystemVersionBase::Android, 14, 0 };
|
static constexpr QOperatingSystemVersionBase Android14 { QOperatingSystemVersionBase::Android, 14, 0 };
|
||||||
static constexpr QOperatingSystemVersionBase Windows11_23H2 { QOperatingSystemVersionBase::Windows, 10, 0, 22631 };
|
static constexpr QOperatingSystemVersionBase Windows11_23H2 { QOperatingSystemVersionBase::Windows, 10, 0, 22631 };
|
||||||
static constexpr QOperatingSystemVersionBase Windows11_24H2 { QOperatingSystemVersionBase::Windows, 10, 0, 26100 };
|
static constexpr QOperatingSystemVersionBase Windows11_24H2 { QOperatingSystemVersionBase::Windows, 10, 0, 26100 };
|
||||||
|
@ -111,6 +111,7 @@ static const char *osVer_helper(QOperatingSystemVersion version = QOperatingSyst
|
|||||||
case 13: return "Ventura";
|
case 13: return "Ventura";
|
||||||
case 14: return "Sonoma";
|
case 14: return "Sonoma";
|
||||||
case 15: return "Sequoia";
|
case 15: return "Sequoia";
|
||||||
|
case 26: return "Tahoe";
|
||||||
default:
|
default:
|
||||||
// Unknown, future version
|
// Unknown, future version
|
||||||
break;
|
break;
|
||||||
|
@ -44,7 +44,22 @@
|
|||||||
set to the same version as in the user code. That is because in static
|
set to the same version as in the user code. That is because in static
|
||||||
build the Qt libraries also become a part of the binary.
|
build the Qt libraries also become a part of the binary.
|
||||||
|
|
||||||
\sa QT_DEPRECATED_WARNINGS, QT_DISABLE_DEPRECATED_UP_TO
|
\sa QT_DEPRECATED_WARNINGS, QT_WARN_DEPRECATED_UP_TO
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\macro QT_WARN_DEPRECATED_UP_TO
|
||||||
|
\relates <QtDeprecationMarkers>
|
||||||
|
|
||||||
|
This macro can be defined in the project file to disable deprecation
|
||||||
|
warnings introduced in Qt versions higher than the specified version.
|
||||||
|
|
||||||
|
For instance, when preparing to upgrade to Qt 6.10, if you are not
|
||||||
|
ready to deal with every single deprecation warnings, you can set
|
||||||
|
\c{QT_WARN_DEPRECATED_UP_TO=0x060900} to limit the deprecation
|
||||||
|
warnings to those in 6.9 and earlier.
|
||||||
|
|
||||||
|
\sa QT_DISABLE_DEPRECATED_UP_TO, QT_NO_DEPRECATED_WARNINGS
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -55,7 +70,7 @@
|
|||||||
is defined, the compiler will generate warnings if any API declared as
|
is defined, the compiler will generate warnings if any API declared as
|
||||||
deprecated by Qt is used.
|
deprecated by Qt is used.
|
||||||
|
|
||||||
\sa QT_DISABLE_DEPRECATED_UP_TO, QT_NO_DEPRECATED_WARNINGS
|
\sa QT_DISABLE_DEPRECATED_UP_TO, QT_NO_DEPRECATED_WARNINGS, QT_WARN_DEPRECATED_UP_TO
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -66,5 +81,5 @@
|
|||||||
This macro can be used to suppress deprecation warnings that would otherwise
|
This macro can be used to suppress deprecation warnings that would otherwise
|
||||||
be generated when using deprecated APIs.
|
be generated when using deprecated APIs.
|
||||||
|
|
||||||
\sa QT_DISABLE_DEPRECATED_UP_TO
|
\sa QT_DISABLE_DEPRECATED_UP_TO, QT_WARN_DEPRECATED_UP_TO
|
||||||
*/
|
*/
|
||||||
|
@ -26,14 +26,11 @@
|
|||||||
#include <map>
|
#include <map>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <optional>
|
#include <optional>
|
||||||
#include <set>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
#include <QtCore/q20type_traits.h>
|
#include <QtCore/q20type_traits.h>
|
||||||
#include <unordered_map>
|
|
||||||
#include <unordered_set>
|
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
|
@ -76,7 +76,7 @@
|
|||||||
links to directories will be excluded too.
|
links to directories will be excluded too.
|
||||||
|
|
||||||
\omitvalue ExcludeSpecial
|
\omitvalue ExcludeSpecial
|
||||||
\value ExcludeOther
|
\value ExcludeOther [since 6.10]
|
||||||
Don't list file system entries that are \e not directories, regular files,
|
Don't list file system entries that are \e not directories, regular files,
|
||||||
or symbolic links.
|
or symbolic links.
|
||||||
\list
|
\list
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#ifndef QDIRLISTING_H
|
#ifndef QDIRLISTING_H
|
||||||
#define QDIRLISTING_H
|
#define QDIRLISTING_H
|
||||||
|
|
||||||
|
#include <QtCore/qtdeprecationmarkers.h>
|
||||||
#include <QtCore/qfiledevice.h>
|
#include <QtCore/qfiledevice.h>
|
||||||
#include <QtCore/qflags.h>
|
#include <QtCore/qflags.h>
|
||||||
#include <QtCore/qtclasshelpermacros.h>
|
#include <QtCore/qtclasshelpermacros.h>
|
||||||
@ -28,7 +29,9 @@ public:
|
|||||||
Default = 0x000000,
|
Default = 0x000000,
|
||||||
ExcludeFiles = 0x000004,
|
ExcludeFiles = 0x000004,
|
||||||
ExcludeDirs = 0x000008,
|
ExcludeDirs = 0x000008,
|
||||||
QT6_ONLY(ExcludeSpecial = 0x000010,)
|
#if QT_DEPRECATED_SINCE(6, 14)
|
||||||
|
ExcludeSpecial QT_DEPRECATED_VERSION_X_6_14("Use ExcludeOther instead.") = 0x000010,
|
||||||
|
#endif
|
||||||
ExcludeOther = 0x000010,
|
ExcludeOther = 0x000010,
|
||||||
ResolveSymlinks = 0x000020,
|
ResolveSymlinks = 0x000020,
|
||||||
FilesOnly = ExcludeDirs | ExcludeOther,
|
FilesOnly = ExcludeDirs | ExcludeOther,
|
||||||
|
@ -963,6 +963,7 @@ bool QFileSystemEngine::fillMetaData(const QFileSystemEntry &entry, QFileSystemM
|
|||||||
} else {
|
} else {
|
||||||
// it doesn't exist
|
// it doesn't exist
|
||||||
entryErrno = errno;
|
entryErrno = errno;
|
||||||
|
statResult = -1;
|
||||||
data.knownFlagsMask |= QFileSystemMetaData::ExistsAttribute;
|
data.knownFlagsMask |= QFileSystemMetaData::ExistsAttribute;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -971,7 +972,7 @@ bool QFileSystemEngine::fillMetaData(const QFileSystemEntry &entry, QFileSystemM
|
|||||||
|
|
||||||
// second, we try a regular stat(2)
|
// second, we try a regular stat(2)
|
||||||
if (statResult == -1 && (what & QFileSystemMetaData::PosixStatFlags)) {
|
if (statResult == -1 && (what & QFileSystemMetaData::PosixStatFlags)) {
|
||||||
if (entryErrno == 0 && statResult == -1) {
|
if (entryErrno == 0) {
|
||||||
data.entryFlags &= ~QFileSystemMetaData::PosixStatFlags;
|
data.entryFlags &= ~QFileSystemMetaData::PosixStatFlags;
|
||||||
statResult = qt_statx(nativeFilePath, &statxBuffer);
|
statResult = qt_statx(nativeFilePath, &statxBuffer);
|
||||||
if (statResult == -ENOSYS) {
|
if (statResult == -ENOSYS) {
|
||||||
@ -1080,8 +1081,17 @@ bool QFileSystemEngine::fillMetaData(const QFileSystemEntry &entry, QFileSystemM
|
|||||||
|
|
||||||
if (what & QFileSystemMetaData::HiddenAttribute
|
if (what & QFileSystemMetaData::HiddenAttribute
|
||||||
&& !data.isHidden()) {
|
&& !data.isHidden()) {
|
||||||
QString fileName = entry.fileName();
|
// reusing nativeFilePath from above instead of entry.fileName(), to
|
||||||
if (fileName.startsWith(u'.')
|
// avoid memory allocation for the QString result.
|
||||||
|
qsizetype lastSlash = nativeFilePath.size();
|
||||||
|
|
||||||
|
while (lastSlash && nativeFilePath.at(lastSlash - 1) == '/')
|
||||||
|
--lastSlash; // skip ending slashes
|
||||||
|
while (lastSlash && nativeFilePath.at(lastSlash - 1) != '/')
|
||||||
|
--lastSlash; // skip non-slashes
|
||||||
|
--lastSlash; // point to the slash or -1 if no slash
|
||||||
|
|
||||||
|
if (nativeFilePath.at(lastSlash + 1) == '.'
|
||||||
#if defined(Q_OS_DARWIN)
|
#if defined(Q_OS_DARWIN)
|
||||||
|| (entryErrno == 0 && hasResourcePropertyFlag(data, entry, kCFURLIsHiddenKey))
|
|| (entryErrno == 0 && hasResourcePropertyFlag(data, entry, kCFURLIsHiddenKey))
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
// Copyright (C) 2022 Intel Corporation.
|
// Copyright (C) 2022 Intel Corporation.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|
||||||
#ifndef QNATIVEIPCKEY_H
|
#ifndef QTIPCCOMMON_H
|
||||||
#define QNATIVEIPCKEY_H
|
#define QTIPCCOMMON_H
|
||||||
|
|
||||||
#include <QtCore/qglobal.h>
|
#include <QtCore/qglobal.h>
|
||||||
#include <QtCore/qtcore-config.h>
|
#include <QtCore/qtcore-config.h>
|
||||||
@ -207,4 +207,4 @@ QT_END_NAMESPACE
|
|||||||
#endif // QT_CONFIG(sharedmemory) || QT_CONFIG(systemsemaphore)
|
#endif // QT_CONFIG(sharedmemory) || QT_CONFIG(systemsemaphore)
|
||||||
|
|
||||||
|
|
||||||
#endif // QNATIVEIPCKEY_H
|
#endif // QTIPCCOMMON_H
|
||||||
|
@ -291,10 +291,13 @@ QVariant QIdentityProxyModel::headerData(int section, Qt::Orientation orientatio
|
|||||||
*/
|
*/
|
||||||
void QIdentityProxyModel::setSourceModel(QAbstractItemModel* newSourceModel)
|
void QIdentityProxyModel::setSourceModel(QAbstractItemModel* newSourceModel)
|
||||||
{
|
{
|
||||||
beginResetModel();
|
|
||||||
|
|
||||||
Q_D(QIdentityProxyModel);
|
Q_D(QIdentityProxyModel);
|
||||||
|
|
||||||
|
if (newSourceModel == d->model)
|
||||||
|
return;
|
||||||
|
|
||||||
|
beginResetModel();
|
||||||
|
|
||||||
// Call QObject::disconnect() unconditionally, if there is an existing source
|
// Call QObject::disconnect() unconditionally, if there is an existing source
|
||||||
// model, it's disconnected, and if there isn't, then calling disconnect() on
|
// model, it's disconnected, and if there isn't, then calling disconnect() on
|
||||||
// a default-constructed Connection does nothing
|
// a default-constructed Connection does nothing
|
||||||
|
@ -101,7 +101,9 @@ namespace QRangeModelDetails
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
static constexpr bool isValid(const T &t) noexcept
|
static constexpr bool isValid(const T &t) noexcept
|
||||||
{
|
{
|
||||||
if constexpr (is_validatable<T>())
|
if constexpr (std::is_array_v<T>)
|
||||||
|
return true;
|
||||||
|
else if constexpr (is_validatable<T>())
|
||||||
return bool(t);
|
return bool(t);
|
||||||
else
|
else
|
||||||
return true;
|
return true;
|
||||||
|
@ -2110,6 +2110,13 @@ void QSortFilterProxyModel::setSourceModel(QAbstractItemModel *sourceModel)
|
|||||||
QObjectPrivate::connect(d->model, &QAbstractItemModel::modelReset, d,
|
QObjectPrivate::connect(d->model, &QAbstractItemModel::modelReset, d,
|
||||||
&QSortFilterProxyModelPrivate::_q_sourceReset)
|
&QSortFilterProxyModelPrivate::_q_sourceReset)
|
||||||
};
|
};
|
||||||
|
/* check whether we are connecting to a model that is undergoing a reset currently.
|
||||||
|
If it is, _q_sourceReset will take care of calling endResetModel, and of
|
||||||
|
calling sort if necessary.
|
||||||
|
*/
|
||||||
|
auto modelPrivate = d->model ? QAbstractItemModelPrivate::get(d->model) : nullptr;
|
||||||
|
if (modelPrivate && modelPrivate->resetting)
|
||||||
|
return;
|
||||||
endResetModel();
|
endResetModel();
|
||||||
if (d->update_source_sort_column() && d->dynamic_sortfilter)
|
if (d->update_source_sort_column() && d->dynamic_sortfilter)
|
||||||
d->sort();
|
d->sort();
|
||||||
|
@ -1873,8 +1873,9 @@ void QCoreApplicationPrivate::sendPostedEvents(QObject *receiver, int event_type
|
|||||||
QEvent *e = pe.event;
|
QEvent *e = pe.event;
|
||||||
QObject * r = pe.receiver;
|
QObject * r = pe.receiver;
|
||||||
|
|
||||||
r->d_func()->postedEvents.fetchAndSubAcquire(1);
|
[[maybe_unused]]
|
||||||
Q_ASSERT(r->d_func()->postedEvents >= 0);
|
const auto previous = r->d_func()->postedEvents.fetchAndSubAcquire(1);
|
||||||
|
Q_ASSERT(previous > 0);
|
||||||
|
|
||||||
// next, update the data structure so that we're ready
|
// next, update the data structure so that we're ready
|
||||||
// for the next event.
|
// for the next event.
|
||||||
@ -1951,7 +1952,7 @@ void QCoreApplication::removePostedEvents(QObject *receiver, int eventType)
|
|||||||
|
|
||||||
#ifdef QT_DEBUG
|
#ifdef QT_DEBUG
|
||||||
if (receiver && eventType == 0) {
|
if (receiver && eventType == 0) {
|
||||||
Q_ASSERT(!receiver->d_func()->postedEvents);
|
Q_ASSERT(!receiver->d_func()->postedEvents.loadRelaxed());
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -34,8 +34,8 @@ public:
|
|||||||
|
|
||||||
QAtomicInt quitLockRef;
|
QAtomicInt quitLockRef;
|
||||||
|
|
||||||
QBasicAtomicInt exit; // bool
|
QAtomicInt exit; // bool
|
||||||
QBasicAtomicInt returnCode;
|
QAtomicInt returnCode;
|
||||||
bool inExec;
|
bool inExec;
|
||||||
|
|
||||||
void ref()
|
void ref()
|
||||||
|
@ -772,7 +772,7 @@ public:
|
|||||||
|
|
||||||
if constexpr (QtJniTypes::isObjectType<T>()) {
|
if constexpr (QtJniTypes::isObjectType<T>()) {
|
||||||
QtJniTypes::Detail::LocalFrame<T> frame(env);
|
QtJniTypes::Detail::LocalFrame<T> frame(env);
|
||||||
jobject element = frame.template convertToJni(val);
|
jobject element = frame.convertToJni(val);
|
||||||
env->SetObjectArrayElement(object<jobjectArray>(), i, element);
|
env->SetObjectArrayElement(object<jobjectArray>(), i, element);
|
||||||
} else { // primitive types
|
} else { // primitive types
|
||||||
if constexpr (QtJniTypes::sameTypeForJni<T, jbyte>)
|
if constexpr (QtJniTypes::sameTypeForJni<T, jbyte>)
|
||||||
|
@ -26,6 +26,8 @@
|
|||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
using namespace Qt::StringLiterals;
|
using namespace Qt::StringLiterals;
|
||||||
@ -741,6 +743,31 @@ inline int QMetaObjectPrivate::indexOfMethodRelative(const QMetaObject **baseObj
|
|||||||
\sa constructor(), constructorCount(), normalizedSignature()
|
\sa constructor(), constructorCount(), normalizedSignature()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if QT_DEPRECATED_SINCE(6, 10)
|
||||||
|
Q_DECL_COLD_FUNCTION
|
||||||
|
static int compat_indexOf(const char *what, const char *sig, const QMetaObject *mo,
|
||||||
|
int (*indexOf)(const QMetaObject *, const char *))
|
||||||
|
{
|
||||||
|
const QByteArray normalized = QByteArray(sig).replace("QVector<", "QList<");
|
||||||
|
const int i = indexOf(mo, normalized.data());
|
||||||
|
if (i >= 0) {
|
||||||
|
qWarning(R"(QMetaObject::indexOf%s: argument "%s" is not normalized, because it contains "QVector<". )"
|
||||||
|
R"(Earlier versions of Qt 6 incorrectly normalized QVector< to QList<, silently. )"
|
||||||
|
R"(This behavior is deprecated as of 6.10, and will be removed in a future version of Qt.)",
|
||||||
|
what, sig);
|
||||||
|
}
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
|
||||||
|
#define INDEXOF_COMPAT(what, arg) \
|
||||||
|
do { \
|
||||||
|
if (i < 0 && Q_UNLIKELY(std::strstr(arg, "QVector<"))) \
|
||||||
|
i = compat_indexOf(#what, arg, this, &indexOf ## what ## _helper); \
|
||||||
|
} while (false)
|
||||||
|
#else
|
||||||
|
#define INDEXOF_COMPAT(what, arg)
|
||||||
|
#endif // QT_DEPRECATED_SINCE(6, 10)
|
||||||
|
|
||||||
static int indexOfConstructor_helper(const QMetaObject *mo, const char *constructor)
|
static int indexOfConstructor_helper(const QMetaObject *mo, const char *constructor)
|
||||||
{
|
{
|
||||||
QArgumentTypeArray types;
|
QArgumentTypeArray types;
|
||||||
@ -752,6 +779,7 @@ int QMetaObject::indexOfConstructor(const char *constructor) const
|
|||||||
{
|
{
|
||||||
Q_ASSERT(priv(d.data)->revision >= 7);
|
Q_ASSERT(priv(d.data)->revision >= 7);
|
||||||
int i = indexOfConstructor_helper(this, constructor);
|
int i = indexOfConstructor_helper(this, constructor);
|
||||||
|
INDEXOF_COMPAT(Constructor, constructor);
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -782,6 +810,7 @@ int QMetaObject::indexOfMethod(const char *method) const
|
|||||||
{
|
{
|
||||||
const QMetaObject *m = this;
|
const QMetaObject *m = this;
|
||||||
int i = indexOfMethod_helper(m, method);
|
int i = indexOfMethod_helper(m, method);
|
||||||
|
INDEXOF_COMPAT(Method, method);
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -804,7 +833,6 @@ static void argumentTypesFromString(const char *str, const char *end,
|
|||||||
++str;
|
++str;
|
||||||
}
|
}
|
||||||
QByteArray argType(begin, str - begin);
|
QByteArray argType(begin, str - begin);
|
||||||
argType.replace("QVector<", "QList<");
|
|
||||||
types += QArgumentType(std::move(argType));
|
types += QArgumentType(std::move(argType));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -856,6 +884,7 @@ int QMetaObject::indexOfSignal(const char *signal) const
|
|||||||
{
|
{
|
||||||
const QMetaObject *m = this;
|
const QMetaObject *m = this;
|
||||||
int i = indexOfSignal_helper(m, signal);
|
int i = indexOfSignal_helper(m, signal);
|
||||||
|
INDEXOF_COMPAT(Signal, signal);
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -912,9 +941,12 @@ int QMetaObject::indexOfSlot(const char *slot) const
|
|||||||
{
|
{
|
||||||
const QMetaObject *m = this;
|
const QMetaObject *m = this;
|
||||||
int i = indexOfSlot_helper(m, slot);
|
int i = indexOfSlot_helper(m, slot);
|
||||||
|
INDEXOF_COMPAT(Slot, slot);
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef INDEXOF_COMPAT
|
||||||
|
|
||||||
// same as indexOfSignalRelative but for slots.
|
// same as indexOfSignalRelative but for slots.
|
||||||
int QMetaObjectPrivate::indexOfSlotRelative(const QMetaObject **m,
|
int QMetaObjectPrivate::indexOfSlotRelative(const QMetaObject **m,
|
||||||
QByteArrayView name, int argc,
|
QByteArrayView name, int argc,
|
||||||
|
@ -360,6 +360,17 @@ class QProperty : public QPropertyData<T>
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename U, typename = void>
|
||||||
|
struct has_operator_equal_to : std::false_type{};
|
||||||
|
|
||||||
|
template <typename U>
|
||||||
|
struct has_operator_equal_to<U, std::void_t<decltype(bool(std::declval<const T&>() == std::declval<const U&>()))>>
|
||||||
|
: std::true_type{};
|
||||||
|
|
||||||
|
template <typename U>
|
||||||
|
static constexpr bool has_operator_equal_to_v =
|
||||||
|
!std::is_same_v<U, T> && has_operator_equal_to<U>::value;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using value_type = typename QPropertyData<T>::value_type;
|
using value_type = typename QPropertyData<T>::value_type;
|
||||||
using parameter_type = typename QPropertyData<T>::parameter_type;
|
using parameter_type = typename QPropertyData<T>::parameter_type;
|
||||||
@ -388,6 +399,23 @@ public:
|
|||||||
QT_DECLARE_EQUALITY_OPERATORS_HELPER(QProperty, T, /* non-constexpr */, noexcept(false), template <typename Ty = T, std::enable_if_t<QTypeTraits::has_operator_equal_v<Ty>>* = nullptr>)
|
QT_DECLARE_EQUALITY_OPERATORS_HELPER(QProperty, T, /* non-constexpr */, noexcept(false), template <typename Ty = T, std::enable_if_t<QTypeTraits::has_operator_equal_v<Ty>>* = nullptr>)
|
||||||
QT_DECLARE_EQUALITY_OPERATORS_REVERSED_HELPER(QProperty, T, /* non-constexpr */, noexcept(false), template <typename Ty = T, std::enable_if_t<QTypeTraits::has_operator_equal_v<Ty>>* = nullptr>)
|
QT_DECLARE_EQUALITY_OPERATORS_REVERSED_HELPER(QProperty, T, /* non-constexpr */, noexcept(false), template <typename Ty = T, std::enable_if_t<QTypeTraits::has_operator_equal_v<Ty>>* = nullptr>)
|
||||||
|
|
||||||
|
QT_DECLARE_EQUALITY_OPERATORS_HELPER(QProperty, U, /* non-constexpr */, noexcept(false), template <typename U, std::enable_if_t<has_operator_equal_to_v<U>>* = nullptr>)
|
||||||
|
QT_DECLARE_EQUALITY_OPERATORS_REVERSED_HELPER(QProperty, U, /* non-constexpr */, noexcept(false), template <typename U, std::enable_if_t<has_operator_equal_to_v<U>>* = nullptr>)
|
||||||
|
|
||||||
|
// Explicitly delete op==(QProperty<T>, QProperty<U>) for different T & U.
|
||||||
|
// We do not want implicit conversions here!
|
||||||
|
// However, GCC complains about using a default template argument in a
|
||||||
|
// friend declaration, while Clang and MSVC are fine. So, skip GCC here.
|
||||||
|
#if !defined(Q_CC_GNU) || defined(Q_CC_CLANG)
|
||||||
|
#define QPROPERTY_DECL_DELETED_EQ_OP \
|
||||||
|
Q_DECL_EQ_DELETE_X("Call .value() on one of the properties explicitly.")
|
||||||
|
template <typename U, std::enable_if_t<!std::is_same_v<T, U>>* = nullptr>
|
||||||
|
friend void operator==(const QProperty &, const QProperty<U> &) QPROPERTY_DECL_DELETED_EQ_OP;
|
||||||
|
template <typename U, std::enable_if_t<!std::is_same_v<T, U>>* = nullptr>
|
||||||
|
friend void operator!=(const QProperty &, const QProperty<U> &) QPROPERTY_DECL_DELETED_EQ_OP;
|
||||||
|
#undef QPROPERTY_DECL_DELETED_EQ_OP
|
||||||
|
#endif // !defined(Q_CC_GNU) || defined(Q_CC_CLANG)
|
||||||
|
|
||||||
parameter_type value() const
|
parameter_type value() const
|
||||||
{
|
{
|
||||||
d.registerWithCurrentlyEvaluatingBinding();
|
d.registerWithCurrentlyEvaluatingBinding();
|
||||||
@ -520,6 +548,12 @@ private:
|
|||||||
return lhs.value() == rhs;
|
return lhs.value() == rhs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename U, std::enable_if_t<has_operator_equal_to_v<U>>* = nullptr>
|
||||||
|
friend bool comparesEqual(const QProperty &lhs, const U &rhs)
|
||||||
|
{
|
||||||
|
return lhs.value() == rhs;
|
||||||
|
}
|
||||||
|
|
||||||
void notify()
|
void notify()
|
||||||
{
|
{
|
||||||
d.notifyObservers(this);
|
d.notifyObservers(this);
|
||||||
|
@ -107,7 +107,22 @@ Q_CORE_EXPORT void QTest::qWait(int msecs)
|
|||||||
The code above will wait until the network server is responding for a
|
The code above will wait until the network server is responding for a
|
||||||
maximum of about 12.5 seconds.
|
maximum of about 12.5 seconds.
|
||||||
|
|
||||||
\sa QTest::qSleep(), QSignalSpy::wait()
|
The \l{QTRY_COMPARE()}{QTRY_*} macros are usually a better choice than
|
||||||
|
qWait(). qWait() always pauses for the full timeout, which can leave the
|
||||||
|
test idle and slow down execution.
|
||||||
|
|
||||||
|
The \c {QTRY_*} macros poll the condition until it succeeds or the timeout
|
||||||
|
expires. Your test therefore continues as soon as possible and stays more
|
||||||
|
reliable. If the condition still fails, the macros double the timeout once
|
||||||
|
and report the new value so that you can adjust it.
|
||||||
|
|
||||||
|
For example, rewrite the code above as:
|
||||||
|
|
||||||
|
\code
|
||||||
|
QTRY_VERIFY_WITH_TIMEOUT(!myNetworkServerNotResponding(), 12.5s);
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
\sa QTest::qSleep(), QSignalSpy::wait(), QTRY_VERIFY_WITH_TIMEOUT()
|
||||||
*/
|
*/
|
||||||
Q_CORE_EXPORT void QTest::qWait(std::chrono::milliseconds msecs)
|
Q_CORE_EXPORT void QTest::qWait(std::chrono::milliseconds msecs)
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
// Copyright (C) 2016 The Qt Company Ltd.
|
// Copyright (C) 2016 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||||
|
// Qt-Security score:critical reason:data-parser
|
||||||
|
|
||||||
#include "qmimeglobpattern_p.h"
|
#include "qmimeglobpattern_p.h"
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// Copyright (C) 2016 The Qt Company Ltd.
|
// Copyright (C) 2016 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||||
|
// Qt-Security score:critical reason:data-parser
|
||||||
|
|
||||||
#define QT_NO_CAST_FROM_ASCII
|
#define QT_NO_CAST_FROM_ASCII
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
// Copyright (C) 2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author David Faure <david.faure@kdab.com>
|
// Copyright (C) 2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author David Faure <david.faure@kdab.com>
|
||||||
// Copyright (C) 2019 Intel Corporation.
|
// Copyright (C) 2019 Intel Corporation.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||||
|
// Qt-Security score:critical reason:data-parser
|
||||||
|
|
||||||
#include "qmimeprovider_p.h"
|
#include "qmimeprovider_p.h"
|
||||||
|
|
||||||
@ -717,10 +718,24 @@ void QMimeXMLProvider::findByMagic(const QByteArray &data, QMimeMagicResult &res
|
|||||||
for (const QMimeMagicRuleMatcher &matcher : std::as_const(m_magicMatchers)) {
|
for (const QMimeMagicRuleMatcher &matcher : std::as_const(m_magicMatchers)) {
|
||||||
if (matcher.matches(data)) {
|
if (matcher.matches(data)) {
|
||||||
const int priority = matcher.priority();
|
const int priority = matcher.priority();
|
||||||
if (priority > result.accuracy) {
|
if (priority < result.accuracy)
|
||||||
result.accuracy = priority;
|
continue;
|
||||||
result.candidate = matcher.mimetype();
|
if (priority == result.accuracy) {
|
||||||
|
if (m_db->inherits(result.candidate, matcher.mimetype()))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (!m_db->inherits(matcher.mimetype(), result.candidate)) {
|
||||||
|
// Two or more magic rules matching, both with the same priority but not
|
||||||
|
// connected with one another should not happen:
|
||||||
|
qWarning("QMimeXMLProvider: MimeType is ambiguous between %ls and %ls",
|
||||||
|
qUtf16Printable(result.candidate),
|
||||||
|
qUtf16Printable(matcher.mimetype()));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
result.accuracy = priority;
|
||||||
|
result.candidate = matcher.mimetype();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -175,9 +175,14 @@ QJsonValue::QJsonValue(int v)
|
|||||||
/*!
|
/*!
|
||||||
\overload
|
\overload
|
||||||
Creates a value of type Double, with value \a v.
|
Creates a value of type Double, with value \a v.
|
||||||
NOTE: the integer limits for IEEE 754 double precision data is 2^53 (-9007199254740992 to +9007199254740992).
|
|
||||||
If you pass in values outside this range expect a loss of precision to occur.
|
This is stored internally as a 64-bit integer, so retains its full
|
||||||
*/
|
precision, as long as it is retrieved with \l toInteger(). However,
|
||||||
|
retrieving its value with \l toDouble() will lose precision unless the value
|
||||||
|
lies between ±2^53.
|
||||||
|
|
||||||
|
\sa toInteger(), toDouble()
|
||||||
|
*/
|
||||||
QJsonValue::QJsonValue(qint64 v)
|
QJsonValue::QJsonValue(qint64 v)
|
||||||
: value(v)
|
: value(v)
|
||||||
{
|
{
|
||||||
|
@ -83,7 +83,7 @@ void qt_doubleToAscii(double d, QLocaleData::DoubleForm form, int precision,
|
|||||||
template <typename UcsInt>
|
template <typename UcsInt>
|
||||||
[[nodiscard]] inline UcsInt unicodeForDigit(uint digit, UcsInt zero)
|
[[nodiscard]] inline UcsInt unicodeForDigit(uint digit, UcsInt zero)
|
||||||
{
|
{
|
||||||
// Must match qlocale.cpp's NumberTokenizer's digit-digestion.
|
// Must match qlocale.cpp's NumericTokenizer's digit-digestion.
|
||||||
Q_ASSERT(digit < 10);
|
Q_ASSERT(digit < 10);
|
||||||
if (!digit)
|
if (!digit)
|
||||||
return zero;
|
return zero;
|
||||||
|
@ -19,7 +19,7 @@ class QMutex;
|
|||||||
class QRecursiveMutex;
|
class QRecursiveMutex;
|
||||||
class QMutexPrivate;
|
class QMutexPrivate;
|
||||||
|
|
||||||
class Q_CORE_EXPORT QBasicMutex
|
class QT6_ONLY(Q_CORE_EXPORT) QBasicMutex
|
||||||
{
|
{
|
||||||
Q_DISABLE_COPY_MOVE(QBasicMutex)
|
Q_DISABLE_COPY_MOVE(QBasicMutex)
|
||||||
protected:
|
protected:
|
||||||
@ -88,18 +88,28 @@ private:
|
|||||||
return false;
|
return false;
|
||||||
return d_ptr.testAndSetAcquire(nullptr, dummyLocked());
|
return d_ptr.testAndSetAcquire(nullptr, dummyLocked());
|
||||||
}
|
}
|
||||||
|
#if QT_CORE_REMOVED_SINCE(6, 10)
|
||||||
|
inline bool fastTryUnlock() noexcept {
|
||||||
|
return d_ptr.testAndSetRelease(dummyLocked(), nullptr);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
QT7_ONLY(Q_CORE_EXPORT)
|
||||||
void lockInternal() noexcept(FutexAlwaysAvailable);
|
void lockInternal() noexcept(FutexAlwaysAvailable);
|
||||||
|
QT7_ONLY(Q_CORE_EXPORT)
|
||||||
bool lockInternal(QDeadlineTimer timeout) noexcept(FutexAlwaysAvailable);
|
bool lockInternal(QDeadlineTimer timeout) noexcept(FutexAlwaysAvailable);
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
|
#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
|
||||||
bool lockInternal(int timeout) noexcept(FutexAlwaysAvailable);
|
bool lockInternal(int timeout) noexcept(FutexAlwaysAvailable);
|
||||||
void unlockInternal() noexcept;
|
void unlockInternal() noexcept;
|
||||||
#endif
|
#endif
|
||||||
|
QT7_ONLY(Q_CORE_EXPORT)
|
||||||
void unlockInternalFutex(void *d) noexcept;
|
void unlockInternalFutex(void *d) noexcept;
|
||||||
|
QT7_ONLY(Q_CORE_EXPORT)
|
||||||
void unlockInternal(void *d) noexcept;
|
void unlockInternal(void *d) noexcept;
|
||||||
#if QT_CORE_REMOVED_SINCE(6, 9)
|
#if QT_CORE_REMOVED_SINCE(6, 9)
|
||||||
void destroyInternal(QMutexPrivate *d);
|
void destroyInternal(QMutexPrivate *d);
|
||||||
#endif
|
#endif
|
||||||
|
QT7_ONLY(Q_CORE_EXPORT)
|
||||||
void destroyInternal(void *d);
|
void destroyInternal(void *d);
|
||||||
|
|
||||||
QBasicAtomicPointer<QMutexPrivate> d_ptr;
|
QBasicAtomicPointer<QMutexPrivate> d_ptr;
|
||||||
@ -111,7 +121,7 @@ private:
|
|||||||
friend class QMutexPrivate;
|
friend class QMutexPrivate;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Q_CORE_EXPORT QMutex : public QBasicMutex
|
class QT6_ONLY(Q_CORE_EXPORT) QMutex : public QBasicMutex
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
constexpr QMutex() = default;
|
constexpr QMutex() = default;
|
||||||
@ -174,7 +184,7 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class Q_CORE_EXPORT QRecursiveMutex
|
class QT6_ONLY(Q_CORE_EXPORT) QRecursiveMutex
|
||||||
{
|
{
|
||||||
Q_DISABLE_COPY_MOVE(QRecursiveMutex)
|
Q_DISABLE_COPY_MOVE(QRecursiveMutex)
|
||||||
// written to by the thread that first owns 'mutex';
|
// written to by the thread that first owns 'mutex';
|
||||||
@ -187,6 +197,7 @@ class Q_CORE_EXPORT QRecursiveMutex
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
constexpr QRecursiveMutex() = default;
|
constexpr QRecursiveMutex() = default;
|
||||||
|
QT7_ONLY(Q_CORE_EXPORT)
|
||||||
~QRecursiveMutex();
|
~QRecursiveMutex();
|
||||||
|
|
||||||
|
|
||||||
@ -195,8 +206,10 @@ public:
|
|||||||
{ tryLock(QDeadlineTimer(QDeadlineTimer::Forever)); }
|
{ tryLock(QDeadlineTimer(QDeadlineTimer::Forever)); }
|
||||||
QT_CORE_INLINE_SINCE(6, 6)
|
QT_CORE_INLINE_SINCE(6, 6)
|
||||||
bool tryLock(int timeout) noexcept(LockIsNoexcept);
|
bool tryLock(int timeout) noexcept(LockIsNoexcept);
|
||||||
|
QT7_ONLY(Q_CORE_EXPORT)
|
||||||
bool tryLock(QDeadlineTimer timer = {}) noexcept(LockIsNoexcept);
|
bool tryLock(QDeadlineTimer timer = {}) noexcept(LockIsNoexcept);
|
||||||
// BasicLockable concept
|
// BasicLockable concept
|
||||||
|
QT7_ONLY(Q_CORE_EXPORT)
|
||||||
void unlock() noexcept;
|
void unlock() noexcept;
|
||||||
|
|
||||||
// Lockable concept
|
// Lockable concept
|
||||||
|
@ -5512,13 +5512,14 @@ QDateTime QDateTime::currentDateTime(const QTimeZone &zone)
|
|||||||
// convert, which is most efficiently done from UTC.
|
// convert, which is most efficiently done from UTC.
|
||||||
const Qt::TimeSpec spec = zone.timeSpec();
|
const Qt::TimeSpec spec = zone.timeSpec();
|
||||||
SYSTEMTIME st = {};
|
SYSTEMTIME st = {};
|
||||||
// GetSystemTime()'s page links to its partner page for GetLocalTime().
|
|
||||||
// https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getsystemtime
|
// https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getsystemtime
|
||||||
(spec == Qt::LocalTime ? GetLocalTime : GetSystemTime)(&st);
|
// We previously used GetLocalTime for spec == LocalTime but it didn't provide enough
|
||||||
|
// information to differentiate between repeated hours of a tradition and would report the same
|
||||||
|
// timezone (eg always CEST, never CET) for both. But toTimeZone handles it correctly, given
|
||||||
|
// the UTC time.
|
||||||
|
GetSystemTime(&st);
|
||||||
QDate d(st.wYear, st.wMonth, st.wDay);
|
QDate d(st.wYear, st.wMonth, st.wDay);
|
||||||
QTime t(msecsFromDecomposed(st.wHour, st.wMinute, st.wSecond, st.wMilliseconds));
|
QTime t(msecsFromDecomposed(st.wHour, st.wMinute, st.wSecond, st.wMilliseconds));
|
||||||
if (spec == Qt::LocalTime)
|
|
||||||
return QDateTime(d, t);
|
|
||||||
QDateTime utc(d, t, QTimeZone::UTC);
|
QDateTime utc(d, t, QTimeZone::UTC);
|
||||||
return spec == Qt::UTC ? utc : utc.toTimeZone(zone);
|
return spec == Qt::UTC ? utc : utc.toTimeZone(zone);
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,8 @@ void QContiguousCacheData::dump() const
|
|||||||
|
|
||||||
QContiguousCacheData *QContiguousCacheData::allocateData(qsizetype size, qsizetype alignment)
|
QContiguousCacheData *QContiguousCacheData::allocateData(qsizetype size, qsizetype alignment)
|
||||||
{
|
{
|
||||||
return static_cast<QContiguousCacheData *>(qMallocAligned(size_t(size), size_t(alignment)));
|
void *mem = qMallocAligned(size_t(size), size_t(alignment));
|
||||||
|
return new (mem) QContiguousCacheData{/*ref=*/1, 0, 0, 0, 0};
|
||||||
}
|
}
|
||||||
|
|
||||||
void QContiguousCacheData::freeData(QContiguousCacheData *data)
|
void QContiguousCacheData::freeData(QContiguousCacheData *data)
|
||||||
|
@ -152,7 +152,6 @@ template <typename T>
|
|||||||
void QContiguousCache<T>::detach_helper()
|
void QContiguousCache<T>::detach_helper()
|
||||||
{
|
{
|
||||||
Data *x = allocateData(d->alloc);
|
Data *x = allocateData(d->alloc);
|
||||||
x->ref.storeRelaxed(1);
|
|
||||||
x->count = d->count;
|
x->count = d->count;
|
||||||
x->start = d->start;
|
x->start = d->start;
|
||||||
x->offset = d->offset;
|
x->offset = d->offset;
|
||||||
@ -184,7 +183,6 @@ void QContiguousCache<T>::setCapacity(qsizetype asize)
|
|||||||
return;
|
return;
|
||||||
detach();
|
detach();
|
||||||
Data *x = allocateData(asize);
|
Data *x = allocateData(asize);
|
||||||
x->ref.storeRelaxed(1);
|
|
||||||
x->alloc = asize;
|
x->alloc = asize;
|
||||||
x->count = qMin(d->count, asize);
|
x->count = qMin(d->count, asize);
|
||||||
x->offset = d->offset + d->count - x->count;
|
x->offset = d->offset + d->count - x->count;
|
||||||
@ -231,7 +229,6 @@ void QContiguousCache<T>::clear()
|
|||||||
d->count = d->start = d->offset = 0;
|
d->count = d->start = d->offset = 0;
|
||||||
} else {
|
} else {
|
||||||
Data *x = allocateData(d->alloc);
|
Data *x = allocateData(d->alloc);
|
||||||
x->ref.storeRelaxed(1);
|
|
||||||
x->alloc = d->alloc;
|
x->alloc = d->alloc;
|
||||||
x->count = x->start = x->offset = 0;
|
x->count = x->start = x->offset = 0;
|
||||||
if (!d->ref.deref())
|
if (!d->ref.deref())
|
||||||
@ -251,7 +248,6 @@ QContiguousCache<T>::QContiguousCache(qsizetype cap)
|
|||||||
{
|
{
|
||||||
Q_ASSERT(cap >= 0);
|
Q_ASSERT(cap >= 0);
|
||||||
d = allocateData(cap);
|
d = allocateData(cap);
|
||||||
d->ref.storeRelaxed(1);
|
|
||||||
d->alloc = cap;
|
d->alloc = cap;
|
||||||
d->count = d->start = d->offset = 0;
|
d->count = d->start = d->offset = 0;
|
||||||
}
|
}
|
||||||
|
@ -50,6 +50,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define Q_REFCOUNT_INITIALIZE_STATIC { Q_BASIC_ATOMIC_INITIALIZER(-1) }
|
#define Q_REFCOUNT_INITIALIZE_STATIC { Q_BASIC_ATOMIC_INITIALIZER(-1) }
|
||||||
|
#define Q_REFCOUNT_INITIALIZE_OWNED { Q_BASIC_ATOMIC_INITIALIZER(1) }
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
@ -18,6 +18,9 @@ QT_BEGIN_NAMESPACE
|
|||||||
your cleanup code is executed, whether the function is exited normally,
|
your cleanup code is executed, whether the function is exited normally,
|
||||||
exited early by a return statement, or exited by an exception.
|
exited early by a return statement, or exited by an exception.
|
||||||
|
|
||||||
|
A scope guard can be disabled using dismiss(), in which case the function
|
||||||
|
is not run at all.
|
||||||
|
|
||||||
\note Exceptions are not supported. The callable shouldn't throw when
|
\note Exceptions are not supported. The callable shouldn't throw when
|
||||||
executed, copied or moved.
|
executed, copied or moved.
|
||||||
|
|
||||||
@ -28,7 +31,7 @@ QT_BEGIN_NAMESPACE
|
|||||||
\fn template <typename F> QScopeGuard<F>::QScopeGuard(F &&f)
|
\fn template <typename F> QScopeGuard<F>::QScopeGuard(F &&f)
|
||||||
\fn template <typename F> QScopeGuard<F>::QScopeGuard(const F &f)
|
\fn template <typename F> QScopeGuard<F>::QScopeGuard(const F &f)
|
||||||
|
|
||||||
Create a scope guard that will execute \a f at the end of the scope.
|
Creates a scope guard that will execute \a f at the end of the scope.
|
||||||
|
|
||||||
If \e F is a lambda, its type cannot be written. In that case you need to
|
If \e F is a lambda, its type cannot be written. In that case you need to
|
||||||
either rely on class template argument deduction (C++17 feature) and leave
|
either rely on class template argument deduction (C++17 feature) and leave
|
||||||
|
@ -1541,6 +1541,7 @@ QtSharedPointer::ExternalRefCountData *QtSharedPointer::ExternalRefCountData::ge
|
|||||||
ExternalRefCountData *x = ::new ExternalRefCountData(Qt::Uninitialized);
|
ExternalRefCountData *x = ::new ExternalRefCountData(Qt::Uninitialized);
|
||||||
x->strongref.storeRelaxed(-1);
|
x->strongref.storeRelaxed(-1);
|
||||||
x->weakref.storeRelaxed(2); // the QWeakPointer that called us plus the QObject itself
|
x->weakref.storeRelaxed(2); // the QWeakPointer that called us plus the QObject itself
|
||||||
|
x->destroyer = nullptr;
|
||||||
|
|
||||||
ExternalRefCountData *ret;
|
ExternalRefCountData *ret;
|
||||||
if (d->sharedRefcount.testAndSetOrdered(nullptr, x, ret)) { // ought to be release+acquire; this is acq_rel+acquire
|
if (d->sharedRefcount.testAndSetOrdered(nullptr, x, ret)) { // ought to be release+acquire; this is acq_rel+acquire
|
||||||
|
@ -360,8 +360,7 @@ public:
|
|||||||
inline QVarLengthArray(InputIterator first, InputIterator last)
|
inline QVarLengthArray(InputIterator first, InputIterator last)
|
||||||
: QVarLengthArray()
|
: QVarLengthArray()
|
||||||
{
|
{
|
||||||
QtPrivate::reserveIfForwardIterator(this, first, last);
|
assign(first, last);
|
||||||
std::copy(first, last, std::back_inserter(*this));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline ~QVarLengthArray()
|
inline ~QVarLengthArray()
|
||||||
|
@ -206,6 +206,21 @@ QDBusReply<uint> QDBusConnectionInterface::serviceUid(const QString &serviceName
|
|||||||
QList<QVariant>() << serviceName);
|
QList<QVariant>() << serviceName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\since 6.10
|
||||||
|
|
||||||
|
Returns the connection credentials for the process currently holding
|
||||||
|
the bus service \a serviceName.
|
||||||
|
|
||||||
|
See <https://dbus.freedesktop.org/doc/dbus-specification.html>
|
||||||
|
section: 'Method: org.freedesktop.DBus.GetConnectionCredentials' for more information.
|
||||||
|
*/
|
||||||
|
QDBusReply<QVariantMap> QDBusConnectionInterface::serviceCredentials(const QString &serviceName) const
|
||||||
|
{
|
||||||
|
return internalConstCall(QDBus::AutoDetect, "GetConnectionCredentials"_L1,
|
||||||
|
QList<QVariant>() << serviceName);
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Requests that the bus start the service given by the name \a name.
|
Requests that the bus start the service given by the name \a name.
|
||||||
*/
|
*/
|
||||||
|
@ -66,6 +66,8 @@ public Q_SLOTS:
|
|||||||
QDBusReply<uint> servicePid(const QString &serviceName) const;
|
QDBusReply<uint> servicePid(const QString &serviceName) const;
|
||||||
QDBusReply<uint> serviceUid(const QString &serviceName) const;
|
QDBusReply<uint> serviceUid(const QString &serviceName) const;
|
||||||
|
|
||||||
|
QDBusReply<QVariantMap> serviceCredentials(const QString &serviceName) const;
|
||||||
|
|
||||||
QDBusReply<void> startService(const QString &name);
|
QDBusReply<void> startService(const QString &name);
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
|
@ -1059,11 +1059,6 @@ qt_internal_extend_target(Gui CONDITION UNIX AND (QT_FEATURE_xcb OR NOT MACOS) A
|
|||||||
platform/unix/qgnometheme_p.h platform/unix/qgnometheme.cpp
|
platform/unix/qgnometheme_p.h platform/unix/qgnometheme.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
qt_internal_extend_target(Gui CONDITION UNIX AND QT_FEATURE_dbus AND (QT_FEATURE_xcb OR QT_FEATURE_wayland)
|
|
||||||
SOURCES
|
|
||||||
platform/unix/qgnomeportalinterface.cpp platform/unix/qgnomeportalinterface_p.h
|
|
||||||
)
|
|
||||||
|
|
||||||
qt_internal_extend_target(Gui CONDITION TARGET Qt::DBus AND UNIX AND (QT_FEATURE_xcb OR NOT MACOS) AND (QT_FEATURE_xcb OR NOT UIKIT)
|
qt_internal_extend_target(Gui CONDITION TARGET Qt::DBus AND UNIX AND (QT_FEATURE_xcb OR NOT MACOS) AND (QT_FEATURE_xcb OR NOT UIKIT)
|
||||||
SOURCES
|
SOURCES
|
||||||
platform/unix/dbusmenu/qdbusmenuadaptor.cpp platform/unix/dbusmenu/qdbusmenuadaptor_p.h
|
platform/unix/dbusmenu/qdbusmenuadaptor.cpp platform/unix/dbusmenu/qdbusmenuadaptor_p.h
|
||||||
@ -1074,6 +1069,7 @@ qt_internal_extend_target(Gui CONDITION TARGET Qt::DBus AND UNIX AND (QT_FEATURE
|
|||||||
platform/unix/dbusmenu/qdbusplatformmenu.cpp platform/unix/dbusmenu/qdbusplatformmenu_p.h
|
platform/unix/dbusmenu/qdbusplatformmenu.cpp platform/unix/dbusmenu/qdbusplatformmenu_p.h
|
||||||
platform/unix/qdbuslistener_p.h platform/unix/qdbuslistener.cpp
|
platform/unix/qdbuslistener_p.h platform/unix/qdbuslistener.cpp
|
||||||
platform/unix/qdbussettings_p.h platform/unix/qdbussettings.cpp
|
platform/unix/qdbussettings_p.h platform/unix/qdbussettings.cpp
|
||||||
|
platform/unix/qgnomeportalinterface.cpp platform/unix/qgnomeportalinterface_p.h
|
||||||
)
|
)
|
||||||
|
|
||||||
qt_internal_extend_target(Gui CONDITION QT_FEATURE_systemtrayicon AND TARGET Qt::DBus AND UNIX AND (QT_FEATURE_xcb OR NOT MACOS) AND (QT_FEATURE_xcb OR NOT UIKIT)
|
qt_internal_extend_target(Gui CONDITION QT_FEATURE_systemtrayicon AND TARGET Qt::DBus AND UNIX AND (QT_FEATURE_xcb OR NOT MACOS) AND (QT_FEATURE_xcb OR NOT UIKIT)
|
||||||
|
@ -1384,10 +1384,10 @@ void AtSpiAdaptor::sendFocusChanged(QAccessibleInterface *interface) const
|
|||||||
void AtSpiAdaptor::childrenChanged(QAccessibleInterface *interface) const
|
void AtSpiAdaptor::childrenChanged(QAccessibleInterface *interface) const
|
||||||
{
|
{
|
||||||
QString parentPath = pathForInterface(interface);
|
QString parentPath = pathForInterface(interface);
|
||||||
int childCount = interface->childCount();
|
const int childCount = interface->childCount();
|
||||||
for (int i = 0; i < interface->childCount(); ++i) {
|
for (int i = 0; i < childCount; ++i) {
|
||||||
QString childPath = pathForInterface(interface->child(i));
|
QString childPath = pathForInterface(interface->child(i));
|
||||||
QVariantList args = packDBusSignalArguments("add"_L1, childCount, 0, childPath);
|
QVariantList args = packDBusSignalArguments("add"_L1, i, 0, childPath);
|
||||||
sendDBusSignal(parentPath, ATSPI_DBUS_INTERFACE_EVENT_OBJECT ""_L1, "ChildrenChanged"_L1, args);
|
sendDBusSignal(parentPath, ATSPI_DBUS_INTERFACE_EVENT_OBJECT ""_L1, "ChildrenChanged"_L1, args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1401,9 +1401,9 @@ void AtSpiAdaptor::notifyAboutCreation(QAccessibleInterface *interface) const
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
QString path = pathForInterface(interface);
|
QString path = pathForInterface(interface);
|
||||||
int childCount = parent->childCount();
|
const int childIndex = parent->indexOfChild(interface);
|
||||||
QString parentPath = pathForInterface(parent);
|
QString parentPath = pathForInterface(parent);
|
||||||
QVariantList args = packDBusSignalArguments("add"_L1, childCount, 0, variantForPath(path));
|
QVariantList args = packDBusSignalArguments("add"_L1, childIndex, 0, variantForPath(path));
|
||||||
sendDBusSignal(parentPath, ATSPI_DBUS_INTERFACE_EVENT_OBJECT ""_L1, "ChildrenChanged"_L1, args);
|
sendDBusSignal(parentPath, ATSPI_DBUS_INTERFACE_EVENT_OBJECT ""_L1, "ChildrenChanged"_L1, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1513,6 +1513,12 @@ bool AtSpiAdaptor::applicationInterface(QAccessibleInterface *interface, const Q
|
|||||||
QDBusMessage reply = message.createReply(QVariant::fromValue(QDBusVariant(m_applicationId)));
|
QDBusMessage reply = message.createReply(QVariant::fromValue(QDBusVariant(m_applicationId)));
|
||||||
return connection.send(reply);
|
return connection.send(reply);
|
||||||
}
|
}
|
||||||
|
if (function == "GetAtspiVersion"_L1) {
|
||||||
|
Q_ASSERT(message.signature() == "ss"_L1);
|
||||||
|
// return "2.1" as described in the Application interface spec
|
||||||
|
QDBusMessage reply = message.createReply(QVariant::fromValue(QDBusVariant("2.1"_L1)));
|
||||||
|
return connection.send(reply);
|
||||||
|
}
|
||||||
if (function == "GetToolkitName"_L1) {
|
if (function == "GetToolkitName"_L1) {
|
||||||
Q_ASSERT(message.signature() == "ss"_L1);
|
Q_ASSERT(message.signature() == "ss"_L1);
|
||||||
QDBusMessage reply = message.createReply(QVariant::fromValue(QDBusVariant("Qt"_L1)));
|
QDBusMessage reply = message.createReply(QVariant::fromValue(QDBusVariant("Qt"_L1)));
|
||||||
@ -1528,7 +1534,8 @@ bool AtSpiAdaptor::applicationInterface(QAccessibleInterface *interface, const Q
|
|||||||
QDBusMessage reply = message.createReply(QVariant::fromValue(QLocale().name()));
|
QDBusMessage reply = message.createReply(QVariant::fromValue(QLocale().name()));
|
||||||
return connection.send(reply);
|
return connection.send(reply);
|
||||||
}
|
}
|
||||||
qCDebug(lcAccessibilityAtspi) << "AtSpiAdaptor::applicationInterface " << message.path() << interface << function;
|
qCWarning(lcAccessibilityAtspi) << "AtSpiAdaptor::applicationInterface does not implement"
|
||||||
|
<< function << message.path();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1537,13 +1544,12 @@ bool AtSpiAdaptor::applicationInterface(QAccessibleInterface *interface, const Q
|
|||||||
*/
|
*/
|
||||||
void AtSpiAdaptor::registerApplication()
|
void AtSpiAdaptor::registerApplication()
|
||||||
{
|
{
|
||||||
OrgA11yAtspiSocketInterface *registry;
|
OrgA11yAtspiSocketInterface registry(ATSPI_DBUS_NAME_REGISTRY ""_L1, ATSPI_DBUS_PATH_ROOT ""_L1,
|
||||||
registry = new OrgA11yAtspiSocketInterface(ATSPI_DBUS_NAME_REGISTRY ""_L1,
|
m_dbus->connection());
|
||||||
ATSPI_DBUS_PATH_ROOT ""_L1, m_dbus->connection());
|
|
||||||
|
|
||||||
QDBusPendingReply<QSpiObjectReference> reply;
|
QDBusPendingReply<QSpiObjectReference> reply;
|
||||||
QSpiObjectReference ref = QSpiObjectReference(m_dbus->connection(), QDBusObjectPath(ATSPI_DBUS_PATH_ROOT));
|
QSpiObjectReference ref = QSpiObjectReference(m_dbus->connection(), QDBusObjectPath(ATSPI_DBUS_PATH_ROOT));
|
||||||
reply = registry->Embed(ref);
|
reply = registry.Embed(ref);
|
||||||
reply.waitForFinished(); // TODO: make this async
|
reply.waitForFinished(); // TODO: make this async
|
||||||
if (reply.isValid ()) {
|
if (reply.isValid ()) {
|
||||||
const QSpiObjectReference &socket = reply.value();
|
const QSpiObjectReference &socket = reply.value();
|
||||||
@ -1553,7 +1559,6 @@ void AtSpiAdaptor::registerApplication()
|
|||||||
<< reply.error().name()
|
<< reply.error().name()
|
||||||
<< reply.error().message();
|
<< reply.error().message();
|
||||||
}
|
}
|
||||||
delete registry;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Accessible
|
// Accessible
|
||||||
|
@ -609,6 +609,9 @@ QFactoryLoader *qt_iconEngineFactoryLoader()
|
|||||||
QImageWriter::supportedImageFormats() functions to retrieve a
|
QImageWriter::supportedImageFormats() functions to retrieve a
|
||||||
complete list of the supported file formats.
|
complete list of the supported file formats.
|
||||||
|
|
||||||
|
\note If using an SVG image file, make sure to add it before any non-SVG files,
|
||||||
|
so that the correct \l{Icon Engines}{icon engine} gets selected.
|
||||||
|
|
||||||
\section1 Creating an icon from a theme or icon library
|
\section1 Creating an icon from a theme or icon library
|
||||||
|
|
||||||
The most convenient way to construct an icon is by using the
|
The most convenient way to construct an icon is by using the
|
||||||
|
@ -16,7 +16,11 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#include <QtCore/qlist.h>
|
#include <QtCore/qlist.h>
|
||||||
|
#include <QtCore/qsimd.h>
|
||||||
#include <QtGui/private/qcolormatrix_p.h>
|
#include <QtGui/private/qcolormatrix_p.h>
|
||||||
|
#if defined(__SSE2__)
|
||||||
|
#include <immintrin.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
@ -44,6 +48,43 @@ public:
|
|||||||
{
|
{
|
||||||
Q_ASSERT(table.size() == qsizetype(gridPointsX * gridPointsY * gridPointsZ * gridPointsW));
|
Q_ASSERT(table.size() == qsizetype(gridPointsX * gridPointsY * gridPointsZ * gridPointsW));
|
||||||
QColorVector frac;
|
QColorVector frac;
|
||||||
|
#if defined(__SSE2__)
|
||||||
|
const __m128 minV = _mm_setzero_ps();
|
||||||
|
const __m128 maxV = _mm_set1_ps(1.0f);
|
||||||
|
const __m128i gridPointsInt = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&gridPointsX));
|
||||||
|
const __m128 gridPointsV = _mm_cvtepi32_ps(_mm_add_epi32(gridPointsInt, _mm_set1_epi32(-1)));
|
||||||
|
__m128 c = _mm_loadu_ps(&v.x);
|
||||||
|
c = _mm_max_ps(c, minV);
|
||||||
|
c = _mm_min_ps(c, maxV);
|
||||||
|
c = _mm_mul_ps(c, gridPointsV);
|
||||||
|
#if !defined(__SSE4_1__)
|
||||||
|
const __m128 clo = _mm_cvtepi32_ps(_mm_cvttps_epi32(c)); // truncation == floor for x >= 0
|
||||||
|
#else
|
||||||
|
const __m128 clo = _mm_floor_ps(c);
|
||||||
|
#endif
|
||||||
|
__m128 chi = _mm_add_ps(clo, maxV);
|
||||||
|
chi = _mm_min_ps(chi, gridPointsV);
|
||||||
|
_mm_storeu_ps(reinterpret_cast<float *>(&frac), _mm_sub_ps(c, clo));
|
||||||
|
const __m128i ilo = _mm_cvtps_epi32(clo);
|
||||||
|
const __m128i ihi = _mm_cvtps_epi32(chi);
|
||||||
|
const uint32_t lox = _mm_cvtsi128_si32(ilo);
|
||||||
|
const uint32_t hix = _mm_cvtsi128_si32(ihi);
|
||||||
|
#if !defined(__SSE4_1__)
|
||||||
|
const uint32_t loy = _mm_cvtsi128_si32(_mm_shuffle_epi32(ilo, _MM_SHUFFLE(1, 1, 1, 1)));
|
||||||
|
const uint32_t loz = _mm_cvtsi128_si32(_mm_unpackhi_epi32(ilo, ilo));
|
||||||
|
const uint32_t low = _mm_cvtsi128_si32(_mm_shuffle_epi32(ilo, _MM_SHUFFLE(3, 3, 3, 3)));
|
||||||
|
const uint32_t hiy = _mm_cvtsi128_si32(_mm_shuffle_epi32(ihi, _MM_SHUFFLE(1, 1, 1, 1)));
|
||||||
|
const uint32_t hiz = _mm_cvtsi128_si32(_mm_unpackhi_epi32(ihi, ihi));
|
||||||
|
const uint32_t hiw = _mm_cvtsi128_si32(_mm_shuffle_epi32(ihi, _MM_SHUFFLE(3, 3, 3, 3)));
|
||||||
|
#else
|
||||||
|
const uint32_t loy = _mm_extract_epi32(ilo, 1);
|
||||||
|
const uint32_t loz = _mm_extract_epi32(ilo, 2);
|
||||||
|
const uint32_t low = _mm_extract_epi32(ilo, 3);
|
||||||
|
const uint32_t hiy = _mm_extract_epi32(ihi, 1);
|
||||||
|
const uint32_t hiz = _mm_extract_epi32(ihi, 2);
|
||||||
|
const uint32_t hiw = _mm_extract_epi32(ihi, 3);
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
const float x = std::clamp(v.x, 0.0f, 1.0f) * (gridPointsX - 1);
|
const float x = std::clamp(v.x, 0.0f, 1.0f) * (gridPointsX - 1);
|
||||||
const float y = std::clamp(v.y, 0.0f, 1.0f) * (gridPointsY - 1);
|
const float y = std::clamp(v.y, 0.0f, 1.0f) * (gridPointsY - 1);
|
||||||
const float z = std::clamp(v.z, 0.0f, 1.0f) * (gridPointsZ - 1);
|
const float z = std::clamp(v.z, 0.0f, 1.0f) * (gridPointsZ - 1);
|
||||||
@ -60,6 +101,7 @@ public:
|
|||||||
frac.y = y - static_cast<float>(loy);
|
frac.y = y - static_cast<float>(loy);
|
||||||
frac.z = z - static_cast<float>(loz);
|
frac.z = z - static_cast<float>(loz);
|
||||||
frac.w = w - static_cast<float>(low);
|
frac.w = w - static_cast<float>(low);
|
||||||
|
#endif
|
||||||
if (gridPointsW > 1) {
|
if (gridPointsW > 1) {
|
||||||
auto index = [&](qsizetype x, qsizetype y, qsizetype z, qsizetype w) -> qsizetype {
|
auto index = [&](qsizetype x, qsizetype y, qsizetype z, qsizetype w) -> qsizetype {
|
||||||
return x * gridPointsW * gridPointsZ * gridPointsY
|
return x * gridPointsW * gridPointsZ * gridPointsY
|
||||||
|
@ -3812,7 +3812,6 @@ QRegion::QRegion(const QRect &r, RegionType t)
|
|||||||
d = const_cast<QRegionData*>(&shared_empty);
|
d = const_cast<QRegionData*>(&shared_empty);
|
||||||
} else {
|
} else {
|
||||||
d = new QRegionData;
|
d = new QRegionData;
|
||||||
d->ref.initializeOwned();
|
|
||||||
if (t == Rectangle) {
|
if (t == Rectangle) {
|
||||||
d->qt_rgn = new QRegionPrivate(r);
|
d->qt_rgn = new QRegionPrivate(r);
|
||||||
} else if (t == Ellipse) {
|
} else if (t == Ellipse) {
|
||||||
@ -3831,7 +3830,6 @@ QRegion::QRegion(const QPolygon &a, Qt::FillRule fillRule)
|
|||||||
fillRule == Qt::WindingFill ? WindingRule : EvenOddRule);
|
fillRule == Qt::WindingFill ? WindingRule : EvenOddRule);
|
||||||
if (qt_rgn) {
|
if (qt_rgn) {
|
||||||
d = new QRegionData;
|
d = new QRegionData;
|
||||||
d->ref.initializeOwned();
|
|
||||||
d->qt_rgn = qt_rgn;
|
d->qt_rgn = qt_rgn;
|
||||||
} else {
|
} else {
|
||||||
d = const_cast<QRegionData*>(&shared_empty);
|
d = const_cast<QRegionData*>(&shared_empty);
|
||||||
@ -3854,7 +3852,6 @@ QRegion::QRegion(const QBitmap &bm)
|
|||||||
d = const_cast<QRegionData*>(&shared_empty);
|
d = const_cast<QRegionData*>(&shared_empty);
|
||||||
} else {
|
} else {
|
||||||
d = new QRegionData;
|
d = new QRegionData;
|
||||||
d->ref.initializeOwned();
|
|
||||||
d->qt_rgn = qt_bitmapToRegion(bm);
|
d->qt_rgn = qt_bitmapToRegion(bm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -121,7 +121,7 @@ Q_GUI_EXPORT
|
|||||||
void exec(const QByteArray &ba, int ver = 0, QDataStream::ByteOrder byteOrder = QDataStream::BigEndian);
|
void exec(const QByteArray &ba, int ver = 0, QDataStream::ByteOrder byteOrder = QDataStream::BigEndian);
|
||||||
#endif
|
#endif
|
||||||
struct QRegionData {
|
struct QRegionData {
|
||||||
QtPrivate::RefCount ref;
|
QtPrivate::RefCount ref = Q_REFCOUNT_INITIALIZE_OWNED;
|
||||||
QRegionPrivate *qt_rgn;
|
QRegionPrivate *qt_rgn;
|
||||||
};
|
};
|
||||||
struct QRegionData *d;
|
struct QRegionData *d;
|
||||||
|
@ -159,7 +159,7 @@ void QDxgiVSyncService::beginFrame(LUID)
|
|||||||
// else, then start from scratch.
|
// else, then start from scratch.
|
||||||
|
|
||||||
if (dxgiFactory && !dxgiFactory->IsCurrent()) {
|
if (dxgiFactory && !dxgiFactory->IsCurrent()) {
|
||||||
qWarning("QDxgiVSyncService: DXGI Factory is no longer Current");
|
qCDebug(lcQpaScreenUpdates, "QDxgiVSyncService: DXGI Factory is no longer Current");
|
||||||
QVarLengthArray<LUID, 8> luids;
|
QVarLengthArray<LUID, 8> luids;
|
||||||
for (auto it = adapters.begin(), end = adapters.end(); it != end; ++it)
|
for (auto it = adapters.begin(), end = adapters.end(); it != end; ++it)
|
||||||
luids.append(it->luid);
|
luids.append(it->luid);
|
||||||
|
@ -6612,18 +6612,11 @@ bool QGles2GraphicsPipeline::create()
|
|||||||
// force replacing existing cache entry (if there is one, then
|
// force replacing existing cache entry (if there is one, then
|
||||||
// something is wrong with it, as there was no hit)
|
// something is wrong with it, as there was no hit)
|
||||||
rhiD->trySaveToPipelineCache(program, cacheKey, true);
|
rhiD->trySaveToPipelineCache(program, cacheKey, true);
|
||||||
|
} else {
|
||||||
|
// legacy QOpenGLShaderProgram style behavior: the "pipeline cache"
|
||||||
|
// was not enabled, so instead store to the Qt 5 disk cache
|
||||||
|
rhiD->trySaveToDiskCache(program, cacheKey);
|
||||||
}
|
}
|
||||||
// legacy QOpenGLShaderProgram style behavior: do this always, even
|
|
||||||
// though it is superfluous with the "pipeline cache" enabled. Continue
|
|
||||||
// storing to the Qt 5 style individual-file disk cache, because there
|
|
||||||
// is no guarantee one retrieves the "pipeline cache" blob and writes it
|
|
||||||
// out. Classic example: if Qt Quick only retrieves and stores the
|
|
||||||
// combined cache contents when exiting, applications that never exit
|
|
||||||
// cleanly (because they are killed, Ctrl+C'd, etc.) never store any
|
|
||||||
// program binaries! Therefore, to maintain Qt 5 behavioral
|
|
||||||
// compatibility, continue writing out the individual files no matter
|
|
||||||
// what.
|
|
||||||
rhiD->trySaveToDiskCache(program, cacheKey);
|
|
||||||
} else {
|
} else {
|
||||||
Q_ASSERT(cacheResult == QRhiGles2::ProgramCacheHit);
|
Q_ASSERT(cacheResult == QRhiGles2::ProgramCacheHit);
|
||||||
if (rhiD->rhiFlags.testFlag(QRhi::EnablePipelineCacheDataSave)) {
|
if (rhiD->rhiFlags.testFlag(QRhi::EnablePipelineCacheDataSave)) {
|
||||||
@ -6739,9 +6732,11 @@ bool QGles2ComputePipeline::create()
|
|||||||
// force replacing existing cache entry (if there is one, then
|
// force replacing existing cache entry (if there is one, then
|
||||||
// something is wrong with it, as there was no hit)
|
// something is wrong with it, as there was no hit)
|
||||||
rhiD->trySaveToPipelineCache(program, cacheKey, true);
|
rhiD->trySaveToPipelineCache(program, cacheKey, true);
|
||||||
|
} else {
|
||||||
|
// legacy QOpenGLShaderProgram style behavior: the "pipeline cache"
|
||||||
|
// was not enabled, so instead store to the Qt 5 disk cache
|
||||||
|
rhiD->trySaveToDiskCache(program, cacheKey);
|
||||||
}
|
}
|
||||||
// legacy QOpenGLShaderProgram style behavior
|
|
||||||
rhiD->trySaveToDiskCache(program, cacheKey);
|
|
||||||
} else {
|
} else {
|
||||||
Q_ASSERT(cacheResult == QRhiGles2::ProgramCacheHit);
|
Q_ASSERT(cacheResult == QRhiGles2::ProgramCacheHit);
|
||||||
if (rhiD->rhiFlags.testFlag(QRhi::EnablePipelineCacheDataSave)) {
|
if (rhiD->rhiFlags.testFlag(QRhi::EnablePipelineCacheDataSave)) {
|
||||||
|
@ -6566,7 +6566,13 @@ bool QMetalSwapChain::createOrResize()
|
|||||||
desc.storageMode = MTLStorageModePrivate;
|
desc.storageMode = MTLStorageModePrivate;
|
||||||
desc.usage = MTLTextureUsageRenderTarget;
|
desc.usage = MTLTextureUsageRenderTarget;
|
||||||
for (int i = 0; i < QMTL_FRAMES_IN_FLIGHT; ++i) {
|
for (int i = 0; i < QMTL_FRAMES_IN_FLIGHT; ++i) {
|
||||||
[d->msaaTex[i] release];
|
if (d->msaaTex[i]) {
|
||||||
|
QRhiMetalData::DeferredReleaseEntry e;
|
||||||
|
e.type = QRhiMetalData::DeferredReleaseEntry::RenderBuffer;
|
||||||
|
e.lastActiveFrameSlot = 1; // because currentFrameSlot is reset to 0
|
||||||
|
e.renderbuffer.texture = d->msaaTex[i];
|
||||||
|
rhiD->d->releaseQueue.append(e);
|
||||||
|
}
|
||||||
d->msaaTex[i] = [rhiD->d->dev newTextureWithDescriptor: desc];
|
d->msaaTex[i] = [rhiD->d->dev newTextureWithDescriptor: desc];
|
||||||
}
|
}
|
||||||
[desc release];
|
[desc release];
|
||||||
|
@ -2581,7 +2581,7 @@ void QFont::clearVariableAxes()
|
|||||||
kerning property is set to false. Similarly, if it is set to 0, then it will always be disabled.
|
kerning property is set to false. Similarly, if it is set to 0, then it will always be disabled.
|
||||||
To reset a font feature to its default behavior, you can unset it using unsetFeature().
|
To reset a font feature to its default behavior, you can unset it using unsetFeature().
|
||||||
|
|
||||||
\sa QFont::Tag, clearFeatures(), setFeature(), unsetFeature(), featureTags()
|
\sa QFont::Tag, clearFeatures(), unsetFeature(), featureTags()
|
||||||
*/
|
*/
|
||||||
void QFont::setFeature(Tag tag, quint32 value)
|
void QFont::setFeature(Tag tag, quint32 value)
|
||||||
{
|
{
|
||||||
|
@ -421,7 +421,14 @@ void QFontEngine::initializeHeightMetrics() const
|
|||||||
!getSfntTable(QFont::Tag("EBLC").value()).isEmpty()
|
!getSfntTable(QFont::Tag("EBLC").value()).isEmpty()
|
||||||
|| !getSfntTable(QFont::Tag("CBLC").value()).isEmpty()
|
|| !getSfntTable(QFont::Tag("CBLC").value()).isEmpty()
|
||||||
|| !getSfntTable(QFont::Tag("bdat").value()).isEmpty();
|
|| !getSfntTable(QFont::Tag("bdat").value()).isEmpty();
|
||||||
if (!hasEmbeddedBitmaps) {
|
|
||||||
|
// When porting applications from Qt 5 to Qt 6, users have noticed differences in line
|
||||||
|
// metrics due to the effort to consolidate these across platforms instead of using the
|
||||||
|
// system values directly. This environment variable gives a "last resort" for those users
|
||||||
|
// to tell Qt to prefer the metrics we get from the system, despite the fact these being
|
||||||
|
// inconsistent across platforms.
|
||||||
|
static bool useSystemLineMetrics = qEnvironmentVariableIntValue("QT_USE_SYSTEM_LINE_METRICS") > 0;
|
||||||
|
if (!hasEmbeddedBitmaps && !useSystemLineMetrics) {
|
||||||
// Get HHEA table values if available
|
// Get HHEA table values if available
|
||||||
processHheaTable();
|
processHheaTable();
|
||||||
|
|
||||||
@ -496,6 +503,13 @@ QFixed QFontEngine::leading() const
|
|||||||
return m_leading;
|
return m_leading;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QFixed QFontEngine::emSquareSize() const
|
||||||
|
{
|
||||||
|
qCWarning(lcQpaFonts) << "Font engine does not reimplement emSquareSize(). Returning minimum value.";
|
||||||
|
return 16;
|
||||||
|
}
|
||||||
|
|
||||||
QFixed QFontEngine::ascent() const
|
QFixed QFontEngine::ascent() const
|
||||||
{
|
{
|
||||||
if (!m_heightMetricsQueried)
|
if (!m_heightMetricsQueried)
|
||||||
@ -2354,6 +2368,9 @@ glyph_metrics_t QFontEngineMulti::boundingBox(glyph_t glyph)
|
|||||||
return engine(which)->boundingBox(stripped(glyph));
|
return engine(which)->boundingBox(stripped(glyph));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QFixed QFontEngineMulti::emSquareSize() const
|
||||||
|
{ return engine(0)->emSquareSize(); }
|
||||||
|
|
||||||
QFixed QFontEngineMulti::ascent() const
|
QFixed QFontEngineMulti::ascent() const
|
||||||
{ return engine(0)->ascent(); }
|
{ return engine(0)->ascent(); }
|
||||||
|
|
||||||
|
@ -163,7 +163,7 @@ public:
|
|||||||
|| QChar::category(ucs4) == QChar::Other_Control;
|
|| QChar::category(ucs4) == QChar::Other_Control;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual QFixed emSquareSize() const { return ascent(); }
|
virtual QFixed emSquareSize() const;
|
||||||
|
|
||||||
/* returns 0 as glyph index for non existent glyphs */
|
/* returns 0 as glyph index for non existent glyphs */
|
||||||
virtual glyph_t glyphIndex(uint ucs4) const = 0;
|
virtual glyph_t glyphIndex(uint ucs4) const = 0;
|
||||||
@ -425,6 +425,7 @@ public:
|
|||||||
virtual glyph_metrics_t boundingBox(glyph_t glyph) override;
|
virtual glyph_metrics_t boundingBox(glyph_t glyph) override;
|
||||||
virtual QFontEngine *cloneWithSize(qreal pixelSize) const override;
|
virtual QFontEngine *cloneWithSize(qreal pixelSize) const override;
|
||||||
|
|
||||||
|
virtual QFixed emSquareSize() const override { return _size; }
|
||||||
virtual QFixed ascent() const override;
|
virtual QFixed ascent() const override;
|
||||||
virtual QFixed capHeight() const override;
|
virtual QFixed capHeight() const override;
|
||||||
virtual QFixed descent() const override;
|
virtual QFixed descent() const override;
|
||||||
@ -463,6 +464,7 @@ public:
|
|||||||
virtual void addOutlineToPath(qreal, qreal, const QGlyphLayout &, QPainterPath *, QTextItem::RenderFlags flags) override;
|
virtual void addOutlineToPath(qreal, qreal, const QGlyphLayout &, QPainterPath *, QTextItem::RenderFlags flags) override;
|
||||||
virtual void getGlyphBearings(glyph_t glyph, qreal *leftBearing = nullptr, qreal *rightBearing = nullptr) override;
|
virtual void getGlyphBearings(glyph_t glyph, qreal *leftBearing = nullptr, qreal *rightBearing = nullptr) override;
|
||||||
|
|
||||||
|
virtual QFixed emSquareSize() const override;
|
||||||
virtual QFixed ascent() const override;
|
virtual QFixed ascent() const override;
|
||||||
virtual QFixed capHeight() const override;
|
virtual QFixed capHeight() const override;
|
||||||
virtual QFixed descent() const override;
|
virtual QFixed descent() const override;
|
||||||
|
@ -1894,7 +1894,7 @@ void QTextDocumentLayoutPrivate::drawTableCell(const QRectF &cellRect, QPainter
|
|||||||
}
|
}
|
||||||
|
|
||||||
// paint over the background - otherwise we would have to adjust the background paint cellRect for the border values
|
// paint over the background - otherwise we would have to adjust the background paint cellRect for the border values
|
||||||
if (cellBorderConfigured)
|
if (cellBorderConfigured || (td->borderCollapse && td->border != 0))
|
||||||
drawTableCellBorder(cellRect, painter, table, td, cell);
|
drawTableCellBorder(cellRect, painter, table, td, cell);
|
||||||
|
|
||||||
const QFixed verticalOffset = td->cellVerticalOffsets.at(c + r * table->columns());
|
const QFixed verticalOffset = td->cellVerticalOffsets.at(c + r * table->columns());
|
||||||
|
@ -357,79 +357,6 @@ QStringList QWindowsDirectWriteFontDatabase::fallbacksForFamily(const QString &f
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
void QWindowsDirectWriteFontDatabase::collectAdditionalNames(T *font,
|
|
||||||
wchar_t *defaultLocale,
|
|
||||||
wchar_t *englishLocale,
|
|
||||||
std::function<void(const std::pair<QString, QString> &)> registerFamily)
|
|
||||||
{
|
|
||||||
BOOL ok;
|
|
||||||
QString defaultLocaleGdiCompatibleFamilyName;
|
|
||||||
QString englishLocaleGdiCompatibleFamilyName;
|
|
||||||
|
|
||||||
const bool hasDefaultLocale = defaultLocale != nullptr;
|
|
||||||
Q_ASSERT(englishLocale != nullptr);
|
|
||||||
|
|
||||||
IDWriteLocalizedStrings *names = nullptr;
|
|
||||||
if (SUCCEEDED(font->GetInformationalStrings(DWRITE_INFORMATIONAL_STRING_WIN32_FAMILY_NAMES, &names, &ok)) && ok) {
|
|
||||||
defaultLocaleGdiCompatibleFamilyName = hasDefaultLocale ? localeString(names, defaultLocale) : QString();
|
|
||||||
englishLocaleGdiCompatibleFamilyName = localeString(names, englishLocale);
|
|
||||||
|
|
||||||
names->Release();
|
|
||||||
}
|
|
||||||
|
|
||||||
QString defaultLocaleGdiCompatibleStyleName;
|
|
||||||
QString englishLocaleGdiCompatibleStyleName;
|
|
||||||
if (SUCCEEDED(font->GetInformationalStrings(DWRITE_INFORMATIONAL_STRING_WIN32_SUBFAMILY_NAMES, &names, &ok)) && ok) {
|
|
||||||
defaultLocaleGdiCompatibleStyleName = hasDefaultLocale ? localeString(names, defaultLocale) : QString();
|
|
||||||
englishLocaleGdiCompatibleStyleName = localeString(names, englishLocale);
|
|
||||||
|
|
||||||
names->Release();
|
|
||||||
}
|
|
||||||
|
|
||||||
QString defaultLocaleTypographicFamilyName;
|
|
||||||
QString englishLocaleTypographicFamilyName;
|
|
||||||
if (SUCCEEDED(font->GetInformationalStrings(DWRITE_INFORMATIONAL_STRING_TYPOGRAPHIC_FAMILY_NAMES, &names, &ok)) && ok) {
|
|
||||||
defaultLocaleTypographicFamilyName = hasDefaultLocale ? localeString(names, defaultLocale) : QString();
|
|
||||||
englishLocaleTypographicFamilyName = localeString(names, englishLocale);
|
|
||||||
|
|
||||||
names->Release();
|
|
||||||
}
|
|
||||||
|
|
||||||
QString defaultLocaleTypographicStyleName;
|
|
||||||
QString englishLocaleTypographicStyleName;
|
|
||||||
if (SUCCEEDED(font->GetInformationalStrings(DWRITE_INFORMATIONAL_STRING_TYPOGRAPHIC_SUBFAMILY_NAMES, &names, &ok)) && ok) {
|
|
||||||
defaultLocaleTypographicStyleName = hasDefaultLocale ? localeString(names, defaultLocale) : QString();
|
|
||||||
englishLocaleTypographicStyleName = localeString(names, englishLocale);
|
|
||||||
|
|
||||||
names->Release();
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
const auto key = std::make_pair(englishLocaleGdiCompatibleFamilyName, englishLocaleGdiCompatibleStyleName);
|
|
||||||
if (!englishLocaleGdiCompatibleFamilyName.isEmpty())
|
|
||||||
registerFamily(key);
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
const auto key = std::make_pair(defaultLocaleGdiCompatibleFamilyName, defaultLocaleGdiCompatibleStyleName);
|
|
||||||
if (!defaultLocaleGdiCompatibleFamilyName.isEmpty())
|
|
||||||
registerFamily(key);
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
const auto key = std::make_pair(englishLocaleTypographicFamilyName, englishLocaleTypographicStyleName);
|
|
||||||
if (!englishLocaleTypographicFamilyName.isEmpty())
|
|
||||||
registerFamily(key);
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
const auto key = std::make_pair(defaultLocaleTypographicFamilyName, defaultLocaleTypographicStyleName);
|
|
||||||
if (!defaultLocaleTypographicFamilyName.isEmpty())
|
|
||||||
registerFamily(key);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QStringList QWindowsDirectWriteFontDatabase::addApplicationFont(const QByteArray &fontData, const QString &fileName, QFontDatabasePrivate::ApplicationFont *applicationFont)
|
QStringList QWindowsDirectWriteFontDatabase::addApplicationFont(const QByteArray &fontData, const QString &fileName, QFontDatabasePrivate::ApplicationFont *applicationFont)
|
||||||
{
|
{
|
||||||
qCDebug(lcQpaFonts) << "Adding application font" << fileName;
|
qCDebug(lcQpaFonts) << "Adding application font" << fileName;
|
||||||
@ -450,7 +377,6 @@ QStringList QWindowsDirectWriteFontDatabase::addApplicationFont(const QByteArray
|
|||||||
return QStringList();
|
return QStringList();
|
||||||
}
|
}
|
||||||
|
|
||||||
QSet<std::pair<QString, QString> > registeredFonts;
|
|
||||||
QSet<QString> ret;
|
QSet<QString> ret;
|
||||||
for (int i = 0; i < faces.size(); ++i) {
|
for (int i = 0; i < faces.size(); ++i) {
|
||||||
IDWriteFontFace *face = faces.at(i);
|
IDWriteFontFace *face = faces.at(i);
|
||||||
@ -467,46 +393,6 @@ QStringList QWindowsDirectWriteFontDatabase::addApplicationFont(const QByteArray
|
|||||||
DirectWriteScope<IDWriteFontFace3> face3;
|
DirectWriteScope<IDWriteFontFace3> face3;
|
||||||
if (SUCCEEDED(face->QueryInterface(__uuidof(IDWriteFontFace3),
|
if (SUCCEEDED(face->QueryInterface(__uuidof(IDWriteFontFace3),
|
||||||
reinterpret_cast<void **>(&face3)))) {
|
reinterpret_cast<void **>(&face3)))) {
|
||||||
|
|
||||||
QFont::Stretch stretch = fromDirectWriteStretch(face3->GetStretch());
|
|
||||||
QFont::Style style = fromDirectWriteStyle(face3->GetStyle());
|
|
||||||
QFont::Weight weight = fromDirectWriteWeight(face3->GetWeight());
|
|
||||||
bool fixed = face3->IsMonospacedFont();
|
|
||||||
bool color = face3->IsColorFont();
|
|
||||||
|
|
||||||
auto registerFamilyAndStyle = [&](const std::pair<QString, QString> &familyAndStyle)
|
|
||||||
{
|
|
||||||
if (registeredFonts.contains(familyAndStyle))
|
|
||||||
return;
|
|
||||||
registeredFonts.insert(familyAndStyle);
|
|
||||||
ret.insert(familyAndStyle.first);
|
|
||||||
|
|
||||||
qCDebug(lcQpaFonts) << "\tRegistering alternative:" << familyAndStyle.first
|
|
||||||
<< ":" << familyAndStyle.second;
|
|
||||||
if (applicationFont != nullptr) {
|
|
||||||
QFontDatabasePrivate::ApplicationFont::Properties properties;
|
|
||||||
properties.style = style;
|
|
||||||
properties.weight = weight;
|
|
||||||
properties.familyName = familyAndStyle.first;
|
|
||||||
properties.styleName = familyAndStyle.second;
|
|
||||||
applicationFont->properties.append(properties);
|
|
||||||
}
|
|
||||||
|
|
||||||
QPlatformFontDatabase::registerFont(familyAndStyle.first,
|
|
||||||
familyAndStyle.second,
|
|
||||||
QString(),
|
|
||||||
weight,
|
|
||||||
style,
|
|
||||||
stretch,
|
|
||||||
antialias,
|
|
||||||
scalable,
|
|
||||||
size,
|
|
||||||
fixed,
|
|
||||||
color,
|
|
||||||
writingSystems,
|
|
||||||
new FontHandle(face, familyAndStyle.first));
|
|
||||||
};
|
|
||||||
|
|
||||||
QString defaultLocaleFamilyName;
|
QString defaultLocaleFamilyName;
|
||||||
QString englishLocaleFamilyName;
|
QString englishLocaleFamilyName;
|
||||||
|
|
||||||
@ -527,6 +413,49 @@ QStringList QWindowsDirectWriteFontDatabase::addApplicationFont(const QByteArray
|
|||||||
names->Release();
|
names->Release();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL ok;
|
||||||
|
QString defaultLocaleGdiCompatibleFamilyName;
|
||||||
|
QString englishLocaleGdiCompatibleFamilyName;
|
||||||
|
if (SUCCEEDED(face3->GetInformationalStrings(DWRITE_INFORMATIONAL_STRING_WIN32_FAMILY_NAMES, &names, &ok)) && ok) {
|
||||||
|
defaultLocaleGdiCompatibleFamilyName = hasDefaultLocale ? localeString(names, defaultLocale) : QString();
|
||||||
|
englishLocaleGdiCompatibleFamilyName = localeString(names, englishLocale);
|
||||||
|
|
||||||
|
names->Release();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString defaultLocaleGdiCompatibleStyleName;
|
||||||
|
QString englishLocaleGdiCompatibleStyleName;
|
||||||
|
if (SUCCEEDED(face3->GetInformationalStrings(DWRITE_INFORMATIONAL_STRING_WIN32_SUBFAMILY_NAMES, &names, &ok)) && ok) {
|
||||||
|
defaultLocaleGdiCompatibleStyleName = hasDefaultLocale ? localeString(names, defaultLocale) : QString();
|
||||||
|
englishLocaleGdiCompatibleStyleName = localeString(names, englishLocale);
|
||||||
|
|
||||||
|
names->Release();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString defaultLocaleTypographicFamilyName;
|
||||||
|
QString englishLocaleTypographicFamilyName;
|
||||||
|
if (SUCCEEDED(face3->GetInformationalStrings(DWRITE_INFORMATIONAL_STRING_TYPOGRAPHIC_FAMILY_NAMES, &names, &ok)) && ok) {
|
||||||
|
defaultLocaleTypographicFamilyName = hasDefaultLocale ? localeString(names, defaultLocale) : QString();
|
||||||
|
englishLocaleTypographicFamilyName = localeString(names, englishLocale);
|
||||||
|
|
||||||
|
names->Release();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString defaultLocaleTypographicStyleName;
|
||||||
|
QString englishLocaleTypographicStyleName;
|
||||||
|
if (SUCCEEDED(face3->GetInformationalStrings(DWRITE_INFORMATIONAL_STRING_TYPOGRAPHIC_SUBFAMILY_NAMES, &names, &ok)) && ok) {
|
||||||
|
defaultLocaleTypographicStyleName = hasDefaultLocale ? localeString(names, defaultLocale) : QString();
|
||||||
|
englishLocaleTypographicStyleName = localeString(names, englishLocale);
|
||||||
|
|
||||||
|
names->Release();
|
||||||
|
}
|
||||||
|
|
||||||
|
QFont::Stretch stretch = fromDirectWriteStretch(face3->GetStretch());
|
||||||
|
QFont::Style style = fromDirectWriteStyle(face3->GetStyle());
|
||||||
|
QFont::Weight weight = fromDirectWriteWeight(face3->GetWeight());
|
||||||
|
bool fixed = face3->IsMonospacedFont();
|
||||||
|
bool color = face3->IsColorFont();
|
||||||
|
|
||||||
qCDebug(lcQpaFonts) << "\tFont names:" << englishLocaleFamilyName << ", " << defaultLocaleFamilyName
|
qCDebug(lcQpaFonts) << "\tFont names:" << englishLocaleFamilyName << ", " << defaultLocaleFamilyName
|
||||||
<< ", style names:" << englishLocaleStyleName << ", " << defaultLocaleStyleName
|
<< ", style names:" << englishLocaleStyleName << ", " << defaultLocaleStyleName
|
||||||
<< ", stretch:" << stretch
|
<< ", stretch:" << stretch
|
||||||
@ -534,22 +463,161 @@ QStringList QWindowsDirectWriteFontDatabase::addApplicationFont(const QByteArray
|
|||||||
<< ", weight:" << weight
|
<< ", weight:" << weight
|
||||||
<< ", fixed:" << fixed;
|
<< ", fixed:" << fixed;
|
||||||
|
|
||||||
{
|
if (!englishLocaleFamilyName.isEmpty()) {
|
||||||
const auto key = std::make_pair(englishLocaleFamilyName, englishLocaleStyleName);
|
if (applicationFont != nullptr) {
|
||||||
if (!englishLocaleFamilyName.isEmpty())
|
QFontDatabasePrivate::ApplicationFont::Properties properties;
|
||||||
registerFamilyAndStyle(key);
|
properties.style = style;
|
||||||
|
properties.weight = weight;
|
||||||
|
properties.familyName = englishLocaleFamilyName;
|
||||||
|
properties.styleName = englishLocaleStyleName;
|
||||||
|
applicationFont->properties.append(properties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ret.insert(englishLocaleFamilyName);
|
||||||
|
QPlatformFontDatabase::registerFont(englishLocaleFamilyName,
|
||||||
|
englishLocaleStyleName,
|
||||||
|
QString(),
|
||||||
|
weight,
|
||||||
|
style,
|
||||||
|
stretch,
|
||||||
|
antialias,
|
||||||
|
scalable,
|
||||||
|
size,
|
||||||
|
fixed,
|
||||||
|
color,
|
||||||
|
writingSystems,
|
||||||
|
new FontHandle(face, englishLocaleFamilyName));
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
if (!defaultLocaleFamilyName.isEmpty() && !ret.contains(defaultLocaleFamilyName)) {
|
||||||
const auto key = std::make_pair(defaultLocaleFamilyName, defaultLocaleStyleName);
|
if (applicationFont != nullptr) {
|
||||||
if (!defaultLocaleFamilyName.isEmpty())
|
QFontDatabasePrivate::ApplicationFont::Properties properties;
|
||||||
registerFamilyAndStyle(key);
|
properties.style = style;
|
||||||
|
properties.weight = weight;
|
||||||
|
properties.familyName = englishLocaleFamilyName;
|
||||||
|
properties.styleName = englishLocaleStyleName;
|
||||||
|
applicationFont->properties.append(properties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ret.insert(defaultLocaleFamilyName);
|
||||||
|
QPlatformFontDatabase::registerFont(defaultLocaleFamilyName,
|
||||||
|
defaultLocaleStyleName,
|
||||||
|
QString(),
|
||||||
|
weight,
|
||||||
|
style,
|
||||||
|
stretch,
|
||||||
|
antialias,
|
||||||
|
scalable,
|
||||||
|
size,
|
||||||
|
fixed,
|
||||||
|
color,
|
||||||
|
writingSystems,
|
||||||
|
new FontHandle(face, defaultLocaleFamilyName));
|
||||||
}
|
}
|
||||||
|
|
||||||
collectAdditionalNames(*face3,
|
if (!englishLocaleGdiCompatibleFamilyName.isEmpty() &&
|
||||||
hasDefaultLocale ? defaultLocale : nullptr,
|
!ret.contains(englishLocaleGdiCompatibleFamilyName)) {
|
||||||
englishLocale,
|
if (applicationFont != nullptr) {
|
||||||
registerFamilyAndStyle);
|
QFontDatabasePrivate::ApplicationFont::Properties properties;
|
||||||
|
properties.style = style;
|
||||||
|
properties.weight = weight;
|
||||||
|
properties.familyName = englishLocaleGdiCompatibleFamilyName;
|
||||||
|
applicationFont->properties.append(properties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ret.insert(englishLocaleGdiCompatibleFamilyName);
|
||||||
|
QPlatformFontDatabase::registerFont(englishLocaleGdiCompatibleFamilyName,
|
||||||
|
englishLocaleGdiCompatibleStyleName,
|
||||||
|
QString(),
|
||||||
|
weight,
|
||||||
|
style,
|
||||||
|
stretch,
|
||||||
|
antialias,
|
||||||
|
scalable,
|
||||||
|
size,
|
||||||
|
fixed,
|
||||||
|
color,
|
||||||
|
writingSystems,
|
||||||
|
new FontHandle(face, englishLocaleGdiCompatibleFamilyName));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!defaultLocaleGdiCompatibleFamilyName.isEmpty()
|
||||||
|
&& !ret.contains(defaultLocaleGdiCompatibleFamilyName)) {
|
||||||
|
if (applicationFont != nullptr) {
|
||||||
|
QFontDatabasePrivate::ApplicationFont::Properties properties;
|
||||||
|
properties.style = style;
|
||||||
|
properties.weight = weight;
|
||||||
|
properties.familyName = defaultLocaleGdiCompatibleFamilyName;
|
||||||
|
applicationFont->properties.append(properties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ret.insert(defaultLocaleGdiCompatibleFamilyName);
|
||||||
|
QPlatformFontDatabase::registerFont(defaultLocaleGdiCompatibleFamilyName,
|
||||||
|
defaultLocaleGdiCompatibleStyleName,
|
||||||
|
QString(),
|
||||||
|
weight,
|
||||||
|
style,
|
||||||
|
stretch,
|
||||||
|
antialias,
|
||||||
|
scalable,
|
||||||
|
size,
|
||||||
|
fixed,
|
||||||
|
color,
|
||||||
|
writingSystems,
|
||||||
|
new FontHandle(face, defaultLocaleGdiCompatibleFamilyName));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!englishLocaleTypographicFamilyName.isEmpty()
|
||||||
|
&& !ret.contains(englishLocaleTypographicFamilyName)) {
|
||||||
|
if (applicationFont != nullptr) {
|
||||||
|
QFontDatabasePrivate::ApplicationFont::Properties properties;
|
||||||
|
properties.style = style;
|
||||||
|
properties.weight = weight;
|
||||||
|
properties.familyName = englishLocaleTypographicFamilyName;
|
||||||
|
applicationFont->properties.append(properties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ret.insert(englishLocaleTypographicFamilyName);
|
||||||
|
QPlatformFontDatabase::registerFont(englishLocaleTypographicFamilyName,
|
||||||
|
englishLocaleTypographicStyleName,
|
||||||
|
QString(),
|
||||||
|
weight,
|
||||||
|
style,
|
||||||
|
stretch,
|
||||||
|
antialias,
|
||||||
|
scalable,
|
||||||
|
size,
|
||||||
|
fixed,
|
||||||
|
color,
|
||||||
|
writingSystems,
|
||||||
|
new FontHandle(face, englishLocaleTypographicFamilyName));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!defaultLocaleTypographicFamilyName.isEmpty()
|
||||||
|
&& !ret.contains(defaultLocaleTypographicFamilyName)) {
|
||||||
|
if (applicationFont != nullptr) {
|
||||||
|
QFontDatabasePrivate::ApplicationFont::Properties properties;
|
||||||
|
properties.style = style;
|
||||||
|
properties.weight = weight;
|
||||||
|
properties.familyName = defaultLocaleTypographicFamilyName;
|
||||||
|
applicationFont->properties.append(properties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ret.insert(defaultLocaleTypographicFamilyName);
|
||||||
|
QPlatformFontDatabase::registerFont(defaultLocaleTypographicFamilyName,
|
||||||
|
defaultLocaleTypographicStyleName,
|
||||||
|
QString(),
|
||||||
|
weight,
|
||||||
|
style,
|
||||||
|
stretch,
|
||||||
|
antialias,
|
||||||
|
scalable,
|
||||||
|
size,
|
||||||
|
fixed,
|
||||||
|
color,
|
||||||
|
writingSystems,
|
||||||
|
new FontHandle(face, defaultLocaleTypographicFamilyName));
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
qCWarning(lcQpaFonts) << "Unable to query IDWriteFontFace3 interface from font face.";
|
qCWarning(lcQpaFonts) << "Unable to query IDWriteFontFace3 interface from font face.";
|
||||||
@ -610,59 +678,44 @@ void QWindowsDirectWriteFontDatabase::populateFontDatabase()
|
|||||||
if (SUCCEEDED(factory6->GetSystemFontCollection(false,
|
if (SUCCEEDED(factory6->GetSystemFontCollection(false,
|
||||||
DWRITE_FONT_FAMILY_MODEL_TYPOGRAPHIC,
|
DWRITE_FONT_FAMILY_MODEL_TYPOGRAPHIC,
|
||||||
&fontCollection))) {
|
&fontCollection))) {
|
||||||
QSet<QString> registeredFamilies;
|
|
||||||
for (uint i = 0; i < fontCollection->GetFontFamilyCount(); ++i) {
|
for (uint i = 0; i < fontCollection->GetFontFamilyCount(); ++i) {
|
||||||
DirectWriteScope<IDWriteFontFamily2> fontFamily;
|
DirectWriteScope<IDWriteFontFamily2> fontFamily;
|
||||||
if (SUCCEEDED(fontCollection->GetFontFamily(i, &fontFamily))) {
|
if (SUCCEEDED(fontCollection->GetFontFamily(i, &fontFamily))) {
|
||||||
auto registerFamily = [&](const std::pair<QString, QString> &familyAndStyle) {
|
|
||||||
const QString registeredFamily = familyAndStyle.first;
|
|
||||||
if (registeredFamilies.contains(registeredFamily))
|
|
||||||
return;
|
|
||||||
registeredFamilies.insert(registeredFamily);
|
|
||||||
|
|
||||||
qCDebug(lcQpaFonts) << "Registering font family" << registeredFamily;
|
|
||||||
registerFontFamily(registeredFamily);
|
|
||||||
m_populatedFonts.insert(registeredFamily, *fontFamily);
|
|
||||||
fontFamily->AddRef();
|
|
||||||
|
|
||||||
if (registeredFamily == defaultFontName
|
|
||||||
&& defaultFontName != systemDefaultFontName) {
|
|
||||||
qCDebug(lcQpaFonts) << "Adding default font" << systemDefaultFontName
|
|
||||||
<< "as alternative to" << registeredFamily;
|
|
||||||
|
|
||||||
m_populatedFonts.insert(systemDefaultFontName, *fontFamily);
|
|
||||||
fontFamily->AddRef();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
QString defaultLocaleName;
|
QString defaultLocaleName;
|
||||||
QString englishLocaleName;
|
QString englishLocaleName;
|
||||||
|
|
||||||
DirectWriteScope<IDWriteLocalizedStrings> names;
|
DirectWriteScope<IDWriteLocalizedStrings> names;
|
||||||
if (SUCCEEDED(fontFamily->GetFamilyNames(&names))) {
|
if (SUCCEEDED(fontFamily->GetFamilyNames(&names))) {
|
||||||
if (hasDefaultLocale)
|
if (hasDefaultLocale)
|
||||||
defaultLocaleName = localeString(*names, defaultLocale);
|
defaultLocaleName = localeString(*names, defaultLocale);
|
||||||
|
|
||||||
englishLocaleName = localeString(*names, englishLocale);
|
englishLocaleName = localeString(*names, englishLocale);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
qCDebug(lcQpaFonts) << "Registering font, english name = " << englishLocaleName << ", name in current locale = " << defaultLocaleName;
|
||||||
const auto key = std::make_pair(defaultLocaleName, QString{});
|
if (!defaultLocaleName.isEmpty()) {
|
||||||
if (!defaultLocaleName.isEmpty())
|
registerFontFamily(defaultLocaleName);
|
||||||
registerFamily(key);
|
m_populatedFonts.insert(defaultLocaleName, *fontFamily);
|
||||||
|
fontFamily->AddRef();
|
||||||
|
|
||||||
|
if (defaultLocaleName == defaultFontName && defaultFontName != systemDefaultFontName) {
|
||||||
|
qCDebug(lcQpaFonts) << "Adding default font" << systemDefaultFontName << "as alternative to" << defaultLocaleName;
|
||||||
|
|
||||||
|
m_populatedFonts.insert(systemDefaultFontName, *fontFamily);
|
||||||
|
fontFamily->AddRef();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
if (!englishLocaleName.isEmpty() && englishLocaleName != defaultLocaleName) {
|
||||||
const auto key = std::make_pair(englishLocaleName, QString{});
|
registerFontFamily(englishLocaleName);
|
||||||
if (!englishLocaleName.isEmpty())
|
m_populatedFonts.insert(englishLocaleName, *fontFamily);
|
||||||
registerFamily(key);
|
fontFamily->AddRef();
|
||||||
}
|
|
||||||
|
|
||||||
for (uint j = 0; j < fontFamily->GetFontCount(); ++j) {
|
if (englishLocaleName == defaultFontName && defaultFontName != systemDefaultFontName) {
|
||||||
DirectWriteScope<IDWriteFont3> font;
|
qCDebug(lcQpaFonts) << "Adding default font" << systemDefaultFontName << "as alternative to" << englishLocaleName;
|
||||||
if (SUCCEEDED(fontFamily->GetFont(j, &font))) {
|
|
||||||
collectAdditionalNames(*font,
|
m_populatedFonts.insert(systemDefaultFontName, *fontFamily);
|
||||||
hasDefaultLocale ? defaultLocale : nullptr,
|
fontFamily->AddRef();
|
||||||
englishLocale,
|
|
||||||
registerFamily);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -69,12 +69,6 @@ private:
|
|||||||
friend class QWindowsFontEngineDirectWrite;
|
friend class QWindowsFontEngineDirectWrite;
|
||||||
static QString localeString(IDWriteLocalizedStrings *names, wchar_t localeName[]);
|
static QString localeString(IDWriteLocalizedStrings *names, wchar_t localeName[]);
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
static void collectAdditionalNames(T *fontFace,
|
|
||||||
wchar_t *defaultLocale,
|
|
||||||
wchar_t *englishLocale,
|
|
||||||
std::function<void(const std::pair<QString, QString> &)> registerFamily);
|
|
||||||
|
|
||||||
QSupportedWritingSystems supportedWritingSystems(IDWriteFontFace *face) const;
|
QSupportedWritingSystems supportedWritingSystems(IDWriteFontFace *face) const;
|
||||||
|
|
||||||
QHash<QString, IDWriteFontFamily *> m_populatedFonts;
|
QHash<QString, IDWriteFontFamily *> m_populatedFonts;
|
||||||
|
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