summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2018-07-27 11:22:57 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2018-07-31 13:33:14 +0200
commit23c9d4c98f3c6729b56700edc1d7144b444b16db (patch)
tree27b20ccbf3c101dbc7bcb1e509882b6c7fc75962 /src/corelib/tools
parentf69a5857d115786f44d053e68c36f74526020e82 (diff)
parent0ef66e98ccf4946a0e4513ab5fc157df0f0aca4e (diff)
Merge branch '5.11' into dev
Conflicts: qmake/library/qmakebuiltins.cpp src/plugins/platforms/windows/qwindowstabletsupport.h src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbconnection.h src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/plugins/platforms/xcb/qxcbwindow.cpp src/widgets/styles/qstylesheetstyle.cpp tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp Done-With: Gatis Paeglis <gatis.paeglis@qt.io> Change-Id: I000b0eb3cea2a5c7a99b95732bfdd41507cf916e
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qchar.h2
-rw-r--r--src/corelib/tools/qcollator.cpp14
2 files changed, 14 insertions, 2 deletions
diff --git a/src/corelib/tools/qchar.h b/src/corelib/tools/qchar.h
index 84df8accc5..8590b91ba3 100644
--- a/src/corelib/tools/qchar.h
+++ b/src/corelib/tools/qchar.h
@@ -93,7 +93,9 @@ public:
Q_STATIC_ASSERT(sizeof(wchar_t) == sizeof(ushort));
#endif
#if defined(Q_OS_WIN) || defined(Q_CLANG_QDOC)
+# if !defined(_WCHAR_T_DEFINED) || defined(_NATIVE_WCHAR_T_DEFINED)
Q_DECL_CONSTEXPR QChar(wchar_t ch) Q_DECL_NOTHROW : ucs(ushort(ch)) {} // implicit
+# endif
#endif
#ifndef QT_NO_CAST_FROM_ASCII
diff --git a/src/corelib/tools/qcollator.cpp b/src/corelib/tools/qcollator.cpp
index f1e3d6652d..5155badcf8 100644
--- a/src/corelib/tools/qcollator.cpp
+++ b/src/corelib/tools/qcollator.cpp
@@ -89,7 +89,12 @@ QCollator::QCollator(const QLocale &locale)
QCollator::QCollator(const QCollator &other)
: d(other.d)
{
- d->ref.ref();
+ if (d) {
+ // Ensure clean, lest both copies try to init() at the same time:
+ if (d->dirty)
+ d->init();
+ d->ref.ref();
+ }
}
/*!
@@ -110,7 +115,12 @@ QCollator &QCollator::operator=(const QCollator &other)
if (d && !d->ref.deref())
delete d;
d = other.d;
- if (d) d->ref.ref();
+ if (d) {
+ // Ensure clean, lest both copies try to init() at the same time:
+ if (d->dirty)
+ d->init();
+ d->ref.ref();
+ }
}
return *this;
}