Skip to content

Commit

Permalink
Merge integration refs/builds/qtci/dev/1618585460
Browse files Browse the repository at this point in the history
  • Loading branch information
Qt CI Bot committed Apr 16, 2021
2 parents 9319298 + fdedcb6 commit 5839dee
Show file tree
Hide file tree
Showing 23 changed files with 644 additions and 316 deletions.
28 changes: 19 additions & 9 deletions cmake/QtModuleHelpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
function(qt_internal_add_module target)
qt_internal_module_info(module "${target}")

# TODO: Remove GENERATE_METATYPES once it's not used anymore.
# Process arguments:
qt_parse_all_arguments(arg "qt_add_module"
"NO_MODULE_HEADERS;STATIC;DISABLE_TOOLS_EXPORT;EXCEPTIONS;INTERNAL_MODULE;NO_SYNC_QT;NO_PRIVATE_MODULE;HEADER_MODULE;GENERATE_METATYPES;NO_CONFIG_HEADER_FILE;SKIP_DEPENDS_INCLUDE;NO_ADDITIONAL_TARGET_INFO"
"NO_MODULE_HEADERS;STATIC;DISABLE_TOOLS_EXPORT;EXCEPTIONS;INTERNAL_MODULE;NO_SYNC_QT;NO_PRIVATE_MODULE;HEADER_MODULE;GENERATE_METATYPES;NO_GENERATE_METATYPES;NO_CONFIG_HEADER_FILE;SKIP_DEPENDS_INCLUDE;NO_ADDITIONAL_TARGET_INFO"
"MODULE_INCLUDE_NAME;CONFIG_MODULE_NAME;PRECOMPILED_HEADER;CONFIGURE_FILE_PATH;${__default_target_info_args}"
"${__default_private_args};${__default_public_args};${__default_private_module_args};QMAKE_MODULE_CONFIG;EXTRA_CMAKE_FILES;EXTRA_CMAKE_INCLUDES;NO_PCH_SOURCES" ${ARGN})

Expand Down Expand Up @@ -498,15 +499,24 @@ set(QT_CMAKE_EXPORT_NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE})")
endif()

# Generate metatypes
if (${arg_GENERATE_METATYPES})
set(metatypes_install_dir ${INSTALL_LIBDIR}/metatypes)
set(args)
if (NOT QT_WILL_INSTALL)
set(args COPY_OVER_INSTALL INSTALL_DIR "${QT_BUILD_DIR}/${metatypes_install_dir}")
else()
set(args INSTALL_DIR "${metatypes_install_dir}")
if(${arg_GENERATE_METATYPES})
# No mention of NO_GENERATE_METATYPES. You should not use it.
message(WARNING "GENERATE_METATYPES is on by default for Qt modules. Please remove the manual specification.")
endif()
if (NOT ${arg_NO_GENERATE_METATYPES})
get_target_property(target_type ${target} TYPE)
if (NOT target_type STREQUAL "INTERFACE_LIBRARY")
set(metatypes_install_dir ${INSTALL_LIBDIR}/metatypes)
set(args)
if (NOT QT_WILL_INSTALL)
set(args COPY_OVER_INSTALL INSTALL_DIR "${QT_BUILD_DIR}/${metatypes_install_dir}")
else()
set(args INSTALL_DIR "${metatypes_install_dir}")
endif()
qt6_extract_metatypes(${target} ${args})
elseif(${arg_GENERATE_METATYPES})
message(FATAL_ERROR "Meta types generation does not work on interface libraries")
endif()
qt6_extract_metatypes(${target} ${args})
endif()
qt_internal_get_min_new_policy_cmake_version(min_new_policy_version)
qt_internal_get_max_new_policy_cmake_version(max_new_policy_version)
Expand Down
5 changes: 5 additions & 0 deletions config.tests/cmake_zstd/check_zstd.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
file(ARCHIVE_CREATE
OUTPUT cmake_zstd.zstd
PATHS "${CMAKE_CURRENT_LIST_FILE}"
FORMAT raw
COMPRESSION Zstd)
18 changes: 18 additions & 0 deletions configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,24 @@ qt_feature("zstd" PRIVATE
LABEL "Zstandard support"
CONDITION ZSTD_FOUND
)
# special case begin
# Check whether CMake was built with zstd support.
# See https://gitlab.kitware.com/cmake/cmake/-/issues/21552
if(NOT DEFINED CACHE{QT_CMAKE_ZSTD_SUPPORT})
set(QT_CMAKE_ZSTD_SUPPORT FALSE CACHE INTERNAL "")
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.18")
execute_process(COMMAND "${CMAKE_COMMAND}"
-P "${CMAKE_CURRENT_SOURCE_DIR}/config.tests/cmake_zstd/check_zstd.cmake"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/config.tests"
OUTPUT_QUIET ERROR_QUIET
RESULT_VARIABLE qt_check_zstd_exit_code)
if(qt_check_zstd_exit_code EQUAL 0)
set(QT_CMAKE_ZSTD_SUPPORT TRUE CACHE INTERNAL "")
endif()
unset(qt_check_zstd_exit_code)
endif()
endif()
# special case end
qt_feature("thread" PUBLIC
SECTION "Kernel"
LABEL "Thread support"
Expand Down
2 changes: 1 addition & 1 deletion examples/widgets/tools/settingseditor/settingstree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ void SettingsTree::updateChildItems(QTreeWidgetItem *parent)
if (value.userType() == QMetaType::UnknownType) {
child->setText(1, "Invalid");
} else {
if (value.type() == QVariant::String) {
if (value.typeId() == QMetaType::QString) {
const QString stringValue = value.toString();
if (m_typeChecker->boolExp.match(stringValue).hasMatch()) {
value.setValue(stringValue.compare("true", Qt::CaseInsensitive) == 0);
Expand Down
6 changes: 6 additions & 0 deletions src/corelib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ endif()

qt_internal_add_module(Core
QMAKE_MODULE_CONFIG moc resources
NO_GENERATE_METATYPES # metatypes are extracted manually below
EXCEPTIONS
SOURCES
global/archdetect.cpp
Expand Down Expand Up @@ -1186,6 +1187,11 @@ if(QT_FEATURE_mimetype AND QT_FEATURE_mimetype_database)
)
else()
if(QT_FEATURE_zstd)
if(NOT QT_CMAKE_ZSTD_SUPPORT)
message(FATAL_ERROR
"CMake was not built with zstd support. "
"Rebuild CMake or set QT_AVOID_CMAKE_ARCHIVING_API=ON.")
endif()
set(qmime_db_compression Zstd)
string(APPEND qmime_db_content "#define MIME_DATABASE_IS_ZSTD\n")
else()
Expand Down
12 changes: 11 additions & 1 deletion src/corelib/doc/src/external-resources.qdoc
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@

/*!
\externalpage https://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/functions.html
\title Oracle: JNI Functions
\title Java: JNI Functions
*/

/*!
Expand All @@ -90,3 +90,13 @@
\externalpage https://developer.android.com/training/articles/perf-jni#local-and-global-references
\title JNI tips: Local and global references
*/

/*!
\externalpage https://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/invocation.html#attach_current_thread
\title Java: AttachCurrentThread
*/

/*!
\externalpage https://docs.oracle.com/en/java/javase/13/docs/specs/jni/functions.html#interface-function-table
\title Java: Interface Function Table
*/
16 changes: 7 additions & 9 deletions src/corelib/doc/src/objectmodel/bindableproperties.qdoc
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@
The binding expression computes the value by reading other QProperty values.
Behind the scenes this dependency is tracked. Whenever a change in any property's
dependency is detected, the binding expression is re-evaluated and the new
result is applied to the property. This happens lazily, by marking the binding
as dirty and evaluating it only when the property's value is requested. For example:
result is applied to the property. For example:

\code
QProperty<QString> firstname("John");
Expand All @@ -63,20 +62,19 @@

qDebug() << fullname.value(); // Prints "John Smith age: 41"

firstname = "Emma"; // Marks binding expression as dirty
firstname = "Emma"; // Triggers binding reevaluation

qDebug() << fullname.value(); // Re-evaluates the binding expression and prints "Emma Smith age: 41"
qDebug() << fullname.value(); // Prints the new value "Emma Smith age: 41"

// Birthday is coming up
age.setValue(age.value() + 1);
age.setValue(age.value() + 1); // Triggers re-evaluation

qDebug() << fullname.value(); // Re-evaluates the binding expression and prints "Emma Smith age: 42"
qDebug() << fullname.value(); // Prints "Emma Smith age: 42"
\endcode

When a new value is assigned to the \c firstname property, the binding
expression for \c fullname is marked as dirty. So when the last \c qDebug() statement
tries to read the name value of the \c fullname property, the expression is
evaluated again, \c firstname() will be called again and return the new value.
expression for \c fullname is reevaluated. So when the last \c qDebug() statement
tries to read the name value of the \c fullname property, the new value is returned.

Since bindings are C++ functions, they may do anything that's possible
in C++. This includes calling other functions. If those functions access values
Expand Down
6 changes: 4 additions & 2 deletions src/corelib/kernel/qjnienvironment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ QT_BEGIN_NAMESPACE
Since \c JNIEnv doesn't do much error checking, such as exception checking and clearing,
QJniEnvironment allows you to do that easily.
For more information about JNIEnv, see \l {Java: Interface Function Table}.
\note This API has been designed and tested for use with Android.
It has not been tested for other platforms.
*/
Expand Down Expand Up @@ -266,7 +268,7 @@ bool QJniEnvironment::registerNativeMethods(const char *className, JNINativeMeth
In contrast to \l QJniObject, which handles exceptions internally, if you
make JNI calls directly via \c JNIEnv, you need to clear any potential
exceptions after the call using this function. For more information about
\c JNIEnv calls that can throw an exception, see \l {Oracle: JNI Functions}{JNI Functions}.
\c JNIEnv calls that can throw an exception, see \l {Java: JNI Functions}{JNI Functions}.
\return \c true when a pending exception was cleared.
*/
Expand All @@ -293,7 +295,7 @@ bool QJniEnvironment::checkAndClearExceptions(QJniEnvironment::OutputMode output
In contrast to \l QJniObject, which handles exceptions internally, if you
make JNI calls directly via \c JNIEnv, you need to clear any potential
exceptions after the call using this function. For more information about
\c JNIEnv calls that can throw an exception, see \l {Oracle: JNI Functions}{JNI Functions}.
\c JNIEnv calls that can throw an exception, see \l {Java: JNI Functions}{JNI Functions}.
\return \c true when a pending exception was cleared.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/corelib/kernel/qjniobject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ QT_BEGIN_NAMESPACE
\l {JNI Design Overview: Global and Local References}. Local references
created outside a native method scope must be deleted manually, since
the garbage collector will not free them automatically because we are using
\c AttachCurrentThread. For more information, see
\l {Java: AttachCurrentThread}{AttachCurrentThread}. For more information, see
\l {JNI tips: Local and global references}.
If you want to keep a Java object alive you need to either create a new global
Expand Down
Loading

0 comments on commit 5839dee

Please sign in to comment.