diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-10-17 01:01:01 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-10-17 01:01:01 +0200 |
commit | 6f27bb135246b7fe9d11ba58e05d2b7661bc2080 (patch) | |
tree | 9704e1c4ffb775472a9984872c3bd292faa999a5 /src/corelib/global | |
parent | dc4212b3a694e143595968419ae5ad695ab2aa03 (diff) | |
parent | c222a9283d94ad1e29334bb2fba0beef7cc716c7 (diff) |
Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ica69de99be9c8af4d28a52e4b69e6af748ed983c
Diffstat (limited to 'src/corelib/global')
-rw-r--r-- | src/corelib/global/qconfig-bootstrapped.h | 1 | ||||
-rw-r--r-- | src/corelib/global/qglobal.cpp | 29 | ||||
-rw-r--r-- | src/corelib/global/qnamespace.h | 5 | ||||
-rw-r--r-- | src/corelib/global/qnamespace.qdoc | 32 |
4 files changed, 38 insertions, 29 deletions
diff --git a/src/corelib/global/qconfig-bootstrapped.h b/src/corelib/global/qconfig-bootstrapped.h index e6ad80525a..e9383ca68b 100644 --- a/src/corelib/global/qconfig-bootstrapped.h +++ b/src/corelib/global/qconfig-bootstrapped.h @@ -74,6 +74,7 @@ #else # define QT_FEATURE_alloca_malloc_h -1 #endif +#define QT_FEATURE_cborstream -1 #define QT_CRYPTOGRAPHICHASH_ONLY_SHA1 #define QT_FEATURE_cxx11_random (QT_HAS_INCLUDE(<random>) ? 1 : -1) #define QT_NO_DATASTREAM diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 114a4d71e2..a06e9ab6c6 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -47,12 +47,11 @@ #include "qoperatingsystemversion.h" #include "qoperatingsystemversion_p.h" #if defined(Q_OS_WIN) || defined(Q_OS_CYGWIN) || defined(Q_OS_WINRT) -#include "qoperatingsystemversion_win_p.h" -# if QT_CONFIG(settings) -# include "qsettings.h" -# include "qvariant.h" +# include "qoperatingsystemversion_win_p.h" +# ifndef Q_OS_WINRT +# include "private/qwinregistry_p.h" # endif -#endif +#endif // Q_OS_WIN || Q_OS_CYGWIN #include <private/qlocale_tools_p.h> #include <qmutex.h> @@ -2206,28 +2205,25 @@ const QSysInfo::WinVersion QSysInfo::WindowsVersion = QSysInfo::windowsVersion() QT_WARNING_POP #endif -static QString readRegistryString(const QString &key, const QString &subKey) +static QString readVersionRegistryString(const wchar_t *subKey) { -#if QT_CONFIG(settings) - QSettings settings(key, QSettings::NativeFormat); - return settings.value(subKey).toString(); +#if !defined(QT_BUILD_QMAKE) && !defined(Q_OS_WINRT) + return QWinRegistryKey(HKEY_LOCAL_MACHINE, LR"(SOFTWARE\Microsoft\Windows NT\CurrentVersion)") + .stringValue(subKey); #else - Q_UNUSED(key); - Q_UNUSED(subKey); - return QString(); + Q_UNUSED(subKey); + return QString(); #endif } -static inline QString windowsVersionKey() { return QStringLiteral(R"(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion)"); } - static inline QString windows10ReleaseId() { - return readRegistryString(windowsVersionKey(), QStringLiteral("ReleaseId")); + return readVersionRegistryString(L"ReleaseId"); } static inline QString windows7Build() { - return readRegistryString(windowsVersionKey(), QStringLiteral("CurrentBuild")); + return readVersionRegistryString(L"CurrentBuild"); } static QString winSp_helper() @@ -3094,6 +3090,7 @@ QByteArray QSysInfo::machineUniqueId() } #elif defined(Q_OS_WIN) && !defined(Q_OS_WINRT) // Let's poke at the registry + // ### Qt 6: Use new helpers from qwinregistry.cpp (once bootstrap builds are obsolete) HKEY key = NULL; if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Cryptography", 0, KEY_READ | KEY_WOW64_64KEY, &key) == ERROR_SUCCESS) { diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 810c55709c..047ed8e7b3 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -1575,9 +1575,12 @@ public: MatchContains = 1, MatchStartsWith = 2, MatchEndsWith = 3, - MatchRegExp = 4, +#if QT_DEPRECATED_SINCE(5, 15) + MatchRegExp Q_DECL_ENUMERATOR_DEPRECATED_X("MatchRegExp is deprecated. Use MatchRegularExpression instead") = 4, +#endif MatchWildcard = 5, MatchFixedString = 8, + MatchRegularExpression = 9, MatchCaseSensitive = 16, MatchWrap = 32, MatchRecursive = 64 diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index cce88782e9..9896cf6e02 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -2840,24 +2840,32 @@ This enum describes the type of matches that can be used when searching for items in a model. - \value MatchExactly Performs QVariant-based matching. - \value MatchFixedString Performs string-based matching. + \value MatchExactly Performs QVariant-based matching. + \value MatchFixedString Performs string-based matching. String-based comparisons are case-insensitive unless the \c MatchCaseSensitive flag is also specified. - \value MatchContains The search term is contained in the item. - \value MatchStartsWith The search term matches the start of the item. - \value MatchEndsWith The search term matches the end of the item. - \value MatchCaseSensitive The search is case sensitive. - \value MatchRegExp Performs string-based matching using a regular - expression as the search term. - \value MatchWildcard Performs string-based matching using a string with + \value MatchContains The search term is contained in the item. + \value MatchStartsWith The search term matches the start of the item. + \value MatchEndsWith The search term matches the end of the item. + \value MatchCaseSensitive The search is case sensitive. + \value MatchRegExp Performs string-based matching using a regular + expression as the search term. Uses the deprecated QRegExp class. + \e{This enum value is deprecated since Qt 5.15.} + \value MatchRegularExpression Performs string-based matching using a regular + expression as the search term. Uses QRegularExpression. + When using this flag, a QRegularExpression object can be passed as + parameter and will directly be used to perform the search. The case + sensitivity flag will be ignored as the QRegularExpression object is + expected to be fully configured. + This enum value was added in Qt 5.15. + \value MatchWildcard Performs string-based matching using a string with wildcards as the search term. - \value MatchWrap Perform a search that wraps around, so that when + \value MatchWrap Perform a search that wraps around, so that when the search reaches the last item in the model, it begins again at the first item and continues until all items have been examined. - \value MatchRecursive Searches the entire hierarchy. + \value MatchRecursive Searches the entire hierarchy. - \sa QString::compare(), QRegExp + \sa QString::compare(), QRegExp, QRegularExpression */ /*! |