QTfrontend/drawmapwidget.cpp
changeset 4520 e7882bd1a894
parent 4477 63a21fac8bf7
child 4556 c7f4eb6cbd0c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/drawmapwidget.cpp	Mon Dec 13 22:12:30 2010 +0300
@@ -0,0 +1,38 @@
+#include "drawmapwidget.h"
+
+DrawMapWidget::DrawMapWidget(QWidget *parent) :
+    QWidget(parent),
+    ui(new Ui::DrawMapWidget)
+{
+    ui->setupUi(this);
+}
+
+DrawMapWidget::~DrawMapWidget()
+{
+    delete ui;
+}
+
+void DrawMapWidget::changeEvent(QEvent *e)
+{
+    QWidget::changeEvent(e);
+    switch (e->type()) {
+    case QEvent::LanguageChange:
+        ui->retranslateUi(this);
+        break;
+    default:
+        break;
+    }
+}
+
+void DrawMapWidget::setScene(DrawMapScene * scene)
+{
+    ui->graphicsView->setScene(scene);
+}
+
+void DrawMapWidget::resizeEvent(QResizeEvent * event)
+{
+    Q_UNUSED(event);
+
+    if(ui->graphicsView && ui->graphicsView->scene())
+        ui->graphicsView->fitInView(ui->graphicsView->scene()->sceneRect(), Qt::KeepAspectRatio);
+}