Old post, but I am having problems with QTextEdit. I looked into QTextDocument::drawContents, but all that ever draws is the text. Where is the cursor???

Qt Code:
  1. void TextEdit::paintEvent(QPaintEvent *e)
  2. {
  3. QPainter painter(viewport());
  4. document()->drawContents(&painter,viewport()->rect());
  5. }
To copy to clipboard, switch view to plain text mode