diff options
Diffstat (limited to 'src/corelib/global/qglobal.cpp')
-rw-r--r-- | src/corelib/global/qglobal.cpp | 66 |
1 files changed, 24 insertions, 42 deletions
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: |