In QTextEdit the only option is to manually store the text to be hidden somewhere and delete it from textEdit. When you want to show it, paste it back.
For example:

Qt Code:
  1. bool QObject::setProperty(const char * name, const QVariant & value)
  2. QVariant QObject::property(const char * name) const
To copy to clipboard, switch view to plain text mode