diff --git a/gpt4all-chat/chatmodel.h b/gpt4all-chat/chatmodel.h index fa4f5506..9313dff6 100644 --- a/gpt4all-chat/chatmodel.h +++ b/gpt4all-chat/chatmodel.h @@ -188,6 +188,11 @@ public: } } + Q_INVOKABLE void forceUpdate(int index) + { + emit dataChanged(createIndex(index, 0), createIndex(index, 0), {ValueRole}); + } + Q_INVOKABLE void updateValue(int index, const QString &value) { if (index < 0 || index >= m_chatItems.size()) return; diff --git a/gpt4all-chat/qml/ChatView.qml b/gpt4all-chat/qml/ChatView.qml index bcc9ccc5..c47b537a 100644 --- a/gpt4all-chat/qml/ChatView.qml +++ b/gpt4all-chat/qml/ChatView.qml @@ -966,7 +966,7 @@ Rectangle { textProcessor.codeColors.headerColor = theme.codeHeaderColor textProcessor.codeColors.backgroundColor = theme.codeBackgroundColor textProcessor.textDocument = textDocument - myTextArea.text = value + chatModel.forceUpdate(index); // called to trigger a reprocessing of the text } Component.onCompleted: {