-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainwidget.h
58 lines (47 loc) · 1.78 KB
/
mainwidget.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef MAINWIDGET_H
#define MAINWIDGET_H
#include <QWidget>
#include <QPushButton>
#include "chatbox.h"
#include "addbutton.h"
#include "serialize.h"
#include "chatlabel.h"
#include <QGridLayout>
#include <QHBoxLayout>
#include <QVBoxLayout>
/**
* @brief Main Wigget class is a simulation for Qt's standard QMainWindow with some small differencies.
*
* Actually normal widget class used instead of Qt's Mainwindow class as features in QMainwindow were not needed.
* This class is as well responsible of establishing Main window of the program containing all widgets and layouts.
* And under the hood this class is grand parent class for all others class below so it can take care of memory management in Qt way.
* This class also partially implements Model View Controller design pattern by defining a \ref controller() method taking care of children widget's
* affairs including their initiliziation calls via respective init method of each.
*
*/
class Widget : public QWidget
{
Q_OBJECT
public:
Widget(QWidget *parent = nullptr);
~Widget();
signals:
void labelObjectDeleteRequest(int labelkey);
void labelObjectEditRequest(ChatLabel* choice, int labelkey);
void chatLabelObjectConstructed(ChatLabel* m_chatLabel, int key);
public slots:
void controller(QByteArray* input,int keycouter);
void deleteLabel(ChatLabel* choice, int labelkey);
void editLabel(ChatLabel* choice, int labelkey);
protected slots:
private:
serialize* m_serializer;
QVBoxLayout *mainLayout;
QHBoxLayout *inputBox;
QWidget* displayWidget;
Mainchatbox* m_chatbox; //main text field to read user input via QLineEdit
addButton* m_add; //main add button
ChatLabel* m_label; //labels
QMap <QString,ChatLabel> *lebelsParentClassList;
};
#endif // WIDGET_H