-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
282 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#include "fourOptionsNFlashy.h" | ||
#include "global.h" | ||
#include "ui_fourOptionsNFlashy.h" | ||
|
||
#include <QTimer> | ||
#include <QDebug> | ||
|
||
fourOptionsNFlashy::fourOptionsNFlashy(QWidget *parent) : | ||
QWidget(parent), | ||
ui(new Ui::fourOptionsNFlashy) | ||
{ | ||
ui->setupUi(this); | ||
if(ereader) { | ||
ui->againButton->setStyleSheet(ereaderVars::buttonNoFlashStylesheet); | ||
ui->hardButton->setStyleSheet(ereaderVars::buttonNoFlashStylesheet); | ||
ui->goodButton->setStyleSheet(ereaderVars::buttonNoFlashStylesheet); | ||
ui->easyButton->setStyleSheet(ereaderVars::buttonNoFlashStylesheet); | ||
this->setFixedHeight(125); | ||
} | ||
} | ||
|
||
fourOptionsNFlashy::~fourOptionsNFlashy() | ||
{ | ||
delete ui; | ||
} | ||
|
||
void fourOptionsNFlashy::on_againButton_clicked() | ||
{ | ||
if(enabledButtons == true) { | ||
emit again(); | ||
enabledButtons = false; | ||
} | ||
} | ||
|
||
void fourOptionsNFlashy::on_hardButton_clicked() | ||
{ | ||
if(enabledButtons == true) { | ||
emit hard(); | ||
enabledButtons = false; | ||
} | ||
} | ||
|
||
void fourOptionsNFlashy::on_goodButton_clicked() | ||
{ | ||
if(enabledButtons == true) { | ||
emit good(); | ||
enabledButtons = false; | ||
} | ||
} | ||
|
||
void fourOptionsNFlashy::on_easyButton_clicked() | ||
{ | ||
if(enabledButtons == true) { | ||
emit easy(); | ||
enabledButtons = false; | ||
} | ||
} | ||
|
||
void fourOptionsNFlashy::enableButtons() { | ||
qDebug() << "Enabled buttons for fourOptionsNFlashy"; | ||
// Delay for skipping any button that would accour of taps inside this widget | ||
QTimer::singleShot(100, this, [this]() { | ||
enabledButtons = true; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#ifndef fourOptionsNFlashy_H | ||
#define fourOptionsNFlashy_H | ||
|
||
#include <QWidget> | ||
|
||
namespace Ui { | ||
class fourOptionsNFlashy; | ||
} | ||
|
||
class fourOptionsNFlashy : public QWidget | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
explicit fourOptionsNFlashy(QWidget *parent = nullptr); | ||
~fourOptionsNFlashy(); | ||
bool enabledButtons = false; | ||
|
||
public slots: | ||
void enableButtons(); | ||
|
||
signals: | ||
void again(); | ||
void hard(); | ||
void good(); | ||
void easy(); | ||
|
||
private slots: | ||
void on_hardButton_clicked(); | ||
|
||
void on_againButton_clicked(); | ||
|
||
void on_goodButton_clicked(); | ||
|
||
void on_easyButton_clicked(); | ||
|
||
private: | ||
Ui::fourOptionsNFlashy *ui; | ||
}; | ||
|
||
#endif // fourOptionsNFlashy_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>fourOptionsNFlashy</class> | ||
<widget class="QWidget" name="fourOptionsNFlashy"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>356</width> | ||
<height>42</height> | ||
</rect> | ||
</property> | ||
<property name="sizePolicy"> | ||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed"> | ||
<horstretch>0</horstretch> | ||
<verstretch>0</verstretch> | ||
</sizepolicy> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Form</string> | ||
</property> | ||
<layout class="QHBoxLayout" name="horizontalLayout"> | ||
<property name="spacing"> | ||
<number>0</number> | ||
</property> | ||
<property name="leftMargin"> | ||
<number>0</number> | ||
</property> | ||
<property name="topMargin"> | ||
<number>0</number> | ||
</property> | ||
<property name="rightMargin"> | ||
<number>0</number> | ||
</property> | ||
<property name="bottomMargin"> | ||
<number>0</number> | ||
</property> | ||
<item> | ||
<widget class="QPushButton" name="againButton"> | ||
<property name="sizePolicy"> | ||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding"> | ||
<horstretch>0</horstretch> | ||
<verstretch>0</verstretch> | ||
</sizepolicy> | ||
</property> | ||
<property name="text"> | ||
<string>Again</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QPushButton" name="hardButton"> | ||
<property name="sizePolicy"> | ||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding"> | ||
<horstretch>0</horstretch> | ||
<verstretch>0</verstretch> | ||
</sizepolicy> | ||
</property> | ||
<property name="text"> | ||
<string>Hard</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QPushButton" name="goodButton"> | ||
<property name="sizePolicy"> | ||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding"> | ||
<horstretch>0</horstretch> | ||
<verstretch>0</verstretch> | ||
</sizepolicy> | ||
</property> | ||
<property name="text"> | ||
<string>Good</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QPushButton" name="easyButton"> | ||
<property name="sizePolicy"> | ||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding"> | ||
<horstretch>0</horstretch> | ||
<verstretch>0</verstretch> | ||
</sizepolicy> | ||
</property> | ||
<property name="text"> | ||
<string>Easy</string> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</widget> | ||
<resources/> | ||
<connections/> | ||
</ui> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.