Ground-Truthing GUI  1.0
removeconfirmationwindow.h
1 
22 #ifndef REMOVEICONPICTURE
23 #define REMOVEICONPICTURE
24 
25 #include <QGraphicsScene>
26 #include <QWidget>
27 #include <QtextEdit>
28 #include <QLineEdit>
29 #include <QVBoxLayout>
30 #include <QPushButton>
31 #include <QObject>
32 #include <QLabel>
33 
34 #include "rectangledraw.h"
35 
36 class RemoveConfirmationWindow:public QWidget{
37  Q_OBJECT
38 
39 private:
40 
41  // The rectangle which is going to be deleted
42  RectangleDraw *rectangleDraw;
43 
44  // The application scene where the rectangle is drawn
45  QGraphicsScene *graphicScene;
46 
47  // The list containing all the rectangles drawn in the scene
48  QList<RectangleDraw*> *list;
49 
50  // Create a push button
51  QPushButton* push_delete;
52 
53  // Create a push button
54  QPushButton* push_noDelete;
55 
56  // Create a horizontal layout containing the push button
57  QHBoxLayout *push_layout;
58 
59  // Create a vertical layout
60  QVBoxLayout* layout;
61 
62  // Create the label which is going to display the
63  QLabel *text;
64 
65 public:
66 
72  RemoveConfirmationWindow(RectangleDraw *rectangle,QGraphicsScene *scene,QList<RectangleDraw*> *list_1):rectangleDraw(rectangle),
73  graphicScene(scene),list(list_1)
74  {
75  text=new QLabel(this);
76  text->setText("Do you really want to delete rectangle number "+QString::number(rectangleDraw->getId())+" ?");
77 
78  push_delete=new QPushButton();
79  push_delete->setText("Delete the rectangle");
80  push_noDelete=new QPushButton();
81  push_noDelete->setText("Do not delete the rectangle");
82 
83  layout=new QVBoxLayout(this);
84  push_layout=new QHBoxLayout();
85 
86  push_layout->addWidget(push_delete);
87  push_layout->addWidget(push_noDelete);
88 
89  layout->addWidget(text);
90  layout->addLayout(push_layout);
91 
92  this->setWindowTitle("Delete Rectangle "+QString::number(rectangle->getId()));
93  this->show();
94 
95  QObject::connect(push_delete,SIGNAL(clicked()),this,SLOT(push_delete_Clicked()));
96  QObject::connect(push_noDelete,SIGNAL(clicked()),this,SLOT(push_noDelete_Clicked()));
97 
98  }
99 
100 private slots:
101 
105  void push_delete_Clicked();
106 
110  void push_noDelete_Clicked();
111 };
112 
113 #endif // REMOVEICONPICTURE
114 
The window asking for the user confirmation when he wants to delete a rectangle.
Definition: removeconfirmationwindow.h:36
virtual int getId() const
Returns the rectangle ID.
Definition: rectangledraw.cpp:5
Describes a rectangle drawn by the user.
Definition: rectangledraw.h:34
RemoveConfirmationWindow(RectangleDraw *rectangle, QGraphicsScene *scene, QList< RectangleDraw * > *list_1)
The constructor of the RemoveConfirmationWindow class.
Definition: removeconfirmationwindow.h:72