summaryrefslogtreecommitdiffstats
path: root/src/corelib/global
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/global')
-rw-r--r--src/corelib/global/qcompilerdetection.h22
-rw-r--r--src/corelib/global/qconfig-bootstrapped.h1
-rw-r--r--src/corelib/global/qendian.cpp2
-rw-r--r--src/corelib/global/qglobal.cpp16
-rw-r--r--src/corelib/global/qglobal.h58
-rw-r--r--src/corelib/global/qlibraryinfo.cpp2
-rw-r--r--src/corelib/global/qlibraryinfo.h1
-rw-r--r--src/corelib/global/qlogging.cpp2
-rw-r--r--src/corelib/global/qnamespace.h200
-rw-r--r--src/corelib/global/qnumeric_p.h6
-rw-r--r--src/corelib/global/qrandom.cpp4
-rw-r--r--src/corelib/global/qrandom.h2
-rw-r--r--src/corelib/global/qtypeinfo.h1
13 files changed, 122 insertions, 195 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index b1fcf09e92..fedf08301f 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -91,8 +91,6 @@
# define Q_OUTOFLINE_TEMPLATE inline
# define Q_COMPILER_MANGLES_RETURN_TYPE
# define Q_FUNC_INFO __FUNCSIG__
-# define Q_ALIGNOF(type) __alignof(type)
-# define Q_DECL_ALIGN(n) __declspec(align(n))
# define Q_ASSUME_IMPL(expr) __assume(expr)
# define Q_UNREACHABLE_IMPL() __assume(0)
# define Q_NORETURN __declspec(noreturn)
@@ -222,10 +220,8 @@
# endif
# define Q_FUNC_INFO __PRETTY_FUNCTION__
-# define Q_ALIGNOF(type) __alignof__(type)
# define Q_TYPEOF(expr) __typeof__(expr)
# define Q_DECL_DEPRECATED __attribute__ ((__deprecated__))
-# define Q_DECL_ALIGN(n) __attribute__((__aligned__(n)))
# define Q_DECL_UNUSED __attribute__((__unused__))
# define Q_LIKELY(expr) __builtin_expect(!!(expr), true)
# define Q_UNLIKELY(expr) __builtin_expect(!!(expr), false)
@@ -272,9 +268,7 @@
# if __xlC__ < 0x400
# error "Compiler not supported"
# elif __xlC__ >= 0x0600
-# define Q_ALIGNOF(type) __alignof__(type)
# define Q_TYPEOF(expr) __typeof__(expr)
-# define Q_DECL_ALIGN(n) __attribute__((__aligned__(n)))
# define Q_PACKED __attribute__((__packed__))
# endif
@@ -352,7 +346,6 @@
# define Q_PACKED __attribute__ ((__packed__))
# define Q_FUNC_INFO __PRETTY_FUNCTION__
# define Q_TYPEOF(expr) __typeof__(expr)
-# define Q_ALIGNOF(type) __alignof__(type)
# define Q_UNREACHABLE_IMPL()
# if defined(__cplusplus)
# define Q_COMPILER_AUTO_TYPE
@@ -449,9 +442,7 @@
# define QT_NO_TEMPLATE_TEMPLATE_PARAMETERS
/* see http://developers.sun.com/sunstudio/support/Ccompare.html */
# if __SUNPRO_CC >= 0x590
-# define Q_ALIGNOF(type) __alignof__(type)
# define Q_TYPEOF(expr) __typeof__(expr)
-# define Q_DECL_ALIGN(n) __attribute__((__aligned__(n)))
# endif
# if __SUNPRO_CC >= 0x550
# define Q_DECL_EXPORT __global
@@ -488,9 +479,6 @@
# define Q_DECL_EXPORT __declspec(dllexport)
# define Q_DECL_IMPORT __declspec(dllimport)
# endif
-# if __HP_aCC-0 >= 061200
-# define Q_DECL_ALIGN(n) __attribute__((aligned(n)))
-# endif
# if __HP_aCC-0 >= 062000
# define Q_DECL_EXPORT __attribute__((visibility("default")))
# define Q_DECL_HIDDEN __attribute__((visibility("hidden")))
@@ -1129,14 +1117,12 @@
#endif
#define Q_DECL_NOTHROW Q_DECL_NOEXCEPT
-#if defined(Q_COMPILER_ALIGNOF)
-# undef Q_ALIGNOF
-# define Q_ALIGNOF(x) alignof(x)
+#ifndef Q_ALIGNOF
+# define Q_ALIGNOF(x) alignof(x)
#endif
-#if defined(Q_COMPILER_ALIGNAS)
-# undef Q_DECL_ALIGN
-# define Q_DECL_ALIGN(n) alignas(n)
+#ifndef Q_DECL_ALIGN
+# define Q_DECL_ALIGN(n) alignas(n)
#endif
#if __has_cpp_attribute(nodiscard) && !defined(Q_CC_CLANG) // P0188R1
diff --git a/src/corelib/global/qconfig-bootstrapped.h b/src/corelib/global/qconfig-bootstrapped.h
index b62c1a4d35..2e6c3fbb20 100644
--- a/src/corelib/global/qconfig-bootstrapped.h
+++ b/src/corelib/global/qconfig-bootstrapped.h
@@ -111,6 +111,7 @@
# define QT_FEATURE_renameat2 -1
#endif
#define QT_FEATURE_sharedmemory -1
+#define QT_FEATURE_shortcut -1
#define QT_FEATURE_signaling_nan -1
#define QT_FEATURE_slog2 -1
#ifdef __GLIBC_PREREQ
diff --git a/src/corelib/global/qendian.cpp b/src/corelib/global/qendian.cpp
index 7fd6e13d3b..c56a7ffbf7 100644
--- a/src/corelib/global/qendian.cpp
+++ b/src/corelib/global/qendian.cpp
@@ -765,7 +765,7 @@ QT_BEGIN_NAMESPACE
#if defined(__SSSE3__)
using ShuffleMask = uchar[16];
-Q_DECL_ALIGN(16) static const ShuffleMask shuffleMasks[3] = {
+alignas(16) static const ShuffleMask shuffleMasks[3] = {
// 16-bit
{1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14},
// 32-bit
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 025ec4ee33..c2c91df756 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -1213,11 +1213,14 @@ bool qSharedBuild() noexcept
the application is compiled (32 or 64).
*/
+#if QT_DEPRECATED_SINCE(5, 9)
/*!
\deprecated
\variable QSysInfo::WindowsVersion
\brief the version of the Windows operating system on which the
application is run.
+
+ Use QOperatingSystemVersion::current() instead.
*/
/*!
@@ -1225,6 +1228,8 @@ bool qSharedBuild() noexcept
\fn QSysInfo::WindowsVersion QSysInfo::windowsVersion()
\since 4.4
+ Use QOperatingSystemVersion::current() instead.
+
Returns the version of the Windows operating system on which the
application is run, or WV_None if the operating system is not
Windows.
@@ -1235,16 +1240,21 @@ bool qSharedBuild() noexcept
\variable QSysInfo::MacintoshVersion
\brief the version of the Macintosh operating system on which
the application is run.
+
+ Use QOperatingSystemVersion::current() instead.
*/
/*!
\deprecated
\fn QSysInfo::MacVersion QSysInfo::macVersion()
+ Use QOperatingSystemVersion::current() instead.
+
Returns the version of Darwin (\macos or iOS) on which the
application is run, or MV_None if the operating system
is not a version of Darwin.
*/
+#endif
/*!
\enum QSysInfo::Endian
@@ -1255,10 +1265,13 @@ bool qSharedBuild() noexcept
the platform's byte order.
*/
+#if QT_DEPRECATED_SINCE(5, 9)
/*!
\deprecated
\enum QSysInfo::WinVersion
+ Use the versions defined in QOperatingSystemVersion instead.
+
This enum provides symbolic names for the various versions of the
Windows operating system. On Windows, the
QSysInfo::WindowsVersion variable gives the version of the system
@@ -1316,6 +1329,8 @@ bool qSharedBuild() noexcept
\deprecated
\enum QSysInfo::MacVersion
+ Use the versions defined in QOperatingSystemVersion instead.
+
This enum provides symbolic names for the various versions of the
Darwin operating system, covering both \macos and iOS. The
QSysInfo::MacintoshVersion variable gives the version of the
@@ -1386,6 +1401,7 @@ bool qSharedBuild() noexcept
\sa WinVersion
*/
+#endif
/*!
\macro Q_OS_DARWIN
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index e335916eac..80433ebeff 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -86,14 +86,9 @@
#define QT_CONFIG(feature) (1/QT_FEATURE_##feature == 1)
#define QT_REQUIRE_CONFIG(feature) Q_STATIC_ASSERT_X(QT_FEATURE_##feature == 1, "Required feature " #feature " for file " __FILE__ " not available.")
-#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
-# define QT_NO_UNSHARABLE_CONTAINERS
-# define QT6_VIRTUAL virtual
-# define QT6_NOT_VIRTUAL
-#else
-# define QT6_VIRTUAL
-# define QT6_NOT_VIRTUAL virtual
-#endif
+// ### Clean those up, once all code is adjusted
+#define QT6_VIRTUAL virtual
+#define QT6_NOT_VIRTUAL
/* These two macros makes it possible to turn the builtin line expander into a
* string literal. */
@@ -498,53 +493,6 @@ Q_CORE_EXPORT Q_DECL_CONST_FUNCTION const char *qVersion(void) Q_DECL_NOEXCEPT;
# define Q_DESTRUCTOR_FUNCTION(AFUNC) Q_DESTRUCTOR_FUNCTION0(AFUNC)
#endif
-namespace QtPrivate {
- template <class T>
- struct AlignOfHelper
- {
- char c;
- T type;
-
- AlignOfHelper();
- ~AlignOfHelper();
- };
-
- template <class T>
- struct AlignOf_Default
- {
- enum { Value = sizeof(AlignOfHelper<T>) - sizeof(T) };
- };
-
- template <class T> struct AlignOf : AlignOf_Default<T> { };
- template <class T> struct AlignOf<T &> : AlignOf<T> {};
- template <class T> struct AlignOf<T &&> : AlignOf<T> {};
- template <size_t N, class T> struct AlignOf<T[N]> : AlignOf<T> {};
-
-#if defined(Q_PROCESSOR_X86_32) && !defined(Q_OS_WIN)
- template <class T> struct AlignOf_WorkaroundForI386Abi { enum { Value = sizeof(T) }; };
-
- // x86 ABI weirdness
- // Alignment of naked type is 8, but inside struct has alignment 4.
- template <> struct AlignOf<double> : AlignOf_WorkaroundForI386Abi<double> {};
- template <> struct AlignOf<qint64> : AlignOf_WorkaroundForI386Abi<qint64> {};
- template <> struct AlignOf<quint64> : AlignOf_WorkaroundForI386Abi<quint64> {};
-#ifdef Q_CC_CLANG
- // GCC and Clang seem to disagree wrt to alignment of arrays
- template <size_t N> struct AlignOf<double[N]> : AlignOf_Default<double> {};
- template <size_t N> struct AlignOf<qint64[N]> : AlignOf_Default<qint64> {};
- template <size_t N> struct AlignOf<quint64[N]> : AlignOf_Default<quint64> {};
-#endif
-#endif
-} // namespace QtPrivate
-
-#define QT_EMULATED_ALIGNOF(T) \
- (size_t(QT_PREPEND_NAMESPACE(QtPrivate)::AlignOf<T>::Value))
-
-#ifndef Q_ALIGNOF
-#define Q_ALIGNOF(T) QT_EMULATED_ALIGNOF(T)
-#endif
-
-
/*
quintptr and qptrdiff is guaranteed to be the same size as a pointer, i.e.
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
index ecd26233cd..aed224215c 100644
--- a/src/corelib/global/qlibraryinfo.cpp
+++ b/src/corelib/global/qlibraryinfo.cpp
@@ -419,7 +419,6 @@ static const struct {
#endif
{ "Binaries", "bin" },
{ "Plugins", "plugins" }, // should be ${ArchData}/plugins
- { "Imports", "imports" }, // should be ${ArchData}/imports
{ "Qml2Imports", "qml" }, // should be ${ArchData}/qml
{ "ArchData", "." },
{ "Data", "." },
@@ -856,7 +855,6 @@ QStringList QLibraryInfo::platformPluginArguments(const QString &platformName)
\value LibraryExecutablesPath The location of installed executables required by libraries at runtime.
\value BinariesPath The location of installed Qt binaries (tools and applications).
\value PluginsPath The location of installed Qt plugins.
- \value ImportsPath The location of installed QML extensions to import (QML 1.x).
\value Qml2ImportsPath The location of installed QML extensions to import (QML 2.x).
\value ArchDataPath The location of general architecture-dependent Qt data.
\value DataPath The location of general architecture-independent Qt data.
diff --git a/src/corelib/global/qlibraryinfo.h b/src/corelib/global/qlibraryinfo.h
index ed60b170a5..031dfe37e2 100644
--- a/src/corelib/global/qlibraryinfo.h
+++ b/src/corelib/global/qlibraryinfo.h
@@ -79,7 +79,6 @@ public:
LibraryExecutablesPath,
BinariesPath,
PluginsPath,
- ImportsPath,
Qml2ImportsPath,
ArchDataPath,
DataPath,
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp
index c1a45476f9..ca4d8dbd11 100644
--- a/src/corelib/global/qlogging.cpp
+++ b/src/corelib/global/qlogging.cpp
@@ -1307,7 +1307,7 @@ static QStringList backtraceFramesForLogMessage(int frameCount)
QString function = m.captured(2);
// skip the trace from QtCore that are because of the qDebug itself
- if (!numberPrinted && library.contains(QLatin1String("Qt5Core"))
+ if (!numberPrinted && library.contains(QLatin1String("Qt6Core"))
&& (function.isEmpty() || function.contains(QLatin1String("Message"), Qt::CaseInsensitive)
|| function.contains(QLatin1String("QDebug")))) {
continue;
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index 047ed8e7b3..6ae04f0c7b 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,
@@ -1767,102 +1749,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/qnumeric_p.h b/src/corelib/global/qnumeric_p.h
index fdfcbda6ca..376da66e31 100644
--- a/src/corelib/global/qnumeric_p.h
+++ b/src/corelib/global/qnumeric_p.h
@@ -202,7 +202,7 @@ namespace {
This function works for v containing infinities, but not NaN. It's the
caller's responsibility to exclude that possibility before calling it.
*/
-template <typename T> static inline bool convertDoubleTo(double v, T *value)
+template <typename T> static inline bool convertDoubleTo(double v, T *value, bool allow_precision_upgrade = true)
{
Q_STATIC_ASSERT(std::numeric_limits<T>::is_integer);
@@ -227,6 +227,10 @@ template <typename T> static inline bool convertDoubleTo(double v, T *value)
supremum = -2.0 * std::numeric_limits<ST>::min(); // -2 * (-2^63) = 2^64, exact (for T = quint64)
v = fabs(v);
}
+ if (std::is_integral<T>::value && sizeof(T) > 4 && !allow_precision_upgrade) {
+ if (v > double(Q_INT64_C(1)<<53) || v < double(-((Q_INT64_C(1)<<53) + 1)))
+ return false;
+ }
*value = std::numeric_limits<T>::max();
if (v >= supremum)
diff --git a/src/corelib/global/qrandom.cpp b/src/corelib/global/qrandom.cpp
index 3cbd40b772..563e5eb7ed 100644
--- a/src/corelib/global/qrandom.cpp
+++ b/src/corelib/global/qrandom.cpp
@@ -355,7 +355,7 @@ struct QRandomGenerator::SystemAndGlobalGenerators
// the state in case another thread tries to lock the mutex. It's not
// a common scenario, but since sizeof(QRandomGenerator) >= 2560, the
// overhead is actually acceptable.
- // 2) We use both Q_DECL_ALIGN and std::aligned_storage<..., 64> because
+ // 2) We use both alignas and std::aligned_storage<..., 64> because
// some implementations of std::aligned_storage can't align to more
// than a primitive type's alignment.
// 3) We don't store the entire system QRandomGenerator, only the space
@@ -364,7 +364,7 @@ struct QRandomGenerator::SystemAndGlobalGenerators
QBasicMutex globalPRNGMutex;
struct ShortenedSystem { uint type; } system_;
SystemGenerator sys;
- Q_DECL_ALIGN(64) std::aligned_storage<sizeof(QRandomGenerator64), 64>::type global_;
+ alignas(64) std::aligned_storage<sizeof(QRandomGenerator64), 64>::type global_;
#ifdef Q_COMPILER_CONSTEXPR
constexpr SystemAndGlobalGenerators()
diff --git a/src/corelib/global/qrandom.h b/src/corelib/global/qrandom.h
index 445b520c76..e1494ab523 100644
--- a/src/corelib/global/qrandom.h
+++ b/src/corelib/global/qrandom.h
@@ -196,7 +196,7 @@ private:
RandomEngine &engine() { return twister; }
const RandomEngine &engine() const { return twister; }
#else
- std::aligned_storage<sizeof(RandomEngine), Q_ALIGNOF(RandomEngine)>::type buffer;
+ std::aligned_storage<sizeof(RandomEngine), alignof(RandomEngine)>::type buffer;
RandomEngine &engine() { return reinterpret_cast<RandomEngine &>(buffer); }
const RandomEngine &engine() const { return reinterpret_cast<const RandomEngine &>(buffer); }
#endif
diff --git a/src/corelib/global/qtypeinfo.h b/src/corelib/global/qtypeinfo.h
index 30be47296e..34cf1de4f5 100644
--- a/src/corelib/global/qtypeinfo.h
+++ b/src/corelib/global/qtypeinfo.h
@@ -209,7 +209,6 @@ public: \
}; \
}
-Q_DECLARE_MOVABLE_CONTAINER(QList);
Q_DECLARE_MOVABLE_CONTAINER(QVector);
Q_DECLARE_MOVABLE_CONTAINER(QQueue);
Q_DECLARE_MOVABLE_CONTAINER(QStack);