diff --git a/src/plugins/codegeex/widgets/askpagewidget.cpp b/src/plugins/codegeex/widgets/askpagewidget.cpp index fe5366387..ecc249f92 100644 --- a/src/plugins/codegeex/widgets/askpagewidget.cpp +++ b/src/plugins/codegeex/widgets/askpagewidget.cpp @@ -60,10 +60,12 @@ void AskPageWidget::onMessageUpdate(const MessageData &msgData) msgComponents.value(msgData.messageID())->updateMessage(msgData); } - if (scrollArea->verticalScrollBar()->isVisible()) { - int maxValue = scrollArea->verticalScrollBar()->maximum(); - scrollArea->verticalScrollBar()->setValue(maxValue); - } + QTimer::singleShot(100, [this](){ + if (scrollArea->verticalScrollBar()->isVisible()) { + int maxValue = scrollArea->verticalScrollBar()->maximum(); + scrollArea->verticalScrollBar()->setValue(maxValue); + } + }); } void AskPageWidget::onSendBtnClicked()