]> Git trees. - qtvoc.git/commitdiff
add apply button
authorReto Zingg <g.d0b3rm4n@gmail.com>
Sat, 27 Mar 2010 00:03:44 +0000 (02:03 +0200)
committerReto Zingg <g.d0b3rm4n@gmail.com>
Sat, 27 Mar 2010 00:03:44 +0000 (02:03 +0200)
TinyVocTrainer/tinyvoctrainer.cpp
TinyVocTrainer/tinyvoctrainer.h

index beafc72156032a29c40cb80ad8f76989d15ef7dd..c17e7563e7233ad538f5b8cbf8058070bceb264f 100644 (file)
@@ -20,7 +20,11 @@ TinyVocTrainer::TinyVocTrainer(QWidget *parent)
     QHBoxLayout *hbox_question_lang = new QHBoxLayout();
     QHBoxLayout *hbox_answer_lang = new QHBoxLayout();
     QVBoxLayout *vbox_label = new QVBoxLayout();
+    QHBoxLayout *hbox_buttons = new QHBoxLayout();
 
+    QPushButton *button = new QPushButton("Apply");
+    hbox_buttons->addWidget(button);
+    connect(button, SIGNAL(clicked(bool)), this, SLOT(slotInit(bool)));
 
     bgroup_lesson = new QButtonGroup();
     bgroup_question_lang = new QButtonGroup();
@@ -120,6 +124,7 @@ TinyVocTrainer::TinyVocTrainer(QWidget *parent)
     vbox->addLayout(hbox_less);
     vbox->addLayout(hbox_question_lang);
     vbox->addLayout(hbox_answer_lang);
+    vbox->addLayout(hbox_buttons);
     vbox->addLayout(vbox_label);
     setLayout(vbox);
 
@@ -190,7 +195,7 @@ void TinyVocTrainer::slotCheck(int buttonID){
 
     if(buttonID == CorrectID){
         qDebug() << "\\o/ correct answer...";
-        slotInit();
+        slotInit(1);
         return;
     }
     else{
@@ -199,7 +204,9 @@ void TinyVocTrainer::slotCheck(int buttonID){
 
 }
 
-void TinyVocTrainer::slotInit(){
+void TinyVocTrainer::slotInit(bool clicked){
+
+    Q_UNUSED(clicked);
 
     choiceList.clear();
     for (int i=0; i < 3; ++i){
index 46bbef88891aeb466c0e1d2d241717473d3a622d..cdec9509359269893c2154f244fc43e7aea3be37 100644 (file)
@@ -49,7 +49,7 @@ private slots:
     void slotAnswer1(bool clicked = 0);
     void slotAnswer2(bool clicked = 0);
     void slotAnswer3(bool clicked = 0);
-    void slotInit();
+    void slotInit(bool clicked = 0);
 
 };