Sin descripción

mainwindow.cpp 995B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #include "mainwindow.h"
  2. #include "ui_mainwindow.h"
  3. #include <QDebug>
  4. #include <country.h>
  5. #include <gispoi.h>
  6. using namespace std;
  7. Country PR;
  8. MainWindow::MainWindow(QWidget *parent) :
  9. QMainWindow(parent),
  10. ui(new Ui::MainWindow)
  11. {
  12. srand(time(NULL));
  13. myMap = new Map(this);
  14. myMap->show();
  15. ui->setupUi(this);
  16. // just hidding the toolbars to have a bigger drawing area.
  17. QList<QToolBar *> toolbars = this->findChildren<QToolBar *>();
  18. foreach(QToolBar *t, toolbars) t->hide();
  19. QList<QStatusBar *> statusbars = this->findChildren<QStatusBar *>();
  20. foreach(QStatusBar *t, statusbars) t->hide();
  21. resize(myMap->width(), myMap->height());
  22. }
  23. void MainWindow::drawPoints(GISPOI* gisLocations, unsigned int size) {
  24. myMap->drawPoints(gisLocations, size);
  25. }
  26. void MainWindow::drawLine(const GISPOI &poi01, const GISPOI &poi02) {
  27. myMap->drawLine(poi01, poi02);
  28. }
  29. MainWindow::~MainWindow() {
  30. delete ui;
  31. if (myMap != NULL) delete myMap;
  32. }