🛰️航天仿真算法库 SpaceAST 0.0.1
载入中...
搜索中...
未找到
UiChatInput.hpp
浏览该文件的文档.
1
12
13#pragma once
14
15#include "AstGlobal.h"
16#include <QWidget>
17
18class QTextEdit;
19class QPushButton;
20
21AST_NAMESPACE_BEGIN
22
29class AST_UIAI_API UiChatInput : public QWidget
30{
31 Q_OBJECT
32
33public:
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
52Q_SIGNALS:
54 void sendMessage(const QString& message);
55
58
59private Q_SLOTS:
60 void onSendClicked();
61 void onTextChanged();
62
63private:
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
74AST_NAMESPACE_END
聊天输入区域部件
定义 UiChatInput.hpp:30
void sendMessage(const QString &message)
用户点击发送
void stopRequested()
用户点击停止