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 freeRecite::Reciter
*reciter
= new freeRecite::Reciter
;
11 reciter
->load(taskID
);
12 scanner
= dynamic_cast<freeRecite::Scanner
*>(reciter
);
13 topicLabel
->setText(tr("Reciting"));
19 void ReciterWidget::displayResult() {
22 startTime
= endTime
- startTime
;
24 startTime
= startTime
> 1 ? startTime
: 1;
26 QString str11
,str12
,str21
,str22
,str31
,str32
,strTail
;
27 str11
= tr("Amount: ");
28 str12
= QVariant(scanner
->capability()).toString();
29 str21
= tr("Used Time: ");
30 str22
= QVariant(static_cast<unsigned>(startTime
)).toString() + tr(" min");
31 str31
= tr("Recite Rate: ");
33 QVariant(static_cast<float>(scanner
->capability() -
34 scanner
->getScore())/startTime
).toString()
36 strTail
= tr("There are ") + QVariant(scanner
->getScore()).toString() +
37 tr(" words you have remembered before.");
38 resultWidget
= new ResultWidget(this);
39 connect(resultWidget
,SIGNAL(confirmed()),this,SIGNAL(finished()));
40 resultWidget
->setInfo(str11
,str12
,str21
,str22
,str31
,str32
);
41 resultWidget
->setTailer(strTail
);