Re #1489, #1270, Re #1466: Allow only one instance of new dialogs

This commit is contained in:
Damjan Adamic
2015-01-04 20:07:39 +01:00
parent bb921a0a7f
commit 5037dff0d4
8 changed files with 57 additions and 14 deletions
+12 -1
View File
@@ -22,7 +22,6 @@ TrainerSimulator::TrainerSimulator(QWidget * parent, SimulatorInterface * simula
timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(onTimerEvent()));
timer->start(10);
}
TrainerSimulator::~TrainerSimulator()
@@ -31,6 +30,18 @@ TrainerSimulator::~TrainerSimulator()
delete ui;
}
void TrainerSimulator::showEvent(QShowEvent *event)
{
timer->start(10);
event->accept();
}
void TrainerSimulator::closeEvent(QCloseEvent *event)
{
timer->stop();
event->accept();
}
void TrainerSimulator::centerSticks()
{
if (leftStick->scene())