summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-10-09 17:56:51 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-10-09 17:56:52 +0200
commit881ceeff428c377d02ae3881beccdbb028385075 (patch)
tree65bd4335d7f67b81b04e33f2cbb17a41cf966dd8 /src/corelib/tools
parentb3d2c867ed14cd6337d5e32b8750f198b5b7d331 (diff)
parent106487387d493dab934e19b33bfed55b8df62d67 (diff)
Merge remote-tracking branch 'origin/5.4' into dev
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qalgorithms.qdoc2
-rw-r--r--src/corelib/tools/qbitarray.cpp13
-rw-r--r--src/corelib/tools/qdatetime.cpp4
-rw-r--r--src/corelib/tools/qelapsedtimer.cpp2
-rw-r--r--src/corelib/tools/qlist.cpp2
-rw-r--r--src/corelib/tools/qregularexpression.cpp18
-rw-r--r--src/corelib/tools/qscopedpointer.cpp2
-rw-r--r--src/corelib/tools/qshareddata.cpp2
-rw-r--r--src/corelib/tools/qsharedpointer.cpp2
-rw-r--r--src/corelib/tools/qstring.h4
-rw-r--r--src/corelib/tools/qstringiterator.qdoc4
-rw-r--r--src/corelib/tools/qstringlist.cpp6
-rw-r--r--src/corelib/tools/qtimezone.cpp4
-rw-r--r--src/corelib/tools/qtimezoneprivate_tz.cpp4
14 files changed, 38 insertions, 31 deletions
diff --git a/src/corelib/tools/qalgorithms.qdoc b/src/corelib/tools/qalgorithms.qdoc
index 2551233aec..5e5a2b42e2 100644
--- a/src/corelib/tools/qalgorithms.qdoc
+++ b/src/corelib/tools/qalgorithms.qdoc
@@ -144,7 +144,7 @@
QList and QVector's non-const iterator types are random access iterators.
- \section1 Qt and the STL algorithms
+ \section1 Qt and the STL Algorithms
Historically, Qt used to provide functions which were direct equivalents of
many STL algorithmic functions. Starting with Qt 5.0, you are instead
diff --git a/src/corelib/tools/qbitarray.cpp b/src/corelib/tools/qbitarray.cpp
index 62c77cf10f..5c391d7e4f 100644
--- a/src/corelib/tools/qbitarray.cpp
+++ b/src/corelib/tools/qbitarray.cpp
@@ -282,11 +282,18 @@ void QBitArray::resize(int size)
/*!
\overload
- Sets bits at index positions \a begin up to and excluding \a end
+ Sets bits at index positions \a begin up to (but not including) \a end
to \a value.
- \a begin and \a end must be a valid index position in the bit
- array (i.e., 0 <= \a begin <= size() and 0 <= \a end <= size()).
+ \a begin must be a valid index position in the bit array
+ (0 <= \a begin < size()).
+
+ \a end must be either a valid index position or equal to size(), in
+ which case the fill operation runs until the end of the array
+ (0 <= \a end <= size()).
+
+ Example:
+ \snippet code/src_corelib_tools_qbitarray.cpp 15
*/
void QBitArray::fill(bool value, int begin, int end)
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index a0b88a65d0..4fa07b17d4 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -196,7 +196,7 @@ static void rfcDateImpl(const QString &s, QDate *dd = 0, QTime *dt = 0, int *utc
min = rex.cap(5).toInt();
sec = rex.cap(6).toInt();
}
- positiveOffset = (rex.cap(7) == QStringLiteral("+"));
+ positiveOffset = (rex.cap(7) == QLatin1String("+"));
hourOffset = rex.cap(8).toInt();
minOffset = rex.cap(9).toInt();
}
@@ -217,7 +217,7 @@ static void rfcDateImpl(const QString &s, QDate *dd = 0, QTime *dt = 0, int *utc
min = rex.cap(4).toInt();
sec = rex.cap(5).toInt();
}
- positiveOffset = (rex.cap(7) == QStringLiteral("+"));
+ positiveOffset = (rex.cap(7) == QLatin1String("+"));
hourOffset = rex.cap(8).toInt();
minOffset = rex.cap(9).toInt();
}
diff --git a/src/corelib/tools/qelapsedtimer.cpp b/src/corelib/tools/qelapsedtimer.cpp
index cf2b3b4c9d..52875bc9fe 100644
--- a/src/corelib/tools/qelapsedtimer.cpp
+++ b/src/corelib/tools/qelapsedtimer.cpp
@@ -77,7 +77,7 @@ QT_BEGIN_NAMESPACE
\snippet qelapsedtimer/main.cpp 2
- \section1 Reference clocks
+ \section1 Reference Clocks
QElapsedTimer will use the platform's monotonic reference clock in all
platforms that support it (see QElapsedTimer::isMonotonic()). This has
diff --git a/src/corelib/tools/qlist.cpp b/src/corelib/tools/qlist.cpp
index 7ab2ffffd4..8e2bed7a7c 100644
--- a/src/corelib/tools/qlist.cpp
+++ b/src/corelib/tools/qlist.cpp
@@ -468,7 +468,7 @@ void **QListData::erase(void **xi)
value that might not be in the valid range, check that it is less
than the value returned by size() but \e not less than 0.
- \section1 More members
+ \section1 More Members
If T is a QByteArray, this class has a couple more members that can be
used. See the documentation for QByteArrayList for more information.
diff --git a/src/corelib/tools/qregularexpression.cpp b/src/corelib/tools/qregularexpression.cpp
index cd7b375c8f..228ee5b842 100644
--- a/src/corelib/tools/qregularexpression.cpp
+++ b/src/corelib/tools/qregularexpression.cpp
@@ -138,7 +138,7 @@ QT_BEGIN_NAMESPACE
\snippet code/src_corelib_tools_qregularexpression.cpp 3
- \section1 Pattern options
+ \section1 Pattern Options
The meaning of the pattern string can be modified by setting one or more
\e{pattern options}. For instance, it is possible to set a pattern to match
@@ -162,7 +162,7 @@ QT_BEGIN_NAMESPACE
Please refer to the QRegularExpression::PatternOption enum documentation for
more information about each pattern option.
- \section1 Match type and match options
+ \section1 Match Type and Match Options
The last two arguments of the match() and the globalMatch() functions set
the match type and the match options. The match type is a value of the
@@ -177,7 +177,7 @@ QT_BEGIN_NAMESPACE
QRegularExpression::MatchOption enum documentation for more details.
\target normal matching
- \section1 Normal matching
+ \section1 Normal Matching
In order to perform a match you can simply invoke the match() function
passing a string to match against. We refer to this string as the
@@ -227,7 +227,7 @@ QT_BEGIN_NAMESPACE
\snippet code/src_corelib_tools_qregularexpression.cpp 12
\target global matching
- \section1 Global matching
+ \section1 Global Matching
\e{Global matching} is useful to find all the occurrences of a given
regular expression inside a subject string. Suppose that we want to extract
@@ -257,7 +257,7 @@ QT_BEGIN_NAMESPACE
the globalMatch() function, exactly like normal matching with match().
\target partial matching
- \section1 Partial matching
+ \section1 Partial Matching
A \e{partial match} is obtained when the end of the subject string is
reached, but more characters are needed to successfully complete the match.
@@ -396,7 +396,7 @@ QT_BEGIN_NAMESPACE
text) would have been \c{"abcabc"}; by matching only against the leading
\c{"abc"} we instead get a partial match.
- \section1 Error handling
+ \section1 Error Handling
It is possible for a QRegularExpression object to be invalid because of
syntax errors in the pattern string. The isValid() function will return
@@ -415,7 +415,7 @@ QT_BEGIN_NAMESPACE
its \l{QRegularExpressionMatch::}{isValid()} function will return false).
The same applies for attempting a global match.
- \section1 Unsupported Perl-compatible regular expressions features
+ \section1 Unsupported Perl-compatible Regular Expressions Features
QRegularExpression does not support all the features available in
Perl-compatible regular expressions. The most notable one is the fact that
@@ -424,7 +424,7 @@ QT_BEGIN_NAMESPACE
This may change in a future version of Qt.
- \section1 Notes for QRegExp users
+ \section1 Notes for QRegExp Users
The QRegularExpression class introduced in Qt 5 is a big improvement upon
QRegExp, in terms of APIs offered, supported pattern syntax and speed of
@@ -517,7 +517,7 @@ QT_BEGIN_NAMESPACE
QRegExp::CaretAtOffset behaviour. There is no equivalent for the other
QRegExp::CaretMode modes.
- \section1 Debugging code that uses QRegularExpression
+ \section1 Debugging Code that Uses QRegularExpression
QRegularExpression internally uses a just in time compiler (JIT) to
optimize the execution of the matching algorithm. The JIT makes extensive
diff --git a/src/corelib/tools/qscopedpointer.cpp b/src/corelib/tools/qscopedpointer.cpp
index 1f166bb3c3..57829bdd08 100644
--- a/src/corelib/tools/qscopedpointer.cpp
+++ b/src/corelib/tools/qscopedpointer.cpp
@@ -73,7 +73,7 @@ QT_BEGIN_NAMESPACE
\snippet code/src_corelib_tools_qscopedpointer.cpp 2
- \section1 Custom cleanup handlers
+ \section1 Custom Cleanup Handlers
Arrays as well as pointers that have been allocated with \c malloc must
not be deleted using \c delete. QScopedPointer's second template parameter
diff --git a/src/corelib/tools/qshareddata.cpp b/src/corelib/tools/qshareddata.cpp
index a72a99dbe7..37de091776 100644
--- a/src/corelib/tools/qshareddata.cpp
+++ b/src/corelib/tools/qshareddata.cpp
@@ -222,7 +222,7 @@ QT_BEGIN_NAMESPACE
In the member function documentation, \e{d pointer} always refers
to the internal pointer to the shared data object.
- \section1 Optimize performance for usage in Qt Containers
+ \section1 Optimize Performance for Usage in Qt Containers
You should consider marking your implicitly shared class as a movable type
using the Q_DECLARE_TYPEINFO() macro if it resembles the \c Employee class
diff --git a/src/corelib/tools/qsharedpointer.cpp b/src/corelib/tools/qsharedpointer.cpp
index ed557a05c7..666bc107fa 100644
--- a/src/corelib/tools/qsharedpointer.cpp
+++ b/src/corelib/tools/qsharedpointer.cpp
@@ -103,7 +103,7 @@
does so weakly. QWeakPointer has the same functionality, but its use for
that function is deprecated.
- \section1 Optional pointer tracking
+ \section1 Optional Pointer Tracking
A feature of QSharedPointer that can be enabled at compile-time for
debugging purposes is a pointer tracking mechanism. When enabled,
diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h
index c0bfafc9a7..a84179e1e6 100644
--- a/src/corelib/tools/qstring.h
+++ b/src/corelib/tools/qstring.h
@@ -163,8 +163,8 @@ Q_STATIC_ASSERT_X(sizeof(qunicodechar) == 2,
Q_STATIC_STRING_DATA_HEADER_INITIALIZER(Size), \
QT_UNICODE_LITERAL(str) }; \
QStringDataPtr holder = { qstring_literal.data_ptr() }; \
- const QString s(holder); \
- return s; \
+ const QString qstring_literal_temp(holder); \
+ return qstring_literal_temp; \
}()) \
/**/
diff --git a/src/corelib/tools/qstringiterator.qdoc b/src/corelib/tools/qstringiterator.qdoc
index 9355191d46..ff0a097cb9 100644
--- a/src/corelib/tools/qstringiterator.qdoc
+++ b/src/corelib/tools/qstringiterator.qdoc
@@ -69,7 +69,7 @@
respectively after and behind the iterator's current position, but they
will not return the code point the iterator has moved through.
- \section1 Unicode handling
+ \section1 Unicode Handling
QString and all of its functions work in terms of UTF-16 code units. Unicode code points
that fall outside the Basic Multilingual Plane (U+10000 to U+10FFFF) will therefore
@@ -91,7 +91,7 @@
a decoding problem; please refer to the each function documentation for
more details.
- \section1 Unchecked iteration
+ \section1 Unchecked Iteration
It is possible to optimize iterating over a QString contents by skipping
some checks. This is in general not safe to do, because a QString is allowed
diff --git a/src/corelib/tools/qstringlist.cpp b/src/corelib/tools/qstringlist.cpp
index 0f9d427bab..4e5393e0b0 100644
--- a/src/corelib/tools/qstringlist.cpp
+++ b/src/corelib/tools/qstringlist.cpp
@@ -90,7 +90,7 @@ QT_BEGIN_NAMESPACE
\tableofcontents
- \section1 Adding strings
+ \section1 Adding Strings
Strings can be added to a list using the \l
{QList::append()}{append()}, \l
@@ -99,7 +99,7 @@ QT_BEGIN_NAMESPACE
\snippet qstringlist/main.cpp 0
- \section1 Iterating over the strings
+ \section1 Iterating Over the Strings
To iterate over a list, you can either use index positions or
QList's Java-style and STL-style iterator types:
@@ -121,7 +121,7 @@ QT_BEGIN_NAMESPACE
QMutableStringListIterator class which is a type definition for
QMutableListIterator<QString>.
- \section1 Manipulating the strings
+ \section1 Manipulating the Strings
QStringList provides several functions allowing you to manipulate
the contents of a list. You can concatenate all the strings in a
diff --git a/src/corelib/tools/qtimezone.cpp b/src/corelib/tools/qtimezone.cpp
index 0f8f4937b9..8f3db74131 100644
--- a/src/corelib/tools/qtimezone.cpp
+++ b/src/corelib/tools/qtimezone.cpp
@@ -935,7 +935,7 @@ QDataStream &operator>>(QDataStream &ds, QTimeZone &tz)
{
QString ianaId;
ds >> ianaId;
- if (ianaId == QStringLiteral("OffsetFromUtc")) {
+ if (ianaId == QLatin1String("OffsetFromUtc")) {
int utcOffset;
QString name;
QString abbreviation;
@@ -954,7 +954,7 @@ QDataStream &operator>>(QDataStream &ds, QTimeZone &tz)
QDebug operator<<(QDebug dbg, const QTimeZone &tz)
{
//TODO Include backend and data version details?
- dbg.nospace() << QStringLiteral("QTimeZone(") << qPrintable(QString::fromUtf8(tz.id())) << ')';
+ dbg.nospace() << "QTimeZone(" << QString::fromUtf8(tz.id()) << ')';
return dbg.space();
}
#endif
diff --git a/src/corelib/tools/qtimezoneprivate_tz.cpp b/src/corelib/tools/qtimezoneprivate_tz.cpp
index f93b17f505..d1ef769414 100644
--- a/src/corelib/tools/qtimezoneprivate_tz.cpp
+++ b/src/corelib/tools/qtimezoneprivate_tz.cpp
@@ -940,9 +940,9 @@ QByteArray QTzTimeZonePrivate::systemTimeZoneId() const
QString line;
while (ianaId.isEmpty() && !ts.atEnd() && ts.status() == QTextStream::Ok) {
line = ts.readLine();
- if (line.left(5) == QStringLiteral("ZONE=")) {
+ if (line.startsWith(QLatin1String("ZONE="))) {
ianaId = line.mid(6, line.size() - 7).toUtf8();
- } else if (line.left(9) == QStringLiteral("TIMEZONE=")) {
+ } else if (line.startsWith(QLatin1String("TIMEZONE="))) {
ianaId = line.mid(10, line.size() - 11).toUtf8();
}
}