summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qglobal.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2017-10-10 09:42:41 +0200
committerAntti Kokko <antti.kokko@qt.io>2017-11-28 18:41:40 +0000
commit984ad6124992c9831f57c2776aa2ed0a760149e6 (patch)
tree320236847752f32a56a1c6e18618a353172921f9 /src/corelib/global/qglobal.cpp
parent8298956eb084d8f0e478240a674c5ae131c8be97 (diff)
Improve readability of code that uses the Qt signed size typev5.10.0-rc2
During the container BoF session at the Qt Contributor Summit 2017 the name of the signed size type became a subject of discussion in the context of readability of code using this type and the intention of using it for all length, size and count properties throughout the entire framework in future versions of Qt. This change proposes qsizetype as new name for qssize_t to emphasize the readability of code over POSIX compatibility, the former being potentially more relevant than the latter to the majority of users of Qt. Change-Id: Idb99cb4a8782703c054fa463a9e5af23a918e7f3 Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch> Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src/corelib/global/qglobal.cpp')
-rw-r--r--src/corelib/global/qglobal.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 36b7560398..2c2dcb663b 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -160,8 +160,8 @@ Q_STATIC_ASSERT_X(std::numeric_limits<float>::radix == 2,
// not required by the definition of size_t, but we depend on this
Q_STATIC_ASSERT_X(sizeof(size_t) == sizeof(void *), "size_t and a pointer don't have the same size");
-Q_STATIC_ASSERT(sizeof(size_t) == sizeof(qssize_t)); // implied by the definition
-Q_STATIC_ASSERT((std::is_same<qssize_t, qptrdiff>::value));
+Q_STATIC_ASSERT(sizeof(size_t) == sizeof(qsizetype)); // implied by the definition
+Q_STATIC_ASSERT((std::is_same<qsizetype, qptrdiff>::value));
/*!
\class QFlag
@@ -824,7 +824,7 @@ Q_STATIC_ASSERT((std::is_same<qssize_t, qptrdiff>::value));
*/
/*!
- \typedef qssize_t
+ \typedef qsizetype
\relates <QtGlobal>
\since 5.10
@@ -833,7 +833,7 @@ Q_STATIC_ASSERT((std::is_same<qssize_t, qptrdiff>::value));
This type is guaranteed to be the same size as a \c size_t on all
platforms supported by Qt.
- Note that qssize_t is signed. Use \c size_t for unsigned values.
+ Note that qsizetype is signed. Use \c size_t for unsigned values.
\sa qptrdiff
*/