tools/drawMapTest/drawmapwidget.cpp
author unc0rr
Fri, 01 May 2015 23:22:23 +0300
changeset 10917 97f9a25024e6
parent 4477 63a21fac8bf7
permissions -rw-r--r--
- ?Fix? nemo's attempt in r959219241c67 - Wrap mode: camera comes to followgear by the shortest path (better implementation, than sheepluva's re0d7d499c851) - Wrap mode: keep less than 50% of the screen grayed

#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);
}