simple_mtglife
diff mainwin.cc @ 0:6321cfa2ad62
initial
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Fri, 23 Jan 2015 15:24:27 +0200 |
parents | |
children | d76fb2ffe7f5 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/mainwin.cc Fri Jan 23 15:24:27 2015 +0200 1.3 @@ -0,0 +1,44 @@ 1.4 +#include "mainwin.h" 1.5 +#include "ui_mainwin.h" 1.6 + 1.7 +MainWin::MainWin(QWidget *parent) : 1.8 + QMainWindow(parent), 1.9 + ui(new Ui::MainWin) 1.10 +{ 1.11 + ui->setupUi(this); 1.12 +} 1.13 + 1.14 +MainWin::~MainWin() 1.15 +{ 1.16 + delete ui; 1.17 +} 1.18 + 1.19 +void MainWin::on_bn_p1_reset_clicked() 1.20 +{ 1.21 + ui->spin_p1_life->setValue(20); 1.22 +} 1.23 + 1.24 +void MainWin::on_bn_p2_reset_clicked() 1.25 +{ 1.26 + ui->spin_p2_life->setValue(20); 1.27 +} 1.28 + 1.29 +void MainWin::on_bn_p1_inc10_clicked() 1.30 +{ 1.31 + ui->spin_p1_life->setValue(ui->spin_p1_life->value() + 10); 1.32 +} 1.33 + 1.34 +void MainWin::on_bn_p1_dec10_clicked() 1.35 +{ 1.36 + ui->spin_p1_life->setValue(ui->spin_p1_life->value() - 10); 1.37 +} 1.38 + 1.39 +void MainWin::on_bn_p2_inc10_clicked() 1.40 +{ 1.41 + ui->spin_p2_life->setValue(ui->spin_p2_life->value() + 10); 1.42 +} 1.43 + 1.44 +void MainWin::on_bn_p2_dec10_clicked() 1.45 +{ 1.46 + ui->spin_p2_life->setValue(ui->spin_p2_life->value() - 10); 1.47 +}