tools/drawMapTest/mainwindow.cpp
changeset 4425 2314bb0c433d
child 4426 969e411c72aa
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/drawMapTest/mainwindow.cpp	Sat Nov 27 23:57:31 2010 +0300
@@ -0,0 +1,38 @@
+#include "mainwindow.h"
+#include "ui_mainwindow.h"
+#include "drawmapscene.h"
+
+MainWindow::MainWindow(QWidget *parent) :
+    QMainWindow(parent),
+    ui(new Ui::MainWindow)
+{
+    ui->setupUi(this);
+
+    DrawMapScene * scene = new DrawMapScene(this);
+    ui->graphicsView->setScene(scene);
+}
+
+MainWindow::~MainWindow()
+{
+    delete ui;
+}
+
+void MainWindow::changeEvent(QEvent *e)
+{
+    QMainWindow::changeEvent(e);
+    switch (e->type()) {
+    case QEvent::LanguageChange:
+        ui->retranslateUi(this);
+        break;
+    default:
+        break;
+    }
+}
+
+void MainWindow::resizeEvent(QResizeEvent * event)
+{
+    Q_UNUSED(event);
+
+    if(ui->graphicsView)
+        ui->graphicsView->fitInView(ui->graphicsView->scene()->sceneRect(), Qt::KeepAspectRatio);
+}