summaryrefslogtreecommitdiffstats
path: root/src/corelib/global
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/global')
-rw-r--r--src/corelib/global/qcompilerdetection.h1
-rw-r--r--src/corelib/global/qconfig-bootstrapped.h2
-rw-r--r--src/corelib/global/qflags.h7
-rw-r--r--src/corelib/global/qfloat16.cpp8
-rw-r--r--src/corelib/global/qfloat16.h13
-rw-r--r--src/corelib/global/qglobal.cpp28
-rw-r--r--src/corelib/global/qglobal.h6
-rw-r--r--src/corelib/global/qlibraryinfo.cpp17
-rw-r--r--src/corelib/global/qlogging.cpp2
-rw-r--r--src/corelib/global/qnamespace.h5
-rw-r--r--src/corelib/global/qnamespace.qdoc32
11 files changed, 87 insertions, 34 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index 60dc7ce688..b1fcf09e92 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -365,7 +365,6 @@
# define Q_COMPILER_ATTRIBUTES
# define Q_COMPILER_AUTO_FUNCTION
# define Q_COMPILER_CLASS_ENUM
-# define Q_COMPILER_CONSTEXPR
# define Q_COMPILER_DECLTYPE
# define Q_COMPILER_DEFAULT_MEMBERS
# define Q_COMPILER_DELETE_MEMBERS
diff --git a/src/corelib/global/qconfig-bootstrapped.h b/src/corelib/global/qconfig-bootstrapped.h
index c6f071bc3f..b62c1a4d35 100644
--- a/src/corelib/global/qconfig-bootstrapped.h
+++ b/src/corelib/global/qconfig-bootstrapped.h
@@ -74,6 +74,8 @@
#else
# define QT_FEATURE_alloca_malloc_h -1
#endif
+#define QT_FEATURE_binaryjson -1
+#define QT_FEATURE_cborstream -1
#define QT_CRYPTOGRAPHICHASH_ONLY_SHA1
#define QT_FEATURE_cxx11_random (__has_include(<random>) ? 1 : -1)
#define QT_NO_DATASTREAM
diff --git a/src/corelib/global/qflags.h b/src/corelib/global/qflags.h
index bd3c219968..4f46de5eaa 100644
--- a/src/corelib/global/qflags.h
+++ b/src/corelib/global/qflags.h
@@ -93,8 +93,10 @@ class QFlags
"long long will overflow.");
Q_STATIC_ASSERT_X((std::is_enum<Enum>::value), "QFlags is only usable on enumeration types.");
+#if QT_DEPRECATED_SINCE(5,15)
struct Private;
typedef int (Private::*Zero);
+#endif
template <typename E> friend QDataStream &operator>>(QDataStream &, QFlags<E> &);
template <typename E> friend QDataStream &operator<<(QDataStream &, QFlags<E>);
public:
@@ -115,8 +117,11 @@ public:
Q_DECL_CONSTEXPR inline QFlags(const QFlags &other);
Q_DECL_CONSTEXPR inline QFlags &operator=(const QFlags &other);
#endif
+ Q_DECL_CONSTEXPR inline QFlags() noexcept : i(0) {}
Q_DECL_CONSTEXPR inline QFlags(Enum flags) noexcept : i(Int(flags)) {}
- Q_DECL_CONSTEXPR inline QFlags(Zero = nullptr) noexcept : i(0) {}
+#if QT_DEPRECATED_SINCE(5,15)
+ QT_DEPRECATED_X("Use default constructor instead") Q_DECL_CONSTEXPR inline QFlags(Zero) noexcept : i(0) {}
+#endif
Q_DECL_CONSTEXPR inline QFlags(QFlag flag) noexcept : i(flag) {}
Q_DECL_CONSTEXPR inline QFlags(std::initializer_list<Enum> flags) noexcept
diff --git a/src/corelib/global/qfloat16.cpp b/src/corelib/global/qfloat16.cpp
index 6c21b7de5a..97709d7685 100644
--- a/src/corelib/global/qfloat16.cpp
+++ b/src/corelib/global/qfloat16.cpp
@@ -146,6 +146,14 @@ QT_BEGIN_NAMESPACE
*/
/*!
+ \since 5.15
+ \fn qfloat16::copySign(qfloat16 sign) const noexcept
+
+ Returns a qfloat16 with the sign of \a sign but the rest of its value taken
+ from this qfloat16. Serves as qfloat16's equivalent of std::copysign().
+*/
+
+/*!
\internal
\since 5.14
Implements qFpClassify() for qfloat16.
diff --git a/src/corelib/global/qfloat16.h b/src/corelib/global/qfloat16.h
index 02fd2f03cc..f35eefd922 100644
--- a/src/corelib/global/qfloat16.h
+++ b/src/corelib/global/qfloat16.h
@@ -84,6 +84,9 @@ public:
bool isNaN() const noexcept { return ((b16 >> 8) & 0x7e) == 0x7e; }
bool isFinite() const noexcept { return ((b16 >> 8) & 0x7c) != 0x7c; }
Q_CORE_EXPORT int fpClassify() const noexcept;
+ // Can't specialize std::copysign() for qfloat16
+ qfloat16 copySign(qfloat16 sign) const noexcept
+ { return qfloat16(Wrap((sign.b16 & 0x8000) | (b16 & 0x7fff))); }
// Support for std::numeric_limits<qfloat16>
static constexpr qfloat16 _limit_epsilon() noexcept { return qfloat16(Wrap(0x1400)); }
static constexpr qfloat16 _limit_min() noexcept { return qfloat16(Wrap(0x400)); }
@@ -92,7 +95,9 @@ public:
static constexpr qfloat16 _limit_lowest() noexcept { return qfloat16(Wrap(0xfbff)); }
static constexpr qfloat16 _limit_infinity() noexcept { return qfloat16(Wrap(0x7c00)); }
static constexpr qfloat16 _limit_quiet_NaN() noexcept { return qfloat16(Wrap(0x7e00)); }
- // Signalling NaN is 0x7f00
+#if QT_CONFIG(signaling_nan)
+ static constexpr qfloat16 _limit_signaling_NaN() noexcept { return qfloat16(Wrap(0x7f00)); }
+#endif
inline constexpr bool isNormal() const noexcept
{ return (b16 & 0x7fff) == 0 || ((b16 & 0x7c00) && (b16 & 0x7c00) != 0x7c00); }
private:
@@ -328,6 +333,12 @@ public:
{ return QT_PREPEND_NAMESPACE(qfloat16)::_limit_infinity(); }
static constexpr QT_PREPEND_NAMESPACE(qfloat16) quiet_NaN()
{ return QT_PREPEND_NAMESPACE(qfloat16)::_limit_quiet_NaN(); }
+#if QT_CONFIG(signaling_nan)
+ static constexpr QT_PREPEND_NAMESPACE(qfloat16) signaling_NaN()
+ { return QT_PREPEND_NAMESPACE(qfloat16)::_limit_signaling_NaN(); }
+#else
+ static constexpr bool has_signaling_NaN = false;
+#endif
};
template<> class numeric_limits<const QT_PREPEND_NAMESPACE(qfloat16)>
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index b662233d4e..025ec4ee33 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -250,7 +250,7 @@ Q_STATIC_ASSERT((std::is_same<qsizetype, qptrdiff>::value));
Qt::Alignment type is simply a typedef for
QFlags<Qt::AlignmentFlag>. QLabel::setAlignment() takes a
Qt::Alignment parameter, which means that any combination of
- Qt::AlignmentFlag values, or 0, is legal:
+ Qt::AlignmentFlag values, or \c{{ }}, is legal:
\snippet code/src_corelib_global_qglobal.cpp 0
@@ -318,10 +318,20 @@ Q_STATIC_ASSERT((std::is_same<qsizetype, qptrdiff>::value));
*/
/*!
+ \fn template <typename Enum> QFlags<Enum>::QFlags()
+ \since 5.15
+
+ Constructs a QFlags object with no flags set.
+*/
+
+/*!
\fn template <typename Enum> QFlags<Enum>::QFlags(Zero)
+ \deprecated
Constructs a QFlags object with no flags set. The parameter must be a
literal 0 value.
+
+ Deprecated, use default constructor instead.
*/
/*!
@@ -4800,9 +4810,11 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters)
/*!
\macro qMove(x)
\relates <QtGlobal>
+ \obsolete
- It expands to "std::move" if your compiler supports that C++11 function, or to nothing
- otherwise.
+ Use \c std::move instead.
+
+ It expands to "std::move".
qMove takes an rvalue reference to its parameter \a x, and converts it to an xvalue.
*/
@@ -4903,6 +4915,7 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters)
/*!
\macro Q_DECL_OVERRIDE
\since 5.0
+ \obsolete
\relates <QtGlobal>
This macro can be used to declare an overriding virtual
@@ -4910,8 +4923,7 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters)
an error if the overriding virtual function does not in fact
override anything.
- It expands to "override" if your compiler supports that C++11
- contextual keyword, or to nothing otherwise.
+ It expands to "override".
The macro goes at the end of the function, usually after the
\c{const}, if any:
@@ -4923,6 +4935,7 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters)
/*!
\macro Q_DECL_FINAL
\since 5.0
+ \obsolete
\relates <QtGlobal>
This macro can be used to declare an overriding virtual or a class
@@ -4930,10 +4943,7 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters)
no longer override this virtual function, or inherit from this
class, respectively.
- It expands to "final" if your compiler supports that C++11
- contextual keyword, or something non-standard if your compiler
- supports something close enough to the C++11 semantics, or to
- nothing otherwise.
+ It expands to "final".
The macro goes at the end of the function, usually after the
\c{const}, if any:
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index e335916eac..861f087c60 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -1266,8 +1266,10 @@ inline int qIntCast(float f) { return int(f); }
/*
Reentrant versions of basic rand() functions for random number generation
*/
-Q_CORE_EXPORT void qsrand(uint seed);
-Q_CORE_EXPORT int qrand();
+#if QT_DEPRECATED_SINCE(5, 15)
+Q_CORE_EXPORT QT_DEPRECATED_VERSION_X_5_15("use QRandomGenerator instead") void qsrand(uint seed);
+Q_CORE_EXPORT QT_DEPRECATED_VERSION_X_5_15("use QRandomGenerator instead") int qrand();
+#endif
#define QT_MODULE(x)
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
index 276741c9fb..ecd26233cd 100644
--- a/src/corelib/global/qlibraryinfo.cpp
+++ b/src/corelib/global/qlibraryinfo.cpp
@@ -124,12 +124,12 @@ public:
QLibrarySettings *ls = qt_library_settings();
if (ls) {
#ifndef QT_BUILD_QMAKE
- if (ls->reloadOnQAppAvailable && QCoreApplication::instance() != 0)
+ if (ls->reloadOnQAppAvailable && QCoreApplication::instance() != nullptr)
ls->load();
#endif
return ls->settings.data();
} else {
- return 0;
+ return nullptr;
}
}
};
@@ -146,7 +146,7 @@ void QLibrarySettings::load()
// If we get any settings here, those won't change when the application shows up.
settings.reset(QLibraryInfoPrivate::findConfiguration());
#ifndef QT_BUILD_QMAKE
- reloadOnQAppAvailable = (settings.data() == 0 && QCoreApplication::instance() == 0);
+ reloadOnQAppAvailable = (settings.data() == nullptr && QCoreApplication::instance() == nullptr);
bool haveDevicePaths;
bool haveEffectivePaths;
bool havePaths;
@@ -169,7 +169,7 @@ void QLibrarySettings::load()
|| children.contains(QLatin1String("Paths"));
#ifndef QT_BUILD_QMAKE
if (!havePaths)
- settings.reset(0);
+ settings.reset(nullptr);
#else
} else {
haveDevicePaths = false;
@@ -212,7 +212,7 @@ QSettings *QLibraryInfoPrivate::findConfiguration()
return new QSettings(qtconfig, QSettings::IniFormat);
}
#endif
- return 0; //no luck
+ return nullptr; //no luck
}
#endif // settings
@@ -745,7 +745,12 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group)
#ifndef QT_BUILD_QMAKE_BOOTSTRAP
if (!fromConf) {
- const char * volatile path = 0;
+ // "volatile" here is a hack to prevent compilers from doing a
+ // compile-time strlen() on "path". The issue is that Qt installers
+ // will binary-patch the Qt installation paths -- in such scenarios, Qt
+ // will be built with a dummy path, thus the compile-time result of
+ // strlen is meaningless.
+ const char * volatile path = nullptr;
if (loc == PrefixPath) {
path = getPrefix(
#ifdef QT_BUILD_QMAKE
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp
index 5a7f8242de..c1a45476f9 100644
--- a/src/corelib/global/qlogging.cpp
+++ b/src/corelib/global/qlogging.cpp
@@ -1315,7 +1315,7 @@ static QStringList backtraceFramesForLogMessage(int frameCount)
if (function.startsWith(QLatin1String("_Z"))) {
QScopedPointer<char, QScopedPointerPodDeleter> demangled(
- abi::__cxa_demangle(function.toUtf8(), 0, 0, 0));
+ abi::__cxa_demangle(function.toUtf8(), nullptr, nullptr, nullptr));
if (demangled)
function = QString::fromUtf8(qCleanupFuncinfo(demangled.data()));
}
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 bebe67be3f..ef5f345e9c 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -2848,24 +2848,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
*/
/*!