Commit 039568ec authored by Yann Boucher's avatar Yann Boucher
Browse files

Solved a bug with Neighborhooddialog

parent 628369b6
Pipeline #79803 passed with stages
in 16 seconds
...@@ -52,7 +52,6 @@ private: ...@@ -52,7 +52,6 @@ private:
QWidget* current_widget(); QWidget* current_widget();
void push_array_widget(const Property& prop); void push_array_widget(const Property& prop);
QWidget *pop_widget(); QWidget *pop_widget();
NeighborhoodDialog* neighborhoodDialog;
private: private:
void visit(StringProperty& str); void visit(StringProperty& str);
......
...@@ -202,15 +202,15 @@ void UIBuilderVisitor::visit(PropertyList &list) ...@@ -202,15 +202,15 @@ void UIBuilderVisitor::visit(PropertyList &list)
add_button->setEnabled(true); add_button->setEnabled(true);
} }
}); });
QObject::connect(widgetGridNeighborhoodButton, &QPushButton::pressed, [this, &list, list_widget]() { QObject::connect(widgetGridNeighborhoodButton, &QPushButton::pressed, [&list, list_widget]() {
Neighborhood currentNeighborhood = list.to_neighborhood(); Neighborhood currentNeighborhood = list.to_neighborhood();
neighborhoodDialog = new NeighborhoodDialog(currentNeighborhood); NeighborhoodDialog neighborhoodDialog(currentNeighborhood);
if( neighborhoodDialog->exec() ) { if( neighborhoodDialog.exec() ) {
//std::cout << "sacreubleu" << endl; //std::cout << "sacreubleu" << endl;
fflush(stdout); fflush(stdout);
list.clear(); list.clear();
Neighborhood* newNeighborhood = neighborhoodDialog->getNeighborhood(); Neighborhood* newNeighborhood = neighborhoodDialog.getNeighborhood();
list.load_from_neighborhood(*newNeighborhood); list.load_from_neighborhood(*newNeighborhood);
delete newNeighborhood; delete newNeighborhood;
UIBuilderVisitor visit(list_widget); UIBuilderVisitor visit(list_widget);
......
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