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 ChatController::createMessage(const QString& role,const QString& content){
|
||||||
QJsonObject message;
|
QJsonObject message;
|
||||||
message.insert("role",role);
|
message.insert("role",role);
|
||||||
message.insert("content",content);
|
message.insert("content",content);
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatController::clipText(const QString& text){
|
void ChatController::clipText(const QString& text){
|
||||||
qDebug()<<text;
|
qDebug()<<text;
|
||||||
QClipboard *clipboard = QGuiApplication::clipboard();
|
QClipboard *clipboard = QGuiApplication::clipboard();
|
||||||
clipboard->setText(text);
|
clipboard->setText(text);
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include <QGuiApplication>
|
#include <QGuiApplication>
|
||||||
#include <QClipboard>
|
#include <QClipboard>
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
|
#include <QFile>
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
|
|
||||||
class ChatController : public QObject
|
class ChatController : public QObject
|
||||||
|
|
|
@ -50,7 +50,6 @@ FluWindow {
|
||||||
selectByMouse: true
|
selectByMouse: true
|
||||||
selectByKeyboard: true
|
selectByKeyboard: true
|
||||||
selectedTextColor: Qt.rgba(51,153,255,1)
|
selectedTextColor: Qt.rgba(51,153,255,1)
|
||||||
textFormat:TextEdit.MarkdownText
|
|
||||||
color:FluColors.Black
|
color:FluColors.Black
|
||||||
selectionColor: {
|
selectionColor: {
|
||||||
if(FluTheme.isDark){
|
if(FluTheme.isDark){
|
||||||
|
@ -79,13 +78,6 @@ FluWindow {
|
||||||
margins: 10
|
margins: 10
|
||||||
}
|
}
|
||||||
color: FluTheme.isDark ? Qt.rgba(39/255,39/255,39/255,1) : Qt.rgba(245/255,245/255,245/255,1)
|
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{
|
ListView{
|
||||||
id:list_message
|
id:list_message
|
||||||
anchors.fill: parent
|
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){
|
function appendMessage(isMy,text){
|
||||||
model_message.append({isMy:isMy,text:text})
|
model_message.append({isMy:isMy,text:text})
|
||||||
list_message.positionViewAtEnd()
|
list_message.positionViewAtEnd()
|
||||||
|
|
Loading…
Reference in New Issue