[vlc-commits] [Git][videolan/vlc][3.0.x] 9 commits: contrib: gnutls: Backport a patch to avoid -Wint-conversion errors

David (@dfuhrmann) gitlab at videolan.org
Sun Aug 21 19:27:09 UTC 2022



David pushed to branch 3.0.x at VideoLAN / VLC


Commits:
f22fc52d by Martin Storsjö at 2022-08-19T15:18:45+03:00
contrib: gnutls: Backport a patch to avoid -Wint-conversion errors

Clang 15 made "incompatible pointer to integer conversion" an error
instead of a plain warning. This fixes errors like these:

system/keys-win.c:257:13: error: incompatible pointer to integer conversion initializing 'HCRYPTHASH' (aka 'unsigned long') with an expression of type 'void *' [-Wint-conversion]
        HCRYPTHASH hHash = NULL;
                   ^       ~~~~

This backports
https://gitlab.com/gnutls/gnutls/-/commit/88d79b964d88730e316919d6ccd17ca0fe9b3244.

(cherry picked from commit ef1d4f3d22abacb6b5333e5c1a3ff943255f9101)
Signed-off-by: Martin Storsjö <martin at martin.st>

- - - - -
1d4bcca1 by Steve Lhomme at 2022-08-19T15:47:46+03:00
contrib: crystalhd: fix forward declaration of a struct

Clang doesn't like it and warns about setting the callback using this signature.

(cherry picked from commit aee808c442476604846a8a33c48e51a0110957f7)
Signed-off-by: Martin Storsjö <martin at martin.st>

- - - - -
ab3617c2 by Martin Storsjö at 2022-08-19T15:47:46+03:00
contrib: qt: Backport patches to Qt 5.6 to fix compilation with latest Clang

Clang 16 errors out on ill-formed constant expressions when setting an
enum value to an out of range value for a non-fixed type enum.

These are all fixes that have been made in newer versions of Qt, but
which are backported to the version carried in vlc contribs.

- - - - -
57df8aee by Steve Lhomme at 2022-08-19T15:47:46+03:00
winvlc: fix warnings

(cherry picked from commit 260ee399c517721806076a6ffd6dec7875afa1a4)
Signed-off-by: Martin Storsjö <martin at martin.st>

- - - - -
b184d1fd by Rémi Denis-Courmont at 2022-08-19T15:47:46+03:00
yadif: fix invalid function pointer conversion

(cherry picked from commit 87724691c899a02d94fb64a3ef16868d65f3551b)
Signed-off-by: Martin Storsjö <martin at martin.st>

- - - - -
957906af by Rémi Denis-Courmont at 2022-08-19T15:47:46+03:00
ts: fix invalid casts

(cherry picked from commit 779c87eaff8399a3c7f65fe51fcf107c727fc227)
Signed-off-by: Martin Storsjö <martin at martin.st>

- - - - -
71707c2f by Steve Lhomme at 2022-08-19T15:47:46+03:00
ntservice: fix warning on losing const attribute

(cherry picked from commit 6add3c05520f0a81f9fe61d27eb31f1e1a1a8919)
Signed-off-by: Martin Storsjö <martin at martin.st>

- - - - -
9e4d83f3 by Martin Storsjö at 2022-08-19T15:47:46+03:00
d3d11: Avoid -Wint-conversion errors

Clang 15 made "incompatible pointer to integer conversion" an error
instead of a plain warning. This fixes errors like these:

d3d11va.c:426:29: error: incompatible integer to pointer conversion assigning to 'ID3D11DeviceContext *' (aka 'struct ID3D11DeviceContext *') from 'int64_t' (aka 'long long') [-Wint-conversion]
    sys->d3d_dev.d3dcontext = var_InheritInteger(va, "winrt-d3dcontext");

- - - - -
d2cad92d by Martin Storsjö at 2022-08-19T15:47:46+03:00
spudec: Fix function pointer incompatibilities

This is an error in Clang 16.

- - - - -


18 changed files:

- bin/winvlc.c
- + contrib/src/crystalhd/callback_proto.patch
- contrib/src/crystalhd/rules.mak
- + contrib/src/gnutls/0001-windows-Avoid-Wint-conversion-errors.patch
- contrib/src/gnutls/rules.mak
- + contrib/src/qt/0015-foreach-remove-implementations-not-using-decltype.patch
- + contrib/src/qt/0016-Replace-custom-type-traits-with-std-one-s.patch
- + contrib/src/qt/0017-Rename-QtPrivate-is_-un-signed-to-QtPrivate-Is-Un-si.patch
- + contrib/src/qt/0018-Remove-qtypetraits.h-s-contents-altogether.patch
- contrib/src/qt/rules.mak
- modules/codec/avcodec/d3d11va.c
- modules/codec/crystalhd.c
- modules/codec/spudec/parse.c
- modules/codec/spudec/spudec.h
- modules/control/ntservice.c
- modules/demux/mpeg/ts_pid.c
- modules/video_filter/deinterlace/yadif.h
- modules/video_output/win32/direct3d11.c


Changes:

=====================================
bin/winvlc.c
=====================================
@@ -70,8 +70,8 @@ static BOOL SetDefaultDllDirectories_(DWORD flags)
 
     BOOL (WINAPI * SetDefaultDllDirectoriesReal)(DWORD);
 
-    SetDefaultDllDirectoriesReal = GetProcAddress(h,
-                                                  "SetDefaultDllDirectories");
+    SetDefaultDllDirectoriesReal = (BOOL (WINAPI *)(DWORD))
+                                    GetProcAddress(h, "SetDefaultDllDirectories");
     if (SetDefaultDllDirectoriesReal == NULL)
         return FALSE;
 
@@ -149,7 +149,9 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
     if (h_Kernel32 != NULL)
     {
         /* Enable DEP */
+#ifndef PROCESS_DEP_ENABLE
 # define PROCESS_DEP_ENABLE 1
+#endif /* PROCESS_DEP_ENABLE */
         BOOL (WINAPI * mySetProcessDEPPolicy)( DWORD dwFlags);
         mySetProcessDEPPolicy = (BOOL (WINAPI *)(DWORD))
                             GetProcAddress(h_Kernel32, "SetProcessDEPPolicy");


=====================================
contrib/src/crystalhd/callback_proto.patch
=====================================
@@ -0,0 +1,29 @@
+--- libcrystalhd/bc_dts_defs.h.orig	2019-07-12 07:02:21.393012000 +0200
++++ libcrystalhd/bc_dts_defs.h	2019-07-12 07:01:48.787781100 +0200
+@@ -439,6 +439,8 @@ enum DECODER_CAP_FLAGS
+ 	BC_DEC_FLAGS_M4P2		= 0x08,	//MPEG-4 Part 2: Divx, Xvid etc.
+ };
+ 
++typedef struct _BC_DTS_PROC_OUT BC_DTS_PROC_OUT;
++
+ #if defined(__KERNEL__) || defined(__LINUX_USER__)
+ typedef BC_STATUS (*dts_pout_callback)(void  *shnd, U32	width,U32 height, U32 stride, void *pOut);
+ #else
+@@ -449,7 +451,7 @@ typedef BC_STATUS (*dts_pout_callback)(v
+ //User Data
+ #define MAX_UD_SIZE		1792	//1920 - 128
+ 
+-typedef struct _BC_DTS_PROC_OUT{
++struct _BC_DTS_PROC_OUT{
+ 	U8		*Ybuff;			/* Caller Supplied buffer for Y data */
+ 	U32		YbuffSz;		/* Caller Supplied Y buffer size */
+ 	U32		YBuffDoneSz;	/* Transferred Y datasize */
+@@ -478,7 +480,7 @@ typedef struct _BC_DTS_PROC_OUT{
+ 	U8		bRevertScramble;
+ 	U32		StrideSzUV;		/* Caller supplied Stride Size for UV data */
+ 
+-}BC_DTS_PROC_OUT;
++};
+ 
+ typedef struct _BC_DTS_STATUS {
+ 	U8	ReadyListCount;             /* Number of frames in ready list (reported by driver) */


=====================================
contrib/src/crystalhd/rules.mak
=====================================
@@ -13,10 +13,16 @@ CRYSTAL_SOURCES := crystalhd_lgpl_includes_v1.zip
 
 .sum-crystalhd: $(CRYSTAL_SOURCES)
 
-.crystalhd: $(CRYSTAL_SOURCES) .sum-crystalhd
-	mkdir -p -- "$(PREFIX)/include/libcrystalhd"
-	unzip -o $< -d "$(PREFIX)/include/libcrystalhd"
+libcrystalhd: $(CRYSTAL_SOURCES) .sum-crystalhd
+	$(RM) -R $(UNPACK_DIR) && unzip -o $< -d $(UNPACK_DIR)
+	chmod -R u+w $(UNPACK_DIR)
+	$(APPLY) $(SRC)/crystalhd/callback_proto.patch
 ifdef HAVE_WIN32 # we want dlopening on win32
-	rm -rf $(PREFIX)/include/libcrystalhd/bc_drv_if.h
+	rm -rf $(UNPACK_DIR)/bc_drv_if.h
 endif
+	$(MOVE)
+
+.crystalhd: libcrystalhd
+	rm -Rf "$(PREFIX)/include/libcrystalhd"
+	cp -R $< "$(PREFIX)/include"
 	touch $@


=====================================
contrib/src/gnutls/0001-windows-Avoid-Wint-conversion-errors.patch
=====================================
@@ -0,0 +1,60 @@
+From 88d79b964d88730e316919d6ccd17ca0fe9b3244 Mon Sep 17 00:00:00 2001
+From: Martin Storsjo <martin at martin.st>
+Date: Mon, 15 Aug 2022 23:50:16 +0300
+Subject: [PATCH] windows: Avoid -Wint-conversion errors
+
+Clang 15 made "incompatible pointer to integer conversion" an error
+instead of a plain warning. This fixes errors like these:
+
+system/keys-win.c:257:13: error: incompatible pointer to integer conversion initializing 'HCRYPTHASH' (aka 'unsigned long') with an expression of type 'void *' [-Wint-conversion]
+        HCRYPTHASH hHash = NULL;
+                   ^       ~~~~
+
+Signed-off-by: Martin Storsjo <martin at martin.st>
+---
+ lib/system/keys-win.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/lib/system/keys-win.c b/lib/system/keys-win.c
+index 4463c3b2d7..a0fffe249e 100644
+--- a/lib/system/keys-win.c
++++ b/lib/system/keys-win.c
+@@ -254,7 +254,7 @@ int capi_sign(gnutls_privkey_t key, void *userdata,
+ {
+ 	priv_st *priv = (priv_st *) userdata;
+ 	ALG_ID Algid;
+-	HCRYPTHASH hHash = NULL;
++	HCRYPTHASH hHash = 0;
+ 	uint8_t digest[MAX_HASH_SIZE];
+ 	unsigned int digest_size;
+ 	gnutls_digest_algorithm_t algo;
+@@ -441,7 +441,7 @@ static
+ int privkey_import_capi(gnutls_privkey_t pkey, const char *url, 
+ 		priv_st *priv, CRYPT_KEY_PROV_INFO *kpi)
+ {
+-	HCRYPTPROV hCryptProv = NULL;
++	HCRYPTPROV hCryptProv = 0;
+ 	int ret, enc_too = 0;
+ 	DWORD i, dwErrCode = 0;
+ 
+@@ -702,7 +702,7 @@ int privkey_import_ncrypt(gnutls_privkey_t pkey, const char *url,
+ 		priv_st *priv, CRYPT_KEY_PROV_INFO *kpi, NCRYPT_PROV_HANDLE *sctx)
+ {
+ 	SECURITY_STATUS r;
+-	NCRYPT_KEY_HANDLE nc = NULL;
++	NCRYPT_KEY_HANDLE nc = 0;
+ 	int ret, enc_too = 0;
+ 	WCHAR algo_str[64];
+ 	DWORD algo_str_size = 0;
+@@ -786,7 +786,7 @@ int _gnutls_privkey_import_system_url(gnutls_privkey_t pkey, const char *url)
+ 	const CERT_CONTEXT *cert = NULL;
+ 	CRYPT_HASH_BLOB blob;
+ 	CRYPT_KEY_PROV_INFO *kpi = NULL;
+-	NCRYPT_PROV_HANDLE sctx = NULL;
++	NCRYPT_PROV_HANDLE sctx = 0;
+ 	DWORD kpi_size;
+ 	SECURITY_STATUS r;
+ 	int ret;
+-- 
+2.25.1
+


=====================================
contrib/src/gnutls/rules.mak
=====================================
@@ -47,6 +47,8 @@ ifdef HAVE_DARWIN_OS
 	$(APPLY) $(SRC)/gnutls/gnutls-fix-aarch64-compilation-appleos.patch
 endif
 
+	$(APPLY) $(SRC)/gnutls/0001-windows-Avoid-Wint-conversion-errors.patch
+
 	$(UPDATE_AUTOCONFIG)
 	$(MOVE)
 


=====================================
contrib/src/qt/0015-foreach-remove-implementations-not-using-decltype.patch
=====================================
@@ -0,0 +1,113 @@
+From 26c3a74b6a0b1e904e8fe88e938ce701ee1cc441 Mon Sep 17 00:00:00 2001
+From: Olivier Goffart <ogoffart at woboq.com>
+Date: Sat, 7 Nov 2015 13:08:16 +0100
+Subject: [PATCH 15/18] foreach: remove implementations not using decltype
+
+decltype is mandatory now so we can remove the implementations
+of Q_FOREACH that are not using decltype
+
+Change-Id: If42a7fb078230ee7bdb55a9442125d7af70913e6
+Reviewed-by: Thiago Macieira <thiago.macieira at intel.com>
+Backport-Of: ae35b2dc62625341517caadca27cc6ec40890f7d (v5.7.0)
+---
+ src/corelib/global/qglobal.h | 66 ++----------------------------------
+ 1 file changed, 2 insertions(+), 64 deletions(-)
+
+diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
+index 27a14e2b66..baa9053876 100644
+--- a/src/corelib/global/qglobal.h
++++ b/src/corelib/global/qglobal.h
+@@ -924,8 +924,6 @@ QT_WARNING_DISABLE_MSVC(4530) /* C++ exception handler used, but unwind semantic
+ #  endif
+ #endif
+ 
+-#if defined(Q_COMPILER_DECLTYPE) || defined(Q_CC_GNU)
+-/* make use of decltype or GCC's __typeof__ extension */
+ template <typename T>
+ class QForeachContainer {
+     QForeachContainer &operator=(const QForeachContainer &) Q_DECL_EQ_DELETE;
+@@ -936,17 +934,6 @@ public:
+     int control;
+ };
+ 
+-// We need to use __typeof__ if we don't have decltype or if the compiler
+-// hasn't been updated to the fix of Core Language Defect Report 382
+-// (http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#382).
+-// GCC 4.3 and 4.4 have support for decltype, but are affected by DR 382.
+-#  if defined(Q_COMPILER_DECLTYPE) && \
+-    (defined(Q_CC_CLANG) || defined(Q_CC_INTEL) || !defined(Q_CC_GNU) || Q_CC_GNU >= 405)
+-#    define QT_FOREACH_DECLTYPE(x) typename QtPrivate::remove_reference<decltype(x)>::type
+-#  else
+-#    define QT_FOREACH_DECLTYPE(x) __typeof__((x))
+-#  endif
+-
+ // Explanation of the control word:
+ //  - it's initialized to 1
+ //  - that means both the inner and outer loops start
+@@ -956,61 +943,12 @@ public:
+ //    the outer loop to continue executing
+ //  - if there was a break inside the inner loop, it will exit with control still
+ //    set to 1; in that case, the outer loop will invert it to 0 and will exit too
+-#  define Q_FOREACH(variable, container)                                \
+-for (QForeachContainer<QT_FOREACH_DECLTYPE(container)> _container_((container)); \
++#define Q_FOREACH(variable, container)                                \
++for (QForeachContainer<typename QtPrivate::remove_reference<decltype(container)>::type> _container_((container)); \
+      _container_.control && _container_.i != _container_.e;         \
+      ++_container_.i, _container_.control ^= 1)                     \
+     for (variable = *_container_.i; _container_.control; _container_.control = 0)
+ 
+-#else
+-
+-struct QForeachContainerBase {};
+-
+-template <typename T>
+-class QForeachContainer : public QForeachContainerBase {
+-    QForeachContainer &operator=(const QForeachContainer &) Q_DECL_EQ_DELETE;
+-public:
+-    inline QForeachContainer(const T& t): c(t), brk(0), i(c.begin()), e(c.end()){}
+-    QForeachContainer(const QForeachContainer &other)
+-        : c(other.c), brk(other.brk), i(other.i), e(other.e) {}
+-    const T c;
+-    mutable int brk;
+-    mutable typename T::const_iterator i, e;
+-    inline bool condition() const { return (!brk++ && i != e); }
+-};
+-
+-template <typename T> inline T *qForeachPointer(const T &) { return 0; }
+-
+-template <typename T> inline QForeachContainer<T> qForeachContainerNew(const T& t)
+-{ return QForeachContainer<T>(t); }
+-
+-template <typename T>
+-inline const QForeachContainer<T> *qForeachContainer(const QForeachContainerBase *base, const T *)
+-{ return static_cast<const QForeachContainer<T> *>(base); }
+-
+-#if defined(Q_CC_DIAB)
+-// VxWorks DIAB generates unresolvable symbols, if container is a function call
+-#  define Q_FOREACH(variable,container)                                                             \
+-    if(0){}else                                                                                     \
+-    for (const QForeachContainerBase &_container_ = qForeachContainerNew(container);                \
+-         qForeachContainer(&_container_, (__typeof__(container) *) 0)->condition();       \
+-         ++qForeachContainer(&_container_, (__typeof__(container) *) 0)->i)               \
+-        for (variable = *qForeachContainer(&_container_, (__typeof__(container) *) 0)->i; \
+-             qForeachContainer(&_container_, (__typeof__(container) *) 0)->brk;           \
+-             --qForeachContainer(&_container_, (__typeof__(container) *) 0)->brk)
+-
+-#else
+-#  define Q_FOREACH(variable, container) \
+-    for (const QForeachContainerBase &_container_ = qForeachContainerNew(container); \
+-         qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->condition();       \
+-         ++qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->i)               \
+-        for (variable = *qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->i; \
+-             qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->brk;           \
+-             --qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->brk)
+-#endif // MSVC6 || MIPSpro
+-
+-#endif
+-
+ #define Q_FOREVER for(;;)
+ #ifndef QT_NO_KEYWORDS
+ #  ifndef foreach
+-- 
+2.25.1
+


=====================================
contrib/src/qt/0016-Replace-custom-type-traits-with-std-one-s.patch
=====================================
@@ -0,0 +1,1148 @@
+From 2c12688e30f2e38c9d7ff9ab8718d6580b2eeb34 Mon Sep 17 00:00:00 2001
+From: Kai Koehne <kai.koehne at qt.io>
+Date: Fri, 5 Aug 2016 10:12:12 +0200
+Subject: [PATCH 16/18] Replace custom type traits with std one's
+
+Remove most type traits from qtypetraits.h, but keep the custom
+implementation of is_signed/is_unsigned. This gets rid of
+BSD-3 licensed code from Google in a public header (hugh!).
+
+The custom implementations for is_signed/is_unsigned are kept
+because the implementations in gcc's standard headers do not
+work as we expect for enums - both is_signed and is_unsigned
+always returns false there - see also
+  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59027
+
+[ChangeLog][QtCore][General] Qt now relies on type traits from
+the C++ standard library.
+
+Change-Id: I3f2188b46949f04ca4482a6ac9afd3482103f0e1
+Reviewed-by: Thiago Macieira <thiago.macieira at intel.com>
+Backport-Of: ed7f77071dcca996a8c8147fd66344090666e60c (v5.8.0)
+---
+ src/corelib/global/qflags.h                   |   2 +-
+ src/corelib/global/qglobal.h                  |   3 +-
+ src/corelib/global/qisenum.h                  |   3 +-
+ src/corelib/global/qnumeric_p.h               |   4 +-
+ src/corelib/global/qtypeinfo.h                |   7 +-
+ src/corelib/global/qtypetraits.h              | 450 +-----------------
+ src/corelib/kernel/qmetatype.h                |   9 +-
+ src/corelib/kernel/qobject.h                  |  12 +-
+ src/corelib/kernel/qpointer.h                 |   2 +-
+ src/corelib/kernel/qtimer.h                   |   8 +-
+ src/corelib/kernel/qvariant_p.h               |  10 +-
+ src/corelib/thread/qmutex.cpp                 |   3 +-
+ src/corelib/tools/qbytearray_p.h              |   3 +-
+ src/corelib/tools/qhash.h                     |   2 +-
+ src/corelib/tools/qlist.h                     |   4 +-
+ src/corelib/tools/qmap.h                      |   7 +-
+ src/corelib/tools/qsharedpointer_impl.h       |   2 +-
+ src/corelib/tools/qstringalgorithms_p.h       |   4 +-
+ src/testlib/qtestcase.h                       |   3 +-
+ src/widgets/graphicsview/qgraphicsitem.h      |   4 +-
+ src/widgets/styles/qstyleoption.h             |   8 +-
+ src/widgets/widgets/qmenu.h                   |   4 +-
+ src/widgets/widgets/qtoolbar.h                |   4 +-
+ .../corelib/global/qglobal/tst_qglobal.cpp    |   5 +-
+ .../qhashfunctions/tst_qhashfunctions.cpp     |   3 +-
+ 25 files changed, 58 insertions(+), 508 deletions(-)
+
+diff --git a/src/corelib/global/qflags.h b/src/corelib/global/qflags.h
+index f434e87c85..d2a6b51d90 100644
+--- a/src/corelib/global/qflags.h
++++ b/src/corelib/global/qflags.h
+@@ -96,7 +96,7 @@ public:
+     // the definition below is too complex for qdoc
+     typedef int Int;
+ #else
+-    typedef typename QtPrivate::if_<
++    typedef typename std::conditional<
+             QtPrivate::is_unsigned<Enum>::value,
+             unsigned int,
+             signed int
+diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
+index baa9053876..d35963dff3 100644
+--- a/src/corelib/global/qglobal.h
++++ b/src/corelib/global/qglobal.h
+@@ -36,6 +36,7 @@
+ #define QGLOBAL_H
+ 
+ #ifdef __cplusplus
++#  include <type_traits>
+ #  include <cstddef>
+ #endif
+ 
+@@ -944,7 +945,7 @@ public:
+ //  - if there was a break inside the inner loop, it will exit with control still
+ //    set to 1; in that case, the outer loop will invert it to 0 and will exit too
+ #define Q_FOREACH(variable, container)                                \
+-for (QForeachContainer<typename QtPrivate::remove_reference<decltype(container)>::type> _container_((container)); \
++for (QForeachContainer<typename std::remove_reference<decltype(container)>::type> _container_((container)); \
+      _container_.control && _container_.i != _container_.e;         \
+      ++_container_.i, _container_.control ^= 1)                     \
+     for (variable = *_container_.i; _container_.control; _container_.control = 0)
+diff --git a/src/corelib/global/qisenum.h b/src/corelib/global/qisenum.h
+index 3a05297bd6..e5f3f9c00c 100644
+--- a/src/corelib/global/qisenum.h
++++ b/src/corelib/global/qisenum.h
+@@ -49,8 +49,7 @@
+ #endif
+ 
+ #ifndef Q_IS_ENUM
+-#  include <QtCore/qtypetraits.h>
+-#  define Q_IS_ENUM(x) QtPrivate::is_enum<x>::value
++#  define Q_IS_ENUM(x) std::is_enum<x>::value
+ #endif
+ 
+ // shut up syncqt
+diff --git a/src/corelib/global/qnumeric_p.h b/src/corelib/global/qnumeric_p.h
+index c29ec0ea7b..24a51fd911 100644
+--- a/src/corelib/global/qnumeric_p.h
++++ b/src/corelib/global/qnumeric_p.h
+@@ -201,7 +201,7 @@ static inline bool qt_is_finite(float d)
+ // Overflow math
+ //
+ namespace {
+-template <typename T> inline typename QtPrivate::QEnableIf<QtPrivate::is_unsigned<T>::value, bool>::Type
++template <typename T> inline typename QtPrivate::QEnableIf<std::is_unsigned<T>::value, bool>::Type
+ add_overflow(T v1, T v2, T *r)
+ {
+     // unsigned additions are well-defined
+@@ -209,7 +209,7 @@ add_overflow(T v1, T v2, T *r)
+     return v1 > T(v1 + v2);
+ }
+ 
+-template <typename T> inline typename QtPrivate::QEnableIf<QtPrivate::is_unsigned<T>::value, bool>::Type
++template <typename T> inline typename QtPrivate::QEnableIf<std::is_unsigned<T>::value, bool>::Type
+ mul_overflow(T v1, T v2, T *r)
+ {
+     // use the next biggest type
+diff --git a/src/corelib/global/qtypeinfo.h b/src/corelib/global/qtypeinfo.h
+index f5fc311a22..5d60f1f83b 100644
+--- a/src/corelib/global/qtypeinfo.h
++++ b/src/corelib/global/qtypeinfo.h
+@@ -31,12 +31,13 @@
+ **
+ ****************************************************************************/
+ 
+-#include <QtCore/qtypetraits.h>
+ #include <QtCore/qisenum.h>
+ 
+ #ifndef QTYPEINFO_H
+ #define QTYPEINFO_H
+ 
++#include <QtCore/qglobal.h>
++
+ QT_BEGIN_NAMESPACE
+ 
+ /*
+@@ -53,7 +54,7 @@ class QTypeInfo
+ public:
+     enum {
+         isPointer = false,
+-        isIntegral = QtPrivate::is_integral<T>::value,
++        isIntegral = std::is_integral<T>::value,
+         isComplex = true,
+         isStatic = true,
+         isRelocatable = Q_IS_ENUM(T),
+@@ -214,7 +215,7 @@ public: \
+         isRelocatable = !isStatic || ((FLAGS) & Q_RELOCATABLE_TYPE), \
+         isLarge = (sizeof(TYPE)>sizeof(void*)), \
+         isPointer = false, \
+-        isIntegral = QtPrivate::is_integral< TYPE >::value, \
++        isIntegral = std::is_integral< TYPE >::value, \
+         isDummy = (((FLAGS) & Q_DUMMY_TYPE) != 0), \
+         sizeOf = sizeof(TYPE) \
+     }; \
+diff --git a/src/corelib/global/qtypetraits.h b/src/corelib/global/qtypetraits.h
+index 488e257e0f..86593f7b11 100644
+--- a/src/corelib/global/qtypetraits.h
++++ b/src/corelib/global/qtypetraits.h
+@@ -31,451 +31,28 @@
+ **
+ ****************************************************************************/
+ 
+-// BEGIN Google Code
+-
+-// Copyright (c) 2006, Google Inc.
+-// All rights reserved.
+-//
+-// Redistribution and use in source and binary forms, with or without
+-// modification, are permitted provided that the following conditions are
+-// met:
+-//
+-//     * Redistributions of source code must retain the above copyright
+-// notice, this list of conditions and the following disclaimer.
+-//     * Redistributions in binary form must reproduce the above
+-// copyright notice, this list of conditions and the following disclaimer
+-// in the documentation and/or other materials provided with the
+-// distribution.
+-//     * Neither the name of Google Inc. nor the names of its
+-// contributors may be used to endorse or promote products derived from
+-// this software without specific prior written permission.
+-//
+-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-
+-// ----
+-//
+-// This code is compiled directly on many platforms, including client
+-// platforms like Windows, Mac, and embedded systems.  Before making
+-// any changes here, make sure that you're not breaking any platforms.
+-//
+-// Define a small subset of tr1 type traits. The traits we define are:
+-//   is_integral
+-//   is_floating_point
+-//   is_pointer
+-//   is_enum
+-//   is_reference
+-//   is_const
+-//   is_volatile
+-//   is_pod
+-//   has_trivial_constructor
+-//   has_trivial_copy
+-//   has_trivial_assign
+-//   has_trivial_destructor
+-//   is_signed
+-//   is_unsigned
+-//   remove_const
+-//   remove_volatile
+-//   remove_cv
+-//   remove_reference
+-//   add_reference
+-//   remove_pointer
+-//   is_same
+-//   is_convertible
+-// We can add more type traits as required.
+-
+-// Changes from the original implementation:
+-//  - Move base types from template_util.h directly into this header.
+-//  - Use Qt macros for long long type differences on Windows.
+-//  - Enclose in QtPrivate namespace.
+-
+ #include "QtCore/qglobal.h"
+ 
+ #ifndef QTYPETRAITS_H
+ #define QTYPETRAITS_H
+ 
+-#include <utility>                  // For pair
+-
+ QT_BEGIN_NAMESPACE
+ 
+ namespace QtPrivate {
+ 
+-// Types small_ and big_ are guaranteed such that sizeof(small_) <
+-// sizeof(big_)
+-typedef char small_;
+-
+-struct big_ {
+-  char dummy[2];
+-};
+-
+-// Identity metafunction.
+-template <class T>
+-struct identity_ {
+-  typedef T type;
+-};
+-
+-// integral_constant, defined in tr1, is a wrapper for an integer
+-// value. We don't really need this generality; we could get away
+-// with hardcoding the integer type to bool. We use the fully
+-// general integer_constant for compatibility with tr1.
+-
+-template<class T, T v>
+-struct integral_constant {
+-  static const T value = v;
+-  typedef T value_type;
+-  typedef integral_constant<T, v> type;
+-};
+-
+-template <class T, T v> const T integral_constant<T, v>::value;
+-
+-
+-// Abbreviations: true_type and false_type are structs that represent boolean
+-// true and false values. Also define the boost::mpl versions of those names,
+-// true_ and false_.
+-typedef integral_constant<bool, true>  true_type;
+-typedef integral_constant<bool, false> false_type;
+-typedef true_type  true_;
+-typedef false_type false_;
+-
+-// if_ is a templatized conditional statement.
+-// if_<cond, A, B> is a compile time evaluation of cond.
+-// if_<>::type contains A if cond is true, B otherwise.
+-template<bool cond, typename A, typename B>
+-struct if_{
+-  typedef A type;
+-};
+-
+-template<typename A, typename B>
+-struct if_<false, A, B> {
+-  typedef B type;
+-};
+-
+-
+-// type_equals_ is a template type comparator, similar to Loki IsSameType.
+-// type_equals_<A, B>::value is true iff "A" is the same type as "B".
+ //
+-// New code should prefer base::is_same, defined in base/type_traits.h.
+-// It is functionally identical, but is_same is the standard spelling.
+-template<typename A, typename B>
+-struct type_equals_ : public false_ {
+-};
+-
+-template<typename A>
+-struct type_equals_<A, A> : public true_ {
+-};
+-
+-// and_ is a template && operator.
+-// and_<A, B>::value evaluates "A::value && B::value".
+-template<typename A, typename B>
+-struct and_ : public integral_constant<bool, (A::value && B::value)> {
+-};
+-
+-// or_ is a template || operator.
+-// or_<A, B>::value evaluates "A::value || B::value".
+-template<typename A, typename B>
+-struct or_ : public integral_constant<bool, (A::value || B::value)> {
+-};
+-
+-template <class T> struct is_integral;
+-template <class T> struct is_floating_point;
+-template <class T> struct is_pointer;
+-// MSVC can't compile this correctly, and neither can gcc 3.3.5 (at least)
+-#if !defined(_MSC_VER) && !(defined(__GNUC__) && __GNUC__ <= 3)
+-// is_enum uses is_convertible, which is not available on MSVC.
+-template <class T> struct is_enum;
+-#endif
+-template <class T> struct is_reference;
+-template <class T> struct is_pod;
+-template <class T> struct has_trivial_constructor;
+-template <class T> struct has_trivial_copy;
+-template <class T> struct has_trivial_assign;
+-template <class T> struct has_trivial_destructor;
+-template <class T> struct remove_const;
+-template <class T> struct remove_volatile;
+-template <class T> struct remove_cv;
+-template <class T> struct remove_reference;
+-template <class T> struct add_reference;
+-template <class T> struct remove_pointer;
+-template <class T, class U> struct is_same;
+-#if !defined(_MSC_VER) && !(defined(__GNUC__) && __GNUC__ <= 3)
+-template <class From, class To> struct is_convertible;
+-#endif
+-
+-// is_integral is false except for the built-in integer types. A
+-// cv-qualified type is integral if and only if the underlying type is.
+-template <class T> struct is_integral : false_type { };
+-template<> struct is_integral<bool> : true_type { };
+-template<> struct is_integral<char> : true_type { };
+-template<> struct is_integral<unsigned char> : true_type { };
+-template<> struct is_integral<signed char> : true_type { };
+-#if defined(_MSC_VER)
+-// wchar_t is not by default a distinct type from unsigned short in
+-// Microsoft C.
+-// See http://msdn2.microsoft.com/en-us/library/dh8che7s(VS.80).aspx
+-template<> struct is_integral<__wchar_t> : true_type { };
+-#else
+-template<> struct is_integral<wchar_t> : true_type { };
+-#endif
+-template<> struct is_integral<short> : true_type { };
+-template<> struct is_integral<unsigned short> : true_type { };
+-template<> struct is_integral<int> : true_type { };
+-template<> struct is_integral<unsigned int> : true_type { };
+-template<> struct is_integral<long> : true_type { };
+-template<> struct is_integral<unsigned long> : true_type { };
+-#if defined(Q_OS_WIN) && !defined(Q_CC_GNU)
+-template<> struct is_integral<__int64> : true_type { };
+-template<> struct is_integral<unsigned __int64> : true_type { };
+-#else
+-template<> struct is_integral<long long> : true_type { };
+-template<> struct is_integral<unsigned long long> : true_type { };
+-#endif
+-template <class T> struct is_integral<const T> : is_integral<T> { };
+-template <class T> struct is_integral<volatile T> : is_integral<T> { };
+-template <class T> struct is_integral<const volatile T> : is_integral<T> { };
+-#if defined (Q_COMPILER_UNICODE_STRINGS)
+-template<> struct is_integral<char16_t> : true_type { };
+-template<> struct is_integral<char32_t> : true_type { };
+-#endif
+-
+-// is_floating_point is false except for the built-in floating-point types.
+-// A cv-qualified type is integral if and only if the underlying type is.
+-template <class T> struct is_floating_point : false_type { };
+-template<> struct is_floating_point<float> : true_type { };
+-template<> struct is_floating_point<double> : true_type { };
+-template<> struct is_floating_point<long double> : true_type { };
+-template <class T> struct is_floating_point<const T>
+-    : is_floating_point<T> { };
+-template <class T> struct is_floating_point<volatile T>
+-    : is_floating_point<T> { };
+-template <class T> struct is_floating_point<const volatile T>
+-    : is_floating_point<T> { };
+-
+-// is_pointer is false except for pointer types. A cv-qualified type (e.g.
+-// "int* const", as opposed to "int const*") is cv-qualified if and only if
+-// the underlying type is.
+-template <class T> struct is_pointer : false_type { };
+-template <class T> struct is_pointer<T*> : true_type { };
+-template <class T> struct is_pointer<const T> : is_pointer<T> { };
+-template <class T> struct is_pointer<volatile T> : is_pointer<T> { };
+-template <class T> struct is_pointer<const volatile T> : is_pointer<T> { };
+-
+-#if !defined(_MSC_VER) && !(defined(__GNUC__) && __GNUC__ <= 3)
+-
+-namespace internal {
+-
+-template <class T> struct is_class_or_union {
+-  template <class U> static small_ tester(void (U::*)());
+-  template <class U> static big_ tester(...);
+-  static const bool value = sizeof(tester<T>(0)) == sizeof(small_);
+-};
+-
+-// is_convertible chokes if the first argument is an array. That's why
+-// we use add_reference here.
+-template <bool NotUnum, class T> struct is_enum_impl
+-    : is_convertible<typename add_reference<T>::type, int> { };
+-
+-template <class T> struct is_enum_impl<true, T> : false_type { };
+-
+-}  // namespace internal
+-
+-// Specified by TR1 [4.5.1] primary type categories.
+-
+-// Implementation note:
++// define custom is_signed, is_unsigned that also works with enum's
+ //
+-// Each type is either void, integral, floating point, array, pointer,
+-// reference, member object pointer, member function pointer, enum,
+-// union or class. Out of these, only integral, floating point, reference,
+-// class and enum types are potentially convertible to int. Therefore,
+-// if a type is not a reference, integral, floating point or class and
+-// is convertible to int, it's a enum. Adding cv-qualification to a type
+-// does not change whether it's an enum.
+-//
+-// Is-convertible-to-int check is done only if all other checks pass,
+-// because it can't be used with some types (e.g. void or classes with
+-// inaccessible conversion operators).
+-template <class T> struct is_enum
+-    : internal::is_enum_impl<
+-          is_same<T, void>::value ||
+-              is_integral<T>::value ||
+-              is_floating_point<T>::value ||
+-              is_reference<T>::value ||
+-              internal::is_class_or_union<T>::value,
+-          T> { };
+-
+-template <class T> struct is_enum<const T> : is_enum<T> { };
+-template <class T> struct is_enum<volatile T> : is_enum<T> { };
+-template <class T> struct is_enum<const volatile T> : is_enum<T> { };
+-
+-#endif
+-
+-// is_reference is false except for reference types.
+-template<typename T> struct is_reference : false_type {};
+-template<typename T> struct is_reference<T&> : true_type {};
+-
+-// Specified by TR1 [4.5.3] Type Properties
+-template <typename T> struct is_const : false_type {};
+-template <typename T> struct is_const<const T> : true_type {};
+-template <typename T> struct is_volatile : false_type {};
+-template <typename T> struct is_volatile<volatile T> : true_type {};
+-
+-// We can't get is_pod right without compiler help, so fail conservatively.
+-// We will assume it's false except for arithmetic types, enumerations,
+-// pointers and cv-qualified versions thereof. Note that std::pair<T,U>
+-// is not a POD even if T and U are PODs.
+-template <class T> struct is_pod
+- : integral_constant<bool, (is_integral<T>::value ||
+-                            is_floating_point<T>::value ||
+-#if !defined(_MSC_VER) && !(defined(__GNUC__) && __GNUC__ <= 3)
+-                            // is_enum is not available on MSVC.
+-                            is_enum<T>::value ||
+-#endif
+-                            is_pointer<T>::value)> { };
+-template <class T> struct is_pod<const T> : is_pod<T> { };
+-template <class T> struct is_pod<volatile T> : is_pod<T> { };
+-template <class T> struct is_pod<const volatile T> : is_pod<T> { };
+-
+-
+-// We can't get has_trivial_constructor right without compiler help, so
+-// fail conservatively. We will assume it's false except for: (1) types
+-// for which is_pod is true. (2) std::pair of types with trivial
+-// constructors. (3) array of a type with a trivial constructor.
+-// (4) const versions thereof.
+-template <class T> struct has_trivial_constructor : is_pod<T> { };
+-template <class T, class U> struct has_trivial_constructor<std::pair<T, U> >
+-  : integral_constant<bool,
+-                      (has_trivial_constructor<T>::value &&
+-                       has_trivial_constructor<U>::value)> { };
+-template <class A, int N> struct has_trivial_constructor<A[N]>
+-  : has_trivial_constructor<A> { };
+-template <class T> struct has_trivial_constructor<const T>
+-  : has_trivial_constructor<T> { };
+-
+-// We can't get has_trivial_copy right without compiler help, so fail
+-// conservatively. We will assume it's false except for: (1) types
+-// for which is_pod is true. (2) std::pair of types with trivial copy
+-// constructors. (3) array of a type with a trivial copy constructor.
+-// (4) const versions thereof.
+-template <class T> struct has_trivial_copy : is_pod<T> { };
+-template <class T, class U> struct has_trivial_copy<std::pair<T, U> >
+-  : integral_constant<bool,
+-                      (has_trivial_copy<T>::value &&
+-                       has_trivial_copy<U>::value)> { };
+-template <class A, int N> struct has_trivial_copy<A[N]>
+-  : has_trivial_copy<A> { };
+-template <class T> struct has_trivial_copy<const T> : has_trivial_copy<T> { };
+-
+-// We can't get has_trivial_assign right without compiler help, so fail
+-// conservatively. We will assume it's false except for: (1) types
+-// for which is_pod is true. (2) std::pair of types with trivial copy
+-// constructors. (3) array of a type with a trivial assign constructor.
+-template <class T> struct has_trivial_assign : is_pod<T> { };
+-template <class T, class U> struct has_trivial_assign<std::pair<T, U> >
+-  : integral_constant<bool,
+-                      (has_trivial_assign<T>::value &&
+-                       has_trivial_assign<U>::value)> { };
+-template <class A, int N> struct has_trivial_assign<A[N]>
+-  : has_trivial_assign<A> { };
+-
+-// We can't get has_trivial_destructor right without compiler help, so
+-// fail conservatively. We will assume it's false except for: (1) types
+-// for which is_pod is true. (2) std::pair of types with trivial
+-// destructors. (3) array of a type with a trivial destructor.
+-// (4) const versions thereof.
+-template <class T> struct has_trivial_destructor : is_pod<T> { };
+-template <class T, class U> struct has_trivial_destructor<std::pair<T, U> >
+-  : integral_constant<bool,
+-                      (has_trivial_destructor<T>::value &&
+-                       has_trivial_destructor<U>::value)> { };
+-template <class A, int N> struct has_trivial_destructor<A[N]>
+-  : has_trivial_destructor<A> { };
+-template <class T> struct has_trivial_destructor<const T>
+-  : has_trivial_destructor<T> { };
+-
+-// Specified by TR1 [4.7.1]
+-template<typename T> struct remove_const { typedef T type; };
+-template<typename T> struct remove_const<T const> { typedef T type; };
+-template<typename T> struct remove_volatile { typedef T type; };
+-template<typename T> struct remove_volatile<T volatile> { typedef T type; };
+-template<typename T> struct remove_cv {
+-  typedef typename remove_const<typename remove_volatile<T>::type>::type type;
+-};
+-
+-
+-// Specified by TR1 [4.7.2] Reference modifications.
+-template<typename T> struct remove_reference { typedef T type; };
+-template<typename T> struct remove_reference<T&> { typedef T type; };
+-
+-template <typename T> struct add_reference { typedef T& type; };
+-template <typename T> struct add_reference<T&> { typedef T& type; };
+-
+-// Specified by TR1 [4.7.4] Pointer modifications.
+-template<typename T> struct remove_pointer { typedef T type; };
+-template<typename T> struct remove_pointer<T*> { typedef T type; };
+-template<typename T> struct remove_pointer<T* const> { typedef T type; };
+-template<typename T> struct remove_pointer<T* volatile> { typedef T type; };
+-template<typename T> struct remove_pointer<T* const volatile> {
+-  typedef T type; };
+-
+-// Specified by TR1 [4.6] Relationships between types
+-template<typename T, typename U> struct is_same : public false_type { };
+-template<typename T> struct is_same<T, T> : public true_type { };
+-
+-// Specified by TR1 [4.6] Relationships between types
+-#if !defined(_MSC_VER) && !(defined(__GNUC__) && __GNUC__ <= 3)
+-namespace internal {
+-
+-// This class is an implementation detail for is_convertible, and you
+-// don't need to know how it works to use is_convertible. For those
+-// who care: we declare two different functions, one whose argument is
+-// of type To and one with a variadic argument list. We give them
+-// return types of different size, so we can use sizeof to trick the
+-// compiler into telling us which function it would have chosen if we
+-// had called it with an argument of type From.  See Alexandrescu's
+-// _Modern C++ Design_ for more details on this sort of trick.
+-
+-template <typename From, typename To>
+-struct ConvertHelper {
+-  static small_ Test(To);
+-  static big_ Test(...);
+-  static From Create();
+-};
+-}  // namespace internal
+-
+-// Inherits from true_type if From is convertible to To, false_type otherwise.
+-template <typename From, typename To>
+-struct is_convertible
+-    : integral_constant<bool,
+-                        sizeof(internal::ConvertHelper<From, To>::Test(
+-                                  internal::ConvertHelper<From, To>::Create()))
+-                        == sizeof(small_)> {
+-};
+-#endif
+-
+-// END Google Code
+ 
+ // a metafunction to invert an integral_constant:
+ template <typename T>
+ struct not_
+-    : integral_constant<bool, !T::value> {};
+-
+-// same, with a bool argument:
+-template <bool B>
+-struct not_c
+-    : integral_constant<bool, !B> {};
++    : std::integral_constant<bool, !T::value> {};
+ 
+ // Checks whether a type is unsigned (T must be convertible to unsigned int):
+ template <typename T>
+ struct is_unsigned
+-    : integral_constant<bool, (T(0) < T(-1))> {};
++    : std::integral_constant<bool, (T(0) < T(-1))> {};
+ 
+ // Checks whether a type is signed (T must be convertible to int):
+ template <typename T>
+@@ -506,27 +83,6 @@ Q_STATIC_ASSERT((!is_unsigned<qint64>::value));
+ Q_STATIC_ASSERT((!is_signed<quint64>::value));
+ Q_STATIC_ASSERT(( is_signed<qint64>::value));
+ 
+-template<class T = void> struct is_default_constructible;
+-
+-template<> struct is_default_constructible<void>
+-{
+-protected:
+-    template<bool> struct test { typedef char type; };
+-public:
+-    static bool const value = false;
+-};
+-template<> struct is_default_constructible<>::test<true> { typedef double type; };
+-
+-template<class T> struct is_default_constructible : is_default_constructible<>
+-{
+-private:
+-    template<class U> static typename test<!!sizeof(::new U())>::type sfinae(U*);
+-    template<class U> static char sfinae(...);
+-public:
+-    static bool const value = sizeof(sfinae<T>(0)) > 1;
+-};
+-
+-
+ } // namespace QtPrivate
+ 
+ QT_END_NAMESPACE
+diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h
+index b6cfad56b5..27fd710ff7 100644
+--- a/src/corelib/kernel/qmetatype.h
++++ b/src/corelib/kernel/qmetatype.h
+@@ -40,7 +40,6 @@
+ #include <QtCore/qbytearray.h>
+ #include <QtCore/qvarlengtharray.h>
+ #include <QtCore/qisenum.h>
+-#include <QtCore/qtypetraits.h>
+ #ifndef QT_NO_QOBJECT
+ #include <QtCore/qobjectdefs.h>
+ #endif
+@@ -880,7 +879,7 @@ private:
+     // is void* to avoid overloads conflicts. We do it by injecting unaccessible Dummy
+     // type as part of the overload signature.
+     struct Dummy {};
+-    typedef typename QtPrivate::if_<QtPrivate::is_same<value_type, void*>::value, Dummy, value_type>::type value_type_OR_Dummy;
++    typedef typename std::conditional<std::is_same<value_type, void*>::value, Dummy, value_type>::type value_type_OR_Dummy;
+ public:
+     static void assign(void **ptr, const value_type_OR_Dummy *iterator )
+     {
+@@ -1085,7 +1084,7 @@ struct QSequentialIterableConvertFunctor
+ }
+ 
+ namespace QtMetaTypePrivate {
+-template<typename T, bool = QtPrivate::is_same<typename T::const_iterator::value_type, typename T::mapped_type>::value>
++template<typename T, bool = std::is_same<typename T::const_iterator::value_type, typename T::mapped_type>::value>
+ struct AssociativeContainerAccessor
+ {
+     static const typename T::key_type& getKey(const typename T::const_iterator &it)
+@@ -1099,7 +1098,7 @@ struct AssociativeContainerAccessor
+     }
+ };
+ 
+-template<typename T, bool = QtPrivate::is_same<typename T::const_iterator::value_type, std::pair<const typename T::key_type, typename T::mapped_type> >::value>
++template<typename T, bool = std::is_same<typename T::const_iterator::value_type, std::pair<const typename T::key_type, typename T::mapped_type> >::value>
+ struct StlStyleAssociativeContainerAccessor;
+ 
+ template<typename T>
+@@ -1787,7 +1786,7 @@ template <typename T>
+ struct QMetaTypeIdQObject<T, QMetaType::IsGadget>
+ {
+     enum {
+-        Defined = QtPrivate::is_default_constructible<T>::value
++        Defined = std::is_default_constructible<T>::value
+     };
+ 
+     static int qt_metatype_id()
+diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h
+index b39eefa795..49a6996313 100644
+--- a/src/corelib/kernel/qobject.h
++++ b/src/corelib/kernel/qobject.h
+@@ -149,14 +149,14 @@ public:
+     template<typename T>
+     inline T findChild(const QString &aName = QString(), Qt::FindChildOptions options = Qt::FindChildrenRecursively) const
+     {
+-        typedef typename QtPrivate::remove_cv<typename QtPrivate::remove_pointer<T>::type>::type ObjType;
++        typedef typename std::remove_cv<typename std::remove_pointer<T>::type>::type ObjType;
+         return static_cast<T>(qt_qFindChild_helper(this, aName, ObjType::staticMetaObject, options));
+     }
+ 
+     template<typename T>
+     inline QList<T> findChildren(const QString &aName = QString(), Qt::FindChildOptions options = Qt::FindChildrenRecursively) const
+     {
+-        typedef typename QtPrivate::remove_cv<typename QtPrivate::remove_pointer<T>::type>::type ObjType;
++        typedef typename std::remove_cv<typename std::remove_pointer<T>::type>::type ObjType;
+         QList<T> list;
+         qt_qFindChildren_helper(this, aName, ObjType::staticMetaObject,
+                                 reinterpret_cast<QList<void *> *>(&list), options);
+@@ -167,7 +167,7 @@ public:
+     template<typename T>
+     inline QList<T> findChildren(const QRegExp &re, Qt::FindChildOptions options = Qt::FindChildrenRecursively) const
+     {
+-        typedef typename QtPrivate::remove_cv<typename QtPrivate::remove_pointer<T>::type>::type ObjType;
++        typedef typename std::remove_cv<typename std::remove_pointer<T>::type>::type ObjType;
+         QList<T> list;
+         qt_qFindChildren_helper(this, re, ObjType::staticMetaObject,
+                                 reinterpret_cast<QList<void *> *>(&list), options);
+@@ -179,7 +179,7 @@ public:
+     template<typename T>
+     inline QList<T> findChildren(const QRegularExpression &re, Qt::FindChildOptions options = Qt::FindChildrenRecursively) const
+     {
+-        typedef typename QtPrivate::remove_cv<typename QtPrivate::remove_pointer<T>::type>::type ObjType;
++        typedef typename std::remove_cv<typename std::remove_pointer<T>::type>::type ObjType;
+         QList<T> list;
+         qt_qFindChildren_helper(this, re, ObjType::staticMetaObject,
+                                 reinterpret_cast<QList<void *> *>(&list), options);
+@@ -514,7 +514,7 @@ inline QT_DEPRECATED QList<T> qFindChildren(const QObject *o, const QRegExp &re)
+ template <class T>
+ inline T qobject_cast(QObject *object)
+ {
+-    typedef typename QtPrivate::remove_cv<typename QtPrivate::remove_pointer<T>::type>::type ObjType;
++    typedef typename std::remove_cv<typename std::remove_pointer<T>::type>::type ObjType;
+     Q_STATIC_ASSERT_X(QtPrivate::HasQ_OBJECT_Macro<ObjType>::Value,
+                     "qobject_cast requires the type to have a Q_OBJECT macro");
+     return static_cast<T>(ObjType::staticMetaObject.cast(object));
+@@ -523,7 +523,7 @@ inline T qobject_cast(QObject *object)
+ template <class T>
+ inline T qobject_cast(const QObject *object)
+ {
+-    typedef typename QtPrivate::remove_cv<typename QtPrivate::remove_pointer<T>::type>::type ObjType;
++    typedef typename std::remove_cv<typename std::remove_pointer<T>::type>::type ObjType;
+     Q_STATIC_ASSERT_X(QtPrivate::HasQ_OBJECT_Macro<ObjType>::Value,
+                       "qobject_cast requires the type to have a Q_OBJECT macro");
+     return static_cast<T>(ObjType::staticMetaObject.cast(object));
+diff --git a/src/corelib/kernel/qpointer.h b/src/corelib/kernel/qpointer.h
+index 52bd368301..13af0bc015 100644
+--- a/src/corelib/kernel/qpointer.h
++++ b/src/corelib/kernel/qpointer.h
+@@ -46,7 +46,7 @@ class QVariant;
+ template <class T>
+ class QPointer
+ {
+-    Q_STATIC_ASSERT_X(!QtPrivate::is_pointer<T>::value, "QPointer's template type must not be a pointer type");
++    Q_STATIC_ASSERT_X(!std::is_pointer<T>::value, "QPointer's template type must not be a pointer type");
+ 
+     template<typename U>
+     struct TypeSelector
+diff --git a/src/corelib/kernel/qtimer.h b/src/corelib/kernel/qtimer.h
+index 889f5d7f70..2fc056a281 100644
+--- a/src/corelib/kernel/qtimer.h
++++ b/src/corelib/kernel/qtimer.h
+@@ -103,14 +103,14 @@ public:
+     // singleShot to a functor or function pointer (without context)
+     template <typename Func1>
+     static inline typename QtPrivate::QEnableIf<!QtPrivate::FunctionPointer<Func1>::IsPointerToMemberFunction &&
+-                                                !QtPrivate::is_same<const char*, Func1>::value, void>::Type
++                                                !std::is_same<const char*, Func1>::value, void>::Type
+             singleShot(int msec, Func1 slot)
+     {
+         singleShot(msec, msec >= 2000 ? Qt::CoarseTimer : Qt::PreciseTimer, Q_NULLPTR, slot);
+     }
+     template <typename Func1>
+     static inline typename QtPrivate::QEnableIf<!QtPrivate::FunctionPointer<Func1>::IsPointerToMemberFunction &&
+-                                                !QtPrivate::is_same<const char*, Func1>::value, void>::Type
++                                                !std::is_same<const char*, Func1>::value, void>::Type
+             singleShot(int msec, Qt::TimerType timerType, Func1 slot)
+     {
+         singleShot(msec, timerType, Q_NULLPTR, slot);
+@@ -118,14 +118,14 @@ public:
+     // singleShot to a functor or function pointer (with context)
+     template <typename Func1>
+     static inline typename QtPrivate::QEnableIf<!QtPrivate::FunctionPointer<Func1>::IsPointerToMemberFunction &&
+-                                                !QtPrivate::is_same<const char*, Func1>::value, void>::Type
++                                                !std::is_same<const char*, Func1>::value, void>::Type
+             singleShot(int msec, QObject *context, Func1 slot)
+     {
+         singleShot(msec, msec >= 2000 ? Qt::CoarseTimer : Qt::PreciseTimer, context, slot);
+     }
+     template <typename Func1>
+     static inline typename QtPrivate::QEnableIf<!QtPrivate::FunctionPointer<Func1>::IsPointerToMemberFunction &&
+-                                                !QtPrivate::is_same<const char*, Func1>::value, void>::Type
++                                                !std::is_same<const char*, Func1>::value, void>::Type
+             singleShot(int msec, Qt::TimerType timerType, QObject *context, Func1 slot)
+     {
+         //compilation error if the slot has arguments.
+diff --git a/src/corelib/kernel/qvariant_p.h b/src/corelib/kernel/qvariant_p.h
+index 337e1406ec..18fda7bae1 100644
+--- a/src/corelib/kernel/qvariant_p.h
++++ b/src/corelib/kernel/qvariant_p.h
+@@ -60,7 +60,7 @@ struct QVariantIntegrator
+ {
+     static const bool CanUseInternalSpace = sizeof(T) <= sizeof(QVariant::Private::Data)
+                                             && ((QTypeInfoQuery<T>::isRelocatable) || Q_IS_ENUM(T));
+-    typedef QtPrivate::integral_constant<bool, CanUseInternalSpace> CanUseInternalSpace_t;
++    typedef std::integral_constant<bool, CanUseInternalSpace> CanUseInternalSpace_t;
+ };
+ Q_STATIC_ASSERT(QVariantIntegrator<double>::CanUseInternalSpace);
+ Q_STATIC_ASSERT(QVariantIntegrator<long int>::CanUseInternalSpace);
+@@ -112,28 +112,28 @@ private:
+ };
+ 
+ template <class T>
+-inline void v_construct_helper(QVariant::Private *x, const T &t, QtPrivate::true_type)
++inline void v_construct_helper(QVariant::Private *x, const T &t, std::true_type)
+ {
+     new (&x->data) T(t);
+     x->is_shared = false;
+ }
+ 
+ template <class T>
+-inline void v_construct_helper(QVariant::Private *x, const T &t, QtPrivate::false_type)
++inline void v_construct_helper(QVariant::Private *x, const T &t, std::false_type)
+ {
+     x->data.shared = new QVariantPrivateSharedEx<T>(t);
+     x->is_shared = true;
+ }
+ 
+ template <class T>
+-inline void v_construct_helper(QVariant::Private *x, QtPrivate::true_type)
++inline void v_construct_helper(QVariant::Private *x, std::true_type)
+ {
+     new (&x->data) T();
+     x->is_shared = false;
+ }
+ 
+ template <class T>
+-inline void v_construct_helper(QVariant::Private *x, QtPrivate::false_type)
++inline void v_construct_helper(QVariant::Private *x, std::false_type)
+ {
+     x->data.shared = new QVariantPrivateSharedEx<T>;
+     x->is_shared = true;
+diff --git a/src/corelib/thread/qmutex.cpp b/src/corelib/thread/qmutex.cpp
+index e9709e34c5..5a6efad7fa 100644
+--- a/src/corelib/thread/qmutex.cpp
++++ b/src/corelib/thread/qmutex.cpp
+@@ -42,7 +42,6 @@
+ #include "qelapsedtimer.h"
+ #include "qthread.h"
+ #include "qmutex_p.h"
+-#include "qtypetraits.h"
+ 
+ #ifndef QT_LINUX_FUTEX
+ #include "private/qfreelist_p.h"
+@@ -71,7 +70,7 @@ public:
+ 
+     // written to by the thread that first owns 'mutex';
+     // read during attempts to acquire ownership of 'mutex' from any other thread:
+-    QAtomicPointer<QtPrivate::remove_pointer<Qt::HANDLE>::type> owner;
++    QAtomicPointer<std::remove_pointer<Qt::HANDLE>::type> owner;
+ 
+     // only ever accessed from the thread that owns 'mutex':
+     uint count;
+diff --git a/src/corelib/tools/qbytearray_p.h b/src/corelib/tools/qbytearray_p.h
+index 78c667aa90..584f8ff801 100644
+--- a/src/corelib/tools/qbytearray_p.h
++++ b/src/corelib/tools/qbytearray_p.h
+@@ -46,14 +46,13 @@
+ //
+ 
+ #include <QtCore/qbytearray.h>
+-#include <QtCore/qtypetraits.h>
+ #include "qtools_p.h"
+ 
+ QT_BEGIN_NAMESPACE
+ 
+ enum {
+     // Define as enum to force inlining. Don't expose MaxAllocSize in a public header.
+-    MaxByteArraySize = MaxAllocSize - sizeof(QtPrivate::remove_pointer<QByteArray::DataPtr>::type)
++    MaxByteArraySize = MaxAllocSize - sizeof(std::remove_pointer<QByteArray::DataPtr>::type)
+ };
+ 
+ QT_END_NAMESPACE
+diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h
+index c181de94bb..28aeafe845 100644
+--- a/src/corelib/tools/qhash.h
++++ b/src/corelib/tools/qhash.h
+@@ -747,7 +747,7 @@ Q_INLINE_TEMPLATE typename QHash<Key, T>::iterator QHash<Key, T>::insert(const K
+         return iterator(createNode(h, akey, avalue, node));
+     }
+ 
+-    if (!QtPrivate::is_same<T, QHashDummyValue>::value)
++    if (!std::is_same<T, QHashDummyValue>::value)
+         (*node)->value = avalue;
+     return iterator(*node);
+ }
+diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h
+index 381875e96f..df79ac0d98 100644
+--- a/src/corelib/tools/qlist.h
++++ b/src/corelib/tools/qlist.h
+@@ -116,10 +116,10 @@ class QList : public QListSpecialMethods<T>
+ {
+ public:
+     struct MemoryLayout
+-        : QtPrivate::if_<
++        : std::conditional<
+             QTypeInfo<T>::isStatic || QTypeInfo<T>::isLarge,
+             QListData::IndirectLayout,
+-            typename QtPrivate::if_<
++            typename std::conditional<
+                 sizeof(T) == sizeof(void*),
+                 QListData::ArrayCompatibleLayout,
+                 QListData::InlineWithPaddingLayout
+diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h
+index 08565dfe9b..5b6382fa8f 100644
+--- a/src/corelib/tools/qmap.h
++++ b/src/corelib/tools/qmap.h
+@@ -38,7 +38,6 @@
+ #include <QtCore/qlist.h>
+ #include <QtCore/qrefcount.h>
+ #include <QtCore/qpair.h>
+-#include <QtCore/qtypetraits.h>
+ 
+ #ifdef Q_MAP_DEBUG
+ #include <QtCore/qdebug.h>
+@@ -124,15 +123,15 @@ struct QMapNode : public QMapNodeBase
+     {
+         callDestructorIfNecessary(key);
+         callDestructorIfNecessary(value);
+-        doDestroySubTree(QtPrivate::integral_constant<bool, QTypeInfo<T>::isComplex || QTypeInfo<Key>::isComplex>());
++        doDestroySubTree(std::integral_constant<bool, QTypeInfo<T>::isComplex || QTypeInfo<Key>::isComplex>());
+     }
+ 
+     QMapNode<Key, T> *lowerBound(const Key &key);
+     QMapNode<Key, T> *upperBound(const Key &key);
+ 
+ private:
+-    void doDestroySubTree(QtPrivate::false_type) {}
+-    void doDestroySubTree(QtPrivate::true_type)
++    void doDestroySubTree(std::false_type) {}
++    void doDestroySubTree(std::true_type)
+     {
+         if (left)
+             leftNode()->destroySubTree();
+diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h
+index c408f54b04..6d3a1deb52 100644
+--- a/src/corelib/tools/qsharedpointer_impl.h
++++ b/src/corelib/tools/qsharedpointer_impl.h
+@@ -499,7 +499,7 @@ private:
+     template <class X>
+     inline void enableSharedFromThis(const QEnableSharedFromThis<X> *ptr)
+     {
+-        ptr->initializeFromSharedPointer(constCast<typename QtPrivate::remove_cv<T>::type>());
++        ptr->initializeFromSharedPointer(constCast<typename std::remove_cv<T>::type>());
+     }
+ 
+     inline void enableSharedFromThis(...) {}
+diff --git a/src/corelib/tools/qstringalgorithms_p.h b/src/corelib/tools/qstringalgorithms_p.h
+index a12874f567..d802995528 100644
+--- a/src/corelib/tools/qstringalgorithms_p.h
++++ b/src/corelib/tools/qstringalgorithms_p.h
+@@ -54,8 +54,8 @@ template <typename StringType> struct QStringAlgorithms
+ {
+     typedef typename StringType::value_type Char;
+     typedef typename StringType::size_type size_type;
+-    typedef typename QtPrivate::remove_cv<StringType>::type NakedStringType;
+-    static const bool isConst = QtPrivate::is_const<StringType>::value;
++    typedef typename std::remove_cv<StringType>::type NakedStringType;
++    static const bool isConst = std::is_const<StringType>::value;
+ 
+     static inline bool isSpace(char ch) { return ascii_isspace(ch); }
+     static inline bool isSpace(QChar ch) { return ch.isSpace(); }
+diff --git a/src/testlib/qtestcase.h b/src/testlib/qtestcase.h
+index a099aaa3d1..776647ae3d 100644
+--- a/src/testlib/qtestcase.h
++++ b/src/testlib/qtestcase.h
+@@ -40,7 +40,6 @@
+ #include <QtCore/qnamespace.h>
+ #include <QtCore/qmetatype.h>
+ #include <QtCore/qmetaobject.h>
+-#include <QtCore/qtypetraits.h>
+ #include <QtCore/qsharedpointer.h>
+ #include <QtCore/qtemporarydir.h>
+ 
+@@ -306,7 +305,7 @@ namespace QTest
+     template <typename T>
+     inline void addColumn(const char *name, T * = Q_NULLPTR)
+     {
+-        typedef QtPrivate::is_same<T, const char*> QIsSameTConstChar;
++        typedef std::is_same<T, const char*> QIsSameTConstChar;
+         Q_STATIC_ASSERT_X(!QIsSameTConstChar::value, "const char* is not allowed as a test data format.");
+         addColumnInternal(qMetaTypeId<T>(), name);
+     }
+diff --git a/src/widgets/graphicsview/qgraphicsitem.h b/src/widgets/graphicsview/qgraphicsitem.h
+index b2f8fcbe74..ad16fffa7e 100644
+--- a/src/widgets/graphicsview/qgraphicsitem.h
++++ b/src/widgets/graphicsview/qgraphicsitem.h
+@@ -1018,14 +1018,14 @@ private:
+ 
+ template <class T> inline T qgraphicsitem_cast(QGraphicsItem *item)
+ {
+-    typedef typename QtPrivate::remove_cv<typename QtPrivate::remove_pointer<T>::type>::type Item;
++    typedef typename std::remove_cv<typename std::remove_pointer<T>::type>::type Item;
+     return int(Item::Type) == int(QGraphicsItem::Type)
+         || (item && int(Item::Type) == item->type()) ? static_cast<T>(item) : 0;
+ }
+ 
+ template <class T> inline T qgraphicsitem_cast(const QGraphicsItem *item)
+ {
+-    typedef typename QtPrivate::remove_cv<typename QtPrivate::remove_pointer<T>::type>::type Item;
++    typedef typename std::remove_cv<typename std::remove_pointer<T>::type>::type Item;
+     return int(Item::Type) == int(QGraphicsItem::Type)
+         || (item && int(Item::Type) == item->type()) ? static_cast<T>(item) : 0;
+ }
+diff --git a/src/widgets/styles/qstyleoption.h b/src/widgets/styles/qstyleoption.h
+index 74dd35cc4a..e7151d0f23 100644
+--- a/src/widgets/styles/qstyleoption.h
++++ b/src/widgets/styles/qstyleoption.h
+@@ -658,7 +658,7 @@ protected:
+ template <typename T>
+ T qstyleoption_cast(const QStyleOption *opt)
+ {
+-    typedef typename QtPrivate::remove_cv<typename QtPrivate::remove_pointer<T>::type>::type Opt;
++    typedef typename std::remove_cv<typename std::remove_pointer<T>::type>::type Opt;
+     if (opt && opt->version >= Opt::Version && (opt->type == Opt::Type
+         || int(Opt::Type) == QStyleOption::SO_Default
+         || (int(Opt::Type) == QStyleOption::SO_Complex
+@@ -670,7 +670,7 @@ T qstyleoption_cast(const QStyleOption *opt)
+ template <typename T>
+ T qstyleoption_cast(QStyleOption *opt)
+ {
+-    typedef typename QtPrivate::remove_cv<typename QtPrivate::remove_pointer<T>::type>::type Opt;
++    typedef typename std::remove_cv<typename std::remove_pointer<T>::type>::type Opt;
+     if (opt && opt->version >= Opt::Version && (opt->type == Opt::Type
+         || int(Opt::Type) == QStyleOption::SO_Default
+         || (int(Opt::Type) == QStyleOption::SO_Complex
+@@ -721,7 +721,7 @@ public:
+ template <typename T>
+ T qstyleoption_cast(const QStyleHintReturn *hint)
+ {
+-    typedef typename QtPrivate::remove_cv<typename QtPrivate::remove_pointer<T>::type>::type Opt;
++    typedef typename std::remove_cv<typename std::remove_pointer<T>::type>::type Opt;
+     if (hint && hint->version <= Opt::Version &&
+         (hint->type == Opt::Type || int(Opt::Type) == QStyleHintReturn::SH_Default))
+         return static_cast<T>(hint);
+@@ -731,7 +731,7 @@ T qstyleoption_cast(const QStyleHintReturn *hint)
+ template <typename T>
+ T qstyleoption_cast(QStyleHintReturn *hint)
+ {
+-    typedef typename QtPrivate::remove_cv<typename QtPrivate::remove_pointer<T>::type>::type Opt;
++    typedef typename std::remove_cv<typename std::remove_pointer<T>::type>::type Opt;
+     if (hint && hint->version <= Opt::Version &&
+         (hint->type == Opt::Type || int(Opt::Type) == QStyleHintReturn::SH_Default))
+         return static_cast<T>(hint);
+diff --git a/src/widgets/widgets/qmenu.h b/src/widgets/widgets/qmenu.h
+index 6bbe54186e..c33cb889b2 100644
+--- a/src/widgets/widgets/qmenu.h
++++ b/src/widgets/widgets/qmenu.h
+@@ -88,7 +88,7 @@ public:
+ #else
+     // addAction(QString): Connect to a QObject slot / functor or function pointer (with context)
+     template<class Obj, typename Func1>
+-    inline typename QtPrivate::QEnableIf<!QtPrivate::is_same<const char*, Func1>::value
++    inline typename QtPrivate::QEnableIf<!std::is_same<const char*, Func1>::value
+         && QtPrivate::IsPointerToTypeDerivedFromQObject<Obj*>::Value, QAction *>::Type
+         addAction(const QString &text, const Obj *object, Func1 slot, const QKeySequence &shortcut = 0)
+     {
+@@ -116,7 +116,7 @@ public:
+     }
+     // addAction(QIcon, QString): Connect to a QObject slot / functor or function pointer (with context)
+     template<class Obj, typename Func1>
+-    inline typename QtPrivate::QEnableIf<!QtPrivate::is_same<const char*, Func1>::value
++    inline typename QtPrivate::QEnableIf<!std::is_same<const char*, Func1>::value
+         && QtPrivate::IsPointerToTypeDerivedFromQObject<Obj*>::Value, QAction *>::Type
+         addAction(const QIcon &actionIcon, const QString &text, const Obj *object, Func1 slot, const QKeySequence &shortcut = 0)
+     {
+diff --git a/src/widgets/widgets/qtoolbar.h b/src/widgets/widgets/qtoolbar.h
+index 9eeb7ccd71..4bd3bc2b21 100644
+--- a/src/widgets/widgets/qtoolbar.h
++++ b/src/widgets/widgets/qtoolbar.h
+@@ -103,7 +103,7 @@ public:
+ #else
+     // addAction(QString): Connect to a QObject slot / functor or function pointer (with context)
+     template<class Obj, typename Func1>
+-    inline typename QtPrivate::QEnableIf<!QtPrivate::is_same<const char*, Func1>::value
++    inline typename QtPrivate::QEnableIf<!std::is_same<const char*, Func1>::value
+         && QtPrivate::IsPointerToTypeDerivedFromQObject<Obj*>::Value, QAction *>::Type
+         addAction(const QString &text, const Obj *object, Func1 slot)
+     {
+@@ -121,7 +121,7 @@ public:
+     }
+     // addAction(QString): Connect to a QObject slot / functor or function pointer (with context)
+     template<class Obj, typename Func1>
+-    inline typename QtPrivate::QEnableIf<!QtPrivate::is_same<const char*, Func1>::value
++    inline typename QtPrivate::QEnableIf<!std::is_same<const char*, Func1>::value
+         && QtPrivate::IsPointerToTypeDerivedFromQObject<Obj*>::Value, QAction *>::Type
+         addAction(const QIcon &actionIcon, const QString &text, const Obj *object, Func1 slot)
+     {
+diff --git a/tests/auto/corelib/global/qglobal/tst_qglobal.cpp b/tests/auto/corelib/global/qglobal/tst_qglobal.cpp
+index 00f70f5380..758c0ff6b4 100644
+--- a/tests/auto/corelib/global/qglobal/tst_qglobal.cpp
++++ b/tests/auto/corelib/global/qglobal/tst_qglobal.cpp
+@@ -33,7 +33,6 @@
+ 
+ 
+ #include <QtTest/QtTest>
+-#include <QtCore/qtypetraits.h>
+ 
+ #include <QPair>
+ #include <QTextCodec>
+@@ -380,8 +379,8 @@ void tst_QGlobal::isEnum()
+ #define IS_ENUM_TRUE(x)     (Q_IS_ENUM(x) == true)
+ #define IS_ENUM_FALSE(x)    (Q_IS_ENUM(x) == false)
+ #else
+-#define IS_ENUM_TRUE(x)     (Q_IS_ENUM(x) == true && QtPrivate::is_enum<x>::value == true)
+-#define IS_ENUM_FALSE(x)    (Q_IS_ENUM(x) == false && QtPrivate::is_enum<x>::value == false)
++#define IS_ENUM_TRUE(x)     (Q_IS_ENUM(x) == true && std::is_enum<x>::value == true)
++#define IS_ENUM_FALSE(x)    (Q_IS_ENUM(x) == false && std::is_enum<x>::value == false)
+ #endif
+ 
+     QVERIFY(IS_ENUM_TRUE(isEnum_B_Byte));
+diff --git a/tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp b/tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp
+index 4d61bc393d..e3d3a4b4e8 100644
+--- a/tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp
++++ b/tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp
+@@ -34,7 +34,6 @@
+ #include <QtTest/QtTest>
+ 
+ #include <qhash.h>
+-#include <qtypetraits.h>
+ 
+ #include <iterator>
+ #include <sstream>
+@@ -186,7 +185,7 @@ void tst_QHashFunctions::range()
+     {
+         // verify that the input iterator category suffices:
+         std::stringstream sstream;
+-        Q_STATIC_ASSERT((QtPrivate::is_same<std::input_iterator_tag, std::istream_iterator<int>::iterator_category>::value));
++        Q_STATIC_ASSERT((std::is_same<std::input_iterator_tag, std::istream_iterator<int>::iterator_category>::value));
+         std::copy(ints, ints + numInts, std::ostream_iterator<int>(sstream, " "));
+         sstream.seekg(0);
+         std::istream_iterator<int> it(sstream), end;
+-- 
+2.25.1
+


=====================================
contrib/src/qt/0017-Rename-QtPrivate-is_-un-signed-to-QtPrivate-Is-Un-si.patch
=====================================
@@ -0,0 +1,125 @@
+From 4e57e3d915557dc00b4931727cf162a1742e73a2 Mon Sep 17 00:00:00 2001
+From: Kai Koehne <kai.koehne at qt.io>
+Date: Mon, 8 Aug 2016 09:41:57 +0200
+Subject: [PATCH 17/18] Rename QtPrivate::is_[un]signed to
+ QtPrivate::Is[Un]signedEnum
+
+Any other use than for enums should use std::is_[un]signed. Make this
+explicit by renaming the type traits.
+
+Change-Id: I494158563c95c710e710d0d337f4e547006df171
+Reviewed-by: Thiago Macieira <thiago.macieira at intel.com>
+Backport-Of: 615270a3008cfc1314a3c983b7e69006dc4184b4 (v5.8.0)
+---
+ src/corelib/global/qflags.h                   |  2 +-
+ src/corelib/global/qtypetraits.h              | 41 ++++++++++---------
+ .../auto/corelib/global/qflags/tst_qflags.cpp |  8 ++--
+ 3 files changed, 26 insertions(+), 25 deletions(-)
+
+diff --git a/src/corelib/global/qflags.h b/src/corelib/global/qflags.h
+index d2a6b51d90..dc0873aaad 100644
+--- a/src/corelib/global/qflags.h
++++ b/src/corelib/global/qflags.h
+@@ -97,7 +97,7 @@ public:
+     typedef int Int;
+ #else
+     typedef typename std::conditional<
+-            QtPrivate::is_unsigned<Enum>::value,
++            QtPrivate::QIsUnsignedEnum<Enum>::value,
+             unsigned int,
+             signed int
+         >::type Int;
+diff --git a/src/corelib/global/qtypetraits.h b/src/corelib/global/qtypetraits.h
+index 86593f7b11..c5d7cacd8d 100644
+--- a/src/corelib/global/qtypetraits.h
++++ b/src/corelib/global/qtypetraits.h
+@@ -41,7 +41,8 @@ QT_BEGIN_NAMESPACE
+ namespace QtPrivate {
+ 
+ //
+-// define custom is_signed, is_unsigned that also works with enum's
++// Define QIsUnsignedEnum, QIsSignedEnum -
++// std::is_signed, std::is_unsigned does not work for enum's
+ //
+ 
+ // a metafunction to invert an integral_constant:
+@@ -51,37 +52,37 @@ struct not_
+ 
+ // Checks whether a type is unsigned (T must be convertible to unsigned int):
+ template <typename T>
+-struct is_unsigned
++struct QIsUnsignedEnum
+     : std::integral_constant<bool, (T(0) < T(-1))> {};
+ 
+ // Checks whether a type is signed (T must be convertible to int):
+ template <typename T>
+-struct is_signed
+-    : not_< is_unsigned<T> > {};
++struct QIsSignedEnum
++    : not_< QIsUnsignedEnum<T> > {};
+ 
+-Q_STATIC_ASSERT(( is_unsigned<quint8>::value));
+-Q_STATIC_ASSERT((!is_unsigned<qint8>::value));
++Q_STATIC_ASSERT(( QIsUnsignedEnum<quint8>::value));
++Q_STATIC_ASSERT((!QIsUnsignedEnum<qint8>::value));
+ 
+-Q_STATIC_ASSERT((!is_signed<quint8>::value));
+-Q_STATIC_ASSERT(( is_signed<qint8>::value));
++Q_STATIC_ASSERT((!QIsSignedEnum<quint8>::value));
++Q_STATIC_ASSERT(( QIsSignedEnum<qint8>::value));
+ 
+-Q_STATIC_ASSERT(( is_unsigned<quint16>::value));
+-Q_STATIC_ASSERT((!is_unsigned<qint16>::value));
++Q_STATIC_ASSERT(( QIsUnsignedEnum<quint16>::value));
++Q_STATIC_ASSERT((!QIsUnsignedEnum<qint16>::value));
+ 
+-Q_STATIC_ASSERT((!is_signed<quint16>::value));
+-Q_STATIC_ASSERT(( is_signed<qint16>::value));
++Q_STATIC_ASSERT((!QIsSignedEnum<quint16>::value));
++Q_STATIC_ASSERT(( QIsSignedEnum<qint16>::value));
+ 
+-Q_STATIC_ASSERT(( is_unsigned<quint32>::value));
+-Q_STATIC_ASSERT((!is_unsigned<qint32>::value));
++Q_STATIC_ASSERT(( QIsUnsignedEnum<quint32>::value));
++Q_STATIC_ASSERT((!QIsUnsignedEnum<qint32>::value));
+ 
+-Q_STATIC_ASSERT((!is_signed<quint32>::value));
+-Q_STATIC_ASSERT(( is_signed<qint32>::value));
++Q_STATIC_ASSERT((!QIsSignedEnum<quint32>::value));
++Q_STATIC_ASSERT(( QIsSignedEnum<qint32>::value));
+ 
+-Q_STATIC_ASSERT(( is_unsigned<quint64>::value));
+-Q_STATIC_ASSERT((!is_unsigned<qint64>::value));
++Q_STATIC_ASSERT(( QIsUnsignedEnum<quint64>::value));
++Q_STATIC_ASSERT((!QIsUnsignedEnum<qint64>::value));
+ 
+-Q_STATIC_ASSERT((!is_signed<quint64>::value));
+-Q_STATIC_ASSERT(( is_signed<qint64>::value));
++Q_STATIC_ASSERT((!QIsSignedEnum<quint64>::value));
++Q_STATIC_ASSERT(( QIsSignedEnum<qint64>::value));
+ 
+ } // namespace QtPrivate
+ 
+diff --git a/tests/auto/corelib/global/qflags/tst_qflags.cpp b/tests/auto/corelib/global/qflags/tst_qflags.cpp
+index 1f2e7ca0cd..f16b5c4cf7 100644
+--- a/tests/auto/corelib/global/qflags/tst_qflags.cpp
++++ b/tests/auto/corelib/global/qflags/tst_qflags.cpp
+@@ -138,11 +138,11 @@ void tst_QFlags::signedness()
+     // underlying type is implementation-defined, we need to allow for
+     // a different signedness, so we only check that the relative
+     // signedness of the types matches:
+-    Q_STATIC_ASSERT((QtPrivate::is_unsigned<Qt::MouseButton>::value ==
+-                     QtPrivate::is_unsigned<Qt::MouseButtons::Int>::value));
++    Q_STATIC_ASSERT((QtPrivate::QIsUnsignedEnum<Qt::MouseButton>::value ==
++                     QtPrivate::QIsUnsignedEnum<Qt::MouseButtons::Int>::value));
+ 
+-    Q_STATIC_ASSERT((QtPrivate::is_signed<Qt::AlignmentFlag>::value ==
+-                     QtPrivate::is_signed<Qt::Alignment::Int>::value));
++    Q_STATIC_ASSERT((QtPrivate::QIsSignedEnum<Qt::AlignmentFlag>::value ==
++                     QtPrivate::QIsSignedEnum<Qt::Alignment::Int>::value));
+ }
+ 
+ #if defined(Q_COMPILER_CLASS_ENUM)
+-- 
+2.25.1
+


=====================================
contrib/src/qt/0018-Remove-qtypetraits.h-s-contents-altogether.patch
=====================================
@@ -0,0 +1,354 @@
+From bd851ae37c6dbd7b770bd5cab771f19c2da66a87 Mon Sep 17 00:00:00 2001
+From: Giuseppe D'Angelo <giuseppe.dangelo at kdab.com>
+Date: Thu, 3 Nov 2016 16:08:55 +0000
+Subject: [PATCH 18/18] Remove qtypetraits.h's contents altogether
+
+So that QFlags can use an (un)signed int matching the
+underlying type as identified by the compiler and not by us.
+
+Requires fixing a few warnings about sign conversion due to
+QFlags misusages in qtbase that were either plain wrong, or
+were relying on the enum being backed by an (un)signed int
+when it wasn't.
+
+Keep qtypetraits.h in the source tree in order to prevent
+source breaks if some downstream #includes it (note however
+that it did not contain any public API).
+
+Change-Id: Ib3a92b98db7031e793a088fb2a3b306eff4d7a3c
+Reviewed-by: Thiago Macieira <thiago.macieira at intel.com>
+Backport-Of: 6255cb893d411b055758f2e64e94fde0bce91ea8 (v5.9.0)
+---
+ src/corelib/global/qflags.h                   |  9 +--
+ src/corelib/global/qtypetraits.h              | 55 +++----------------
+ src/corelib/io/qurl.h                         |  4 +-
+ src/corelib/itemmodels/qabstractitemmodel.cpp |  2 +-
+ src/corelib/kernel/qmetatype.cpp              |  2 +-
+ src/corelib/kernel/qmetatype_p.h              |  2 +-
+ src/gui/opengl/qopengltexturecache.cpp        |  2 +-
+ src/gui/opengl/qopengltexturecache_p.h        | 28 +++++-----
+ src/widgets/kernel/qwidgetwindow.cpp          |  4 +-
+ src/widgets/styles/qfusionstyle.cpp           |  4 +-
+ src/widgets/styles/qmacstyle_mac.mm           |  4 +-
+ .../auto/corelib/global/qflags/tst_qflags.cpp |  8 +--
+ tests/auto/other/modeltest/modeltest.cpp      |  2 +-
+ 13 files changed, 44 insertions(+), 82 deletions(-)
+
+diff --git a/src/corelib/global/qflags.h b/src/corelib/global/qflags.h
+index dc0873aaad..3faf8d5a65 100644
+--- a/src/corelib/global/qflags.h
++++ b/src/corelib/global/qflags.h
+@@ -36,13 +36,12 @@
+ #ifndef QFLAGS_H
+ #define QFLAGS_H
+ 
+-#include <QtCore/qtypeinfo.h>
+-#include <QtCore/qtypetraits.h>
+-
+ #ifdef Q_COMPILER_INITIALIZER_LISTS
+ #include <initializer_list>
+ #endif
+ 
++#include <type_traits>
++
+ QT_BEGIN_NAMESPACE
+ 
+ class QFlag
+@@ -88,6 +87,8 @@ class QFlags
+     Q_STATIC_ASSERT_X((sizeof(Enum) <= sizeof(int)),
+                       "QFlags uses an int as storage, so an enum with underlying "
+                       "long long will overflow.");
++    Q_STATIC_ASSERT_X((std::is_enum<Enum>::value), "QFlags is only usable on enumeration types.");
++
+     struct Private;
+     typedef int (Private::*Zero);
+ public:
+@@ -97,7 +98,7 @@ public:
+     typedef int Int;
+ #else
+     typedef typename std::conditional<
+-            QtPrivate::QIsUnsignedEnum<Enum>::value,
++            std::is_unsigned<typename std::underlying_type<Enum>::type>::value,
+             unsigned int,
+             signed int
+         >::type Int;
+diff --git a/src/corelib/global/qtypetraits.h b/src/corelib/global/qtypetraits.h
+index c5d7cacd8d..f7badd9aee 100644
+--- a/src/corelib/global/qtypetraits.h
++++ b/src/corelib/global/qtypetraits.h
+@@ -31,6 +31,12 @@
+ **
+ ****************************************************************************/
+ 
++// ### Qt 6: remove this header
++//
++// This header is deliberately empty. Although it did not contain any public API,
++// it was accidentally made public in Qt 5. So: do not remove it for the moment
++// being, to prevent #include breaks in downstreams.
++
+ #include "QtCore/qglobal.h"
+ 
+ #ifndef QTYPETRAITS_H
+@@ -38,53 +44,6 @@
+ 
+ QT_BEGIN_NAMESPACE
+ 
+-namespace QtPrivate {
+-
+-//
+-// Define QIsUnsignedEnum, QIsSignedEnum -
+-// std::is_signed, std::is_unsigned does not work for enum's
+-//
+-
+-// a metafunction to invert an integral_constant:
+-template <typename T>
+-struct not_
+-    : std::integral_constant<bool, !T::value> {};
+-
+-// Checks whether a type is unsigned (T must be convertible to unsigned int):
+-template <typename T>
+-struct QIsUnsignedEnum
+-    : std::integral_constant<bool, (T(0) < T(-1))> {};
+-
+-// Checks whether a type is signed (T must be convertible to int):
+-template <typename T>
+-struct QIsSignedEnum
+-    : not_< QIsUnsignedEnum<T> > {};
+-
+-Q_STATIC_ASSERT(( QIsUnsignedEnum<quint8>::value));
+-Q_STATIC_ASSERT((!QIsUnsignedEnum<qint8>::value));
+-
+-Q_STATIC_ASSERT((!QIsSignedEnum<quint8>::value));
+-Q_STATIC_ASSERT(( QIsSignedEnum<qint8>::value));
+-
+-Q_STATIC_ASSERT(( QIsUnsignedEnum<quint16>::value));
+-Q_STATIC_ASSERT((!QIsUnsignedEnum<qint16>::value));
+-
+-Q_STATIC_ASSERT((!QIsSignedEnum<quint16>::value));
+-Q_STATIC_ASSERT(( QIsSignedEnum<qint16>::value));
+-
+-Q_STATIC_ASSERT(( QIsUnsignedEnum<quint32>::value));
+-Q_STATIC_ASSERT((!QIsUnsignedEnum<qint32>::value));
+-
+-Q_STATIC_ASSERT((!QIsSignedEnum<quint32>::value));
+-Q_STATIC_ASSERT(( QIsSignedEnum<qint32>::value));
+-
+-Q_STATIC_ASSERT(( QIsUnsignedEnum<quint64>::value));
+-Q_STATIC_ASSERT((!QIsUnsignedEnum<qint64>::value));
+-
+-Q_STATIC_ASSERT((!QIsSignedEnum<quint64>::value));
+-Q_STATIC_ASSERT(( QIsSignedEnum<qint64>::value));
+-
+-} // namespace QtPrivate
+-
+ QT_END_NAMESPACE
++
+ #endif  // QTYPETRAITS_H
+diff --git a/src/corelib/io/qurl.h b/src/corelib/io/qurl.h
+index e6c570d1db..84be6f0d60 100644
+--- a/src/corelib/io/qurl.h
++++ b/src/corelib/io/qurl.h
+@@ -65,8 +65,8 @@ public:
+     Q_DECL_CONSTEXPR inline QUrlTwoFlags(E1 f) : i(f) {}
+     Q_DECL_CONSTEXPR inline QUrlTwoFlags(E2 f) : i(f) {}
+     Q_DECL_CONSTEXPR inline QUrlTwoFlags(QFlag f) : i(f) {}
+-    Q_DECL_CONSTEXPR inline QUrlTwoFlags(QFlags<E1> f) : i(f.operator int()) {}
+-    Q_DECL_CONSTEXPR inline QUrlTwoFlags(QFlags<E2> f) : i(f.operator int()) {}
++    Q_DECL_CONSTEXPR inline QUrlTwoFlags(QFlags<E1> f) : i(f.operator typename QFlags<E1>::Int()) {}
++    Q_DECL_CONSTEXPR inline QUrlTwoFlags(QFlags<E2> f) : i(f.operator typename QFlags<E2>::Int()) {}
+     Q_DECL_CONSTEXPR inline QUrlTwoFlags(Zero = 0) : i(0) {}
+ 
+     inline QUrlTwoFlags &operator&=(int mask) { i &= mask; return *this; }
+diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp
+index e35454346b..f794fb4bf2 100644
+--- a/src/corelib/itemmodels/qabstractitemmodel.cpp
++++ b/src/corelib/itemmodels/qabstractitemmodel.cpp
+@@ -1959,7 +1959,7 @@ Qt::DropActions QAbstractItemModel::supportedDropActions() const
+ Qt::DropActions QAbstractItemModel::supportedDragActions() const
+ {
+     Q_D(const QAbstractItemModel);
+-    if (d->supportedDragActions != -1)
++    if (d->supportedDragActions != Qt::IgnoreAction)
+         return d->supportedDragActions;
+     return supportedDropActions();
+ }
+diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp
+index 59d75c182f..b51850cad0 100644
+--- a/src/corelib/kernel/qmetatype.cpp
++++ b/src/corelib/kernel/qmetatype.cpp
+@@ -1012,7 +1012,7 @@ int QMetaType::registerNormalizedType(const NS(QByteArray) &normalizedTypeName,
+                                   normalizedTypeName.size());
+ 
+     int previousSize = 0;
+-    int previousFlags = 0;
++    QMetaType::TypeFlags::Int previousFlags = 0;
+     if (idx == UnknownType) {
+         QWriteLocker locker(customTypesLock());
+         int posInVector = -1;
+diff --git a/src/corelib/kernel/qmetatype_p.h b/src/corelib/kernel/qmetatype_p.h
+index 7c0c984c9c..61be08ff24 100644
+--- a/src/corelib/kernel/qmetatype_p.h
++++ b/src/corelib/kernel/qmetatype_p.h
+@@ -119,7 +119,7 @@ public:
+     QMetaType::Constructor constructor;
+     QMetaType::Destructor destructor;
+     int size;
+-    quint32 flags; // same as QMetaType::TypeFlags
++    QMetaType::TypeFlags::Int flags;
+     const QMetaObject *metaObject;
+ };
+ 
+diff --git a/src/gui/opengl/qopengltexturecache.cpp b/src/gui/opengl/qopengltexturecache.cpp
+index 72df636f5f..fbbca35b97 100644
+--- a/src/gui/opengl/qopengltexturecache.cpp
++++ b/src/gui/opengl/qopengltexturecache.cpp
+@@ -365,7 +365,7 @@ static void freeTexture(QOpenGLFunctions *funcs, GLuint id)
+     funcs->glDeleteTextures(1, &id);
+ }
+ 
+-QOpenGLCachedTexture::QOpenGLCachedTexture(GLuint id, int options, QOpenGLContext *context) : m_options(options)
++QOpenGLCachedTexture::QOpenGLCachedTexture(GLuint id, QOpenGLTextureCache::BindOptions options, QOpenGLContext *context) : m_options(options)
+ {
+     m_resource = new QOpenGLSharedResourceGuard(context, id, freeTexture);
+ }
+diff --git a/src/gui/opengl/qopengltexturecache_p.h b/src/gui/opengl/qopengltexturecache_p.h
+index 40f033df43..849f3229b7 100644
+--- a/src/gui/opengl/qopengltexturecache_p.h
++++ b/src/gui/opengl/qopengltexturecache_p.h
+@@ -53,19 +53,7 @@
+ 
+ QT_BEGIN_NAMESPACE
+ 
+-class QOpenGLCachedTexture
+-{
+-public:
+-    QOpenGLCachedTexture(GLuint id, int options, QOpenGLContext *context);
+-    ~QOpenGLCachedTexture() { m_resource->free(); }
+-
+-    GLuint id() const { return m_resource->id(); }
+-    int options() const { return m_options; }
+-
+-private:
+-    QOpenGLSharedResourceGuard *m_resource;
+-    int m_options;
+-};
++class QOpenGLCachedTexture;
+ 
+ class Q_GUI_EXPORT QOpenGLTextureCache : public QOpenGLSharedResource
+ {
+@@ -99,6 +87,20 @@ private:
+ 
+ Q_DECLARE_OPERATORS_FOR_FLAGS(QOpenGLTextureCache::BindOptions)
+ 
++class QOpenGLCachedTexture
++{
++public:
++    QOpenGLCachedTexture(GLuint id, QOpenGLTextureCache::BindOptions options, QOpenGLContext *context);
++    ~QOpenGLCachedTexture() { m_resource->free(); }
++
++    GLuint id() const { return m_resource->id(); }
++    QOpenGLTextureCache::BindOptions options() const { return m_options; }
++
++private:
++    QOpenGLSharedResourceGuard *m_resource;
++    QOpenGLTextureCache::BindOptions m_options;
++};
++
+ QT_END_NAMESPACE
+ 
+ #endif
+diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp
+index 40c488857e..c0a3a670eb 100644
+--- a/src/widgets/kernel/qwidgetwindow.cpp
++++ b/src/widgets/kernel/qwidgetwindow.cpp
+@@ -947,8 +947,8 @@ void QWidgetWindow::handleWindowStateChangedEvent(QWindowStateChangeEvent *event
+ 
+     // Sent event if the state changed (that is, it is not triggered by
+     // QWidget::setWindowState(), which also sends an event to the widget).
+-    if (widgetState != int(m_widget->data->window_state)) {
+-        m_widget->data->window_state = widgetState;
++    if (widgetState != Qt::WindowStates::Int(m_widget->data->window_state)) {
++        m_widget->data->window_state = uint(widgetState);
+         QWindowStateChangeEvent widgetEvent(eventState);
+         QGuiApplication::sendSpontaneousEvent(m_widget, &widgetEvent);
+     }
+diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp
+index dcc99496e3..2d8561219c 100644
+--- a/src/widgets/styles/qfusionstyle.cpp
++++ b/src/widgets/styles/qfusionstyle.cpp
+@@ -2413,7 +2413,7 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
+                 int oldMin = styleObject->property("_q_stylemin").toInt();
+                 int oldMax = styleObject->property("_q_stylemax").toInt();
+                 QRect oldRect = styleObject->property("_q_stylerect").toRect();
+-                int oldState = styleObject->property("_q_stylestate").toInt();
++                QStyle::State oldState = static_cast<QStyle::State>(styleObject->property("_q_stylestate").value<QStyle::State::Int>());
+                 uint oldActiveControls = styleObject->property("_q_stylecontrols").toUInt();
+ 
+                 // a scrollbar is transient when the the scrollbar itself and
+@@ -2436,7 +2436,7 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
+                     styleObject->setProperty("_q_stylemin", scrollBar->minimum);
+                     styleObject->setProperty("_q_stylemax", scrollBar->maximum);
+                     styleObject->setProperty("_q_stylerect", scrollBar->rect);
+-                    styleObject->setProperty("_q_stylestate", static_cast<int>(scrollBar->state));
++                    styleObject->setProperty("_q_stylestate", static_cast<QStyle::State::Int>(scrollBar->state));
+                     styleObject->setProperty("_q_stylecontrols", static_cast<uint>(scrollBar->activeSubControls));
+ 
+ #ifndef QT_NO_ANIMATION
+diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
+index 84445bfce4..fa4ea7f35a 100644
+--- a/src/widgets/styles/qmacstyle_mac.mm
++++ b/src/widgets/styles/qmacstyle_mac.mm
+@@ -5437,7 +5437,7 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
+                     int oldMin = styleObject->property("_q_stylemin").toInt();
+                     int oldMax = styleObject->property("_q_stylemax").toInt();
+                     QRect oldRect = styleObject->property("_q_stylerect").toRect();
+-                    int oldState = styleObject->property("_q_stylestate").toInt();
++                    QStyle::State oldState = static_cast<QStyle::State>(styleObject->property("_q_stylestate").value<QStyle::State::Int>());
+                     uint oldActiveControls = styleObject->property("_q_stylecontrols").toUInt();
+ 
+                     // a scrollbar is transient when the scrollbar itself and
+@@ -5460,7 +5460,7 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
+                         styleObject->setProperty("_q_stylemin", slider->minimum);
+                         styleObject->setProperty("_q_stylemax", slider->maximum);
+                         styleObject->setProperty("_q_stylerect", slider->rect);
+-                        styleObject->setProperty("_q_stylestate", static_cast<int>(slider->state));
++                        styleObject->setProperty("_q_stylestate", static_cast<QStyle::State::Int>(slider->state));
+                         styleObject->setProperty("_q_stylecontrols", static_cast<uint>(slider->activeSubControls));
+ 
+                         QScrollbarStyleAnimation *anim  = qobject_cast<QScrollbarStyleAnimation *>(d->animation(styleObject));
+diff --git a/tests/auto/corelib/global/qflags/tst_qflags.cpp b/tests/auto/corelib/global/qflags/tst_qflags.cpp
+index f16b5c4cf7..562a7a28d0 100644
+--- a/tests/auto/corelib/global/qflags/tst_qflags.cpp
++++ b/tests/auto/corelib/global/qflags/tst_qflags.cpp
+@@ -138,11 +138,11 @@ void tst_QFlags::signedness()
+     // underlying type is implementation-defined, we need to allow for
+     // a different signedness, so we only check that the relative
+     // signedness of the types matches:
+-    Q_STATIC_ASSERT((QtPrivate::QIsUnsignedEnum<Qt::MouseButton>::value ==
+-                     QtPrivate::QIsUnsignedEnum<Qt::MouseButtons::Int>::value));
++    Q_STATIC_ASSERT((std::is_unsigned<typename std::underlying_type<Qt::MouseButton>::type>::value ==
++                     std::is_unsigned<Qt::MouseButtons::Int>::value));
+ 
+-    Q_STATIC_ASSERT((QtPrivate::QIsSignedEnum<Qt::AlignmentFlag>::value ==
+-                     QtPrivate::QIsSignedEnum<Qt::Alignment::Int>::value));
++    Q_STATIC_ASSERT((std::is_signed<typename std::underlying_type<Qt::AlignmentFlag>::type>::value ==
++                     std::is_signed<Qt::Alignment::Int>::value));
+ }
+ 
+ #if defined(Q_COMPILER_CLASS_ENUM)
+diff --git a/tests/auto/other/modeltest/modeltest.cpp b/tests/auto/other/modeltest/modeltest.cpp
+index c119fdaa4e..55290a8402 100644
+--- a/tests/auto/other/modeltest/modeltest.cpp
++++ b/tests/auto/other/modeltest/modeltest.cpp
+@@ -443,7 +443,7 @@ void ModelTest::data()
+     // Check that the alignment is one we know about
+     QVariant textAlignmentVariant = model->data ( model->index ( 0, 0 ), Qt::TextAlignmentRole );
+     if ( textAlignmentVariant.isValid() ) {
+-        int alignment = textAlignmentVariant.toInt();
++        Qt::Alignment alignment = textAlignmentVariant.value<Qt::Alignment>();
+         QCOMPARE( alignment, ( alignment & ( Qt::AlignHorizontal_Mask | Qt::AlignVertical_Mask ) ) );
+     }
+ 
+-- 
+2.25.1
+


=====================================
contrib/src/qt/rules.mak
=====================================
@@ -36,6 +36,10 @@ qt: qt-$(QT_VERSION).tar.xz .sum-qt
 	$(APPLY) $(SRC)/qt/0012-Remove-_bit_scan_-forward-reverse.patch
 	$(APPLY) $(SRC)/qt/0013-qsimd-Fix-compilation-with-trunk-clang-for-mingw.patch
 	$(APPLY) $(SRC)/qt/0014-QtTest-compile-in-C-17-mode-no-more-std-unary_functi.patch
+	$(APPLY) $(SRC)/qt/0015-foreach-remove-implementations-not-using-decltype.patch
+	$(APPLY) $(SRC)/qt/0016-Replace-custom-type-traits-with-std-one-s.patch
+	$(APPLY) $(SRC)/qt/0017-Rename-QtPrivate-is_-un-signed-to-QtPrivate-Is-Un-si.patch
+	$(APPLY) $(SRC)/qt/0018-Remove-qtypetraits.h-s-contents-altogether.patch
 	$(APPLY) $(SRC)/qt/systray-no-sound.patch
 	$(MOVE)
 


=====================================
modules/codec/avcodec/d3d11va.c
=====================================
@@ -423,7 +423,7 @@ static int D3dCreateDevice(vlc_va_t *va)
         return VLC_SUCCESS;
     }
 
-    sys->d3d_dev.d3dcontext = var_InheritInteger(va, "winrt-d3dcontext");
+    sys->d3d_dev.d3dcontext = (void*)var_InheritInteger(va, "winrt-d3dcontext");
     if (unlikely(sys->d3d_dev.d3dcontext))
     {
         ID3D11DeviceContext_GetDevice(sys->d3d_dev.d3dcontext, &sys->d3d_dev.d3ddevice);


=====================================
modules/codec/crystalhd.c
=====================================
@@ -387,13 +387,18 @@ error:
     free( p_sys );
 }
 
+#if defined(__KERNEL__) || defined(__LINUX_USER__)
 static BC_STATUS ourCallback(void *shnd, uint32_t width, uint32_t height, uint32_t stride, void *pOut)
 {
+    BC_DTS_PROC_OUT *proc_in  = (BC_DTS_PROC_OUT*)pOut;
+#else
+static BC_STATUS ourCallback(void *shnd, uint32_t width, uint32_t height, uint32_t stride, BC_DTS_PROC_OUT *proc_in)
+{
+#endif
     VLC_UNUSED(width); VLC_UNUSED(height); VLC_UNUSED(stride);
 
     decoder_t *p_dec          = (decoder_t *)shnd;
     BC_DTS_PROC_OUT *proc_out = p_dec->p_sys->proc_out;
-    BC_DTS_PROC_OUT *proc_in  = (BC_DTS_PROC_OUT*)pOut;
 
     /* Direct Rendering */
     /* Do not allocate for the second-field in the pair, in interlaced */


=====================================
modules/codec/spudec/parse.c
=====================================
@@ -71,7 +71,7 @@ typedef struct
 } subpicture_data_t;
 
 static int  ParseControlSeq( decoder_t *, mtime_t i_pts,
-                             void(*pf_queue)(decoder_t *, subpicture_t *) );
+                             int(*pf_queue)(decoder_t *, subpicture_t *) );
 static int  ParseRLE       ( decoder_t *, subpicture_data_t *,
                              const spu_properties_t *, uint16_t * );
 static int  Render         ( decoder_t *, subpicture_t *, const uint16_t *,
@@ -196,7 +196,7 @@ static void ParsePXCTLI( decoder_t *p_dec, const subpicture_data_t *p_spu_data,
 static void OutputPicture( decoder_t *p_dec,
                            const subpicture_data_t *p_spu_data,
                            const spu_properties_t *p_spu_properties,
-                           void(*pf_queue)(decoder_t *, subpicture_t *) )
+                           int(*pf_queue)(decoder_t *, subpicture_t *) )
 {
     decoder_sys_t *p_sys = p_dec->p_sys;
     subpicture_t *p_spu;
@@ -318,7 +318,7 @@ static int Validate( decoder_t *p_dec, unsigned i_index,
  * This function parses the SPU packet and, if valid, sends it to the
  * video output.
  *****************************************************************************/
-void ParsePacket( decoder_t *p_dec, void(*pf_queue)(decoder_t *, subpicture_t *) )
+void ParsePacket( decoder_t *p_dec, int(*pf_queue)(decoder_t *, subpicture_t *) )
 {
     decoder_sys_t *p_sys = p_dec->p_sys;
 
@@ -335,7 +335,7 @@ void ParsePacket( decoder_t *p_dec, void(*pf_queue)(decoder_t *, subpicture_t *)
  * subtitles format, see http://sam.zoy.org/doc/dvd/subtitles/index.html
  *****************************************************************************/
 static int ParseControlSeq( decoder_t *p_dec, mtime_t i_pts,
-                            void(*pf_queue)(decoder_t *, subpicture_t *) )
+                            int(*pf_queue)(decoder_t *, subpicture_t *) )
 {
     decoder_sys_t *p_sys = p_dec->p_sys;
 


=====================================
modules/codec/spudec/spudec.h
=====================================
@@ -60,4 +60,4 @@ struct decoder_sys_t
 /*****************************************************************************
  * Prototypes
  *****************************************************************************/
-void ParsePacket( decoder_t *, void(*pf_queue)(decoder_t *, subpicture_t *) );
+void ParsePacket( decoder_t *, int(*pf_queue)(decoder_t *, subpicture_t *) );


=====================================
modules/control/ntservice.c
=====================================
@@ -142,7 +142,7 @@ static void *Run( void *data )
     intf_thread_t *p_intf = data;
     SERVICE_TABLE_ENTRY dispatchTable[] =
     {
-        { TEXT(VLCSERVICENAME), &ServiceDispatch },
+        { (WCHAR*) TEXT(VLCSERVICENAME), (LPSERVICE_MAIN_FUNCTION) &ServiceDispatch },
         { NULL, NULL }
     };
 


=====================================
modules/demux/mpeg/ts_pid.c
=====================================
@@ -64,14 +64,16 @@ void ts_pid_list_Release( demux_t *p_demux, ts_pid_list_t *p_list )
 struct searchkey
 {
     int16_t i_pid;
-    ts_pid_t **pp_last;
+    ts_pid_t *const *pp_last;
 };
 
-static int ts_bsearch_searchkey_Compare( void *key, void *other )
+static int ts_bsearch_searchkey_Compare( const void *key, const void *other )
 {
-    struct searchkey *p_key = (struct searchkey *) key;
-    ts_pid_t *p_pid = *((ts_pid_t **) other);
-    p_key->pp_last = (ts_pid_t **) other;
+    struct searchkey *p_key = (void *)key;
+    ts_pid_t *const *pp_pid = other;
+
+    ts_pid_t *p_pid = *pp_pid;
+    p_key->pp_last = other;
     return ( p_key->i_pid >= p_pid->i_pid ) ? p_key->i_pid - p_pid->i_pid : -1;
 }
 


=====================================
modules/video_filter/deinterlace/yadif.h
=====================================
@@ -139,7 +139,11 @@ static void yadif_filter_line_c(uint8_t *dst, uint8_t *prev, uint8_t *cur, uint8
     FILTER
 }
 
-static void yadif_filter_line_c_16bit(uint16_t *dst, uint16_t *prev, uint16_t *cur, uint16_t *next, int w, int prefs, int mrefs, int parity, int mode) {
+static void yadif_filter_line_c_16bit(uint8_t *dst8, uint8_t *prev8, uint8_t *cur8, uint8_t *next8, int w, int prefs, int mrefs, int parity, int mode) {
+    uint8_t *dst = (uint8_t *)dst8;
+    uint8_t *prev = (uint8_t *)prev8;
+    uint8_t *cur = (uint8_t *)cur8;
+    uint8_t *next = (uint8_t *)next8;
     int x;
     uint16_t *prev2= parity ? prev : cur ;
     uint16_t *next2= parity ? cur  : next;


=====================================
modules/video_output/win32/direct3d11.c
=====================================
@@ -214,10 +214,10 @@ static bool GetRect(const vout_display_sys_win32_t *p_sys, RECT *out)
 
 static int OpenCoreW(vout_display_t *vd)
 {
-    IDXGISwapChain1* dxgiswapChain  = var_InheritInteger(vd, "winrt-swapchain");
+    IDXGISwapChain1* dxgiswapChain  = (void*)var_InheritInteger(vd, "winrt-swapchain");
     if (!dxgiswapChain)
         return VLC_EGENERIC;
-    ID3D11DeviceContext* d3dcontext = var_InheritInteger(vd, "winrt-d3dcontext");
+    ID3D11DeviceContext* d3dcontext = (void*)var_InheritInteger(vd, "winrt-d3dcontext");
     if (!d3dcontext)
         return VLC_EGENERIC;
     ID3D11Device* d3ddevice = NULL;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/5c8512dfe1c5b2a2a918425b9de17c40be454675...d2cad92d01c55f4533e3ab18fb14ab168bb7cd2b

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/5c8512dfe1c5b2a2a918425b9de17c40be454675...d2cad92d01c55f4533e3ab18fb14ab168bb7cd2b
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list