tools/drawMapTest/drawmapwidget.cpp
author Xeli
Sat, 28 Apr 2012 12:46:57 +0200
changeset 6950 f34ff54b0cbd
parent 4477 63a21fac8bf7
permissions -rw-r--r--
-Fixed FingerHasMoved function, still might need a little tweaking -Fixed targetting, it's not possible to fire airstrike and the like with a longpress, however it'll fire on the cursor not on the tap location

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