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().