summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qbytearray.cpp9
-rw-r--r--src/corelib/tools/qbytearraylist.h1
-rw-r--r--src/corelib/tools/qdatetime.h3
-rw-r--r--src/corelib/tools/qelapsedtimer.h4
-rw-r--r--src/corelib/tools/qelapsedtimer_unix.cpp19
-rw-r--r--src/corelib/tools/qlist.cpp20
-rw-r--r--src/corelib/tools/qlist.h23
-rw-r--r--src/corelib/tools/qlocale.cpp4
-rw-r--r--src/corelib/tools/qlocale_p.h4
-rw-r--r--src/corelib/tools/qsimd.cpp2
-rw-r--r--src/corelib/tools/qsimd_p.h8
-rw-r--r--src/corelib/tools/qstring.cpp87
-rw-r--r--src/corelib/tools/qversionnumber.cpp3
-rw-r--r--src/corelib/tools/qversionnumber_p.h (renamed from src/corelib/tools/qversionnumber.h)0
-rw-r--r--src/corelib/tools/tools.pri2
15 files changed, 115 insertions, 74 deletions
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index 625b78d001..36acfc4c09 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -785,7 +785,7 @@ static inline char qToLower(char c)
occurrences of a particular value with another, use one of the
two-parameter replace() overloads.
- QByteArrays can be compared using overloaded operators such as
+ {QByteArray}s can be compared using overloaded operators such as
operator<(), operator<=(), operator==(), operator>=(), and so on.
The comparison is based exclusively on the numeric values
of the characters and is very fast, but is not what a human would
@@ -830,7 +830,7 @@ static inline char qToLower(char c)
lastIndexOf(), operator<(), operator<=(), operator>(),
operator>=(), toLower() and toUpper().
- This issue does not apply to QStrings since they represent
+ This issue does not apply to {QString}s since they represent
characters using Unicode.
\sa QString, QBitArray
@@ -3203,6 +3203,7 @@ QDataStream &operator>>(QDataStream &in, QByteArray &ba)
replaced with a single space.
Whitespace means any character for which the standard C++
+ \c isspace() function returns \c true in the C locale. This includes the ASCII
isspace() function returns \c true in the C locale. This includes the ASCII
characters '\\t', '\\n', '\\v', '\\f', '\\r', and ' '.
@@ -3228,13 +3229,13 @@ QByteArray QByteArray::simplified_helper(QByteArray &a)
and the end.
Whitespace means any character for which the standard C++
- isspace() function returns \c true in the C locale. This includes the ASCII
+ \c isspace() function returns \c true in the C locale. This includes the ASCII
characters '\\t', '\\n', '\\v', '\\f', '\\r', and ' '.
Example:
\snippet code/src_corelib_tools_qbytearray.cpp 33
- Unlike simplified(), trimmed() leaves internal whitespace alone.
+ Unlike simplified(), \l {QByteArray::trimmed()}{trimmed()} leaves internal whitespace alone.
\sa simplified()
*/
diff --git a/src/corelib/tools/qbytearraylist.h b/src/corelib/tools/qbytearraylist.h
index 9d7e776028..dd84ec642c 100644
--- a/src/corelib/tools/qbytearraylist.h
+++ b/src/corelib/tools/qbytearraylist.h
@@ -63,6 +63,7 @@ class QByteArrayList : public QList<QByteArray>
template <> struct QListSpecialMethods<QByteArray>
#endif
{
+public:
inline QByteArray join() const
{ return QtPrivate::QByteArrayList_join(self(), 0, 0); }
inline QByteArray join(const QByteArray &sep) const
diff --git a/src/corelib/tools/qdatetime.h b/src/corelib/tools/qdatetime.h
index ec1e78c358..5bcd01a587 100644
--- a/src/corelib/tools/qdatetime.h
+++ b/src/corelib/tools/qdatetime.h
@@ -118,7 +118,8 @@ QT_DEPRECATED inline bool setYMD(int y, int m, int d)
inline qint64 toJulianDay() const { return jd; }
private:
- static inline qint64 nullJd() { return std::numeric_limits<qint64>::min(); }
+ // using extra parentheses around min to avoid expanding it if it is a macro
+ static inline qint64 nullJd() { return (std::numeric_limits<qint64>::min)(); }
static inline qint64 minJd() { return Q_INT64_C(-784350574879); }
static inline qint64 maxJd() { return Q_INT64_C( 784354017364); }
diff --git a/src/corelib/tools/qelapsedtimer.h b/src/corelib/tools/qelapsedtimer.h
index d72a50f127..d21081f815 100644
--- a/src/corelib/tools/qelapsedtimer.h
+++ b/src/corelib/tools/qelapsedtimer.h
@@ -51,8 +51,8 @@ public:
};
Q_DECL_CONSTEXPR QElapsedTimer()
- : t1(Q_INT64_C(0x8000000000000000))
- , t2(Q_INT64_C(0x8000000000000000))
+ : t1(Q_INT64_C(0x8000000000000000)),
+ t2(Q_INT64_C(0x8000000000000000))
{
}
diff --git a/src/corelib/tools/qelapsedtimer_unix.cpp b/src/corelib/tools/qelapsedtimer_unix.cpp
index 02d60cc60c..61bd7f1f21 100644
--- a/src/corelib/tools/qelapsedtimer_unix.cpp
+++ b/src/corelib/tools/qelapsedtimer_unix.cpp
@@ -35,8 +35,12 @@
#define _POSIX_C_SOURCE 200809L
#include "qelapsedtimer.h"
-#ifdef Q_OS_VXWORKS
+#if defined(Q_OS_VXWORKS)
#include "qfunctions_vxworks.h"
+#elif defined(Q_OS_QNX)
+#include <sys/neutrino.h>
+#include <sys/syspage.h>
+#include <inttypes.h>
#else
#include <sys/time.h>
#include <time.h>
@@ -84,7 +88,18 @@ QT_BEGIN_NAMESPACE
* see http://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_getres.html
*/
-#ifndef CLOCK_REALTIME
+#if defined(Q_OS_QNX)
+static inline void qt_clock_gettime(clockid_t clock, struct timespec *ts)
+{
+ // The standard POSIX clock calls only have 1ms accuracy on QNX. To get
+ // higher accuracy, this platform-specific function must be used instead
+ quint64 cycles_per_sec = SYSPAGE_ENTRY(qtime)->cycles_per_sec;
+ quint64 cycles = ClockCycles();
+ ts->tv_sec = cycles / cycles_per_sec;
+ quint64 mod = cycles % cycles_per_sec;
+ ts->tv_nsec = mod * Q_INT64_C(1000000000) / cycles_per_sec;
+}
+#elif !defined(CLOCK_REALTIME)
# define CLOCK_REALTIME 0
static inline void qt_clock_gettime(int, struct timespec *ts)
{
diff --git a/src/corelib/tools/qlist.cpp b/src/corelib/tools/qlist.cpp
index f32cd78801..b91fd38a5f 100644
--- a/src/corelib/tools/qlist.cpp
+++ b/src/corelib/tools/qlist.cpp
@@ -1365,7 +1365,7 @@ void **QListData::erase(void **xi)
\sa operator*()
*/
-/*! \fn T &QList::iterator::operator[](int j) const
+/*! \fn T &QList::iterator::operator[](difference_type j) const
Returns a modifiable reference to the item at position *this +
\a{j}.
@@ -1466,7 +1466,7 @@ void **QListData::erase(void **xi)
current and returns an iterator to the previously current item.
*/
-/*! \fn QList::iterator &QList::iterator::operator+=(int j)
+/*! \fn QList::iterator &QList::iterator::operator+=(difference_type j)
Advances the iterator by \a j items. (If \a j is negative, the
iterator goes backward.)
@@ -1474,7 +1474,7 @@ void **QListData::erase(void **xi)
\sa operator-=(), operator+()
*/
-/*! \fn QList::iterator &QList::iterator::operator-=(int j)
+/*! \fn QList::iterator &QList::iterator::operator-=(difference_type j)
Makes the iterator go back by \a j items. (If \a j is negative,
the iterator goes forward.)
@@ -1482,7 +1482,7 @@ void **QListData::erase(void **xi)
\sa operator+=(), operator-()
*/
-/*! \fn QList::iterator QList::iterator::operator+(int j) const
+/*! \fn QList::iterator QList::iterator::operator+(difference_type j) const
Returns an iterator to the item at \a j positions forward from
this iterator. (If \a j is negative, the iterator goes backward.)
@@ -1490,7 +1490,7 @@ void **QListData::erase(void **xi)
\sa operator-(), operator+=()
*/
-/*! \fn QList::iterator QList::iterator::operator-(int j) const
+/*! \fn QList::iterator QList::iterator::operator-(difference_type j) const
Returns an iterator to the item at \a j positions backward from
this iterator. (If \a j is negative, the iterator goes forward.)
@@ -1620,7 +1620,7 @@ void **QListData::erase(void **xi)
\sa operator*()
*/
-/*! \fn const T &QList::const_iterator::operator[](int j) const
+/*! \fn const T &QList::const_iterator::operator[](difference_type j) const
Returns the item at position *this + \a{j}.
@@ -1712,7 +1712,7 @@ void **QListData::erase(void **xi)
current and returns an iterator to the previously current item.
*/
-/*! \fn QList::const_iterator &QList::const_iterator::operator+=(int j)
+/*! \fn QList::const_iterator &QList::const_iterator::operator+=(difference_type j)
Advances the iterator by \a j items. (If \a j is negative, the
iterator goes backward.)
@@ -1720,7 +1720,7 @@ void **QListData::erase(void **xi)
\sa operator-=(), operator+()
*/
-/*! \fn QList::const_iterator &QList::const_iterator::operator-=(int j)
+/*! \fn QList::const_iterator &QList::const_iterator::operator-=(difference_type j)
Makes the iterator go back by \a j items. (If \a j is negative,
the iterator goes forward.)
@@ -1728,7 +1728,7 @@ void **QListData::erase(void **xi)
\sa operator+=(), operator-()
*/
-/*! \fn QList::const_iterator QList::const_iterator::operator+(int j) const
+/*! \fn QList::const_iterator QList::const_iterator::operator+(difference_type j) const
Returns an iterator to the item at \a j positions forward from
this iterator. (If \a j is negative, the iterator goes backward.)
@@ -1736,7 +1736,7 @@ void **QListData::erase(void **xi)
\sa operator-(), operator+=()
*/
-/*! \fn QList::const_iterator QList::const_iterator::operator-(int j) const
+/*! \fn QList::const_iterator QList::const_iterator::operator-(difference_type j) const
Returns an iterator to the item at \a j positions backward from
this iterator. (If \a j is negative, the iterator goes forward.)
diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h
index 9704c7b953..5b459269c1 100644
--- a/src/corelib/tools/qlist.h
+++ b/src/corelib/tools/qlist.h
@@ -188,6 +188,7 @@ public:
public:
Node *i;
typedef std::random_access_iterator_tag iterator_category;
+ // ### Qt6: use int
typedef qptrdiff difference_type;
typedef T value_type;
typedef T *pointer;
@@ -198,7 +199,7 @@ public:
inline iterator(const iterator &o): i(o.i){}
inline T &operator*() const { return i->t(); }
inline T *operator->() const { return &i->t(); }
- inline T &operator[](int j) const { return i[j].t(); }
+ inline T &operator[](difference_type j) const { return i[j].t(); }
inline bool operator==(const iterator &o) const { return i == o.i; }
inline bool operator!=(const iterator &o) const { return i != o.i; }
inline bool operator<(const iterator& other) const { return i < other.i; }
@@ -223,10 +224,10 @@ public:
inline iterator operator++(int) { Node *n = i; ++i; return n; }
inline iterator &operator--() { i--; return *this; }
inline iterator operator--(int) { Node *n = i; i--; return n; }
- inline iterator &operator+=(int j) { i+=j; return *this; }
- inline iterator &operator-=(int j) { i-=j; return *this; }
- inline iterator operator+(int j) const { return iterator(i+j); }
- inline iterator operator-(int j) const { return iterator(i-j); }
+ inline iterator &operator+=(difference_type j) { i+=j; return *this; }
+ inline iterator &operator-=(difference_type j) { i-=j; return *this; }
+ inline iterator operator+(difference_type j) const { return iterator(i+j); }
+ inline iterator operator-(difference_type j) const { return iterator(i-j); }
inline int operator-(iterator j) const { return int(i - j.i); }
};
friend class iterator;
@@ -235,6 +236,7 @@ public:
public:
Node *i;
typedef std::random_access_iterator_tag iterator_category;
+ // ### Qt6: use int
typedef qptrdiff difference_type;
typedef T value_type;
typedef const T *pointer;
@@ -250,7 +252,7 @@ public:
#endif
inline const T &operator*() const { return i->t(); }
inline const T *operator->() const { return &i->t(); }
- inline const T &operator[](int j) const { return i[j].t(); }
+ inline const T &operator[](difference_type j) const { return i[j].t(); }
inline bool operator==(const const_iterator &o) const { return i == o.i; }
inline bool operator!=(const const_iterator &o) const { return i != o.i; }
inline bool operator<(const const_iterator& other) const { return i < other.i; }
@@ -261,10 +263,10 @@ public:
inline const_iterator operator++(int) { Node *n = i; ++i; return n; }
inline const_iterator &operator--() { i--; return *this; }
inline const_iterator operator--(int) { Node *n = i; i--; return n; }
- inline const_iterator &operator+=(int j) { i+=j; return *this; }
- inline const_iterator &operator-=(int j) { i-=j; return *this; }
- inline const_iterator operator+(int j) const { return const_iterator(i+j); }
- inline const_iterator operator-(int j) const { return const_iterator(i-j); }
+ inline const_iterator &operator+=(difference_type j) { i+=j; return *this; }
+ inline const_iterator &operator-=(difference_type j) { i-=j; return *this; }
+ inline const_iterator operator+(difference_type j) const { return const_iterator(i+j); }
+ inline const_iterator operator-(difference_type j) const { return const_iterator(i-j); }
inline int operator-(const_iterator j) const { return int(i - j.i); }
};
friend class const_iterator;
@@ -316,6 +318,7 @@ public:
typedef const value_type *const_pointer;
typedef value_type &reference;
typedef const value_type &const_reference;
+ // ### Qt6: use int
typedef qptrdiff difference_type;
// comfort
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index a253057435..a923be50c0 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -3144,7 +3144,7 @@ bool QLocaleData::numberToCLocale(const QChar *str, int len,
}
bool QLocaleData::validateChars(const QString &str, NumberMode numMode, QByteArray *buff,
- int decDigits) const
+ int decDigits, bool rejectGroupSeparators) const
{
buff->clear();
buff->reserve(str.length());
@@ -3205,7 +3205,7 @@ bool QLocaleData::validateChars(const QString &str, NumberMode numMode, QByteArr
case ',':
//it can only be placed after a digit which is before the decimal point
- if (!lastWasDigit || decPointCnt > 0)
+ if (rejectGroupSeparators || !lastWasDigit || decPointCnt > 0)
return false;
break;
diff --git a/src/corelib/tools/qlocale_p.h b/src/corelib/tools/qlocale_p.h
index c33ced35d5..c5e62027c4 100644
--- a/src/corelib/tools/qlocale_p.h
+++ b/src/corelib/tools/qlocale_p.h
@@ -251,7 +251,9 @@ public:
inline char digitToCLocale(QChar c) const;
// this function is used in QIntValidator (QtGui)
- Q_CORE_EXPORT bool validateChars(const QString &str, NumberMode numMode, QByteArray *buff, int decDigits = -1) const;
+ Q_CORE_EXPORT bool validateChars(const QString &str, NumberMode numMode,
+ QByteArray *buff, int decDigits = -1,
+ bool rejectGroupSeparators = false) const;
public:
quint16 m_language_id, m_script_id, m_country_id;
diff --git a/src/corelib/tools/qsimd.cpp b/src/corelib/tools/qsimd.cpp
index 0b3bbc0ad0..5281723c5d 100644
--- a/src/corelib/tools/qsimd.cpp
+++ b/src/corelib/tools/qsimd.cpp
@@ -519,7 +519,7 @@ QBasicAtomicInt qt_cpu_features = Q_BASIC_ATOMIC_INITIALIZER(0);
void qDetectCpuFeatures()
{
#if defined(Q_CC_GNU) && !defined(Q_CC_CLANG) && !defined(Q_CC_INTEL)
-# if (__GNUC__ * 100 + __GNUC_MINOR__) < 403
+# if Q_CC_GNU < 403
// GCC 4.2 (at least the one that comes with Apple's XCode, on Mac) is
// known to be broken beyond repair in dealing with the inline assembly
// above. It will generate bad code that could corrupt important registers
diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h
index ee2ff99a80..891a3ff053 100644
--- a/src/corelib/tools/qsimd_p.h
+++ b/src/corelib/tools/qsimd_p.h
@@ -218,8 +218,8 @@
#endif
// other x86 intrinsics
-#if defined(Q_PROCESSOR_X86) && ((defined(Q_CC_GNU) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 404)) \
- || (defined(Q_CC_CLANG) && (__clang_major__ * 100 + __clang_minor__ >= 208)) \
+#if defined(Q_PROCESSOR_X86) && ((defined(Q_CC_GNU) && (Q_CC_GNU >= 404)) \
+ || (defined(Q_CC_CLANG) && (Q_CC_CLANG >= 208)) \
|| defined(Q_CC_INTEL))
# define QT_COMPILER_SUPPORTS_X86INTRIN
# ifdef Q_CC_INTEL
@@ -318,7 +318,7 @@ static inline uint qCpuFeatures()
#ifdef Q_PROCESSOR_X86
// Bit scan functions for x86
-# ifdef Q_CC_MSVC
+# if defined(Q_CC_MSVC) && !defined(Q_OS_WINCE)
// MSVC calls it _BitScanReverse and returns the carry flag, which we don't need
static __forceinline unsigned long _bit_scan_reverse(uint val)
{
@@ -332,7 +332,7 @@ static __forceinline unsigned long _bit_scan_forward(uint val)
_BitScanForward(&result, val);
return result;
}
-# elif (defined(Q_CC_CLANG) || (defined(Q_CC_GNU) && __GNUC__ * 100 + __GNUC_MINOR__ < 405)) \
+# elif (defined(Q_CC_CLANG) || (defined(Q_CC_GNU) && Q_CC_GNU < 405)) \
&& !defined(Q_CC_INTEL)
// Clang is missing the intrinsic for _bit_scan_reverse
// GCC only added it in version 4.5
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 0d13cccbec..76069225eb 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -3938,28 +3938,31 @@ QString QString::section(const QString &sep, int start, int end, SectionFlags fl
{
QStringList sections = split(sep, KeepEmptyParts,
(flags & SectionCaseInsensitiveSeps) ? Qt::CaseInsensitive : Qt::CaseSensitive);
- if (sections.isEmpty())
- return QString();
+ const int sectionsSize = sections.size();
+
if (!(flags & SectionSkipEmpty)) {
if (start < 0)
- start += sections.count();
+ start += sectionsSize;
if (end < 0)
- end += sections.count();
+ end += sectionsSize;
} else {
int skip = 0;
- for (int k=0; k<sections.size(); ++k) {
+ for (int k = 0; k < sectionsSize; ++k) {
if (sections.at(k).isEmpty())
skip++;
}
if (start < 0)
- start += sections.count() - skip;
+ start += sectionsSize - skip;
if (end < 0)
- end += sections.count() - skip;
+ end += sectionsSize - skip;
}
+ if (start >= sectionsSize || end < 0 || start > end)
+ return QString();
+
int x = 0;
QString ret;
int first_i = start, last_i = end;
- for (int i = 0; x <= end && i < sections.size(); ++i) {
+ for (int i = 0; x <= end && i < sectionsSize; ++i) {
QString section = sections.at(i);
const bool empty = section.isEmpty();
if (x >= start) {
@@ -3967,16 +3970,16 @@ QString QString::section(const QString &sep, int start, int end, SectionFlags fl
first_i = i;
if(x == end)
last_i = i;
- if(x > start)
+ if (x > start && i > 0)
ret += sep;
ret += section;
}
if (!empty || !(flags & SectionSkipEmpty))
x++;
}
- if((flags & SectionIncludeLeadingSep) && first_i)
+ if ((flags & SectionIncludeLeadingSep) && first_i > 0)
ret.prepend(sep);
- if((flags & SectionIncludeTrailingSep) && last_i < sections.size()-1)
+ if ((flags & SectionIncludeTrailingSep) && last_i < sectionsSize - 1)
ret += sep;
return ret;
}
@@ -3996,15 +3999,32 @@ static QString extractSections(const QVector<qt_section_chunk> &sections,
int end,
QString::SectionFlags flags)
{
- if (start < 0)
- start += sections.count();
- if (end < 0)
- end += sections.count();
+ const int sectionsSize = sections.size();
+
+ if (!(flags & QString::SectionSkipEmpty)) {
+ if (start < 0)
+ start += sectionsSize;
+ if (end < 0)
+ end += sectionsSize;
+ } else {
+ int skip = 0;
+ for (int k = 0; k < sectionsSize; ++k) {
+ const qt_section_chunk &section = sections.at(k);
+ if (section.length == section.string.length())
+ skip++;
+ }
+ if (start < 0)
+ start += sectionsSize - skip;
+ if (end < 0)
+ end += sectionsSize - skip;
+ }
+ if (start >= sectionsSize || end < 0 || start > end)
+ return QString();
QString ret;
int x = 0;
int first_i = start, last_i = end;
- for (int i = 0; x <= end && i < sections.size(); ++i) {
+ for (int i = 0; x <= end && i < sectionsSize; ++i) {
const qt_section_chunk &section = sections.at(i);
const bool empty = (section.length == section.string.length());
if (x >= start) {
@@ -4021,12 +4041,13 @@ static QString extractSections(const QVector<qt_section_chunk> &sections,
x++;
}
- if ((flags & QString::SectionIncludeLeadingSep) && first_i < sections.size()) {
+ if ((flags & QString::SectionIncludeLeadingSep) && first_i >= 0) {
const qt_section_chunk &section = sections.at(first_i);
ret.prepend(section.string.left(section.length));
}
- if ((flags & QString::SectionIncludeTrailingSep) && last_i+1 <= sections.size()-1) {
+ if ((flags & QString::SectionIncludeTrailingSep)
+ && last_i < sectionsSize - 1) {
const qt_section_chunk &section = sections.at(last_i+1);
ret += section.string.left(section.length);
}
@@ -5650,21 +5671,18 @@ QString QString::toUpper_helper(QString &str)
Safely builds a formatted string from the format string \a cformat
and an arbitrary list of arguments.
- The %lc escape sequence expects a unicode character of type ushort
- (as returned by QChar::unicode()). The %ls escape sequence expects
- a pointer to a zero-terminated array of unicode characters of type
- ushort (as returned by QString::utf16()).
-
- \note This function expects a UTF-8 string for %s and Latin-1 for
- the format string.
+ The format string supports the conversion specifiers, length modifiers,
+ and flags provided by printf() in the standard C++ library. The \a cformat
+ string and \c{%s} arguments must be UTF-8 encoded.
- The format string supports most of the conversion specifiers
- provided by printf() in the standard C++ library. It doesn't
- honor the length modifiers (e.g. \c h for \c short, \c ll for
- \c{long long}). If you need those, use the standard snprintf()
- function instead:
-
- \snippet qstring/main.cpp 63
+ \note The \c{%lc} escape sequence expects a unicode character of type
+ \c char16_t, or \c ushort (as returned by QChar::unicode()).
+ The \c{%ls} escape sequence expects a pointer to a zero-terminated array
+ of unicode characters of type \c char16_t, or ushort (as returned by
+ QString::utf16()). This is at odds with the printf() in the standard C++
+ library, which defines \c {%lc} to print a wchar_t and \c{%ls} to print
+ a \c{wchar_t*}, and might also produce compiler warnings on platforms
+ where the size of \c {wchar_t} is not 16 bits.
\warning We do not recommend using QString::sprintf() in new Qt
code. Instead, consider using QTextStream or arg(), both of
@@ -6284,8 +6302,7 @@ ushort QString::toUShort(bool *ok, int base) const
\snippet qstring/main.cpp 66
- Various string formats for floating point numbers can be converted
- to double values:
+ \warning The QString content may only contain valid numerical characters which includes the plus/minus sign, the characters g and e used in scientific notation, and the decimal point. Including the unit or additional characters leads to a conversion error.
\snippet qstring/main.cpp 67
@@ -6294,7 +6311,7 @@ ushort QString::toUShort(bool *ok, int base) const
\snippet qstring/main.cpp 68
- For historic reasons, this function does not handle
+ For historical reasons, this function does not handle
thousands group separators. If you need to convert such numbers,
use QLocale::toDouble().
diff --git a/src/corelib/tools/qversionnumber.cpp b/src/corelib/tools/qversionnumber.cpp
index 4d148249c0..3c8a9db086 100644
--- a/src/corelib/tools/qversionnumber.cpp
+++ b/src/corelib/tools/qversionnumber.cpp
@@ -40,7 +40,7 @@
**
****************************************************************************/
-#include <QtCore/qversionnumber.h>
+#include <QtCore/private/qversionnumber_p.h>
#include <QtCore/qhash.h>
#include <QtCore/private/qlocale_tools_p.h>
#include <QtCore/qcollator.h>
@@ -61,6 +61,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QVersionNumber
\inmodule QtCore
+ \internal
\since 5.4
\brief The QVersionNumber class contains a version number with an arbitrary
number of segments.
diff --git a/src/corelib/tools/qversionnumber.h b/src/corelib/tools/qversionnumber_p.h
index a951b2f1a0..a951b2f1a0 100644
--- a/src/corelib/tools/qversionnumber.h
+++ b/src/corelib/tools/qversionnumber_p.h
diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri
index 2e77f683a4..6f6404f83c 100644
--- a/src/corelib/tools/tools.pri
+++ b/src/corelib/tools/tools.pri
@@ -72,7 +72,7 @@ HEADERS += \
tools/qunicodetools_p.h \
tools/qvarlengtharray.h \
tools/qvector.h \
- tools/qversionnumber.h
+ tools/qversionnumber_p.h
SOURCES += \