Advertisement
Guest User

Untitled

a guest
Nov 11th, 2017
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void Dialog::on_buttonBox_accepted()my first attempt so I could get the result n Mainwindow.cpp but it could be incorrect
  2. {
  3.      Cities.clear();
  4.      for(int row = 0; row<ui->tableWidget->rowCount(); row++)
  5.      {
  6.          cities s(get_city(row),get_time(row,3),get_time(row,4));
  7.          Cities.push_back(s);
  8.      }
  9. }
  10.  
  11. void Dialog::on_pushButton_clicked()// my attempt to make another button but I could not get a result in Mainwindow.cpp but could check correctly
  12. {
  13.     if(cities_is_filled())
  14.     {
  15.         Cities.clear();
  16.         for(int row = 0; row<ui->tableWidget->rowCount(); row++)
  17.         {
  18.             cities s(get_city(row),get_time(row,3),get_time(row,4));
  19.             Cities.push_back(s);
  20.         }
  21.     }
  22. }
  23.  
  24. //GET RESULT
  25. void MainWindow::on_actionAdd_train_triggered()
  26. {
  27.     Dialog e;
  28.     if(e.exec())
  29.     {
  30.        for(auto City: e.Cities)
  31.        {
  32.            ui->textBrowser->append(City.city_+ " " + City.depart_+ " " +City.leave_);
  33.        }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement