summaryrefslogtreecommitdiffstats
path: root/src/corelib/global
diff options
context:
space:
mode:
authorLeander Beernaert <leander.beernaert@qt.io>2020-01-22 13:47:08 +0100
committerLeander Beernaert <leander.beernaert@qt.io>2020-01-24 13:17:33 +0100
commit502d3d6744913899da87acfda5ebdab42c40329e (patch)
tree16658a328503bfd5a62b4fd5d69ffb66e9854b18 /src/corelib/global
parentd1be8b9ceb2c7b20bbe53a07154c79699540ea3d (diff)
parent06bb315beb6c2c398223cfe52cbc7f66e14a8557 (diff)
Merge remote-tracking branch 'origin/dev' into merge-dev
Diffstat (limited to 'src/corelib/global')
-rw-r--r--src/corelib/global/qcompilerdetection.h98
-rw-r--r--src/corelib/global/qconfig-bootstrapped.h7
-rw-r--r--src/corelib/global/qendian.cpp7
-rw-r--r--src/corelib/global/qendian.h4
-rw-r--r--src/corelib/global/qflags.h7
-rw-r--r--src/corelib/global/qfloat16.cpp16
-rw-r--r--src/corelib/global/qfloat16.h14
-rw-r--r--src/corelib/global/qglobal.cpp66
-rw-r--r--src/corelib/global/qglobal.h14
-rw-r--r--src/corelib/global/qglobal_p.h4
-rw-r--r--src/corelib/global/qlibraryinfo.cpp52
-rw-r--r--src/corelib/global/qlogging.cpp10
-rw-r--r--src/corelib/global/qnamespace.h201
-rw-r--r--src/corelib/global/qnamespace.qdoc22
-rw-r--r--src/corelib/global/qnumeric_p.h3
-rw-r--r--src/corelib/global/qoperatingsystemversion.cpp2
-rw-r--r--src/corelib/global/qrandom.cpp2
17 files changed, 284 insertions, 245 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index ad3d2be69b..99a30e941b 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -358,7 +358,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
@@ -494,6 +493,39 @@
#endif
/*
+ * SG10's SD-6 feature detection and some useful extensions from Clang and GCC
+ * https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations
+ * http://clang.llvm.org/docs/LanguageExtensions.html#feature-checking-macros
+ * Not using wrapper macros, per http://eel.is/c++draft/cpp.cond#7.sentence-2
+ */
+#ifndef __has_builtin
+# define __has_builtin(x) 0
+#endif
+#ifndef __has_feature
+# define __has_feature(x) 0
+#endif
+#ifndef __has_attribute
+# define __has_attribute(x) 0
+#endif
+#ifndef __has_cpp_attribute
+# define __has_cpp_attribute(x) 0
+#endif
+#ifndef __has_include
+# define __has_include(x) 0
+#endif
+#ifndef __has_include_next
+# define __has_include_next(x) 0
+#endif
+
+// Kept around until all submodules have transitioned
+#define QT_HAS_BUILTIN(x) __has_builtin(x)
+#define QT_HAS_FEATURE(x) __has_feature(x)
+#define QT_HAS_ATTRIBUTE(x) __has_attribute(x)
+#define QT_HAS_CPP_ATTRIBUTE(x) __has_cpp_attribute(x)
+#define QT_HAS_INCLUDE(x) __has_include(x)
+#define QT_HAS_INCLUDE_NEXT(x) __has_include_next(x)
+
+/*
* C++11 support
*
* Paper Macro SD-6 macro
@@ -783,13 +815,14 @@
# endif
# endif
-# if defined(__has_warning)
-# if __has_warning("-Wunused-private-field")
-# define Q_DECL_UNUSED_MEMBER Q_DECL_UNUSED
-# endif
-# endif
+#endif // Q_CC_CLANG && !Q_CC_INTEL && !Q_CC_MSVC
-#endif // Q_CC_CLANG
+#if defined(Q_CC_CLANG) && !defined(Q_CC_INTEL)
+# ifndef Q_DECL_UNUSED
+# define Q_DECL_UNUSED __attribute__((__unused__))
+# endif
+# define Q_DECL_UNUSED_MEMBER Q_DECL_UNUSED
+#endif
#if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && !defined(Q_CC_CLANG)
# define Q_COMPILER_RESTRICTED_VLA
@@ -837,7 +870,6 @@
# define Q_COMPILER_DEFAULT_MEMBERS
# define Q_COMPILER_DELETE_MEMBERS
/* C++11 features supported in GCC 4.6: */
-# define Q_COMPILER_CONSTEXPR
# define Q_COMPILER_NULLPTR
# define Q_COMPILER_UNRESTRICTED_UNIONS
# define Q_COMPILER_RANGE_FOR
@@ -868,7 +900,11 @@
# define Q_COMPILER_REF_QUALIFIERS
# endif
# endif
- /* C++11 features are complete as of GCC 4.8.1 */
+# if Q_CC_GNU >= 500
+ /* GCC 4.6 introduces constexpr, but it's bugged (at least) in the whole
+ * 4.x series, see e.g. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57694 */
+# define Q_COMPILER_CONSTEXPR
+# endif
# endif
# if __cplusplus > 201103L
# if Q_CC_GNU >= 409
@@ -1020,37 +1056,6 @@
#endif
/*
- * SG10's SD-6 feature detection and some useful extensions from Clang and GCC
- * https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations
- * http://clang.llvm.org/docs/LanguageExtensions.html#feature-checking-macros
- */
-#ifdef __has_builtin
-# define QT_HAS_BUILTIN(x) __has_builtin(x)
-#else
-# define QT_HAS_BUILTIN(x) 0
-#endif
-#ifdef __has_attribute
-# define QT_HAS_ATTRIBUTE(x) __has_attribute(x)
-#else
-# define QT_HAS_ATTRIBUTE(x) 0
-#endif
-#ifdef __has_cpp_attribute
-# define QT_HAS_CPP_ATTRIBUTE(x) __has_cpp_attribute(x)
-#else
-# define QT_HAS_CPP_ATTRIBUTE(x) 0
-#endif
-#ifdef __has_include
-# define QT_HAS_INCLUDE(x) __has_include(x)
-#else
-# define QT_HAS_INCLUDE(x) 0
-#endif
-#ifdef __has_include_next
-# define QT_HAS_INCLUDE_NEXT(x) __has_include_next(x)
-#else
-# define QT_HAS_INCLUDE_NEXT(x) 0
-#endif
-
-/*
* C++11 keywords and expressions
*/
#ifdef Q_COMPILER_NULLPTR
@@ -1124,7 +1129,7 @@
# define Q_DECL_ALIGN(n) alignas(n)
#endif
-#if QT_HAS_CPP_ATTRIBUTE(nodiscard) && !defined(Q_CC_CLANG) // P0188R1
+#if __has_cpp_attribute(nodiscard) && !defined(Q_CC_CLANG) // P0188R1
// Can't use [[nodiscard]] with Clang, see https://bugs.llvm.org/show_bug.cgi?id=33518
# undef Q_REQUIRED_RESULT
# define Q_REQUIRED_RESULT [[nodiscard]]
@@ -1226,11 +1231,6 @@
#ifndef QT_MAKE_CHECKED_ARRAY_ITERATOR
# define QT_MAKE_CHECKED_ARRAY_ITERATOR(x, N) (x)
#endif
-#ifdef __has_feature
-# define QT_HAS_FEATURE(x) __has_feature(x)
-#else
-# define QT_HAS_FEATURE(x) 0
-#endif
/*
* Warning/diagnostic handling
@@ -1321,11 +1321,11 @@
} while (false)
#if defined(__cplusplus)
-#if QT_HAS_CPP_ATTRIBUTE(clang::fallthrough)
+#if __has_cpp_attribute(clang::fallthrough)
# define Q_FALLTHROUGH() [[clang::fallthrough]]
-#elif QT_HAS_CPP_ATTRIBUTE(gnu::fallthrough)
+#elif __has_cpp_attribute(gnu::fallthrough)
# define Q_FALLTHROUGH() [[gnu::fallthrough]]
-#elif QT_HAS_CPP_ATTRIBUTE(fallthrough)
+#elif __has_cpp_attribute(fallthrough)
# define Q_FALLTHROUGH() [[fallthrough]]
#endif
#endif
diff --git a/src/corelib/global/qconfig-bootstrapped.h b/src/corelib/global/qconfig-bootstrapped.h
index c58dc56c42..4a8a4598a0 100644
--- a/src/corelib/global/qconfig-bootstrapped.h
+++ b/src/corelib/global/qconfig-bootstrapped.h
@@ -75,15 +75,16 @@
# define QT_FEATURE_alloca_malloc_h -1
#endif
#define QT_FEATURE_binaryjson -1
-#define QT_FEATURE_cborstream -1
+#define QT_FEATURE_cborstreamreader -1
+#define QT_FEATURE_cborstreamwriter 1
#define QT_CRYPTOGRAPHICHASH_ONLY_SHA1
-#define QT_FEATURE_cxx11_random (QT_HAS_INCLUDE(<random>) ? 1 : -1)
+#define QT_FEATURE_cxx11_random (__has_include(<random>) ? 1 : -1)
#define QT_NO_DATASTREAM
#define QT_FEATURE_datestring 1
#define QT_FEATURE_datetimeparser -1
#define QT_FEATURE_easingcurve -1
#define QT_FEATURE_etw -1
-#define QT_FEATURE_getauxval (QT_HAS_INCLUDE(<sys/auxv.h>) ? 1 : -1)
+#define QT_FEATURE_getauxval (__has_include(<sys/auxv.h>) ? 1 : -1)
#define QT_FEATURE_getentropy -1
#define QT_NO_GEOM_VARIANT
#define QT_FEATURE_hijricalendar -1
diff --git a/src/corelib/global/qendian.cpp b/src/corelib/global/qendian.cpp
index c56a7ffbf7..c69572cccf 100644
--- a/src/corelib/global/qendian.cpp
+++ b/src/corelib/global/qendian.cpp
@@ -137,7 +137,7 @@ QT_BEGIN_NAMESPACE
\sa qToLittleEndian()
*/
/*!
- \fn template <typename T> T qFromLittleEndian(const void *src)
+ \fn template <typename T> inline T qFromLittleEndian(const void *src)
\since 4.3
\relates <QtEndian>
@@ -159,7 +159,7 @@ QT_BEGIN_NAMESPACE
\sa qToLittleEndian()
*/
/*!
- \fn template <typename T> T qFromLittleEndian(T src)
+ \fn template <typename T> inline T qFromLittleEndian(T src)
\since 4.3
\relates <QtEndian>
\overload
@@ -171,7 +171,7 @@ QT_BEGIN_NAMESPACE
unmodified.
*/
/*!
- \fn template <typename T> T qFromLittleEndian(const void *src, qsizetype count, void *dest)
+ \fn template <typename T> inline T qFromLittleEndian(const void *src, qsizetype count, void *dest)
\since 5.12
\relates <QtEndian>
@@ -192,7 +192,6 @@ QT_BEGIN_NAMESPACE
an in-place swap (if necessary). If they are not the same, the memory
regions must not overlap.
- \sa qFromLittleEndian()
\sa qToBigEndian()
\sa qToLittleEndian()
*/
diff --git a/src/corelib/global/qendian.h b/src/corelib/global/qendian.h
index 5cd9d3160b..257efbbdbe 100644
--- a/src/corelib/global/qendian.h
+++ b/src/corelib/global/qendian.h
@@ -66,7 +66,7 @@ template <typename T> Q_ALWAYS_INLINE void qToUnaligned(const T src, void *dest)
// Using sizeof(T) inside memcpy function produces internal compiler error with
// MSVC2008/ARM in tst_endian -> use extra indirection to resolve size of T.
const size_t size = sizeof(T);
-#if QT_HAS_BUILTIN(__builtin_memcpy)
+#if __has_builtin(__builtin_memcpy)
__builtin_memcpy
#else
memcpy
@@ -78,7 +78,7 @@ template <typename T> Q_ALWAYS_INLINE T qFromUnaligned(const void *src)
{
T dest;
const size_t size = sizeof(T);
-#if QT_HAS_BUILTIN(__builtin_memcpy)
+#if __has_builtin(__builtin_memcpy)
__builtin_memcpy
#else
memcpy
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..51766c9760 100644
--- a/src/corelib/global/qfloat16.cpp
+++ b/src/corelib/global/qfloat16.cpp
@@ -109,7 +109,7 @@ QT_BEGIN_NAMESPACE
/*!
\internal
\since 5.14
- bool qfloat16::isInf() const noexcept
+ \fn bool qfloat16::isInf() const noexcept
Tests whether this \c qfloat16 value is an infinity.
@@ -119,7 +119,7 @@ QT_BEGIN_NAMESPACE
/*!
\internal
\since 5.14
- bool qfloat16::isNaN() const noexcept
+ \fn bool qfloat16::isNaN() const noexcept
Tests whether this \c qfloat16 value is "not a number".
@@ -128,7 +128,7 @@ QT_BEGIN_NAMESPACE
/*!
\since 5.14
- bool qfloat16::isNormal() const noexcept
+ \fn bool qfloat16::isNormal() const noexcept
Tests whether this \c qfloat16 value is finite and in normal form.
@@ -138,7 +138,7 @@ QT_BEGIN_NAMESPACE
/*!
\internal
\since 5.14
- bool qfloat16::isFinite() const noexcept
+ \fn bool qfloat16::isFinite() const noexcept
Tests whether this \c qfloat16 value is finite.
@@ -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 9a4f1800a4..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:
@@ -239,6 +244,7 @@ QF16_MAKE_ARITH_OP_INT(/)
QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wfloat-equal")
QT_WARNING_DISABLE_GCC("-Wfloat-equal")
+QT_WARNING_DISABLE_INTEL(1572)
inline bool operator>(qfloat16 a, qfloat16 b) noexcept { return static_cast<float>(a) > static_cast<float>(b); }
inline bool operator<(qfloat16 a, qfloat16 b) noexcept { return static_cast<float>(a) < static_cast<float>(b); }
@@ -327,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 799d953c8d..ea91dee471 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -92,7 +92,7 @@
# include <sys/systeminfo.h>
#endif
-#if defined(Q_OS_DARWIN) && QT_HAS_INCLUDE(<IOKit/IOKitLib.h>)
+#if defined(Q_OS_DARWIN) && __has_include(<IOKit/IOKitLib.h>)
# include <IOKit/IOKitLib.h>
# include <private/qcore_mac_p.h>
#endif
@@ -139,10 +139,12 @@ Q_CORE_EXPORT void *qMemSet(void *dest, int c, size_t n);
// in. The idea here is to error or warn if otherwise implicit Qt
// assumptions are not fulfilled on new hardware or compilers
// (if this list becomes too long, consider factoring into a separate file)
-Q_STATIC_ASSERT_X(sizeof(int) == 4, "Qt assumes that int is 32 bits");
Q_STATIC_ASSERT_X(UCHAR_MAX == 255, "Qt assumes that char is 8 bits");
+Q_STATIC_ASSERT_X(sizeof(int) == 4, "Qt assumes that int is 32 bits");
Q_STATIC_ASSERT_X(QT_POINTER_SIZE == sizeof(void *), "QT_POINTER_SIZE defined incorrectly");
Q_STATIC_ASSERT_X(sizeof(float) == 4, "Qt assumes that float is 32 bits");
+Q_STATIC_ASSERT_X(sizeof(char16_t) == 2, "Qt assumes that char16_t is 16 bits");
+Q_STATIC_ASSERT_X(sizeof(char32_t) == 4, "Qt assumes that char32_t is 32 bits");
// While we'd like to check for __STDC_IEC_559__, as per ISO/IEC 9899:2011
// Annex F (C11, normative for C++11), there are a few corner cases regarding
@@ -250,7 +252,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 +320,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.
*/
/*!
@@ -3057,7 +3069,7 @@ enum {
*/
QByteArray QSysInfo::machineUniqueId()
{
-#if defined(Q_OS_DARWIN) && QT_HAS_INCLUDE(<IOKit/IOKitLib.h>)
+#if defined(Q_OS_DARWIN) && __has_include(<IOKit/IOKitLib.h>)
char uuid[UuidStringLen + 1];
io_service_t service = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOPlatformExpertDevice"));
QCFString stringRef = (CFStringRef)IORegistryEntryCreateCFProperty(service, CFSTR(kIOPlatformUUIDKey), kCFAllocatorDefault, 0);
@@ -4151,36 +4163,6 @@ bool qunsetenv(const char *varName)
*/
/*!
- \macro QABS(n)
- \relates <QtGlobal>
- \obsolete
-
- Use qAbs(\a n) instead.
-
- \sa QMIN(), QMAX()
-*/
-
-/*!
- \macro QMIN(x, y)
- \relates <QtGlobal>
- \obsolete
-
- Use qMin(\a x, \a y) instead.
-
- \sa QMAX(), QABS()
-*/
-
-/*!
- \macro QMAX(x, y)
- \relates <QtGlobal>
- \obsolete
-
- Use qMax(\a x, \a y) instead.
-
- \sa QMIN(), QABS()
-*/
-
-/*!
\macro const char *qPrintable(const QString &str)
\relates <QtGlobal>
@@ -4816,9 +4798,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.
*/
@@ -4919,6 +4903,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
@@ -4926,8 +4911,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:
@@ -4939,6 +4923,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
@@ -4946,10 +4931,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 4dc63cae5e..c1fcc12cfb 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -717,7 +717,7 @@ inline void qt_noop(void) {}
#if !defined(QT_NO_EXCEPTIONS)
# if !defined(Q_MOC_RUN)
-# if (defined(Q_CC_CLANG) && !defined(Q_CC_INTEL) && !QT_HAS_FEATURE(cxx_exceptions)) || \
+# if (defined(Q_CC_CLANG) && !defined(Q_CC_INTEL) && !__has_feature(cxx_exceptions)) || \
(defined(Q_CC_GNU) && !defined(__EXCEPTIONS))
# define QT_NO_EXCEPTIONS
# endif
@@ -892,6 +892,10 @@ QT_WARNING_POP
# define Q_DUMMY_COMPARISON_OPERATOR(C)
#endif
+QT_WARNING_PUSH
+// warning: noexcept-expression evaluates to 'false' because of a call to 'void swap(..., ...)'
+QT_WARNING_DISABLE_GCC("-Wnoexcept")
+
namespace QtPrivate
{
namespace SwapExceptionTester { // insulate users from the "using std::swap" below
@@ -911,6 +915,8 @@ inline void qSwap(T &value1, T &value2)
swap(value1, value2);
}
+QT_WARNING_POP
+
#if QT_DEPRECATED_SINCE(5, 0)
Q_CORE_EXPORT QT_DEPRECATED void *qMalloc(size_t size) Q_ALLOC_SIZE(1);
Q_CORE_EXPORT QT_DEPRECATED void qFree(void *ptr);
@@ -1214,8 +1220,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/qglobal_p.h b/src/corelib/global/qglobal_p.h
index 58bc8b7bf3..5ab84fa8be 100644
--- a/src/corelib/global/qglobal_p.h
+++ b/src/corelib/global/qglobal_p.h
@@ -74,7 +74,7 @@ Q_CORE_EXPORT time_t qMkTime(struct tm *when);
QT_END_NAMESPACE
-#if !QT_HAS_BUILTIN(__builtin_available)
+#if !__has_builtin(__builtin_available)
#include <initializer_list>
#include <QtCore/qoperatingsystemversion.h>
#include <QtCore/qversionnumber.h>
@@ -142,7 +142,7 @@ QT_END_NAMESPACE
QT_BUILTIN_AVAILABLE1, \
QT_BUILTIN_AVAILABLE0, )
#define __builtin_available(...) QT_BUILTIN_AVAILABLE_CHOOSER(__VA_ARGS__)(__VA_ARGS__)
-#endif // !QT_HAS_BUILTIN(__builtin_available)
+#endif // !__has_builtin(__builtin_available)
#endif // defined(__cplusplus)
#endif // QGLOBAL_P_H
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
index da122f75e5..f8accab548 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
@@ -561,9 +561,39 @@ static QString getRelocatablePrefix()
HMODULE hModule = getWindowsModuleHandle();
const int kBufferSize = 4096;
wchar_t buffer[kBufferSize];
- const int pathSize = GetModuleFileName(hModule, buffer, kBufferSize);
- if (pathSize > 0)
- prefixPath = prefixFromQtCoreLibraryHelper(QString::fromWCharArray(buffer, pathSize));
+ DWORD pathSize = GetModuleFileName(hModule, buffer, kBufferSize);
+ const QString qtCoreFilePath = QString::fromWCharArray(buffer, int(pathSize));
+ const QString qtCoreDirPath = QFileInfo(qtCoreFilePath).absolutePath();
+ pathSize = GetModuleFileName(NULL, buffer, kBufferSize);
+ const QString exeDirPath = QFileInfo(QString::fromWCharArray(buffer, int(pathSize))).absolutePath();
+ if (QFileInfo(exeDirPath) == QFileInfo(qtCoreDirPath)) {
+ // QtCore DLL is next to the executable. This is either a windeployqt'ed executable or an
+ // executable within the QT_HOST_BIN directory. We're detecting the latter case by checking
+ // whether there's an import library corresponding to our QtCore DLL in PREFIX/lib.
+ const QString libdir = QString::fromLatin1(
+ qt_configure_strs + qt_configure_str_offsets[QLibraryInfo::LibrariesPath - 1]);
+ const QLatin1Char slash('/');
+#if defined(Q_CC_MINGW)
+ const QString implibPrefix = QStringLiteral("lib");
+ const QString implibSuffix = QStringLiteral(".a");
+#else
+ const QString implibPrefix;
+ const QString implibSuffix = QStringLiteral(".lib");
+#endif
+ const QString qtCoreImpLibFileName = implibPrefix
+ + QFileInfo(qtCoreFilePath).completeBaseName() + implibSuffix;
+ const QString qtCoreImpLibPath = qtCoreDirPath
+ + slash + QLatin1String(QT_CONFIGURE_LIBLOCATION_TO_PREFIX_PATH)
+ + slash + libdir
+ + slash + qtCoreImpLibFileName;
+ if (!QFileInfo::exists(qtCoreImpLibPath)) {
+ // We did not find a corresponding import library and conclude that this is a
+ // windeployqt'ed executable.
+ return exeDirPath;
+ }
+ }
+ if (!qtCoreFilePath.isEmpty())
+ prefixPath = prefixFromQtCoreLibraryHelper(qtCoreFilePath);
#else
#error "The chosen platform / config does not support querying for a dynamic prefix."
#endif
@@ -751,7 +781,7 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group)
// 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 = 0;
+ const char * volatile path = nullptr;
if (loc == PrefixPath) {
path = getPrefix(
#ifdef QT_BUILD_QMAKE
@@ -892,10 +922,10 @@ void qt_core_boilerplate()
"\n"
"Installation prefix: %s\n"
"Library path: %s\n"
- "Include path: %s\n",
+ "Plugin path: %s\n",
qt_configure_prefix_path_str + 12,
qt_configure_strs + qt_configure_str_offsets[QT_PREPEND_NAMESPACE(QLibraryInfo)::LibrariesPath - 1],
- qt_configure_strs + qt_configure_str_offsets[QT_PREPEND_NAMESPACE(QLibraryInfo)::HeadersPath - 1]);
+ qt_configure_strs + qt_configure_str_offsets[QT_PREPEND_NAMESPACE(QLibraryInfo)::PluginsPath - 1]);
QT_PREPEND_NAMESPACE(qDumpCPUFeatures)();
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp
index 3a9ff1651b..ca4d8dbd11 100644
--- a/src/corelib/global/qlogging.cpp
+++ b/src/corelib/global/qlogging.cpp
@@ -70,7 +70,7 @@
#if QT_CONFIG(slog2)
#include <sys/slog2.h>
#endif
-#if QT_HAS_INCLUDE(<paths.h>)
+#if __has_include(<paths.h>)
#include <paths.h>
#endif
@@ -106,7 +106,7 @@
# if __UCLIBC_HAS_BACKTRACE__
# define QLOGGING_HAVE_BACKTRACE
# endif
-# elif (defined(__GLIBC__) && defined(__GLIBCXX__)) || (QT_HAS_INCLUDE(<cxxabi.h>) && QT_HAS_INCLUDE(<execinfo.h>))
+# elif (defined(__GLIBC__) && defined(__GLIBCXX__)) || (__has_include(<cxxabi.h>) && __has_include(<execinfo.h>))
# define QLOGGING_HAVE_BACKTRACE
# endif
#endif
@@ -116,7 +116,7 @@ extern char *__progname;
#endif
#ifndef QT_BOOTSTRAPPED
-#if defined(Q_OS_LINUX) && (defined(__GLIBC__) || QT_HAS_INCLUDE(<sys/syscall.h>))
+#if defined(Q_OS_LINUX) && (defined(__GLIBC__) || __has_include(<sys/syscall.h>))
# include <sys/syscall.h>
# if defined(Q_OS_ANDROID) && !defined(SYS_gettid)
@@ -1276,7 +1276,7 @@ void QMessagePattern::setPattern(const QString &pattern)
#if defined(QLOGGING_HAVE_BACKTRACE) && !defined(QT_BOOTSTRAPPED)
// make sure the function has "Message" in the name so the function is removed
-#if ((defined(Q_CC_GNU) && defined(QT_COMPILER_SUPPORTS_SIMD_ALWAYS)) || QT_HAS_ATTRIBUTE(optimize)) \
+#if ((defined(Q_CC_GNU) && defined(QT_COMPILER_SUPPORTS_SIMD_ALWAYS)) || __has_attribute(optimize)) \
&& !defined(Q_CC_INTEL) && !defined(Q_CC_CLANG)
// force skipping the frame pointer, to save the backtrace() function some work
__attribute__((optimize("omit-frame-pointer")))
@@ -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 047ed8e7b3..b9e981b4a6 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -41,6 +41,7 @@
#define QNAMESPACE_H
#include <QtCore/qglobal.h>
+#include <QtCore/qtmetamacros.h>
#if defined(__OBJC__) && !defined(__cplusplus)
# warning "File built in Objective-C mode (.m), but using Qt requires Objective-C++ (.mm)"
@@ -48,29 +49,10 @@
QT_BEGIN_NAMESPACE
-#if !defined(Q_QDOC) && !defined(Q_MOC_RUN)
struct QMetaObject;
-const QMetaObject *qt_getQtMetaObject() noexcept; // defined in qobject.h (which can't be included here)
-#define QT_Q_ENUM(ENUM) \
- inline const QMetaObject *qt_getEnumMetaObject(ENUM) noexcept { return qt_getQtMetaObject(); } \
- inline Q_DECL_CONSTEXPR const char *qt_getEnumName(ENUM) noexcept { return #ENUM; }
-#define QT_Q_FLAG(ENUM) QT_Q_ENUM(ENUM)
-#else
-#define QT_Q_ENUM Q_ENUM
-#define QT_Q_FLAG Q_FLAG
-#endif
-
-#ifndef Q_MOC_RUN
-namespace
-#else
-class Q_CORE_EXPORT
-#endif
-Qt {
-#if defined(Q_MOC_RUN)
- Q_OBJECT
-public:
-#endif
+namespace Qt {
+ Q_NAMESPACE_EXPORT(Q_CORE_EXPORT)
enum GlobalColor {
color0,
@@ -523,6 +505,7 @@ public:
AA_DontUseNativeMenuBar = 6,
AA_MacDontSwapCtrlAndMeta = 7,
AA_Use96Dpi = 8,
+ AA_MSWindowsDisableVirtualKeyboard = 9,
#if QT_DEPRECATED_SINCE(5, 14)
AA_X11InitThreads Q_DECL_ENUMERATOR_DEPRECATED = 10,
#endif
@@ -1767,102 +1750,96 @@ public:
};
#ifndef Q_QDOC
- // NOTE: Generally, do not add QT_Q_ENUM if a corresponding Q_Q_FLAG exists.
- QT_Q_ENUM(ScrollBarPolicy)
- QT_Q_ENUM(FocusPolicy)
- QT_Q_ENUM(ContextMenuPolicy)
- QT_Q_ENUM(ArrowType)
- QT_Q_ENUM(ToolButtonStyle)
- QT_Q_ENUM(PenStyle)
- QT_Q_ENUM(PenCapStyle)
- QT_Q_ENUM(PenJoinStyle)
- QT_Q_ENUM(BrushStyle)
- QT_Q_ENUM(FillRule)
- QT_Q_ENUM(MaskMode)
- QT_Q_ENUM(BGMode)
- QT_Q_ENUM(ClipOperation)
- QT_Q_ENUM(SizeMode)
- QT_Q_ENUM(Axis)
- QT_Q_ENUM(Corner)
- QT_Q_ENUM(Edge)
- QT_Q_ENUM(LayoutDirection)
- QT_Q_ENUM(SizeHint)
- QT_Q_ENUM(Orientation)
- QT_Q_ENUM(DropAction)
- QT_Q_FLAG(Alignment)
- QT_Q_ENUM(TextFlag)
- QT_Q_FLAG(Orientations)
- QT_Q_FLAG(SplitBehavior)
- QT_Q_FLAG(DropActions)
- QT_Q_FLAG(Edges)
- QT_Q_FLAG(DockWidgetAreas)
- QT_Q_FLAG(ToolBarAreas)
- QT_Q_ENUM(DockWidgetArea)
- QT_Q_ENUM(ToolBarArea)
- QT_Q_ENUM(TextFormat)
- QT_Q_ENUM(TextElideMode)
- QT_Q_ENUM(DateFormat)
- QT_Q_ENUM(TimeSpec)
- QT_Q_ENUM(DayOfWeek)
- QT_Q_ENUM(CursorShape)
- QT_Q_ENUM(GlobalColor)
- QT_Q_ENUM(AspectRatioMode)
- QT_Q_ENUM(TransformationMode)
- QT_Q_FLAG(ImageConversionFlags)
- QT_Q_ENUM(Key)
- QT_Q_ENUM(ShortcutContext)
- QT_Q_ENUM(TextInteractionFlag)
- QT_Q_FLAG(TextInteractionFlags)
- QT_Q_ENUM(ItemSelectionMode)
- QT_Q_ENUM(ItemSelectionOperation)
- QT_Q_FLAG(ItemFlags)
- QT_Q_ENUM(CheckState)
- QT_Q_ENUM(ItemDataRole)
- QT_Q_ENUM(SortOrder)
- QT_Q_ENUM(CaseSensitivity)
- QT_Q_FLAG(MatchFlags)
- QT_Q_FLAG(KeyboardModifiers)
- QT_Q_FLAG(MouseButtons)
- QT_Q_ENUM(WindowType)
- QT_Q_ENUM(WindowState)
- QT_Q_ENUM(WindowModality)
- QT_Q_ENUM(WidgetAttribute)
- QT_Q_ENUM(ApplicationAttribute)
- QT_Q_FLAG(WindowFlags)
- QT_Q_FLAG(WindowStates)
- QT_Q_ENUM(FocusReason)
- QT_Q_ENUM(InputMethodHint)
- QT_Q_ENUM(InputMethodQuery)
- QT_Q_FLAG(InputMethodHints)
- QT_Q_ENUM(EnterKeyType)
- QT_Q_FLAG(InputMethodQueries)
- QT_Q_FLAG(TouchPointStates)
- QT_Q_ENUM(ScreenOrientation)
- QT_Q_FLAG(ScreenOrientations)
- QT_Q_ENUM(ConnectionType)
- QT_Q_ENUM(ApplicationState)
+ // NOTE: Generally, do not add Q_ENUM_NS if a corresponding Q_FLAG_NS exists.
+ Q_ENUM_NS(ScrollBarPolicy)
+ Q_ENUM_NS(FocusPolicy)
+ Q_ENUM_NS(ContextMenuPolicy)
+ Q_ENUM_NS(ArrowType)
+ Q_ENUM_NS(ToolButtonStyle)
+ Q_ENUM_NS(PenStyle)
+ Q_ENUM_NS(PenCapStyle)
+ Q_ENUM_NS(PenJoinStyle)
+ Q_ENUM_NS(BrushStyle)
+ Q_ENUM_NS(FillRule)
+ Q_ENUM_NS(MaskMode)
+ Q_ENUM_NS(BGMode)
+ Q_ENUM_NS(ClipOperation)
+ Q_ENUM_NS(SizeMode)
+ Q_ENUM_NS(Axis)
+ Q_ENUM_NS(Corner)
+ Q_ENUM_NS(Edge)
+ Q_ENUM_NS(LayoutDirection)
+ Q_ENUM_NS(SizeHint)
+ Q_ENUM_NS(Orientation)
+ Q_ENUM_NS(DropAction)
+ Q_FLAG_NS(Alignment)
+ Q_ENUM_NS(TextFlag)
+ Q_FLAG_NS(Orientations)
+ Q_FLAG_NS(SplitBehavior)
+ Q_FLAG_NS(DropActions)
+ Q_FLAG_NS(Edges)
+ Q_FLAG_NS(DockWidgetAreas)
+ Q_FLAG_NS(ToolBarAreas)
+ Q_ENUM_NS(DockWidgetArea)
+ Q_ENUM_NS(ToolBarArea)
+ Q_ENUM_NS(TextFormat)
+ Q_ENUM_NS(TextElideMode)
+ Q_ENUM_NS(DateFormat)
+ Q_ENUM_NS(TimeSpec)
+ Q_ENUM_NS(DayOfWeek)
+ Q_ENUM_NS(CursorShape)
+ Q_ENUM_NS(GlobalColor)
+ Q_ENUM_NS(AspectRatioMode)
+ Q_ENUM_NS(TransformationMode)
+ Q_FLAG_NS(ImageConversionFlags)
+ Q_ENUM_NS(Key)
+ Q_ENUM_NS(ShortcutContext)
+ Q_ENUM_NS(TextInteractionFlag)
+ Q_FLAG_NS(TextInteractionFlags)
+ Q_ENUM_NS(ItemSelectionMode)
+ Q_ENUM_NS(ItemSelectionOperation)
+ Q_FLAG_NS(ItemFlags)
+ Q_ENUM_NS(CheckState)
+ Q_ENUM_NS(ItemDataRole)
+ Q_ENUM_NS(SortOrder)
+ Q_ENUM_NS(CaseSensitivity)
+ Q_FLAG_NS(MatchFlags)
+ Q_FLAG_NS(KeyboardModifiers)
+ Q_FLAG_NS(MouseButtons)
+ Q_ENUM_NS(WindowType)
+ Q_ENUM_NS(WindowState)
+ Q_ENUM_NS(WindowModality)
+ Q_ENUM_NS(WidgetAttribute)
+ Q_ENUM_NS(ApplicationAttribute)
+ Q_FLAG_NS(WindowFlags)
+ Q_FLAG_NS(WindowStates)
+ Q_ENUM_NS(FocusReason)
+ Q_ENUM_NS(InputMethodHint)
+ Q_ENUM_NS(InputMethodQuery)
+ Q_FLAG_NS(InputMethodHints)
+ Q_ENUM_NS(EnterKeyType)
+ Q_FLAG_NS(InputMethodQueries)
+ Q_FLAG_NS(TouchPointStates)
+ Q_ENUM_NS(ScreenOrientation)
+ Q_FLAG_NS(ScreenOrientations)
+ Q_ENUM_NS(ConnectionType)
+ Q_ENUM_NS(ApplicationState)
#ifndef QT_NO_GESTURES
- QT_Q_ENUM(GestureState)
- QT_Q_ENUM(GestureType)
- QT_Q_ENUM(NativeGestureType)
+ Q_ENUM_NS(GestureState)
+ Q_ENUM_NS(GestureType)
+ Q_ENUM_NS(NativeGestureType)
#endif
- QT_Q_ENUM(CursorMoveStyle)
- QT_Q_ENUM(TimerType)
- QT_Q_ENUM(ScrollPhase)
- QT_Q_ENUM(MouseEventSource)
- QT_Q_FLAG(MouseEventFlag)
- QT_Q_ENUM(ChecksumType)
- QT_Q_ENUM(HighDpiScaleFactorRoundingPolicy)
- QT_Q_ENUM(TabFocusBehavior)
+ Q_ENUM_NS(CursorMoveStyle)
+ Q_ENUM_NS(TimerType)
+ Q_ENUM_NS(ScrollPhase)
+ Q_ENUM_NS(MouseEventSource)
+ Q_FLAG_NS(MouseEventFlag)
+ Q_ENUM_NS(ChecksumType)
+ Q_ENUM_NS(HighDpiScaleFactorRoundingPolicy)
+ Q_ENUM_NS(TabFocusBehavior)
#endif // Q_DOC
}
-#ifdef Q_MOC_RUN
- ;
-#endif
-
-#undef QT_Q_ENUM
-#undef QT_Q_FLAG
typedef bool (*qInternalCallback)(void **);
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 9896cf6e02..6149281904 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
@@ -293,6 +293,12 @@
This attribute must be set before QGuiApplication is constructed.
This value was added in 5.13
+ \value AA_MSWindowsDisableVirtualKeyboard When this attribute is set,
+ Windows' native on-screen virtual keyboard will not be shown
+ automatically when a text input widget gains focus on a system
+ without a physical keyboard.
+ This value was added in 5.15
+
The following values are deprecated or obsolete:
\value AA_ImmediateWidgetCreation This attribute is no longer fully
@@ -724,9 +730,17 @@
\value LocalDate \e{This enum value is deprecated.} Use Qt::SystemLocaleShortDate
instead (or Qt::SystemLocaleLongDate if you want long dates).
- \value RFC2822Date \l{RFC 2822}, \l{RFC 850} and \l{RFC 1036} format: either
- \c{[ddd,] dd MMM yyyy hh:mm[:ss] +/-TZ} or \c{ddd MMM dd yyyy hh:mm[:ss] +/-TZ}
- for combined dates and times.
+ \value RFC2822Date \l{RFC 2822}, \l{RFC 850} and \l{RFC 1036} format:
+ either \c{[ddd,] dd MMM yyyy [hh:mm[:ss]][ ±tzoff]}
+ or \c{ddd MMM dd[ hh:mm:ss] yyyy[ ±tzoff]} are recognized for combined dates
+ and times, where \c{tzoff} is a timezone offset in \c{hhmm} format. For
+ dates and times separately, the same formats are matched and the unwanted
+ parts are ignored. In particular, note that a time is not recognized without
+ an accompanying date. When converting dates to string form,
+ format \c{dd MMM yyyy} is used, for times the format is \c{hh:mm:ss}. For
+ combined date and time, these are combined
+ as \c{dd MMM yyyy hh:mm:ss ±tzoff} (omitting the optional leading day of the
+ week from the first format recognized).
\note For \c ISODate formats, each \c Y, \c M and \c D represents a single digit
of the year, month and day used to specify the date. Each \c H, \c M and \c S
diff --git a/src/corelib/global/qnumeric_p.h b/src/corelib/global/qnumeric_p.h
index c006296b3d..7a03e32699 100644
--- a/src/corelib/global/qnumeric_p.h
+++ b/src/corelib/global/qnumeric_p.h
@@ -253,7 +253,8 @@ QT_WARNING_POP
// size_t. Implementations for 8- and 16-bit types will work but may not be as
// efficient. Implementations for 64-bit may be missing on 32-bit platforms.
-#if (defined(Q_CC_GNU) && (Q_CC_GNU >= 500) || (defined(Q_CC_INTEL) && !defined(Q_OS_WIN))) || QT_HAS_BUILTIN(__builtin_add_overflow)
+#if ((defined(Q_CC_INTEL) ? (Q_CC_INTEL >= 1800 && !defined(Q_OS_WIN)) : defined(Q_CC_GNU)) \
+ && Q_CC_GNU >= 500) || __has_builtin(__builtin_add_overflow)
// GCC 5, ICC 18, and Clang 3.8 have builtins to detect overflows
template <typename T> inline
diff --git a/src/corelib/global/qoperatingsystemversion.cpp b/src/corelib/global/qoperatingsystemversion.cpp
index 33793ca168..261f5c8795 100644
--- a/src/corelib/global/qoperatingsystemversion.cpp
+++ b/src/corelib/global/qoperatingsystemversion.cpp
@@ -299,6 +299,8 @@ int QOperatingSystemVersion::compare(const QOperatingSystemVersion &v1,
Returns the current OS type without constructing a QOperatingSystemVersion instance.
+ \since 5.10
+
\sa current()
*/
diff --git a/src/corelib/global/qrandom.cpp b/src/corelib/global/qrandom.cpp
index 563e5eb7ed..3dc024e301 100644
--- a/src/corelib/global/qrandom.cpp
+++ b/src/corelib/global/qrandom.cpp
@@ -1295,7 +1295,7 @@ void qsrand(uint seed)
\note This function is deprecated. In new applications, use
QRandomGenerator instead.
- \sa qrand(), QRandomGenerator
+ \sa qsrand(), QRandomGenerator
*/
int qrand()
{