I have a QTextEdit control. It has a maximum limit (maximum number of characters it can hold). To implement this I have connected a slot to the textChanged() signal which removes the extra character when the total number of characters exceeds the allowed maximum.
With this I have some problems dealing with the cursor position. Can anyone tell me how to retain the cursor position in QTextEdit?
QTextCursor cursor = ui->textEdit->textCursor(); ui->textEdit->setTextCursor( cursor );
what is the point of writing the above two line ? Its only getting the cursor position and setting it . – asitdhal Jun 19 '13 at 08:50