I'm using a QTextEdit for user input. For some reason I can't clear it properly, I always end up with a blank paragraph (the cursor is on the 2nd line).. I've tried every way I can think off, and nothing seems to work:
inputEdit->clear();
inputEdit->clear();
To copy to clipboard, switch view to plain text mode
inputEdit->setHtml( "" );
inputEdit->setHtml( "" );
To copy to clipboard, switch view to plain text mode
inputEdit->setPlainText( "" );
inputEdit->setPlainText( "" );
To copy to clipboard, switch view to plain text mode
cursor.removeSelectedText();
cursor.clearSelection();
inputEdit->setTextCursor( cursor );
QTextCursor cursor( inputEdit->document() );
cursor.select( QTextCursor::Document );
cursor.removeSelectedText();
cursor.clearSelection();
cursor.movePosition( QTextCursor::Start );
inputEdit->setTextCursor( cursor );
To copy to clipboard, switch view to plain text mode
None of these seem to actually clear the text edit completely, using editInput->toHtml() always shows a HTML document with a blank paragraph in it.. what am I doing wrong here?
Thanks.
Bookmarks