tools/drawMapTest/drawmapwidget.cpp
author Wuzzy <Wuzzy2@mail.ru>
Fri, 09 Mar 2018 00:44:36 +0100
changeset 13140 824a75401a61
parent 4477 63a21fac8bf7
permissions -rw-r--r--
ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends) To make sure the player doesn't forget these. Other bugfixes: - When you skip the 2nd cut scene, hero was teleported back - Increase princess <-> hero distance tolerance

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