Block edit events from happening during typeahead computation
This commit is contained in:
+7
-1
@@ -6321,13 +6321,19 @@ bool MainWindow::prepareNextMessageFrame()
|
|||||||
|
|
||||||
// typeahead
|
// typeahead
|
||||||
if(ui->extFreeTextMsgEdit->isDirty() && !ui->extFreeTextMsgEdit->isEmpty()){
|
if(ui->extFreeTextMsgEdit->isDirty() && !ui->extFreeTextMsgEdit->isEmpty()){
|
||||||
|
// block edit events while computing next frame
|
||||||
|
QString newText;
|
||||||
|
ui->extFreeTextMsgEdit->setReadOnly(true);
|
||||||
|
{
|
||||||
auto sent = ui->extFreeTextMsgEdit->sentText();
|
auto sent = ui->extFreeTextMsgEdit->sentText();
|
||||||
auto unsent = ui->extFreeTextMsgEdit->unsentText();
|
auto unsent = ui->extFreeTextMsgEdit->unsentText();
|
||||||
qDebug() << "text dirty for typeahead\n" << sent << "\n" << unsent;
|
qDebug() << "text dirty for typeahead\n" << sent << "\n" << unsent;
|
||||||
m_txFrameQueue.clear();
|
m_txFrameQueue.clear();
|
||||||
m_txFrameCount = 0;
|
m_txFrameCount = 0;
|
||||||
auto newText = appendMessage(unsent);
|
newText = appendMessage(unsent);
|
||||||
qDebug () << "unsent replaced to" << "\n" << newText;
|
qDebug () << "unsent replaced to" << "\n" << newText;
|
||||||
|
}
|
||||||
|
ui->extFreeTextMsgEdit->setReadOnly(false);
|
||||||
ui->extFreeTextMsgEdit->replaceUnsentText(newText);
|
ui->extFreeTextMsgEdit->replaceUnsentText(newText);
|
||||||
ui->extFreeTextMsgEdit->setClean();
|
ui->extFreeTextMsgEdit->setClean();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user