k-observer/K-observer_client_qt/mainwindow.cpp
2013-01-19 21:55:39 +00:00

36 lines
668 B
C++

#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QtWebKit>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::closeEvent(QCloseEvent *event)
{
if (ObserverClientModel->Connected)
{
ObserverClientModel->Finish();
}
event->accept();
}
void MainWindow::OpenMap()
{
QUrl url("C:/Workplace/Projects/k_observer/K-observer_client_qt/script.html");
ui->webView->settings()->setAttribute(QWebSettings::JavascriptEnabled, true);
ui->webView->load(url);
}