I do this to increase the indent of a selection of lines in a plainTextEdit, but nothing happens:
Qt Code:
  1. QTextCursor cur = plainEdit->textCursor(); // contains the selection
  2. QTextBlockFormat tbf = cur.blockFormat(); //selection format
  3. tbf.setIndent(10); // change indent
  4. cur.setBlockFormat(tbf); // put it all back
  5. plainEdit->setTextCursor(cur);
To copy to clipboard, switch view to plain text mode 
wordwrap is off so a block is a line. This doesn't work, somebody has some pointers? thanks