Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

QLineEdit::textEdited() equivalent in QTextEdit?

In QLineEdit, there is a textEdit() signal, which only emits if the user changes the text, but not when you call setText(),

So what's the equivalent in QTextEdit? I only see a textChanged() signal, and the documentation states it is emitted whenever the text document changes.

EDIT

I want to implement an auto-save feature, with a QTimer of course,

So when you start editing the document, the timer starts, and when timed out, I save the text inside the widget.

like image 676
daisy Avatar asked Jan 26 '13 08:01

daisy


1 Answers

You can block signals of the QTextEdit widget whenever you insert/modify the contents yourself, and then release the block when you're done. By doing that the signal will only be emitted when the user makes changes to the contents.

bool QObject::blockSignals(bool block)
like image 145
Daniel Hedberg Avatar answered Nov 17 '22 05:11

Daniel Hedberg