2 #include "ReciterWidget.h"
3 #include "ResultWidget.h"
5 ReciterWidget::ReciterWidget(QWidget
*parent
)
7 { /* Do Nothing Here! */ }
9 void ReciterWidget::start(time_t taskID
) {
10 scanner
= new freeRecite::Reciter();
11 scanner
->load(taskID
);
12 topicLabel
->setText(tr("Reciting"));
18 void ReciterWidget::displayResult() {
21 startTime
= endTime
- startTime
;
23 startTime
= startTime
> 1 ? startTime
: 1;
25 QString str11
,str12
,str21
,str22
,str31
,str32
,strTail
;
26 str11
= tr("Amount: ");
27 str12
= QVariant(scanner
->capability()).toString();
28 str21
= tr("Used Time: ");
29 str22
= QVariant(static_cast<unsigned>(startTime
)).toString() + tr(" min");
30 str31
= tr("Recite Rate: ");
32 QVariant(static_cast<float>(scanner
->capability() -
33 scanner
->getScore())/startTime
).toString()
35 strTail
= "There are " + QVariant(scanner
->getScore()).toString() +
36 " words you have remembered before.";
37 resultWidget
= new ResultWidget(this);
38 connect(resultWidget
,SIGNAL(confirmed()),this,SIGNAL(finished()));
39 resultWidget
->setInfo(str11
,str12
,str21
,str22
,str31
,str32
);
40 resultWidget
->setTailer(strTail
);