update
parent
a447b260e7
commit
9545175445
|
@ -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()<<text;
|
||||
QClipboard *clipboard = QGuiApplication::clipboard();
|
||||
clipboard->setText(text);
|
||||
QClipboard *clipboard = QGuiApplication::clipboard();
|
||||
clipboard->setText(text);
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include <QGuiApplication>
|
||||
#include <QClipboard>
|
||||
#include <QByteArray>
|
||||
#include <QFile>
|
||||
#include "stdafx.h"
|
||||
|
||||
class ChatController : public QObject
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue