tools/drawMapTest/drawmapwidget.cpp
author nemo
Tue, 21 Jun 2011 18:28:34 -0400
changeset 5285 af4dc03dd60d
parent 4477 63a21fac8bf7
permissions -rw-r--r--
Make sky, horizon, flakes and clouds optional, replace repeated strips of skyL/skyR with 2x2 transparent PNGs instead of larger images of variable dimensions, remove a number of empty unused images

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