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