added returnshortcut in racewinow
This commit is contained in:
@@ -2,9 +2,11 @@
|
|||||||
#include "ui_windowrace.h"
|
#include "ui_windowrace.h"
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <QShortcut>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include "unistd.h"
|
#include "unistd.h"
|
||||||
|
#include <QKeySequence>
|
||||||
|
|
||||||
using std::vector;
|
using std::vector;
|
||||||
using std::string;
|
using std::string;
|
||||||
@@ -118,7 +120,29 @@ WindowRace::WindowRace(DataBase *db, QWidget *parent) :
|
|||||||
this->ui->pbTime->setStyleSheet("QProgressBar::chunk { color: #05B8CC;}");
|
this->ui->pbTime->setStyleSheet("QProgressBar::chunk { color: #05B8CC;}");
|
||||||
this->ui->pbTime->setValue(0);
|
this->ui->pbTime->setValue(0);
|
||||||
|
|
||||||
|
QKeySequence ks(Qt::Key_Return); // btw, this is numpad enter
|
||||||
|
QShortcut *keyReturn = new QShortcut(ks, this);
|
||||||
|
QObject::connect(keyReturn, SIGNAL(activated()), this, SLOT(ReturnPress()));
|
||||||
|
|
||||||
|
//QObject::connect(shortcut, SIGNAL(activated()), this, SLOT(close()));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WindowRace::ReturnPress(){
|
||||||
|
//cout << "Return pressed" << endl;
|
||||||
|
if(this->ui->pBNextRace->isEnabled()){
|
||||||
|
this->prepareNextRace();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if(started){
|
||||||
|
this->breakCounter();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this->go();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void WindowRace::prepareNextRace(){
|
void WindowRace::prepareNextRace(){
|
||||||
this->firstTimeShell = true;
|
this->firstTimeShell = true;
|
||||||
this->firstTimeDea = true;
|
this->firstTimeDea = true;
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ public slots:
|
|||||||
void laufcheck();
|
void laufcheck();
|
||||||
void deaSlot();
|
void deaSlot();
|
||||||
void shellSlot();
|
void shellSlot();
|
||||||
|
void ReturnPress();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // WINDOWRACE_H
|
#endif // WINDOWRACE_H
|
||||||
|
|||||||
Reference in New Issue
Block a user