forked from UAVGCSTeam/GCS
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmainwindow.cpp
More file actions
35 lines (29 loc) · 1.16 KB
/
mainwindow.cpp
File metadata and controls
35 lines (29 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "mainwindow.h"
#include "./ui_mainwindow.h"
#include <QDebug>
#include <QProcess>
#include <QCoreApplication>
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
, pythonProcess(nullptr)
{
ui->setupUi(this);
ui->quickWidget_MapView->setSource(QUrl(QStringLiteral("qrc:/main.qml")));
// Reference to the rootObject of quickWidget_MapView which is our map
auto Obje = ui->quickWidget_MapView->rootObject();
// When setCenterPosition is emitted from the current object, the setCenterPosition method in Obje will be called with the same parameters
connect(this, SIGNAL(setCenterPosition(QVariant,QVariant)), Obje, SLOT(setCenterPosition(QVariant,QVariant)));
connect(this, SIGNAL(setLocationMarking(QVariant,QVariant)), Obje, SLOT(setLocationMarking(QVariant,QVariant)));
}
MainWindow::~MainWindow()
{
// Terminate the Python process
if (pythonProcess && pythonProcess->state() == QProcess::Running) {
pythonProcess->terminate();
if (!pythonProcess->waitForFinished(3000)) {
pythonProcess->kill();
}
}
delete ui;
}