implemented undos for effect fields that aren't keyframed

This commit is contained in:
itsmattkc
2018-09-20 21:34:36 +10:00
parent 4e57b1c26d
commit b1c3f44b04
15 changed files with 122 additions and 17 deletions
+15 -1
View File
@@ -2,7 +2,10 @@
#include <QDebug>
TextEditEx::TextEditEx(QWidget *parent) : QTextEdit(parent) {}
TextEditEx::TextEditEx(QWidget *parent) : QTextEdit(parent) {
setUndoRedoEnabled(false);
connect(this, SIGNAL(textChanged()), this, SLOT(updateInternals()));
}
void TextEditEx::setPlainTextEx(const QString &text) {
blockSignals(true);
@@ -15,5 +18,16 @@ void TextEditEx::setPlainTextEx(const QString &text) {
newCursor.setPosition(pos);
setTextCursor(newCursor);
updateInternals();
blockSignals(false);
}
const QString &TextEditEx::getPreviousValue() {
return previousText;
}
void TextEditEx::updateInternals() {
previousText = text;
text = toPlainText();
}