mainwindow.cpp 661 B

1234567891011121314151617181920212223242526272829303132
  1. #include "mainwindow.h"
  2. #include "ui_mainwindow.h"
  3. MainWindow::MainWindow(QWidget *parent) :
  4. QMainWindow(parent),
  5. ui(new Ui::MainWindow)
  6. {
  7. ui->setupUi(this);
  8. thread = new SegmentUpdate();
  9. thread->setMethod(UpdateBaseInfo);
  10. connect(thread,SIGNAL(updateFinished()),this,SLOT(killme()));
  11. thread->start();
  12. }
  13. MainWindow::~MainWindow()
  14. {
  15. delete ui;
  16. //QFile::remove("baseSeg.csv");
  17. //QFile::remove("dynamicSeg.csv");
  18. }
  19. void MainWindow::killme()
  20. {
  21. thread->abort();
  22. thread->wait();
  23. delete thread;
  24. this->close();
  25. }
  26. void MainWindow::closeEvent(QCloseEvent *event)
  27. {
  28. return ;
  29. }