Qt Code:
  1. QBitArray ba(10);
  2. ba.setBit(5, true);
  3. ba.setBit(7, true);
  4.  
  5. QString text;
  6. for (int i = 0; i < ba.size(); ++i)
  7. text += ba.testBit(i) ? "1": "0";
  8. qDebug() << text;
To copy to clipboard, switch view to plain text mode 
You might like to reverse bit order.

If you are manipulating a small number of bits then direct use of an unsigned int is also a possibility.
Qt Code:
  1. unsigned int bitmap = 0;
  2. bitmap |= 1 << 5;
  3. bitmap |= 1 << 7;
  4. qDebug() << QString::number(bitmap, 2);
To copy to clipboard, switch view to plain text mode