Hi, there! I wonder if you have found this problem. After I called
QTextEdit::setAlignment(Qt::AlignJustify), the textEdit->document()'s
modificationChanged(bool) will not be emitted. I've no idea if this is
my fault or something else. Here is my code:

Qt Code:
  1. MainWindow::MainWindow(QWidget *parent) :
  2. QMainWindow(parent),
  3. ui(new Ui::MainWindow)
  4. {
  5. ui->setupUi(this);
  6. setWindowTitle(tr("Text[*]"));
  7. ui->textEdit->setAlignment(Qt::AlignJustify);
  8. connect(ui->textEdit->document(), SIGNAL(modificationChanged(bool)), this, SLOT(setWindowModified(bool)));
  9. }
To copy to clipboard, switch view to plain text mode 

If I remove ui->textEdit->setAlignment(Qt::AlignJustify);, everything
is OK. But if this line is not removed, the window title will not be
changed. I think this is because the signal is not emitted. How do I solve this?