25 #ifndef RECTANGLEWINDOW 26 #define RECTANGLEWINDOW 30 #include <QVBoxLayout> 31 #include <QPushButton> 36 #include "rectangledraw.h" 38 #include "filewriter.h" 39 #include "addiconpicture.h" 40 #include "filereader.h" 55 QLineEdit *lineEdit_word;
58 QLineEdit *lineEdit_line;
64 QHBoxLayout *id_layout;
67 QHBoxLayout *line_layout;
70 QHBoxLayout *word_layout;
73 QHBoxLayout *annotation_layout;
76 QHBoxLayout *push_layout;
82 QLabel *id_label_show;
94 QLabel *annotation_label;
100 QGraphicsScene *scene;
116 filewriter(filewriter_1),scene(scene_1)
118 textEdit=
new QTextEdit();
119 textEdit->setMaximumSize(100,50);
121 lineEdit_word=
new QLineEdit();
122 lineEdit_line=
new QLineEdit();
123 lineEdit_word->setMaximumSize(100,20);
126 lineEdit_line->setMaximumSize(100,20);
129 line_label=
new QLabel(
this);
130 line_label->setText(
"Line Number:");
131 word_label=
new QLabel(
this);
132 word_label->setText(
"Word Number:");
134 id_label_show=
new QLabel(
this);
135 id_label_show->setAlignment(Qt::AlignLeft);
136 id_text=
new QLabel(
this);
137 id_text->setText(
"Id:");
139 annotation_label=
new QLabel();
140 annotation_label->setText(
"Comments:");
142 push=
new QPushButton();
143 push->setText(
"Add Note");
145 layout=
new QVBoxLayout(
this);
146 id_layout=
new QHBoxLayout();
147 line_layout=
new QHBoxLayout();
148 word_layout=
new QHBoxLayout();
149 annotation_layout=
new QHBoxLayout();
150 push_layout=
new QHBoxLayout();
152 id_label_show->setNum(rectangle->
getId());
154 id_layout->addWidget(id_text);
155 id_layout->addWidget(id_label_show);
156 line_layout->addWidget(line_label);
157 line_layout->addWidget(lineEdit_line);
158 word_layout->addWidget(word_label);
159 word_layout->addWidget(lineEdit_word);
160 annotation_layout->addWidget(annotation_label);
161 annotation_layout->addWidget(textEdit);
162 push_layout->addWidget(push);
164 layout->addLayout(id_layout);
165 layout->addLayout(line_layout);
166 layout->addLayout(word_layout);
167 layout->addLayout(annotation_layout);
168 layout->addLayout(push_layout);
170 this->setWindowTitle(
"Rectangle "+QString::number(rectangle->
getId()));
173 QObject::connect(textEdit,SIGNAL(textChanged()),
this,SLOT(textChangedSlot()));
174 QObject::connect(lineEdit_word,SIGNAL(textChanged(QString)),
this,SLOT(wordChangedSlot(QString)));
175 QObject::connect(lineEdit_line,SIGNAL(textChanged(QString)),
this,SLOT(lineChangedSlot(QString)));
176 QObject::connect(push,SIGNAL(clicked()),
this, SLOT(quit()));
189 void textChangedSlot();
194 void wordChangedSlot(QString word);
199 void lineChangedSlot(QString line);
202 #endif // RECTANGLEWINDOW virtual QString getWordNumber() const
Returns the word number inserted by the user.
Definition: rectangledraw.cpp:51
RectangleWindow(RectangleDraw *rectangle_1, FileWriter *filewriter_1, QGraphicsScene *scene_1)
The constructor of the RectangleWindow class.
Definition: rectanglewindow.h:115
virtual QString getLineNumber() const
Returns the line number inserted by the user.
Definition: rectangledraw.cpp:26
Adds an icon at the top-left corner of a rectangle.
Definition: addiconpicture.h:34
virtual int getId() const
Returns the rectangle ID.
Definition: rectangledraw.cpp:5
Write in a text file.
Definition: filewriter.h:28
The annotation window.
Definition: rectanglewindow.h:42
Describes a rectangle drawn by the user.
Definition: rectangledraw.h:34
virtual QString getAnnotation() const
Returns the comment inserted by the user.
Definition: rectangledraw.cpp:36