From 7b6c526ef1857101a0274ff8d945d4ce08c9bd61 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 4 Mar 2021 10:42:34 +0100 Subject: [PATCH 1/4] Fix double inclusion of QtAutoDetect.cmake in top-level build The variable we need to check is called QT_SUPERBUILD, not QT_SUPER_BUILD. Pick-to: 6.1 6.0 Change-Id: I8487f491a0a4cebdf08f579519e99e6afe3db8c2 Reviewed-by: Alexey Edelev Reviewed-by: Cristian Adam --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5fb65fbd28..2e05aa52e8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,7 @@ qt_internal_check_for_suitable_cmake_version() # Run auto detection routines, but not when doing standalone tests. In that case, the detection # results are taken from either QtBuildInternals or the qt.toolchain.cmake file. Also, inhibit # auto-detection in a top-level build, because the top-level project file already includes it. -if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_SUPER_BUILD) +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_SUPERBUILD) include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/QtAutoDetect.cmake) endif() From 728baba70a389dd13411819a4ec5db6004fb1e97 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 26 Feb 2021 10:18:29 +0100 Subject: [PATCH 2/4] Complete the renaming of qt_add_tool to qt_internal_add_tool Fix the name in the function's doc comment and error messages. Pick-to: 6.1 Change-Id: I918db802a0dbb0508f65d227f7c896d2ad0beeae Reviewed-by: Alexey Edelev Reviewed-by: Craig Scott Reviewed-by: Cristian Adam --- cmake/QtToolHelpers.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/QtToolHelpers.cmake b/cmake/QtToolHelpers.cmake index e052479b6c..5fcc539b56 100644 --- a/cmake/QtToolHelpers.cmake +++ b/cmake/QtToolHelpers.cmake @@ -8,7 +8,7 @@ # We must pass this function a target name obtained from # qt_get_tool_target_name like this: # qt_get_tool_target_name(target_name my_tool) -# qt_add_tool(${target_name}) +# qt_internal_add_tool(${target_name}) # # Arguments: # EXTRA_CMAKE_FILES @@ -25,7 +25,7 @@ function(qt_internal_add_tool target_name) qt_tool_target_to_name(name ${target_name}) set(one_value_keywords TOOLS_TARGET EXTRA_CMAKE_FILES INSTALL_DIR ${__default_target_info_args}) - qt_parse_all_arguments(arg "qt_add_tool" "BOOTSTRAP;NO_INSTALL;USER_FACING" + qt_parse_all_arguments(arg "qt_internal_add_tool" "BOOTSTRAP;NO_INSTALL;USER_FACING" "${one_value_keywords}" "${__default_private_args}" ${ARGN}) @@ -39,7 +39,7 @@ function(qt_internal_add_tool target_name) if(CMAKE_CROSSCOMPILING AND QT_BUILD_TOOLS_WHEN_CROSSCOMPILING AND (name STREQUAL target_name)) message(FATAL_ERROR - "qt_add_tool must be passed a target obtained from qt_get_tool_target_name.") + "qt_internal_add_tool must be passed a target obtained from qt_get_tool_target_name.") endif() set(full_name "${QT_CMAKE_EXPORT_NAMESPACE}::${name}") From 4b9173e3540bd5a80b98be2f41832ae877c2cd1d Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 3 Mar 2021 20:20:51 +0100 Subject: [PATCH 3/4] Fix QT_HOST_LIBEXECS for cross-builds on Windows Like for LibraryExecutables, we must default to "bin" on Windows for HostLibraryExecutables in our generated qconfig.cpp. Pick-to: 6.1 Fixes: QTBUG-91496 Change-Id: Ib5a4b3b3fd6192bd953e615058b482e67ad19462 Reviewed-by: Cristian Adam --- src/corelib/global/qconfig.cpp.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/corelib/global/qconfig.cpp.in b/src/corelib/global/qconfig.cpp.in index 57a5b4116e..b529e19830 100644 --- a/src/corelib/global/qconfig.cpp.in +++ b/src/corelib/global/qconfig.cpp.in @@ -86,7 +86,11 @@ static const struct { { "Sysroot", "" }, { "SysrootifyPrefix", "" }, { "HostBinaries", "bin" }, +#ifdef Q_OS_WIN + { "HostLibraryExecutables", "bin" }, +#else { "HostLibraryExecutables", "libexec" }, +#endif { "HostLibraries", "lib" }, { "HostData", "." }, { "TargetSpec", "" }, From 6e5e8016dd3f0d2bc31ac692843c653cb1872fc9 Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Wed, 3 Mar 2021 16:23:53 +0100 Subject: [PATCH 4/4] Fix build of Core module without regularexpression feature qregularexpression.h requires FEATURE_regularexpression to be enabled. Add a condition to the 'qt_pch.h' header to fix the build when PCH are enabled and FEATURE_regularexpression is disabled. It seems that the filter implementation of QSortFilterProxyModel has QRegularExpression as its base. It's necessary to make sortfilterproxymodel dependent on the regularexpression feature. Fix the precompiler condition for the extractSections function in the QString implementation. Use the same precompiler condition for the QString::section and extractSections functions, since QString::section depends on extractSections. Change-Id: I5b775e0842a0aa1a8d47f8dded376bdfcf63b5bf Reviewed-by: Joerg Bornemann --- src/corelib/.prev_configure.cmake | 2 +- src/corelib/configure.cmake | 2 +- src/corelib/configure.json | 2 +- src/corelib/global/qconfig-bootstrapped.h | 2 -- src/corelib/global/qt_pch.h | 4 +++- src/corelib/itemmodels/qsortfilterproxymodel.cpp | 4 ---- src/corelib/itemmodels/qsortfilterproxymodel.h | 10 +--------- src/corelib/text/qstring.cpp | 4 +--- 8 files changed, 8 insertions(+), 22 deletions(-) diff --git a/src/corelib/.prev_configure.cmake b/src/corelib/.prev_configure.cmake index 9b69329c9b..63238845a0 100644 --- a/src/corelib/.prev_configure.cmake +++ b/src/corelib/.prev_configure.cmake @@ -782,7 +782,7 @@ qt_feature("sortfilterproxymodel" PUBLIC SECTION "ItemViews" LABEL "QSortFilterProxyModel" PURPOSE "Supports sorting and filtering of data passed between another model and a view." - CONDITION QT_FEATURE_proxymodel + CONDITION QT_FEATURE_proxymodel AND QT_FEATURE_regularexpression ) qt_feature_definition("sortfilterproxymodel" "QT_NO_SORTFILTERPROXYMODEL" NEGATE VALUE "1") qt_feature("identityproxymodel" PUBLIC diff --git a/src/corelib/configure.cmake b/src/corelib/configure.cmake index 6dab11b5a5..0b272a6c70 100644 --- a/src/corelib/configure.cmake +++ b/src/corelib/configure.cmake @@ -788,7 +788,7 @@ qt_feature("sortfilterproxymodel" PUBLIC SECTION "ItemViews" LABEL "QSortFilterProxyModel" PURPOSE "Supports sorting and filtering of data passed between another model and a view." - CONDITION QT_FEATURE_proxymodel + CONDITION QT_FEATURE_proxymodel AND QT_FEATURE_regularexpression ) qt_feature_definition("sortfilterproxymodel" "QT_NO_SORTFILTERPROXYMODEL" NEGATE VALUE "1") qt_feature("identityproxymodel" PUBLIC diff --git a/src/corelib/configure.json b/src/corelib/configure.json index 9c8615cf74..b1ba89cd39 100644 --- a/src/corelib/configure.json +++ b/src/corelib/configure.json @@ -898,7 +898,7 @@ "label": "QSortFilterProxyModel", "purpose": "Supports sorting and filtering of data passed between another model and a view.", "section": "ItemViews", - "condition": "features.proxymodel", + "condition": "features.proxymodel && features.regularexpression", "output": [ "publicFeature", "feature" ] }, "identityproxymodel": { diff --git a/src/corelib/global/qconfig-bootstrapped.h b/src/corelib/global/qconfig-bootstrapped.h index 4649395c5f..a3db9231a9 100644 --- a/src/corelib/global/qconfig-bootstrapped.h +++ b/src/corelib/global/qconfig-bootstrapped.h @@ -66,8 +66,6 @@ #define QT_NO_USING_NAMESPACE #define QT_NO_DEPRECATED -#define QT_NO_REGEXP - // Keep feature-test macros in alphabetic order by feature name: #define QT_FEATURE_alloca 1 #define QT_FEATURE_alloca_h -1 diff --git a/src/corelib/global/qt_pch.h b/src/corelib/global/qt_pch.h index 8e59ace85d..58697517b5 100644 --- a/src/corelib/global/qt_pch.h +++ b/src/corelib/global/qt_pch.h @@ -69,7 +69,9 @@ #include #include /* All moc genereated code has this include */ #include -#include +#if QT_CONFIG(regularexpression) +# include +#endif #include #include #include diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.cpp b/src/corelib/itemmodels/qsortfilterproxymodel.cpp index 38417bbba6..398425c020 100644 --- a/src/corelib/itemmodels/qsortfilterproxymodel.cpp +++ b/src/corelib/itemmodels/qsortfilterproxymodel.cpp @@ -2484,7 +2484,6 @@ Qt::SortOrder QSortFilterProxyModel::sortOrder() const return d->sort_order; } -#if QT_CONFIG(regularexpression) /*! \since 5.12 \property QSortFilterProxyModel::filterRegularExpression @@ -2512,7 +2511,6 @@ void QSortFilterProxyModel::setFilterRegularExpression(const QRegularExpression d->filter_data = regularExpression; d->filter_changed(QSortFilterProxyModelPrivate::Direction::Rows); } -#endif /*! \property QSortFilterProxyModel::filterKeyColumn @@ -2640,7 +2638,6 @@ void QSortFilterProxyModel::setSortLocaleAware(bool on) emit sortLocaleAwareChanged(on); } -#if QT_CONFIG(regularexpression) /*! \since 5.12 @@ -2661,7 +2658,6 @@ void QSortFilterProxyModel::setFilterRegularExpression(const QString &pattern) d->filter_data.setPattern(pattern); d->filter_changed(QSortFilterProxyModelPrivate::Direction::Rows); } -#endif /*! Sets the wildcard expression used to filter the contents diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.h b/src/corelib/itemmodels/qsortfilterproxymodel.h index d2c5054351..026da9ecf7 100644 --- a/src/corelib/itemmodels/qsortfilterproxymodel.h +++ b/src/corelib/itemmodels/qsortfilterproxymodel.h @@ -42,9 +42,7 @@ #include -#if QT_CONFIG(regularexpression) -# include -#endif +#include QT_REQUIRE_CONFIG(sortfilterproxymodel); @@ -61,9 +59,7 @@ class Q_CORE_EXPORT QSortFilterProxyModel : public QAbstractProxyModel friend class QSortFilterProxyModelGreaterThan; Q_OBJECT -#if QT_CONFIG(regularexpression) Q_PROPERTY(QRegularExpression filterRegularExpression READ filterRegularExpression WRITE setFilterRegularExpression) -#endif Q_PROPERTY(int filterKeyColumn READ filterKeyColumn WRITE setFilterKeyColumn) Q_PROPERTY(bool dynamicSortFilter READ dynamicSortFilter WRITE setDynamicSortFilter) Q_PROPERTY(Qt::CaseSensitivity filterCaseSensitivity READ filterCaseSensitivity WRITE setFilterCaseSensitivity NOTIFY filterCaseSensitivityChanged) @@ -86,9 +82,7 @@ public: QItemSelection mapSelectionToSource(const QItemSelection &proxySelection) const override; QItemSelection mapSelectionFromSource(const QItemSelection &sourceSelection) const override; -#if QT_CONFIG(regularexpression) QRegularExpression filterRegularExpression() const; -#endif int filterKeyColumn() const; void setFilterKeyColumn(int column); @@ -121,10 +115,8 @@ public: void setAutoAcceptChildRows(bool accept); public Q_SLOTS: -#if QT_CONFIG(regularexpression) void setFilterRegularExpression(const QString &pattern); void setFilterRegularExpression(const QRegularExpression ®ularExpression); -#endif void setFilterWildcard(const QString &pattern); void setFilterFixedString(const QString &pattern); void invalidate(); diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index 390c10e1fc..24e725ee9a 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -4569,7 +4569,7 @@ QString QString::section(const QString &sep, qsizetype start, qsizetype end, Sec return ret; } -#if !(defined(QT_NO_REGEXP) && !QT_CONFIG(regularexpression)) +#if QT_CONFIG(regularexpression) class qt_section_chunk { public: qt_section_chunk() {} @@ -4637,9 +4637,7 @@ static QString extractSections(const QList §ions, qsizetyp return ret; } -#endif -#if QT_CONFIG(regularexpression) /*! \overload section() \since 5.0