mirror of
https://gitee.com/Zhaoxin59/my-chat_-client.git
synced 2026-02-13 16:41:48 +08:00
57 lines
1.3 KiB
C++
57 lines
1.3 KiB
C++
#ifndef MESSAGEEDITAREA_H
|
|
#define MESSAGEEDITAREA_H
|
|
|
|
#include <QWidget>
|
|
#include <QPushButton>
|
|
#include <QPlainTextEdit>
|
|
#include <QVBoxLayout>
|
|
#include <QHBoxLayout>
|
|
#include <QScrollBar>
|
|
//#include <QGraphicsDropShadowEffect>
|
|
//#include <qpropertyanimation.h>
|
|
//#include <QEvent>
|
|
|
|
#include "historymessagewidget.h"
|
|
#include "model/data.h"
|
|
|
|
using namespace model;
|
|
|
|
//编辑消息的区域
|
|
class MessageEditArea : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit MessageEditArea(QWidget *parent = nullptr);
|
|
|
|
void initSignalSlot();
|
|
void sendTextMessage();
|
|
void addSelfMessage(MessageType messageType, const QByteArray& content, const QString& extraInfo);
|
|
void addOtherMessage(const model::Message& message);
|
|
//花式按钮事件
|
|
//bool eventFilter(QObject* obj, QEvent* event) override;
|
|
|
|
void clickSendImageBtn();
|
|
void clickSendFileBtn();
|
|
|
|
void soundRecordPressed();
|
|
void soundRecordReleased();
|
|
|
|
void soundSpeech(const QString& path);
|
|
private:
|
|
QPushButton* sendImageBtn;
|
|
QPushButton* sendFileBtn;
|
|
QPushButton* sendSpeechBtn;
|
|
QPushButton* showHistoryBtn;
|
|
QPlainTextEdit* textEdit;
|
|
QPushButton* sendTextButton;
|
|
QLabel* tipLabel;
|
|
|
|
//花式按钮
|
|
//QGraphicsDropShadowEffect* shadowEffect;
|
|
|
|
|
|
signals:
|
|
};
|
|
|
|
#endif // MESSAGEEDITAREA_H
|