forked from qt-creator/qt-creator
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:
@@ -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]() {
|
||||||
|
if (textEditDisplay->toPlainText() != d->undoable.get()) {
|
||||||
d->undoable.set(undoStack(), textEditDisplay->toPlainText());
|
d->undoable.set(undoStack(), textEditDisplay->toPlainText());
|
||||||
handleGuiChanged();
|
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: {
|
||||||
|
Reference in New Issue
Block a user