🛰️航天仿真算法库 SpaceAST
0.0.1
载入中...
搜索中...
未找到
UiChatInput.hpp
浏览该文件的文档.
1
12
13
#pragma once
14
15
#include "AstGlobal.h"
16
#include <QWidget>
17
18
class
QTextEdit;
19
class
QPushButton;
20
21
AST_NAMESPACE_BEGIN
22
29
class
AST_UIAI_API
UiChatInput
:
public
QWidget
30
{
31
Q_OBJECT
32
33
public
:
34
explicit
UiChatInput
(QWidget* parent =
nullptr
);
35
~UiChatInput
()
override
;
36
37
UiChatInput
(
const
UiChatInput
&) =
delete
;
38
UiChatInput
& operator=(
const
UiChatInput
&) =
delete
;
39
41
void
setSendEnabled(
bool
enabled);
42
44
void
clear();
45
47
void
setInputFocus();
48
50
void
setPlaceholderText(
const
QString& text);
51
52
Q_SIGNALS:
54
void
sendMessage
(
const
QString& message);
55
57
void
stopRequested
();
58
59
private
Q_SLOTS:
60
void
onSendClicked();
61
void
onTextChanged();
62
63
private
:
64
void
setupUi();
65
bool
eventFilter(QObject* obj, QEvent* event)
override
;
66
67
QTextEdit* textEdit_ =
nullptr
;
68
QPushButton* sendButton_ =
nullptr
;
69
QPushButton* stopButton_ =
nullptr
;
70
};
71
74
AST_NAMESPACE_END
ast::UiChatInput
聊天输入区域部件
定义
UiChatInput.hpp:30
ast::UiChatInput::sendMessage
void sendMessage(const QString &message)
用户点击发送
ast::UiChatInput::stopRequested
void stopRequested()
用户点击停止
src
AstUiAI
Chat
UiChatInput.hpp
制作者
1.12.0