forked from askubis/RESpecTa
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsubtaskWidget.h
89 lines (79 loc) · 1.86 KB
/
subtaskWidget.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
class SubtaskWidget;
#ifndef SUBTASKWIDGET_H
#define SUBTASKWIDGET_H
#include <QLineEdit>
#include <QWidget>
#include "Model.h"
QT_BEGIN_NAMESPACE
class QWidget;
QT_END_NAMESPACE
/**
* Widget responsible for editing, creating and deleting tasks.
*/
class SubtaskWidget : public QWidget
{
Q_OBJECT
public:
SubtaskWidget(QWidget * parent, Model * mod);
/**
* Downloads list of tasks from the model.
*/
void refreshData();
signals:
/**
* Signals that a new task should be added.
*/
void added(QString);
/**
* Signals, that the selected task should be removed.
*/
void removed(QString);
/**
* Signals, that a name should be changed
*/
void changed(QString oldName, QString newName);
/**
* Signals to parent Widget, that an error has occured.
*/
void reportError(QString);
private slots:
void CleanClicked();
/**
* Slot after clicking Add button, signals with added SIGNAL.
*/
void AddClicked();
/**
* Slot after clicking Change Name button, signals with changed SIGNAL.
*/
void ChangeClicked();
/**
* Slot after clicking Delete button, signals with removed SIGNAL.
*/
void DeleteClicked();
/**
* Disables or enables Add/Change buttons depending on newString.size().
*/
void LengthChanged(QString newString);
private:
/**
* Pointer to the model representing the project.
*/
Model * model;
/**
* List of subtasks in the project.
*/
QListWidget * subtaskList;
/**
* Line allowing to create new name for task.
*/
QLineEdit * nameEdit;
/**
* Button allowing to change name of a subtask.
*/
QPushButton * changeNameButton;
/**
* Button allowing to add new subtask to the project.
*/
QPushButton * AddButton;
};
#endif // SUBTASKWIDGET_H