Commit 47462bca authored by Tao Zhong's avatar Tao Zhong

Show properties in widget #133 Update goal file format

* x_min
* x_max
* y_min
* y_max
parent 29309c40
Pipeline #19657 passed with stages
in 24 seconds
......@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>200</width>
<height>400</height>
<height>500</height>
</rect>
</property>
<property name="sizePolicy">
......@@ -31,7 +31,7 @@
<x>10</x>
<y>0</y>
<width>181</width>
<height>381</height>
<height>491</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
......@@ -97,7 +97,35 @@
<item>
<widget class="QLabel" name="finalLabel">
<property name="text">
<string>final:</string>
<string>Final:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="xminLabel">
<property name="text">
<string>X Min</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="xmaxLabel">
<property name="text">
<string>X Max</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="yminLabel">
<property name="text">
<string>Y Min</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="ymaxLabel">
<property name="text">
<string>Y Max</string>
</property>
</widget>
</item>
......@@ -114,6 +142,18 @@
<item>
<widget class="QLineEdit" name="finalLineEdit"/>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_XMin"/>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_XMax"/>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_YMin"/>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_YMax"/>
</item>
</layout>
</item>
</layout>
......
......@@ -109,7 +109,7 @@ void GoalReader::readGoal()
xml.skipCurrentElement();
}
QRectF rect(vertexes[0], vertexes[2]);
QRectF rect(vertexes[0], vertexes[2]); //TODO: use x_min, x_max, y_min, y_max to draw the rect.
auto *rectItem = new QGraphicsRectItem;
rectItem->setRect(rect);
auto *goal = new JPSGoal(rectItem);
......
......@@ -66,11 +66,18 @@ GoalWidget::~GoalWidget()
void GoalWidget::showGoals()
{
/*
show the new added goal informations
*/
model->setGoalsList(currentView->getGoals());
ui->goalsListView->setModel(model);
ui->IDlineEdit->clear();
ui->captionLineEdit->clear();
ui->finalLineEdit->clear();
ui->lineEdit_XMin->clear();
ui->lineEdit_XMax->clear();
ui->lineEdit_YMin->clear();
ui->lineEdit_YMax->clear();
}
......@@ -83,6 +90,10 @@ void GoalWidget::showGoalInformation()
ui->IDlineEdit->setText(QString::number(goal->getId()));
ui->captionLineEdit->setText(goal->getCaption());
ui->finalLineEdit->setText(goal->getIsFinal());
ui->lineEdit_XMin->setText(goal->getXMin());
ui->lineEdit_XMax->setText(goal->getXMax());
ui->lineEdit_YMin->setText(goal->getYMin());
ui->lineEdit_YMax->setText(goal->getYMax());
if(goal->getBeSaved()=="true")
{
......@@ -107,6 +118,10 @@ void GoalWidget::applyGoalInformation()
goal->setId(ui->IDlineEdit->text().toInt());
goal->setCaption(ui->captionLineEdit->text());
goal->setIsFinal(ui->finalLineEdit->text());
goal->setXMin(ui->lineEdit_XMin->text());
goal->setXMax(ui->lineEdit_XMax->text());
goal->setYMin(ui->lineEdit_YMin->text());
goal->setYMax(ui->lineEdit_YMax->text());
if(ui->isSaveButton->isChecked())
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment