How do I get QTextEdit to always be aligned the way I want? I can change it just fine with this:

Qt Code:
  1. textEdit->setAlignment(Qt::AlignJustify);
To copy to clipboard, switch view to plain text mode 

I can call this before text is entered into the text edit and it will remain aligned as long as the user edits the text, but if the user pastes texts with multiple blocks or I programmaticaly set the text, the formating is lost. I understand that is how the code snip it above works, but is there a better way, that would make it stick> Otherwise, I'll just have catch contentsChanged signals and reapply the formating each time.