Guard against inputMethodEvent destroying the field.
This commit is contained in:
parent
dbcb6a35b0
commit
4ef97b57f6
1 changed files with 8 additions and 3 deletions
|
|
@ -2901,10 +2901,15 @@ void InputField::inputMethodEventInner(QInputMethodEvent *e) {
|
|||
startPlaceholderAnimation();
|
||||
}
|
||||
_inputMethodCommit = e->commitString();
|
||||
|
||||
const auto weak = Ui::MakeWeak(this);
|
||||
_inner->QTextEdit::inputMethodEvent(e);
|
||||
const auto text = *base::take(_inputMethodCommit);
|
||||
if (!processMarkdownReplaces(text)) {
|
||||
processInstantReplaces(text);
|
||||
|
||||
if (weak) {
|
||||
const auto text = *base::take(_inputMethodCommit);
|
||||
if (!processMarkdownReplaces(text)) {
|
||||
processInstantReplaces(text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue