Utils: Fix StringAspect TextEditDisplay

Remove the unnecessary re-setting of the text edit
content due to the undo => edit => undo => edit
connection.

Fixes: QTCREATORBUG-29688
Change-Id: I7838ed594ae3741df757fa5eb3cdd90506428be3
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Marcus Tillmanns
2023-10-04 14:31:35 +02:00
parent c50f9a9273
commit 6cd2e6de0c

View File

@@ -1229,14 +1229,19 @@ void StringAspect::addToLayout(LayoutItem &parent)
&QTextEdit::setPlaceholderText); &QTextEdit::setPlaceholderText);
connect(textEditDisplay, &QTextEdit::textChanged, this, [this, textEditDisplay]() { connect(textEditDisplay, &QTextEdit::textChanged, this, [this, textEditDisplay]() {
d->undoable.set(undoStack(), textEditDisplay->toPlainText()); if (textEditDisplay->toPlainText() != d->undoable.get()) {
handleGuiChanged(); d->undoable.set(undoStack(), textEditDisplay->toPlainText());
handleGuiChanged();
}
}); });
connect(&d->undoable.m_signal, connect(&d->undoable.m_signal,
&UndoSignaller::changed, &UndoSignaller::changed,
textEditDisplay, textEditDisplay,
[this, textEditDisplay] { textEditDisplay->setText(d->undoable.get()); }); [this, textEditDisplay] {
if (textEditDisplay->toPlainText() != d->undoable.get())
textEditDisplay->setText(d->undoable.get());
});
break; break;
} }
case LabelDisplay: { case LabelDisplay: {