No Description

mainwindow.cpp 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. // solo se esta escondiendo las barras de herramientas para tener una mayor area para dibujar.
  18. QList<QToolBar *> toolbars = this->findChildren<QToolBar *>();
  19. foreach(QToolBar *t, toolbars) t->hide();
  20. QList<QStatusBar *> statusbars = this->findChildren<QStatusBar *>();
  21. foreach(QStatusBar *t, statusbars) t->hide();
  22. resize(myMap->width(), myMap->height());
  23. }
  24. void MainWindow::drawPoints(GISPOI* gisLocations, unsigned int size) {
  25. myMap->drawPoints(gisLocations, size);
  26. }
  27. void MainWindow::drawLine(const GISPOI &poi01, const GISPOI &poi02) {
  28. myMap->drawLine(poi01, poi02);
  29. }
  30. MainWindow::~MainWindow() {
  31. delete ui;
  32. if (myMap != NULL) delete myMap;
  33. }