Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.3.0
-
None
Description
The documentation for QBitArray::fill states:
Sets bits at index positions begin up to and excluding end to value.
begin and end must be a valid index position in the bit array (i.e., 0 <= begin <= size() and 0 <= end <= size()).
However, this is not entirely correct. Since this method excludes the end value, to set the last bit in the array end must be set to size(). begin is restricted to 0 <= begin <= size(), but end is restricted to 0 <= end < size().
For example:
QBitArray a(4); a.fill(true, 1, 2); // a: [ 0, 1, 0, 0 ] a.fill(true, 1, 3); // a: [ 0, 1, 1, 0 ] a.fill(true, 1, 4); // a: [ 0, 1, 1, 1 ]