Compare commits

...

12 Commits

Author SHA1 Message Date
Nyall Dawson
e371c10b5c
Merge c7e1ad98947792a6d6c4c4fbb9eb68becfe4202e into 74549aad26c3358101e88477d9dfa1caae013d72 2025-07-01 12:46:22 +02:00
Juergen E. Fischer
74549aad26 Reapply "Allow free naming of project properties (#60855)"
This reverts commit fb11239112adfc321b3bbacbb20da888a7a37c23.
2025-07-01 09:08:44 +00:00
Juergen E. Fischer
eac401c009 if a plugin supports qt6 it should also support QGIS4 (fixes #62359) 2025-07-01 09:07:26 +00:00
Loïc Bartoletti
1f0166d35e
Merge pull request #62365 from benoitdm-oslandia/fix/cgibin_dir
fix: update default cgi-bin installation paths according to OS
2025-07-01 07:26:25 +02:00
Loïc Bartoletti
ada589bb1d
Merge pull request #62052 from martin-s42/visitPointsByRegularDistance-segfault-fix
fix segfault due to calling qgsDoubleNear with tollerance that can ne…
2025-07-01 06:59:03 +02:00
Nyall Dawson
c7e1ad9894
Also update target_compile_features 2025-06-30 13:40:38 +10:00
Nyall Dawson
3b2d1be5d6
Use cxx20 standard for build 2025-06-30 13:02:26 +10:00
bdm-oslandia
b1c8ef3265 fixup! fix: update default cgi-bin installation paths according to OS 2025-06-27 09:35:48 +02:00
bdm-oslandia
f4cf09d4b0 fixup! fix: update default cgi-bin installation paths according to OS 2025-06-25 08:29:52 +02:00
bdm-oslandia
9db58e3726 fixup! fix: update default cgi-bin installation paths according to OS 2025-06-24 17:37:57 +02:00
bdm-oslandia
551aa20f20 fix: update default cgi-bin installation paths according to OS 2025-06-23 10:44:49 +02:00
Martin Siegert
a156c43f7b
fix segfault due to calling qgsDoubleNear with tollerance that can never been reached
see issue #60772: function interpolatePoint in qgsabstractprofilesurfacegenerator.cpp:157 can return a nullpointer causing a segfault because qgsDoubleNear in visitPointsByRegularDistance in qgslinestring.cpp is called with a tolerance that is too small so that qgsDoubleNear always returns false. Solution: scale epsilon by the size of the numbers to be compared.
2025-05-29 13:37:03 -07:00
61 changed files with 281 additions and 316 deletions

View File

@ -73,6 +73,9 @@ set(QGIS_APP_NAME "qgis" CACHE STRING "The main app name and bundle name")
math(EXPR QGIS_VERSION_INT "${CPACK_PACKAGE_VERSION_MAJOR}*10000+${CPACK_PACKAGE_VERSION_MINOR}*100+${CPACK_PACKAGE_VERSION_PATCH}")
message(STATUS "QGIS version: ${COMPLETE_VERSION} ${RELEASE_NAME} (${QGIS_VERSION_INT})")
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set (ENABLE_LOCAL_BUILD_SHORTCUTS FALSE CACHE BOOL "Disables some build steps which are only relevant for releases to speed up compilation time for development")
#############################################################
@ -531,8 +534,6 @@ if(WITH_CORE)
set(QT_MIN_VERSION 6.4.0)
set(QT_VERSION_BASE "Qt6")
set(QT_VERSION_BASE_LOWER "qt6")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
else()
set(QT_VERSION_MAJOR 5)
set(QT_MIN_VERSION 5.15.2)
@ -979,7 +980,31 @@ if (WITH_CORE)
else()
# UNIX
set (DEFAULT_BIN_SUBDIR bin)
set (DEFAULT_CGIBIN_SUBDIR bin)
# From https://www.cyberciti.biz/faq/how-do-i-find-the-url-for-my-cgi-bin/
execute_process(COMMAND lsb_release -a OUTPUT_VARIABLE LSB_RELEASE_A)
if(EXISTS "/etc/fedora-release")
# in /var/www/cgi-bin
set (DEFAULT_CGIBIN_SUBDIR www/cgi-bin)
elseif (${CMAKE_HOST_SYSTEM_NAME} MATCHES "FreeBSD")
# in /usr/local/www/cgi-bin/
set (DEFAULT_CGIBIN_SUBDIR www/cgi-bin)
elseif (${CMAKE_HOST_SYSTEM_NAME} MATCHES "BSD")
# in /usr/local/libexec/cgi-bin/
set (DEFAULT_CGIBIN_SUBDIR libexec/cgi-bin)
elseif ("${LSB_RELEASE_A}" MATCHES "Ubuntu" OR "${LSB_RELEASE_A}" MATCHES "Debian" OR "${LSB_RELEASE_A}" MATCHES "Mint")
# in /usr/lib/cgi-bin/
set (DEFAULT_CGIBIN_SUBDIR lib/cgi-bin)
else()
# others: Red Hat/CentOS/Rocky/Alma Linux
# in /var/www/cgi-bin/
set (DEFAULT_CGIBIN_SUBDIR www/cgi-bin)
endif()
set (DEFAULT_LIB_SUBDIR lib${LIB_SUFFIX})
set (DEFAULT_DATA_SUBDIR share/qgis)
set (DEFAULT_LIBEXEC_SUBDIR lib${LIB_SUFFIX}/qgis)

View File

@ -659,7 +659,10 @@ class Repositories(QObject):
.strip()
)
if not qgisMaximumVersion:
qgisMaximumVersion = qgisMinimumVersion[0] + ".99"
if qgisMinimumVersion[0] == "3" and supports_qt6:
qgisMaximumVersion = "4.99"
else:
qgisMaximumVersion = qgisMinimumVersion[0] + ".99"
# if compatible, add the plugin to the list
if not pluginNodes.item(i).firstChildElement(
"disabled"
@ -845,7 +848,10 @@ class Plugins(QObject):
qgisMinimumVersion = "0"
qgisMaximumVersion = pluginMetadata("qgisMaximumVersion").strip()
if not qgisMaximumVersion:
qgisMaximumVersion = qgisMinimumVersion[0] + ".99"
if qgisMinimumVersion[0] == "3" and supports_qt6:
qgisMaximumVersion = "4.99"
else:
qgisMaximumVersion = qgisMinimumVersion[0] + ".99"
# if compatible, add the plugin to the list
if not isCompatible(
pyQgisVersion(), qgisMinimumVersion, qgisMaximumVersion

View File

@ -281,8 +281,8 @@ endif()
set_target_properties(qgis_3d PROPERTIES UNITY_BUILD ${ENABLE_UNITY_BUILDS})
# require c++17
target_compile_features(qgis_3d PRIVATE cxx_std_17)
# require c++20
target_compile_features(qgis_3d PRIVATE cxx_std_20)
if (BUILD_WITH_QT6)
target_include_directories(qgis_3d SYSTEM PUBLIC

View File

@ -566,8 +566,8 @@ endif()
set_target_properties(qgis_analysis PROPERTIES UNITY_BUILD ${ENABLE_UNITY_BUILDS})
# require c++17
target_compile_features(qgis_analysis PRIVATE cxx_std_17)
# require c++20
target_compile_features(qgis_analysis PRIVATE cxx_std_20)
target_include_directories(qgis_analysis PUBLIC
${CMAKE_SOURCE_DIR}/src/analysis

View File

@ -512,9 +512,6 @@ endif()
#############
if (ANDROID)
add_library(qgis ${LIBRARY_TYPE} ${QGIS_APPMAIN_SRCS})
# require c++17
target_compile_features(qgis PRIVATE cxx_std_17)
else()
add_executable(qgis WIN32 ${QGIS_APPMAIN_SRCS})
@ -522,19 +519,20 @@ else()
qt_disable_unicode_defines(qgis)
endif()
# require c++17
target_compile_features(qgis PRIVATE cxx_std_17)
target_compile_definitions(qgis PRIVATE "QT_PLUGINS_DIR=\"${QT_PLUGINS_DIR}\"")
endif()
# require c++20
target_compile_features(qgis PRIVATE cxx_std_20)
set_target_properties(qgis PROPERTIES OUTPUT_NAME "${QGIS_APP_NAME}")
# Putting IMAGE_RCC_SRCS into qgis_app lib is causing problems when the lib is
# loaded (by plugin for example) in test unit (qgis_layoutpicturetest).
add_library(qgis_app ${LIBRARY_TYPE} ${QGIS_APP_SRCS})
# require c++17
target_compile_features(qgis_app PRIVATE cxx_std_17)
# require c++20
target_compile_features(qgis_app PRIVATE cxx_std_20)
target_compile_definitions(qgis_app PRIVATE "QT_PLUGINS_DIR=\"${QT_PLUGINS_DIR}\"")
if (POSTGRES_FOUND)

View File

@ -727,19 +727,25 @@ bool QgsPluginRegistry::checkPythonPlugin( const QString &packageName )
bool QgsPluginRegistry::isPythonPluginCompatible( const QString &packageName ) const
{
#ifdef WITH_BINDINGS
#if QT_VERSION >= QT_VERSION_CHECK( 6, 0, 0 )
bool supportsQgis4 = true;
const QString supportsQt6 = mPythonUtils->getPluginMetadata( packageName, QStringLiteral( "supportsQt6" ) ).trimmed();
if ( supportsQt6.compare( QLatin1String( "YES" ), Qt::CaseInsensitive ) != 0 && supportsQt6.compare( QLatin1String( "TRUE" ), Qt::CaseInsensitive ) != 0 )
{
#if QT_VERSION >= QT_VERSION_CHECK( 6, 0, 0 )
if ( !getenv( "QGIS_DISABLE_SUPPORTS_QT6_CHECK" ) )
{
return false;
}
}
#endif
supportsQgis4 = false;
}
const QString minVersion = mPythonUtils->getPluginMetadata( packageName, QStringLiteral( "qgisMinimumVersion" ) );
// try to read qgisMaximumVersion. Note checkQgisVersion can cope with "__error__" value.
const QString maxVersion = mPythonUtils->getPluginMetadata( packageName, QStringLiteral( "qgisMaximumVersion" ) );
QString maxVersion = mPythonUtils->getPluginMetadata( packageName, QStringLiteral( "qgisMaximumVersion" ) );
if ( maxVersion == QLatin1String( "__error__" ) && minVersion.startsWith( QLatin1String( "3." ) ) && supportsQgis4 )
{
maxVersion = QLatin1String( "4.99.0" );
}
return minVersion != QLatin1String( "__error__" ) && checkQgisVersion( minVersion, maxVersion );
#else
Q_UNUSED( packageName )

View File

@ -25,8 +25,8 @@ add_library(authmethod_apiheader_a STATIC ${AUTH_APIHEADER_SRCS} ${AUTH_APIHEADE
target_include_directories(authmethod_apiheader_a PUBLIC ${CMAKE_SOURCE_DIR}/src/auth/apiheader/core)
# require c++17
target_compile_features(authmethod_apiheader_a PRIVATE cxx_std_17)
# require c++20
target_compile_features(authmethod_apiheader_a PRIVATE cxx_std_20)
target_link_libraries(authmethod_apiheader_a qgis_core)
@ -47,8 +47,8 @@ else()
# dynamically loaded module
add_library(authmethod_apiheader MODULE ${AUTH_APIHEADER_SRCS} ${AUTH_APIHEADER_HDRS} ${AUTH_APIHEADER_UIS_H})
# require c++17
target_compile_features(authmethod_apiheader PRIVATE cxx_std_17)
# require c++20
target_compile_features(authmethod_apiheader PRIVATE cxx_std_20)
target_link_libraries(authmethod_apiheader qgis_core)

View File

@ -25,8 +25,8 @@ add_library(authmethod_awss3_a STATIC ${AUTH_AWSS3_SRCS} ${AUTH_AWSS3_HDRS} ${AU
target_include_directories(authmethod_awss3_a PUBLIC ${CMAKE_SOURCE_DIR}/src/auth/awss3/core)
# require c++17
target_compile_features(authmethod_awss3_a PRIVATE cxx_std_17)
# require c++20
target_compile_features(authmethod_awss3_a PRIVATE cxx_std_20)
target_link_libraries(authmethod_awss3_a qgis_core)
@ -50,8 +50,8 @@ else()
# dynamically loaded module
add_library(authmethod_awss3 MODULE ${AUTH_AWSS3_SRCS} ${AUTH_AWSS3_HDRS} ${AUTH_AWSS3_UIS_H})
# require c++17
target_compile_features(authmethod_awss3 PRIVATE cxx_std_17)
# require c++20
target_compile_features(authmethod_awss3 PRIVATE cxx_std_20)
target_link_libraries(authmethod_awss3 qgis_core)

View File

@ -25,8 +25,8 @@ add_library(authmethod_basic_a STATIC ${AUTH_BASIC_SRCS} ${AUTH_BASIC_HDRS} ${AU
target_include_directories(authmethod_basic_a PUBLIC ${CMAKE_SOURCE_DIR}/src/auth/basic/core)
# require c++17
target_compile_features(authmethod_basic_a PRIVATE cxx_std_17)
# require c++20
target_compile_features(authmethod_basic_a PRIVATE cxx_std_20)
target_link_libraries(authmethod_basic_a qgis_core)
@ -50,8 +50,8 @@ else()
# dynamically loaded module
add_library(authmethod_basic MODULE ${AUTH_BASIC_SRCS} ${AUTH_BASIC_HDRS} ${AUTH_BASIC_UIS_H})
# require c++17
target_compile_features(authmethod_basic PRIVATE cxx_std_17)
# require c++20
target_compile_features(authmethod_basic PRIVATE cxx_std_20)
target_link_libraries(authmethod_basic qgis_core)

View File

@ -25,8 +25,8 @@ add_library(authmethod_esritoken_a STATIC ${AUTH_ESRITOKEN_SRCS} ${AUTH_ESRITOKE
target_include_directories(authmethod_esritoken_a PUBLIC ${CMAKE_SOURCE_DIR}/src/auth/esritoken/core)
# require c++17
target_compile_features(authmethod_esritoken_a PRIVATE cxx_std_17)
# require c++20
target_compile_features(authmethod_esritoken_a PRIVATE cxx_std_20)
target_link_libraries(authmethod_esritoken_a qgis_core)
@ -47,8 +47,8 @@ else()
# dynamically loaded module
add_library(authmethod_esritoken MODULE ${AUTH_ESRITOKEN_SRCS} ${AUTH_ESRITOKEN_HDRS} ${AUTH_ESRITOKEN_UIS_H})
# require c++17
target_compile_features(authmethod_esritoken PRIVATE cxx_std_17)
# require c++20
target_compile_features(authmethod_esritoken PRIVATE cxx_std_20)
target_link_libraries(authmethod_esritoken qgis_core)

View File

@ -25,8 +25,8 @@ add_library(authmethod_identcert_a STATIC ${AUTH_IDENTCERT_SRCS} ${AUTH_IDENTCER
target_include_directories(authmethod_identcert_a PUBLIC ${CMAKE_SOURCE_DIR}/src/auth/identcert/core)
# require c++17
target_compile_features(authmethod_identcert_a PRIVATE cxx_std_17)
# require c++20
target_compile_features(authmethod_identcert_a PRIVATE cxx_std_20)
target_link_libraries(authmethod_identcert_a qgis_core)
@ -49,8 +49,8 @@ else()
# dynamically loaded module
add_library(authmethod_identcert MODULE ${AUTH_IDENTCERT_SRCS} ${AUTH_IDENTCERT_HDRS} ${AUTH_IDENTCERT_UIS_H})
# require c++17
target_compile_features(authmethod_identcert PRIVATE cxx_std_17)
# require c++20
target_compile_features(authmethod_identcert PRIVATE cxx_std_20)
target_link_libraries(authmethod_identcert qgis_core)

View File

@ -25,8 +25,8 @@ add_library(authmethod_maptilerhmacsha256_a STATIC ${AUTH_MAPTILER_HMACSHA256_SR
target_include_directories(authmethod_maptilerhmacsha256_a PUBLIC ${CMAKE_SOURCE_DIR}/src/auth/hmacsha256/core)
# require c++17
target_compile_features(authmethod_maptilerhmacsha256_a PRIVATE cxx_std_17)
# require c++20
target_compile_features(authmethod_maptilerhmacsha256_a PRIVATE cxx_std_20)
target_link_libraries(authmethod_maptilerhmacsha256_a qgis_core)
@ -47,8 +47,8 @@ else()
# dynamically loaded module
add_library(authmethod_maptilerhmacsha256 MODULE ${AUTH_MAPTILER_HMACSHA256_SRCS} ${AUTH_MAPTILER_HMACSHA256_HDRS} ${AUTH_MAPTILER_HMACSHA256_UIS_H})
# require c++17
target_compile_features(authmethod_maptilerhmacsha256 PRIVATE cxx_std_17)
# require c++20
target_compile_features(authmethod_maptilerhmacsha256 PRIVATE cxx_std_20)
target_link_libraries(authmethod_maptilerhmacsha256 qgis_core)

View File

@ -105,8 +105,8 @@ add_library(authmethod_oauth2_a STATIC ${AUTH_OAUTH2_SRCS} ${AUTH_OAUTH2_HDRS} $
target_include_directories(authmethod_oauth2_a PUBLIC ${CMAKE_SOURCE_DIR}/src/auth/oauth2/core)
# require c++17
target_compile_features(authmethod_oauth2_a PRIVATE cxx_std_17)
# require c++20
target_compile_features(authmethod_oauth2_a PRIVATE cxx_std_20)
target_compile_definitions(authmethod_oauth2_a PRIVATE "CMAKE_SOURCE_DIR=\"${CMAKE_SOURCE_DIR}\"")
target_link_libraries(authmethod_oauth2_a qgis_core)
@ -141,8 +141,8 @@ else()
${CMAKE_SOURCE_DIR}/src/auth/oauth2/core
)
# require c++17
target_compile_features(authmethod_oauth2 PRIVATE cxx_std_17)
# require c++20
target_compile_features(authmethod_oauth2 PRIVATE cxx_std_20)
target_compile_definitions(authmethod_oauth2 PRIVATE "CMAKE_SOURCE_DIR=\"${CMAKE_SOURCE_DIR}\"")
target_link_libraries(authmethod_oauth2 qgis_core)

View File

@ -24,8 +24,8 @@ add_library(authmethod_pkipaths_a STATIC ${AUTH_PKIPATHS_SRCS} ${AUTH_PKIPATHS_H
target_include_directories(authmethod_pkipaths_a PUBLIC ${CMAKE_SOURCE_DIR}/src/auth/pkipaths/core)
# require c++17
target_compile_features(authmethod_pkipaths_a PRIVATE cxx_std_17)
# require c++20
target_compile_features(authmethod_pkipaths_a PRIVATE cxx_std_20)
target_link_libraries(authmethod_pkipaths_a qgis_core)
@ -48,8 +48,8 @@ else()
# dynamically loaded module
add_library(authmethod_pkipaths MODULE ${AUTH_PKIPATHS_SRCS} ${AUTH_PKIPATHS_HDRS} ${AUTH_PKIPATHS_UIS_H})
# require c++17
target_compile_features(authmethod_pkipaths PRIVATE cxx_std_17)
# require c++20
target_compile_features(authmethod_pkipaths PRIVATE cxx_std_20)
target_link_libraries(authmethod_pkipaths qgis_core)

View File

@ -24,8 +24,8 @@ add_library(authmethod_pkcs12_a STATIC ${AUTH_PKCS12_SRCS} ${AUTH_PKCS12_HDRS} $
target_include_directories(authmethod_pkcs12_a PUBLIC ${CMAKE_SOURCE_DIR}/src/auth/pkipkcs12/core)
# require c++17
target_compile_features(authmethod_pkcs12_a PRIVATE cxx_std_17)
# require c++20
target_compile_features(authmethod_pkcs12_a PRIVATE cxx_std_20)
target_link_libraries(authmethod_pkcs12_a qgis_core)
@ -48,8 +48,8 @@ else()
# dynamically loaded module
add_library(authmethod_pkcs12 MODULE ${AUTH_PKCS12_SRCS} ${AUTH_PKCS12_HDRS} ${AUTH_PKCS12_UIS_H})
# require c++17
target_compile_features(authmethod_pkcs12 PRIVATE cxx_std_17)
# require c++20
target_compile_features(authmethod_pkcs12 PRIVATE cxx_std_20)
target_link_libraries(authmethod_pkcs12 qgis_core)

View File

@ -14,8 +14,6 @@ ADD_FLEX_BISON_DEPENDENCY(QgsMeshCalcLexer QgsMeshCalcParser)
if (WITH_PDF4QT)
SET(PDF4QT_BUILD_ONLY_CORE_LIBRARY TRUE)
SET(PDF4QT_ENABLE_OPENGL FALSE)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
SUBDIRS(${CMAKE_SOURCE_DIR}/external/PDF4QT)
endif()
@ -2361,8 +2359,8 @@ else()
target_link_libraries(qgis_core meshoptimizer::meshoptimizer)
endif()
# require c++17
target_compile_features(qgis_core PRIVATE cxx_std_17)
# require c++20
target_compile_features(qgis_core PRIVATE cxx_std_20)
# Exiv still uses std::auto_ptr
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")

View File

@ -1532,6 +1532,7 @@ void QgsLineString::visitPointsByRegularDistance( const double distance, const s
double pZ = std::numeric_limits<double>::quiet_NaN();
double pM = std::numeric_limits<double>::quiet_NaN();
double nextPointDistance = distance;
const double eps = 4 * nextPointDistance * std::numeric_limits<double>::epsilon ();
for ( int i = 1; i < totalPoints; ++i )
{
double thisX = *x++;
@ -1540,7 +1541,7 @@ void QgsLineString::visitPointsByRegularDistance( const double distance, const s
double thisM = m ? *m++ : 0.0;
const double segmentLength = QgsGeometryUtilsBase::distance2D( thisX, thisY, prevX, prevY );
while ( nextPointDistance < distanceTraversed + segmentLength || qgsDoubleNear( nextPointDistance, distanceTraversed + segmentLength ) )
while ( nextPointDistance < distanceTraversed + segmentLength || qgsDoubleNear( nextPointDistance, distanceTraversed + segmentLength, eps ) )
{
// point falls on this segment - truncate to segment length if qgsDoubleNear test was actually > segment length
const double distanceToPoint = std::min( nextPointDistance - distanceTraversed, segmentLength );

View File

@ -116,21 +116,6 @@ QStringList makeKeyTokens_( const QString &scope, const QString &key )
// be sure to include the canonical root node
keyTokens.push_front( QStringLiteral( "properties" ) );
//check validy of keys since an invalid xml name will will be dropped upon saving the xml file. If not valid, we print a message to the console.
for ( int i = 0; i < keyTokens.size(); ++i )
{
const QString keyToken = keyTokens.at( i );
//invalid chars in XML are found at http://www.w3.org/TR/REC-xml/#NT-NameChar
//note : it seems \x10000-\xEFFFF is valid, but it when added to the regexp, a lot of unwanted characters remain
const thread_local QRegularExpression sInvalidRegexp = QRegularExpression( QStringLiteral( "([^:A-Z_a-z\\x{C0}-\\x{D6}\\x{D8}-\\x{F6}\\x{F8}-\\x{2FF}\\x{370}-\\x{37D}\\x{37F}-\\x{1FFF}\\x{200C}-\\x{200D}\\x{2070}-\\x{218F}\\x{2C00}-\\x{2FEF}\\x{3001}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFFD}\\-\\.0-9\\x{B7}\\x{0300}-\\x{036F}\\x{203F}-\\x{2040}]|^[^:A-Z_a-z\\x{C0}-\\x{D6}\\x{D8}-\\x{F6}\\x{F8}-\\x{2FF}\\x{370}-\\x{37D}\\x{37F}-\\x{1FFF}\\x{200C}-\\x{200D}\\x{2070}-\\x{218F}\\x{2C00}-\\x{2FEF}\\x{3001}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFFD}])" ) );
if ( keyToken.contains( sInvalidRegexp ) )
{
const QString errorString = QObject::tr( "Entry token invalid : '%1'. The token will not be saved to file." ).arg( keyToken );
QgsMessageLog::logMessage( errorString, QString(), Qgis::MessageLevel::Critical );
}
}
return keyTokens;
}
@ -1322,20 +1307,20 @@ void dump_( const QgsProjectPropertyKey &topQgsPropertyKey )
* scope. "layers" is a list containing three string values.
*
* \code{.xml}
* <properties>
* <fsplugin>
* <foo type="int" >42</foo>
* <baz type="int" >1</baz>
* <layers type="QStringList" >
* <properties name="properties">
* <properties name="fsplugin">
* <properties name="foo" type="int" >42</properties>
* <properties name="baz" type="int" >1</properties>
* <properties name="layers" type="QStringList">
* <value>railroad</value>
* <value>airport</value>
* </layers>
* <xyqzzy type="int" >1</xyqzzy>
* <bar type="double" >123.456</bar>
* <feature_types type="QStringList" >
* </properties>
* <properties name="xyqzzy" type="int" >1</properties>
* <properties name="bar" type="double" >123.456</properties>
* <properties name="feature_types" type="QStringList">
* <value>type</value>
* </feature_types>
* </fsplugin>
* </properties>
* </properties>
* </properties>
* \endcode
*
@ -3992,10 +3977,25 @@ bool QgsProject::createEmbeddedLayer( const QString &layerId, const QString &pro
const QDomElement propertiesElem = sProjectDocument.documentElement().firstChildElement( QStringLiteral( "properties" ) );
if ( !propertiesElem.isNull() )
{
const QDomElement absElem = propertiesElem.firstChildElement( QStringLiteral( "Paths" ) ).firstChildElement( QStringLiteral( "Absolute" ) );
if ( !absElem.isNull() )
QDomElement e = propertiesElem.firstChildElement( QStringLiteral( "Paths" ) );
if ( e.isNull() )
{
useAbsolutePaths = absElem.text().compare( QLatin1String( "true" ), Qt::CaseInsensitive ) == 0;
e = propertiesElem.firstChildElement( QStringLiteral( "properties" ) );
while ( !e.isNull() && e.attribute( QStringLiteral( "name" ) ) != QStringLiteral( "Paths" ) )
e = e.nextSiblingElement( QStringLiteral( "properties" ) );
e = e.firstChildElement( QStringLiteral( "properties" ) );
while ( !e.isNull() && e.attribute( QStringLiteral( "name" ) ) != QStringLiteral( "Absolute" ) )
e = e.nextSiblingElement( QStringLiteral( "properties" ) );
}
else
{
e = e.firstChildElement( QStringLiteral( "Absolute" ) );
}
if ( !e.isNull() )
{
useAbsolutePaths = e.text().compare( QLatin1String( "true" ), Qt::CaseInsensitive ) == 0;
}
}

View File

@ -233,15 +233,15 @@ bool QgsProjectPropertyValue::readXml( const QDomNode &keyNode )
// keyElement is created by parent QgsProjectPropertyKey
bool QgsProjectPropertyValue::writeXml( QString const &nodeName,
QDomElement &keyElement,
QDomDocument &document )
QDomElement &keyElement,
QDomDocument &document )
{
QDomElement valueElement = document.createElement( nodeName );
QDomElement valueElement = document.createElement( QStringLiteral( "properties" ) );
// remember the type so that we can rebuild it when the project is read in
valueElement.setAttribute( QStringLiteral( "name" ), nodeName );
valueElement.setAttribute( QStringLiteral( "type" ), mValue.typeName() );
// we handle string lists differently from other types in that we
// create a sequence of repeated elements to cover all the string list
// members; each value will be in a <value></value> tag.
@ -362,33 +362,41 @@ bool QgsProjectPropertyKey::readXml( const QDomNode &keyNode )
while ( i < subkeys.count() )
{
const QDomNode subkey = subkeys.item( i );
QString name;
if ( subkey.nodeName() == QStringLiteral( "properties" ) &&
subkey.hasAttributes() && // if we have attributes
subkey.isElement() && // and we're an element
subkey.toElement().hasAttribute( QStringLiteral( "name" ) ) ) // and we have a "name" attribute
name = subkey.toElement().attribute( QStringLiteral( "name" ) );
else
name = subkey.nodeName();
// if the current node is an element that has a "type" attribute,
// then we know it's a leaf node; i.e., a subkey _value_, and not
// a subkey
if ( subkeys.item( i ).hasAttributes() && // if we have attributes
subkeys.item( i ).isElement() && // and we're an element
subkeys.item( i ).toElement().hasAttribute( QStringLiteral( "type" ) ) ) // and we have a "type" attribute
if ( subkey.hasAttributes() && // if we have attributes
subkey.isElement() && // and we're an element
subkey.toElement().hasAttribute( QStringLiteral( "type" ) ) ) // and we have a "type" attribute
{
// then we're a key value
delete mProperties.take( subkeys.item( i ).nodeName() );
mProperties.insert( subkeys.item( i ).nodeName(), new QgsProjectPropertyValue );
//
delete mProperties.take( name );
mProperties.insert( name, new QgsProjectPropertyValue );
QDomNode subkey = subkeys.item( i );
if ( !mProperties[subkeys.item( i ).nodeName()]->readXml( subkey ) )
if ( !mProperties[name]->readXml( subkey ) )
{
QgsDebugError( QStringLiteral( "unable to parse key value %1" ).arg( subkeys.item( i ).nodeName() ) );
QgsDebugError( QStringLiteral( "unable to parse key value %1" ).arg( name ) );
}
}
else // otherwise it's a subkey, so just recurse on down the remaining keys
{
addKey( subkeys.item( i ).nodeName() );
addKey( name );
QDomNode subkey = subkeys.item( i );
if ( !mProperties[subkeys.item( i ).nodeName()]->readXml( subkey ) )
if ( !mProperties[name]->readXml( subkey ) )
{
QgsDebugError( QStringLiteral( "unable to parse subkey %1" ).arg( subkeys.item( i ).nodeName() ) );
QgsDebugError( QStringLiteral( "unable to parse subkey %1" ).arg( name ) );
}
}
@ -408,7 +416,8 @@ bool QgsProjectPropertyKey::writeXml( QString const &nodeName, QDomElement &elem
// If it's an _empty_ node (i.e., one with no properties) we need to emit
// an empty place holder; else create new Dom elements as necessary.
QDomElement keyElement = document.createElement( nodeName ); // Dom element for this property key
QDomElement keyElement = document.createElement( "properties" ); // Dom element for this property key
keyElement.toElement().setAttribute( QStringLiteral( "name" ), nodeName );
if ( ! mProperties.isEmpty() )
{

View File

@ -23,7 +23,7 @@ add_executable(qgiscrashhandler WIN32
${CMAKE_CURRENT_SOURCE_DIR}/../app/qgis_win32.rc
)
target_compile_features(qgiscrashhandler PRIVATE cxx_std_17)
target_compile_features(qgiscrashhandler PRIVATE cxx_std_20)
target_link_libraries(qgiscrashhandler
${QT_VERSION_BASE}::Core

View File

@ -6,7 +6,7 @@ if (NATIVE_CRSSYNC_BIN)
else ()
add_executable(crssync main.cpp)
target_compile_features(crssync PRIVATE cxx_std_17)
target_compile_features(crssync PRIVATE cxx_std_20)
target_link_libraries(crssync
qgis_core

View File

@ -1697,7 +1697,7 @@ add_library(qgis_gui ${LIBRARY_TYPE}
)
# require c++17
target_compile_features(qgis_gui PRIVATE cxx_std_17)
target_compile_features(qgis_gui PRIVATE cxx_std_20)
if (USE_PRECOMPILED_HEADERS)
target_precompile_headers(qgis_gui PRIVATE $<$<COMPILE_LANGUAGE:CXX>:${CMAKE_SOURCE_DIR}/src/core/qgis.h>)

View File

@ -65,7 +65,7 @@ add_library(qgis_native ${LIBRARY_TYPE} ${QGIS_NATIVE_SRCS} ${QGIS_NATIVE_HDRS})
set_property(TARGET qgis_native PROPERTY POSITION_INDEPENDENT_CODE ON)
# require c++17
target_compile_features(qgis_native PRIVATE cxx_std_17)
target_compile_features(qgis_native PRIVATE cxx_std_20)
target_include_directories(qgis_native PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}

View File

@ -35,7 +35,7 @@ qt_wrap_ui(geometrychecker_UIS_H ${geometrychecker_UIS})
add_library (plugin_geometrychecker MODULE ${geometrychecker_SRCS} ${geometrychecker_RCCS} ${geometrychecker_UIS_H})
# require c++17
target_compile_features(plugin_geometrychecker PRIVATE cxx_std_17)
target_compile_features(plugin_geometrychecker PRIVATE cxx_std_20)
include_directories(
${CMAKE_SOURCE_DIR}/src/plugins

View File

@ -108,7 +108,7 @@ macro(ADD_GRASSPLUGIN GRASS_BUILD_VERSION)
set_source_files_properties(${GRASS_PLUGIN_SRCS} PROPERTIES COMPILE_FLAGS "-wd4611")
endif()
target_compile_features(plugin_grass${GRASS_BUILD_VERSION} PRIVATE cxx_std_17)
target_compile_features(plugin_grass${GRASS_BUILD_VERSION} PRIVATE cxx_std_20)
target_link_libraries(plugin_grass${GRASS_BUILD_VERSION}
qgisgrass${GRASS_BUILD_VERSION}

View File

@ -26,8 +26,8 @@ add_library (plugin_offlineediting MODULE
${offline_editing_plugin_UIS_H}
)
# require c++17
target_compile_features(plugin_offlineediting PRIVATE cxx_std_17)
# require c++20
target_compile_features(plugin_offlineediting PRIVATE cxx_std_20)
target_link_libraries(plugin_offlineediting
qgis_core

View File

@ -25,8 +25,8 @@ qt_wrap_ui(topol_UIS_H ${topol_UIS})
add_library (plugin_topology MODULE ${topol_SRCS} ${topol_RCCS} ${topol_UIS_H})
# require c++17
target_compile_features(plugin_topology PRIVATE cxx_std_17)
# require c++20
target_compile_features(plugin_topology PRIVATE cxx_std_20)
include_directories(
${CMAKE_SOURCE_DIR}/src/plugins

View File

@ -17,8 +17,8 @@ endif()
add_executable (qgis_process ${QGIS_PROCESS_SRCS})
# require c++17
target_compile_features(qgis_process PRIVATE cxx_std_17)
# require c++20
target_compile_features(qgis_process PRIVATE cxx_std_20)
target_include_directories(qgis_process PUBLIC
${CMAKE_CURRENT_BINARY_DIR}

View File

@ -30,8 +30,8 @@ target_include_directories(provider_arcgisfeatureserver_a PUBLIC
${CMAKE_SOURCE_DIR}/src/providers/arcgisrest
)
# require c++17
target_compile_features(provider_arcgisfeatureserver_a PRIVATE cxx_std_17)
# require c++20
target_compile_features(provider_arcgisfeatureserver_a PRIVATE cxx_std_20)
# We use private headers from core that need this
target_compile_definitions(provider_arcgisfeatureserver_a PRIVATE "CMAKE_SOURCE_DIR=\"${CMAKE_SOURCE_DIR}\"")
@ -48,8 +48,8 @@ if (WITH_GUI)
set_target_properties(provider_arcgisfeatureserver_gui_a PROPERTIES UNITY_BUILD ${ENABLE_UNITY_BUILDS})
# require c++17
target_compile_features(provider_arcgisfeatureserver_gui_a PRIVATE cxx_std_17)
# require c++20
target_compile_features(provider_arcgisfeatureserver_gui_a PRIVATE cxx_std_20)
target_link_libraries(provider_arcgisfeatureserver_a
qgis_gui
@ -82,8 +82,8 @@ else()
${QCA_LIBRARY}
)
# require c++17
target_compile_features(provider_arcgisfeatureserver PRIVATE cxx_std_17)
# require c++20
target_compile_features(provider_arcgisfeatureserver PRIVATE cxx_std_20)
# We use private headers from core that need this
target_compile_definitions(provider_arcgisfeatureserver PRIVATE "CMAKE_SOURCE_DIR=\"${CMAKE_SOURCE_DIR}\"")
@ -113,8 +113,8 @@ target_include_directories(provider_arcgismapserver_a PUBLIC
${CMAKE_SOURCE_DIR}/src/providers/arcgisrest
)
# require c++17
target_compile_features(provider_arcgismapserver_a PRIVATE cxx_std_17)
# require c++20
target_compile_features(provider_arcgismapserver_a PRIVATE cxx_std_20)
# We use private headers from core that need this
target_compile_definitions(provider_arcgismapserver_a PRIVATE "CMAKE_SOURCE_DIR=\"${CMAKE_SOURCE_DIR}\"")
@ -130,8 +130,8 @@ if (FORCE_STATIC_LIBS)
else()
add_library(provider_arcgismapserver MODULE ${AMS_SRCS})
# require c++17
target_compile_features(provider_arcgismapserver PRIVATE cxx_std_17)
# require c++20
target_compile_features(provider_arcgismapserver PRIVATE cxx_std_20)
# We use private headers from core that need this
target_compile_definitions(provider_arcgismapserver PRIVATE "CMAKE_SOURCE_DIR=\"${CMAKE_SOURCE_DIR}\"")

View File

@ -24,8 +24,8 @@ target_link_libraries(provider_delimitedtext_a
qgis_core
)
# require c++17
target_compile_features(provider_delimitedtext_a PRIVATE cxx_std_17)
# require c++20
target_compile_features(provider_delimitedtext_a PRIVATE cxx_std_20)
target_compile_definitions(provider_delimitedtext_a PRIVATE "-DQT_NO_FOREACH")
@ -42,8 +42,8 @@ if (WITH_GUI)
qgis_gui
)
# require c++17
target_compile_features(provider_delimitedtext_gui_a PRIVATE cxx_std_17)
# require c++20
target_compile_features(provider_delimitedtext_gui_a PRIVATE cxx_std_20)
target_compile_definitions(provider_delimitedtext_gui_a PRIVATE "-DQT_NO_FOREACH")
@ -59,8 +59,8 @@ if (FORCE_STATIC_LIBS)
else()
add_library(provider_delimitedtext MODULE ${DTEXT_SRCS} ${DTEXT_GUI_SRCS})
# require c++17
target_compile_features(provider_delimitedtext PRIVATE cxx_std_17)
# require c++20
target_compile_features(provider_delimitedtext PRIVATE cxx_std_20)
target_link_libraries(provider_delimitedtext
qgis_core

View File

@ -30,8 +30,8 @@ include_directories (SYSTEM
add_library(provider_gpx MODULE ${GPX_SRCS})
# require c++17
target_compile_features(provider_gpx PRIVATE cxx_std_17)
# require c++20
target_compile_features(provider_gpx PRIVATE cxx_std_20)
target_link_libraries(provider_gpx
qgis_core

View File

@ -63,8 +63,8 @@ macro(ADD_GRASSLIB GRASS_BUILD_VERSION)
${GRASS_LIBRARY_UIS_H}
)
# require c++17
target_compile_features(qgisgrass${GRASS_BUILD_VERSION} PRIVATE cxx_std_17)
# require c++20
target_compile_features(qgisgrass${GRASS_BUILD_VERSION} PRIVATE cxx_std_20)
if(GRASS_OFF_T_SIZE)
set(GRASS_OFF_T_SIZE_DEF "\"-DGRASS_OFF_T_SIZE=${GRASS_OFF_T_SIZE}\"")
@ -132,8 +132,8 @@ macro(ADD_GRASSLIB GRASS_BUILD_VERSION)
set (GRASS_VECTOR_PROVIDER_SRCS ../qgsgrassprovidermodule.cpp)
add_library(provider_grass${GRASS_BUILD_VERSION} MODULE ${GRASS_VECTOR_PROVIDER_SRCS})
# require c++17
target_compile_features(provider_grass${GRASS_BUILD_VERSION} PRIVATE cxx_std_17)
# require c++20
target_compile_features(provider_grass${GRASS_BUILD_VERSION} PRIVATE cxx_std_20)
set_target_properties(provider_grass${GRASS_BUILD_VERSION} PROPERTIES
COMPILE_FLAGS "-DGRASS_BASE=\\\"${GRASS_PREFIX}\\\""
@ -157,8 +157,8 @@ macro(ADD_GRASSLIB GRASS_BUILD_VERSION)
)
add_library(provider_grassraster${GRASS_BUILD_VERSION} MODULE ${GRASS_RASTER_PROVIDER_SRCS})
# require c++17
target_compile_features(provider_grassraster${GRASS_BUILD_VERSION} PRIVATE cxx_std_17)
# require c++20
target_compile_features(provider_grassraster${GRASS_BUILD_VERSION} PRIVATE cxx_std_20)
set_target_properties(provider_grassraster${GRASS_BUILD_VERSION} PROPERTIES
COMPILE_FLAGS "-DGRASS_BASE=\\\"${GRASS_PREFIX}\\\""
@ -749,8 +749,8 @@ if(WITH_GRASS_DIRECT)
endif()
add_library(${FAKE_LIB_GRASS_GIS} MODULE qgsgrassgislib.cpp qgsgrassgislibfunctions.cpp )
# require c++17
target_compile_features(${FAKE_LIB_GRASS_GIS} PRIVATE cxx_std_17)
# require c++20
target_compile_features(${FAKE_LIB_GRASS_GIS} PRIVATE cxx_std_20)
# GRASS_LIBRARY_gis is path to the GRASS library used for compilation, it is the same
# on runtime on Linux and Mac but on Windows with OSGEO4W the GRASS may be installed

View File

@ -80,9 +80,9 @@ add_library(provider_hana_a STATIC ${HANA_SRCS} ${HANA_HDRS})
set_target_properties(provider_hana PROPERTIES UNITY_BUILD ${ENABLE_UNITY_BUILDS})
set_target_properties(provider_hana_a PROPERTIES UNITY_BUILD ${ENABLE_UNITY_BUILDS})
# require c++17
target_compile_features(provider_hana PRIVATE cxx_std_17)
target_compile_features(provider_hana_a PRIVATE cxx_std_17)
# require c++20
target_compile_features(provider_hana PRIVATE cxx_std_20)
target_compile_features(provider_hana_a PRIVATE cxx_std_20)
target_compile_definitions(provider_hana
PRIVATE

View File

@ -184,8 +184,8 @@ include_directories (
add_library (provider_mdal MODULE ${MDAL_SRCS} ${MDAL_LIB_SRCS} ${MDAL_LIB_HDRS})
# require c++17
target_compile_features(provider_mdal PRIVATE cxx_std_17)
# require c++20
target_compile_features(provider_mdal PRIVATE cxx_std_20)
target_link_libraries (provider_mdal
qgis_core

View File

@ -38,8 +38,8 @@ include_directories(
add_library(provider_mssql MODULE ${MSSQL_SRCS} ${MSSQL_HDRS})
# require c++17
target_compile_features(provider_mssql PRIVATE cxx_std_17)
# require c++20
target_compile_features(provider_mssql PRIVATE cxx_std_20)
target_compile_definitions(provider_mssql PRIVATE "CMAKE_SOURCE_DIR=\"${CMAKE_SOURCE_DIR}\"")
@ -61,8 +61,8 @@ endif()
# static library
add_library (provider_mssql_a STATIC ${MSSQL_SRCS} ${MSSQL_HDRS})
# require c++17
target_compile_features(provider_mssql_a PRIVATE cxx_std_17)
# require c++20
target_compile_features(provider_mssql_a PRIVATE cxx_std_20)
# We use private headers from core that need this
target_compile_definitions(provider_mssql_a PRIVATE "CMAKE_SOURCE_DIR=\"${CMAKE_SOURCE_DIR}\"")

View File

@ -50,8 +50,8 @@ endif()
add_library (provider_oracle MODULE ${ORACLE_SRCS} ${ORACLE_HDRS})
# require c++17
target_compile_features(provider_oracle PRIVATE cxx_std_17)
# require c++20
target_compile_features(provider_oracle PRIVATE cxx_std_20)
target_compile_definitions(provider_oracle PRIVATE "CMAKE_SOURCE_DIR=\"${CMAKE_SOURCE_DIR}\"")
target_link_libraries (provider_oracle

View File

@ -174,7 +174,7 @@ include_directories(
)
add_executable(untwine ${UNTWINE_SRCS} ${UNTWINE_HDRS})
target_compile_features(untwine PRIVATE cxx_std_17)
target_compile_features(untwine PRIVATE cxx_std_20)
set_target_properties(untwine PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/${QGIS_LIBEXEC_SUBDIR}
@ -195,7 +195,7 @@ endif()
if (PDAL_2_5_OR_HIGHER)
add_executable(pdal_wrench ${PDAL_WRENCH_SRCS})
target_compile_features(pdal_wrench PRIVATE cxx_std_17)
target_compile_features(pdal_wrench PRIVATE cxx_std_20)
set_target_properties(pdal_wrench PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/${QGIS_LIBEXEC_SUBDIR}
@ -218,7 +218,7 @@ endif()
add_library (provider_pdal MODULE ${PDAL_SRCS} ${PDAL_HDRS} ${PDAL_GUI_SRCS} ${PDAL_GUI_HDRS})
target_compile_features(provider_pdal PRIVATE cxx_std_17)
target_compile_features(provider_pdal PRIVATE cxx_std_20)
target_link_libraries (provider_pdal
qgis_core
@ -243,8 +243,8 @@ endif()
# static library
add_library (provider_pdal_a STATIC ${PDAL_SRCS} ${PDAL_HDRS})
# require c++17
target_compile_features(provider_pdal_a PRIVATE cxx_std_17)
# require c++20
target_compile_features(provider_pdal_a PRIVATE cxx_std_20)
target_link_libraries (provider_pdal_a
${PDAL_LIBRARIES}
@ -260,8 +260,8 @@ target_link_libraries (provider_pdal_a
if (WITH_GUI)
add_library (provider_pdal_gui_a STATIC ${PDAL_GUI_SRCS} ${PDAL_GUI_HDRS})
# require c++17
target_compile_features(provider_pdal_gui_a PRIVATE cxx_std_17)
# require c++20
target_compile_features(provider_pdal_gui_a PRIVATE cxx_std_20)
target_link_libraries (provider_pdal_gui_a
${PDAL_LIBRARIES}

View File

@ -50,8 +50,8 @@ target_include_directories(provider_postgres_a PUBLIC
${CMAKE_SOURCE_DIR}/src/providers/postgres
)
# require c++17
target_compile_features(provider_postgres_a PRIVATE cxx_std_17)
# require c++20
target_compile_features(provider_postgres_a PRIVATE cxx_std_20)
target_compile_definitions(provider_postgres_a PRIVATE "CMAKE_SOURCE_DIR=\"${CMAKE_SOURCE_DIR}\"")
target_link_libraries (provider_postgres_a
@ -70,8 +70,8 @@ if (WITH_GUI)
${CMAKE_BINARY_DIR}/src/providers/postgres
)
# require c++17
target_compile_features(provider_postgres_gui_a PRIVATE cxx_std_17)
# require c++20
target_compile_features(provider_postgres_gui_a PRIVATE cxx_std_20)
target_compile_definitions(provider_postgres_gui_a PRIVATE "CMAKE_SOURCE_DIR=\"${CMAKE_SOURCE_DIR}\"")
target_link_libraries(provider_postgres_gui_a
@ -101,8 +101,8 @@ target_include_directories(provider_postgresraster_a PUBLIC
${CMAKE_SOURCE_DIR}/src/providers/postgres/raster
)
# require c++17
target_compile_features(provider_postgresraster_a PRIVATE cxx_std_17)
# require c++20
target_compile_features(provider_postgresraster_a PRIVATE cxx_std_20)
target_compile_definitions(provider_postgresraster_a PRIVATE "CMAKE_SOURCE_DIR=\"${CMAKE_SOURCE_DIR}\"")
target_link_libraries (provider_postgresraster_a
@ -138,9 +138,9 @@ else()
${CMAKE_SOURCE_DIR}/src/providers/postgres
)
# require c++17
target_compile_features(provider_postgres PRIVATE cxx_std_17)
target_compile_features(provider_postgresraster PRIVATE cxx_std_17)
# require c++20
target_compile_features(provider_postgres PRIVATE cxx_std_20)
target_compile_features(provider_postgresraster PRIVATE cxx_std_20)
target_compile_definitions(provider_postgres PRIVATE "CMAKE_SOURCE_DIR=\"${CMAKE_SOURCE_DIR}\"")
target_compile_definitions(provider_postgresraster PRIVATE "CMAKE_SOURCE_DIR=\"${CMAKE_SOURCE_DIR}\"")

View File

@ -43,8 +43,8 @@ target_link_libraries(provider_spatialite_a
spatialite::spatialite
)
# require c++17
target_compile_features(provider_spatialite_a PRIVATE cxx_std_17)
# require c++20
target_compile_features(provider_spatialite_a PRIVATE cxx_std_20)
target_compile_definitions(provider_spatialite_a PRIVATE "CMAKE_SOURCE_DIR=\"${CMAKE_SOURCE_DIR}\"")
target_compile_definitions(provider_spatialite_a PRIVATE "-DQT_NO_FOREACH")
@ -67,8 +67,8 @@ if (WITH_GUI)
qgis_gui
)
# require c++17
target_compile_features(provider_spatialite_gui_a PRIVATE cxx_std_17)
# require c++20
target_compile_features(provider_spatialite_gui_a PRIVATE cxx_std_20)
target_compile_definitions(provider_spatialite_gui_a PRIVATE "CMAKE_SOURCE_DIR=\"${CMAKE_SOURCE_DIR}\"")
target_compile_definitions(provider_spatialite_gui_a PRIVATE "-DQT_NO_FOREACH")
@ -92,8 +92,8 @@ else()
set_target_properties(provider_spatialite PROPERTIES UNITY_BUILD ${ENABLE_UNITY_BUILDS})
# require c++17
target_compile_features(provider_spatialite PRIVATE cxx_std_17)
# require c++20
target_compile_features(provider_spatialite PRIVATE cxx_std_20)
target_compile_definitions(provider_spatialite PRIVATE "CMAKE_SOURCE_DIR=\"${CMAKE_SOURCE_DIR}\"")
target_compile_definitions(provider_spatialite PRIVATE "-DQT_NO_FOREACH")

View File

@ -42,8 +42,8 @@ target_link_libraries(provider_virtuallayer_a
qgis_core
)
# require c++17
target_compile_features(provider_virtuallayer_a PRIVATE cxx_std_17)
# require c++20
target_compile_features(provider_virtuallayer_a PRIVATE cxx_std_20)
target_compile_definitions(provider_virtuallayer_a PRIVATE "-DQT_NO_FOREACH")
@ -59,8 +59,8 @@ if (WITH_GUI)
qgis_gui
)
# require c++17
target_compile_features(provider_virtuallayer_gui_a PRIVATE cxx_std_17)
# require c++20
target_compile_features(provider_virtuallayer_gui_a PRIVATE cxx_std_20)
target_compile_definitions(provider_virtuallayer_gui_a PRIVATE "-DQT_NO_FOREACH")
@ -82,8 +82,8 @@ if (FORCE_STATIC_LIBS)
else()
add_library(provider_virtuallayer MODULE ${VLAYER_PROVIDER_SRCS} ${VLAYER_PROVIDER_HDRS} ${VLAYER_PROVIDER_GUI_SRCS} ${VLAYER_PROVIDER_GUI_HDRS} ${VLAYER_PROVIDER_UIS_H} ${VLAYER_SQL_FUNCTIONS_RCCS})
# require c++17
target_compile_features(provider_virtuallayer PRIVATE cxx_std_17)
# require c++20
target_compile_features(provider_virtuallayer PRIVATE cxx_std_20)
target_compile_definitions(provider_virtuallayer PRIVATE "-DQT_NO_FOREACH")

View File

@ -13,8 +13,8 @@ set(VRP_HDRS
add_library (provider_virtualraster MODULE ${VRP_SRCS} ${VRP_HDRS})
# require c++17
target_compile_features(provider_virtualraster PRIVATE cxx_std_17)
# require c++20
target_compile_features(provider_virtualraster PRIVATE cxx_std_20)
target_link_libraries (provider_virtualraster
qgis_core

View File

@ -26,8 +26,8 @@ target_link_libraries(provider_wcs_a
qgis_core
)
# require c++17
target_compile_features(provider_wcs_a PRIVATE cxx_std_17)
# require c++20
target_compile_features(provider_wcs_a PRIVATE cxx_std_20)
# We use private headers from core that need this
target_compile_definitions(provider_wcs_a PRIVATE "CMAKE_SOURCE_DIR=\"${CMAKE_SOURCE_DIR}\"")
@ -47,8 +47,8 @@ if (WITH_GUI)
qgis_gui
)
# require c++17
target_compile_features(provider_wcs_gui_a PRIVATE cxx_std_17)
# require c++20
target_compile_features(provider_wcs_gui_a PRIVATE cxx_std_20)
target_compile_definitions(provider_wcs_gui_a PRIVATE "-DQT_NO_FOREACH")
@ -68,8 +68,8 @@ if (FORCE_STATIC_LIBS)
else()
add_library(provider_wcs MODULE ${WCS_SRCS} ${WCS_GUI_SRCS})
# require c++17
target_compile_features(provider_wcs PRIVATE cxx_std_17)
# require c++20
target_compile_features(provider_wcs PRIVATE cxx_std_20)
# We use private headers from core that need this
target_compile_definitions(provider_wcs PRIVATE "CMAKE_SOURCE_DIR=\"${CMAKE_SOURCE_DIR}\"")

View File

@ -70,8 +70,8 @@ target_link_libraries(provider_wfs_a
GDAL::GDAL
)
# require c++17
target_compile_features(provider_wfs_a PRIVATE cxx_std_17)
# require c++20
target_compile_features(provider_wfs_a PRIVATE cxx_std_20)
# We use private headers from core that need this
@ -97,8 +97,8 @@ if (WITH_GUI)
qgis_gui
)
# require c++17
target_compile_features(provider_wfs_gui_a PRIVATE cxx_std_17)
# require c++20
target_compile_features(provider_wfs_gui_a PRIVATE cxx_std_20)
target_compile_definitions(provider_wfs_gui_a PRIVATE "-DQT_NO_FOREACH")
@ -121,8 +121,8 @@ else()
set_target_properties(provider_wfs PROPERTIES UNITY_BUILD ${ENABLE_UNITY_BUILDS})
# require c++17
target_compile_features(provider_wfs PRIVATE cxx_std_17)
# require c++20
target_compile_features(provider_wfs PRIVATE cxx_std_20)
# We use private headers from core that need this
target_compile_definitions(provider_wfs PRIVATE "CMAKE_SOURCE_DIR=\"${CMAKE_SOURCE_DIR}\"")

View File

@ -31,8 +31,8 @@ target_include_directories(provider_wms_a PUBLIC
${CMAKE_SOURCE_DIR}/src/providers/wms
)
# require c++17
target_compile_features(provider_wms_a PRIVATE cxx_std_17)
# require c++20
target_compile_features(provider_wms_a PRIVATE cxx_std_20)
if (WITH_GUI)
qt_wrap_ui(WMS_UIS_H ${WMS_UIS})
@ -45,8 +45,8 @@ if (WITH_GUI)
${CMAKE_BINARY_DIR}/src/providers/wms
)
# require c++17
target_compile_features(provider_wms_gui_a PRIVATE cxx_std_17)
# require c++20
target_compile_features(provider_wms_gui_a PRIVATE cxx_std_20)
add_dependencies(provider_wms_a ui)
add_dependencies(provider_wms_gui_a ui)
@ -80,8 +80,8 @@ else()
set_target_properties(provider_wms PROPERTIES UNITY_BUILD ${ENABLE_UNITY_BUILDS})
# require c++17
target_compile_features(provider_wms PRIVATE cxx_std_17)
# require c++20
target_compile_features(provider_wms PRIVATE cxx_std_20)
target_link_libraries(provider_wms
qgis_core

View File

@ -2,8 +2,8 @@ set(QGISPYTHON_SRCS qgispython.cpp qgspythonutilsimpl.cpp)
add_library (qgispython SHARED ${QGISPYTHON_SRCS})
# require c++17
target_compile_features(qgispython PRIVATE cxx_std_17)
# require c++20
target_compile_features(qgispython PRIVATE cxx_std_20)
target_include_directories(qgispython PUBLIC
${CMAKE_SOURCE_DIR}/src/python

View File

@ -46,8 +46,8 @@ add_library(qgis_quick ${LIBRARY_TYPE}
${QGIS_QUICK_GUI_MOC_SRCS}
${QGIS_QUICK_GUI_HDRS})
# require c++17
target_compile_features(qgis_quick PRIVATE cxx_std_17)
# require c++20
target_compile_features(qgis_quick PRIVATE cxx_std_20)
target_link_libraries(qgis_quick
${QT_VERSION_BASE}::Quick

View File

@ -52,8 +52,8 @@ add_library(qgis_quick_plugin ${LIBRARY_TYPE}
${QGIS_QUICK_PLUGIN_RESOURCES}
)
# require c++17
target_compile_features(qgis_quick_plugin PRIVATE cxx_std_17)
# require c++20
target_compile_features(qgis_quick_plugin PRIVATE cxx_std_20)
target_link_libraries(qgis_quick_plugin qgis_quick)
set_target_properties(qgis_quick_plugin PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${QGIS_QUICK_PLUGIN_RUNTIME_DIR})

View File

@ -92,8 +92,8 @@ endif()
set_target_properties(qgis_server PROPERTIES UNITY_BUILD ${ENABLE_UNITY_BUILDS})
# require c++17
target_compile_features(qgis_server PRIVATE cxx_std_17)
# require c++20
target_compile_features(qgis_server PRIVATE cxx_std_20)
target_include_directories(qgis_server SYSTEM PUBLIC
${FCGI_INCLUDE_DIR}
@ -154,9 +154,9 @@ set(QGIS_SERVER_TESTRCCS ../../tests/testdata/testdata.qrc)
add_executable(qgis_mapserv.fcgi qgis_map_serv.cpp ${QGIS_SERVER_TESTRCCS})
add_executable(qgis_mapserver qgis_mapserver.cpp ${QGIS_SERVER_TESTRCCS})
# require c++17
target_compile_features(qgis_mapserv.fcgi PRIVATE cxx_std_17)
target_compile_features(qgis_mapserver PRIVATE cxx_std_17)
# require c++20
target_compile_features(qgis_mapserv.fcgi PRIVATE cxx_std_20)
target_compile_features(qgis_mapserver PRIVATE cxx_std_20)
target_link_libraries(qgis_mapserv.fcgi qgis_server)
target_link_libraries(qgis_mapserver qgis_server)

View File

@ -13,8 +13,8 @@ set (LANDINGPAGE_SRCS
add_library (landingpage MODULE ${LANDINGPAGE_SRCS})
# require c++17
target_compile_features(landingpage PRIVATE cxx_std_17)
# require c++20
target_compile_features(landingpage PRIVATE cxx_std_20)
include_directories(SYSTEM
)

View File

@ -15,8 +15,8 @@ set (wcs_SRCS
add_library (wcs MODULE ${wcs_SRCS})
# require c++17
target_compile_features(wcs PRIVATE cxx_std_17)
# require c++20
target_compile_features(wcs PRIVATE cxx_std_20)
include_directories(
${CMAKE_SOURCE_DIR}/src/server

View File

@ -31,8 +31,8 @@ foreach(_library_type MODULE STATIC)
add_library (${_library_name} ${_library_type} ${WFS_SRCS} ${WFS_HDRS})
# require c++17
target_compile_features(${_library_name} PRIVATE cxx_std_17)
# require c++20
target_compile_features(${_library_name} PRIVATE cxx_std_20)
target_include_directories(${_library_name} PUBLIC
${CMAKE_SOURCE_DIR}/src/server

View File

@ -42,8 +42,8 @@ foreach(_library_type MODULE STATIC)
add_library(${_library_name} ${_library_type} ${WMS_SRCS} ${WMS_HDRS})
# require c++17
target_compile_features(${_library_name} PRIVATE cxx_std_17)
# require c++20
target_compile_features(${_library_name} PRIVATE cxx_std_20)
target_include_directories(${_library_name} PUBLIC
${CMAKE_SOURCE_DIR}/src/server

View File

@ -20,8 +20,8 @@ set (WMTS_HDRS
add_library (wmts MODULE ${WMTS_SRCS} ${WMTS_HDRS})
# require c++17
target_compile_features(wmts PRIVATE cxx_std_17)
# require c++20
target_compile_features(wmts PRIVATE cxx_std_20)
include_directories(

View File

@ -14,8 +14,8 @@ add_library(qgis_test ${LIBRARY_TYPE}
${QGIS_TEST_HDRS}
)
# require c++17
target_compile_features(qgis_test PRIVATE cxx_std_17)
# require c++20
target_compile_features(qgis_test PRIVATE cxx_std_20)
target_include_directories(qgis_test PUBLIC
${CMAKE_SOURCE_DIR}/src/test

View File

@ -11,8 +11,8 @@ set (BENCH_SRCS
add_executable (qgis_bench WIN32 ${BENCH_SRCS} )
# require c++17
target_compile_features(qgis_bench PRIVATE cxx_std_17)
# require c++20
target_compile_features(qgis_bench PRIVATE cxx_std_20)
include_directories(

View File

@ -25,7 +25,7 @@ add_executable(qgis_3d_sandbox
qgis_3d_sandbox.cpp
)
# require c++17
target_compile_features(qgis_3d_sandbox PRIVATE cxx_std_17)
target_compile_features(qgis_3d_sandbox PRIVATE cxx_std_20)
set_target_properties(qgis_3d_sandbox PROPERTIES AUTORCC TRUE)
target_link_libraries(qgis_3d_sandbox

View File

@ -14,7 +14,7 @@ if (ENABLE_TESTS)
set (TESTNAME "test_${ARG_QGIS_TEST_MODULE}_${TESTNAME}")
add_executable(${TESTNAME} ${TESTSRC} ${util_SRCS})
# add_custom_target(${TESTNAME}moc ALL DEPENDS ${${TESTNAME}_MOC_SRCS})
target_compile_features(${TESTNAME} PRIVATE cxx_std_17)
target_compile_features(${TESTNAME} PRIVATE cxx_std_20)
set_target_properties(${TESTNAME} PROPERTIES AUTORCC TRUE)
target_link_libraries(${TESTNAME} ${ARG_QGIS_TEST_LINKEDLIBRARIES})
target_link_libraries(${TESTNAME} qgis_test)

View File

@ -84,7 +84,7 @@ if(UNIX AND NOT ANDROID AND CMAKE_BUILD_TYPE MATCHES Debug)
)
add_executable(test_provider_wcs ${WCSTEST_SRCS} )
target_compile_features(test_provider_wcs PRIVATE cxx_std_17)
target_compile_features(test_provider_wcs PRIVATE cxx_std_20)
target_compile_definitions(test_provider_wcs PRIVATE "CMAKE_SOURCE_DIR=\"${CMAKE_SOURCE_DIR}\"")
include_directories(${CMAKE_CURRENT_SOURCE_DIR}

View File

@ -10,7 +10,7 @@ macro (ADD_QGIS_GRASS_TEST grass_build_version testname testsrc)
set(qgis_${testname}${grass_build_version}_SRCS ${testsrc} ${util_SRCS})
add_custom_target(qgis_${testname}${grass_build_version}moc ALL DEPENDS ${qgis_${testname}${grass_build_version}_MOC_SRCS})
add_executable(qgis_${testname}${grass_build_version} ${qgis_${testname}${grass_build_version}_SRCS})
target_compile_features(qgis_${testname}${grass_build_version} PRIVATE cxx_std_17)
target_compile_features(qgis_${testname}${grass_build_version} PRIVATE cxx_std_20)
include_directories(
${CMAKE_BINARY_DIR}/src/providers/grass/${grass_build_version}

View File

@ -65,84 +65,6 @@ class TestQgsProject(QgisTestCase):
QgisTestCase.__init__(self, methodName)
self.messageCaught = False
def test_makeKeyTokens_(self):
# see http://www.w3.org/TR/REC-xml/#d0e804 for a list of valid characters
invalidTokens = []
validTokens = []
# all test tokens will be generated by prepending or inserting characters to this token
validBase = "valid"
# some invalid characters, not allowed anywhere in a token
# note that '/' must not be added here because it is taken as a separator by makeKeyTokens_()
invalidChars = "+*,;<>|!$%()=?#\x01"
# generate the characters that are allowed at the start of a token (and at every other position)
validStartChars = ":_"
charRanges = [
(ord("a"), ord("z")),
(ord("A"), ord("Z")),
(0x00F8, 0x02FF),
(0x0370, 0x037D),
(0x037F, 0x1FFF),
(0x200C, 0x200D),
(0x2070, 0x218F),
(0x2C00, 0x2FEF),
(0x3001, 0xD7FF),
(0xF900, 0xFDCF),
(0xFDF0, 0xFFFD),
# (0x10000, 0xEFFFF), while actually valid, these are not yet accepted by makeKeyTokens_()
]
for r in charRanges:
for c in range(r[0], r[1]):
validStartChars += chr(c)
# generate the characters that are only allowed inside a token, not at the start
validInlineChars = "-.\xB7"
charRanges = [
(ord("0"), ord("9")),
(0x0300, 0x036F),
(0x203F, 0x2040),
]
for r in charRanges:
for c in range(r[0], r[1]):
validInlineChars += chr(c)
# test forbidden start characters
for c in invalidChars + validInlineChars:
invalidTokens.append(c + validBase)
# test forbidden inline characters
for c in invalidChars:
invalidTokens.append(validBase[:4] + c + validBase[4:])
# test each allowed start character
for c in validStartChars:
validTokens.append(c + validBase)
# test each allowed inline character
for c in validInlineChars:
validTokens.append(validBase[:4] + c + validBase[4:])
logger = QgsApplication.messageLog()
logger.messageReceived.connect(self.catchMessage)
prj = QgsProject.instance()
for token in validTokens:
self.messageCaught = False
prj.readEntry("test", token)
myMessage = f"valid token '{token}' not accepted"
assert not self.messageCaught, myMessage
for token in invalidTokens:
self.messageCaught = False
prj.readEntry("test", token)
myMessage = f"invalid token '{token}' accepted"
assert self.messageCaught, myMessage
logger.messageReceived.disconnect(self.catchMessage)
def catchMessage(self):
self.messageCaught = True

View File

@ -38,7 +38,7 @@ add_executable(${QGIS_QUICK_APP_NAME}
${QGIS_QUICK_APP_MOC_SRCS}
)
target_compile_features(${QGIS_QUICK_APP_NAME} PRIVATE cxx_std_17)
target_compile_features(${QGIS_QUICK_APP_NAME} PRIVATE cxx_std_20)
target_link_libraries(${QGIS_QUICK_APP_NAME}
${QT_VERSION_BASE}::Gui