All pastes #964676 Raw Edit

Something

public cpp v1 · immutable
#964676 ·published 2008-03-31 13:19 UTC
rendered paste body
#include <QMessageBox>#include <QTimer>#include <QAbstractSlider>#include "mainform.h"MainForm::MainForm(QWidget *parent)        : QWidget(parent){        setupUi(this);        QObject::connect(Start,SIGNAL(clicked()),this,SLOT(OnStartClicked()));        QObject::connect(Stop,SIGNAL(clicked()),this,SLOT(OnStopClicked()));        QObject::connect(timer, SIGNAL(timeout()), this, SLOT(Tick()));        QObject::connect(Speed, SIGNAL(valueChanged(int)), this, SLOT(SetTickTime(int)));        QObject::connect(tabla, SIGNAL(OutOfGolds(bool)), Stop, SLOT(setEnabled(bool)));        QObject::connect(tabla, SIGNAL(OutOfGolds(bool)), Start, SLOT(setEnabled(bool)));}void MainForm::OnStartClicked(){    timer->start(1000-Speed->value()*70);}void MainForm::OnStopClicked(){    timer->stop();}void MainForm::Tick(){    tabla->Step();}void MainForm::SetTickTime(int value){    if(timer->timerId())    {        timer->stop();        timer->start(1000-value*70);    }}