diff options
author | Oswald Buddenhagen <oswald.buddenhagen@digia.com> | 2014-10-06 11:59:47 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@digia.com> | 2014-10-06 11:59:47 +0200 |
commit | f49d5b578cfca311654e09a5161588401fc3815a (patch) | |
tree | 1d97f3e21bf13b4539dc4d9d934fcd3ea92516ec /src/corelib | |
parent | 848e95025297f8f56443ea7b22a1ddca1cc63cd8 (diff) | |
parent | 0edf68120bc72d35d5fe29c84467f5afeacb0585 (diff) |
Merge remote-tracking branch 'origin/5.3' into 5.4
Change-Id: I132bb6cce68e9f8413200f7ee75586bd1cada38c
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/doc/snippets/code/src_corelib_tools_qbitarray.cpp | 7 | ||||
-rw-r--r-- | src/corelib/tools/qbitarray.cpp | 13 | ||||
-rw-r--r-- | src/corelib/tools/qstring.h | 4 |
3 files changed, 19 insertions, 5 deletions
diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qbitarray.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qbitarray.cpp index 4b2916a619..7fe4ea191d 100644 --- a/src/corelib/doc/snippets/code/src_corelib_tools_qbitarray.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_tools_qbitarray.cpp @@ -174,3 +174,10 @@ a[0] = 1; a[1] = 0; a[2] = 1; // a: [ 1, 0, 1 ] b[0] = 1; b[1] = 1; // b: [ 1, 1 ] c = a ^ b; // c: [ 0, 1, 1 ] //! [14] + +//! [15] +QBitArray ba(4); +ba.fill(true, 1, 2); // ba: [ 0, 1, 0, 0 ] +ba.fill(true, 1, 3); // ba: [ 0, 1, 1, 0 ] +ba.fill(true, 1, 4); // ba: [ 0, 1, 1, 1 ] +//! [15] 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/qstring.h b/src/corelib/tools/qstring.h index f54ac0f277..a12946e23c 100644 --- a/src/corelib/tools/qstring.h +++ b/src/corelib/tools/qstring.h @@ -159,8 +159,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; \ }()) \ /**/ |