From 954517544547614895b2a8c68ff23717dea28a4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=AD=90=E6=A5=9A=5Czhuzi?= Date: Sat, 18 Mar 2023 22:52:24 +0800 Subject: [PATCH] update --- example/ChatController.cpp | 12 ++++++------ example/ChatController.h | 1 + example/page/ChatPage.qml | 28 ---------------------------- 3 files changed, 7 insertions(+), 34 deletions(-) diff --git a/example/ChatController.cpp b/example/ChatController.cpp index f38448ce..16f59d21 100644 --- a/example/ChatController.cpp +++ b/example/ChatController.cpp @@ -43,14 +43,14 @@ void ChatController::sendMessage(const QString& text){ } QJsonObject ChatController::createMessage(const QString& role,const QString& content){ - QJsonObject message; - message.insert("role",role); - message.insert("content",content); - return message; + QJsonObject message; + message.insert("role",role); + message.insert("content",content); + return message; } void ChatController::clipText(const QString& text){ qDebug()<setText(text); + QClipboard *clipboard = QGuiApplication::clipboard(); + clipboard->setText(text); } diff --git a/example/ChatController.h b/example/ChatController.h index 2dde89a9..e6781d15 100644 --- a/example/ChatController.h +++ b/example/ChatController.h @@ -10,6 +10,7 @@ #include #include #include +#include #include "stdafx.h" class ChatController : public QObject diff --git a/example/page/ChatPage.qml b/example/page/ChatPage.qml index bab04f8f..fda11a95 100644 --- a/example/page/ChatPage.qml +++ b/example/page/ChatPage.qml @@ -50,7 +50,6 @@ FluWindow { selectByMouse: true selectByKeyboard: true selectedTextColor: Qt.rgba(51,153,255,1) - textFormat:TextEdit.MarkdownText color:FluColors.Black selectionColor: { if(FluTheme.isDark){ @@ -79,13 +78,6 @@ FluWindow { margins: 10 } color: FluTheme.isDark ? Qt.rgba(39/255,39/255,39/255,1) : Qt.rgba(245/255,245/255,245/255,1) - MouseArea{ - anchors.fill: parent - acceptedButtons: Qt.RightButton - onClicked: { - menu_pannel.popup() - } - } ListView{ id:list_message anchors.fill: parent @@ -253,26 +245,6 @@ FluWindow { } } - FluMenu{ - id:menu_pannel - focus: false - FluMenuItem{ - text:"导出消息" - onClicked: { - file_dialog.open() - } - } - } - - FileDialog{ - id:file_dialog - folder: shortcuts.home - selectFolder : true - onAccepted: { - console.log("You chose: " + file_dialog.fileUrl) - } - } - function appendMessage(isMy,text){ model_message.append({isMy:isMy,text:text}) list_message.positionViewAtEnd()