4 #include "StressWidget.h"
5 #include "ResultWidget.h"
7 using freeRecite::manager
;
9 StressWidget::StressWidget(QWidget
*parent
)
10 : TesterWidget(parent
)
12 D_OUTPUT("StressWidget::StressWidget()")
15 void StressWidget::start() {
16 freeRecite::Stress
*stress
= new freeRecite::Stress
;
18 //scanner = 0 by default;
22 scanner
= dynamic_cast<freeRecite::Scanner
*>(stress
);
23 topicLabel
->setText(tr("Review Stress Words"));
30 void StressWidget::displayResult() {
31 QString str11
,str12
,str21
,str22
,str31
,str32
;
32 str11
= tr("Amount: ");
33 str21
= tr("Used Time: ");
34 str31
= tr("Score: ");
35 resultWidget
= new ResultWidget(this);
36 if(scanner
!= 0 && scanner
->capability() != 0) {
39 startTime
= endTime
- startTime
;
41 startTime
= startTime
> 1 ? startTime
: 1;
42 str22
= QVariant(static_cast<unsigned>(startTime
)).toString() + tr(" min");
43 str12
= QVariant(scanner
->capability()).toString();
44 str22
= QVariant(static_cast<unsigned>(startTime
)).toString() + tr(" min");
45 str32
= QVariant(scanner
->getScore()).toString();
50 resultWidget
->setTailer("There's no word needs to be reveiwed!");
52 resultWidget
->setInfo(str11
,str12
,str21
,str22
,str31
,str32
);
53 connect(resultWidget
,SIGNAL(confirmed()),this,SIGNAL(finished()));