mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
refact1
This commit is contained in:
50
LibInstructorsAndTrainees/messanger/msgwidget.h
Normal file
50
LibInstructorsAndTrainees/messanger/msgwidget.h
Normal file
@@ -0,0 +1,50 @@
|
||||
#ifndef MSGWIDGET_H
|
||||
#define MSGWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
namespace Ui {
|
||||
class MsgWidget;
|
||||
}
|
||||
|
||||
//Виджет одного сообщения для/от клиента
|
||||
|
||||
class MsgWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum DirectionMsg
|
||||
{
|
||||
Incoming, //Входящее
|
||||
Outgoing //Исходящее
|
||||
};
|
||||
enum AligneAvatar
|
||||
{
|
||||
Left,
|
||||
Right
|
||||
};
|
||||
|
||||
public:
|
||||
explicit MsgWidget(QString avatar, AligneAvatar aligneAvatar, int width, QWidget *parent = nullptr);
|
||||
~MsgWidget();
|
||||
|
||||
void setText(QString text);
|
||||
void setTime(QString timeStr);
|
||||
void setName(QString name);
|
||||
|
||||
private:
|
||||
void setAligneAvatarLeft();
|
||||
void setAligneAvatarRight();
|
||||
void setAvatar(QString avatar);
|
||||
void setWidth(int width);
|
||||
|
||||
private slots:
|
||||
void on_editText_textChanged();
|
||||
|
||||
private:
|
||||
Ui::MsgWidget *ui;
|
||||
|
||||
int widthEdit;
|
||||
};
|
||||
|
||||
#endif // MSGWIDGET_H
|
||||
Reference in New Issue
Block a user