tools/MissionsEditor/hedgehogedit.cpp
branchexperimental3D
changeset 4343 19cbea33e4d2
parent 4006 45b63c2a694f
parent 4341 46b8791e577f
child 4345 2c93d6a10869
equal deleted inserted replaced
4006:45b63c2a694f 4343:19cbea33e4d2
     1 #include "hedgehogedit.h"
       
     2 #include "ui_hedgehogedit.h"
       
     3 
       
     4 HedgehogEdit::HedgehogEdit(QWidget *parent) :
       
     5     QFrame(parent),
       
     6     m_ui(new Ui::HedgehogEdit)
       
     7 {
       
     8     m_ui->setupUi(this);
       
     9 }
       
    10 
       
    11 HedgehogEdit::~HedgehogEdit()
       
    12 {
       
    13     delete m_ui;
       
    14 }
       
    15 
       
    16 void HedgehogEdit::changeEvent(QEvent *e)
       
    17 {
       
    18     QWidget::changeEvent(e);
       
    19     switch (e->type()) {
       
    20     case QEvent::LanguageChange:
       
    21         m_ui->retranslateUi(this);
       
    22         break;
       
    23     default:
       
    24         break;
       
    25     }
       
    26 }
       
    27 
       
    28 void HedgehogEdit::setHedgehog(quint32 level, quint32 health, const QString & name)
       
    29 {
       
    30     m_ui->cbLevel->setCurrentIndex(level);
       
    31     m_ui->sbHealth->setValue(health);
       
    32     m_ui->leName->setText(name);
       
    33 }
       
    34 
       
    35 void HedgehogEdit::setHat(const QString & name)
       
    36 {
       
    37     m_ui->leHat->setText(name);
       
    38 }
       
    39 
       
    40 void HedgehogEdit::setCoordinates(int x, int y)
       
    41 {
       
    42     m_ui->pbCoordinates->setText(QString("%1x%2").arg(x).arg(y));
       
    43 }