Results 1 to 2 of 2

Thread: modificationChanged() signal will not emit after QTextEdit::setAlignment() called

  1. #1
    Join Date
    Sep 2009
    Location
    Nanjing, China
    Posts
    46
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default modificationChanged() signal will not emit after QTextEdit::setAlignment() called

    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?

  2. #2
    Join Date
    Sep 2009
    Location
    Nanjing, China
    Posts
    46
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: modificationChanged() signal will not emit after QTextEdit::setAlignment() called

    I have found a solution at http://developer.qt.nokia.com/forums/viewthread/2311/, good luck!

Similar Threads

  1. Emit signal from thread
    By sisco in forum Newbie
    Replies: 2
    Last Post: 26th November 2009, 14:32
  2. signal doesnt emit
    By mark2804 in forum Newbie
    Replies: 2
    Last Post: 25th December 2008, 23:36
  3. how to know which button emit the signal?
    By coder1985 in forum Qt Programming
    Replies: 2
    Last Post: 12th January 2008, 15:26
  4. Replies: 1
    Last Post: 16th February 2007, 08:22
  5. emit a signal
    By Morea in forum Qt Programming
    Replies: 2
    Last Post: 27th February 2006, 12:14

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.