bangqianchen
11th January 2010, 07:39
I want to know whether the user had changed the content of QTextEdit. However, this signal is also emited when formatting is applied, while the content had nothing changed in fact. both of the fellowing ways are failed, I don't know how to solve this problem! Any help is appreciated!
m_pText = new QTextEdit(this);
connect(m_pText->document(),SIGNAL(contentsChanged()),this,SLOT(slo t_setModified()));
//or this way
connect(m_pText,SIGNAL(textChanged()),this,SLOT(sl ot_setModified()));
m_pText = new QTextEdit(this);
connect(m_pText->document(),SIGNAL(contentsChanged()),this,SLOT(slo t_setModified()));
//or this way
connect(m_pText,SIGNAL(textChanged()),this,SLOT(sl ot_setModified()));