I want to count the total characters with spaces and total characters without spaces in textEdit. I understand that there's a length property in qt.
Wouldn't you just invoke toPlainText on the QTextEdit control and use the returned QString to get the length and character counts you need?