🛰️航天仿真算法库 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
38 void setSendEnabled(bool enabled);
39
41 void clear();
42
44 void setInputFocus();
45
47 void setPlaceholderText(const QString& text);
48
49Q_SIGNALS:
51 void sendMessage(const QString& message);
52
55
56private Q_SLOTS:
57 void onSendClicked();
58 void onTextChanged();
59
60private:
61 void setupUi();
62 bool eventFilter(QObject* obj, QEvent* event) override;
63
64 QTextEdit* textEdit_ = nullptr;
65 QPushButton* sendButton_ = nullptr;
66 QPushButton* stopButton_ = nullptr;
67};
68
71AST_NAMESPACE_END
聊天输入区域部件
定义 UiChatInput.hpp:30
void sendMessage(const QString &message)
用户点击发送
void stopRequested()
用户点击停止