| 46 | } |
| 47 | |
| 48 | void TutorialDialog::on_pushButton_clicked() |
| 49 | { |
| 50 | _currentStep++; |
| 51 | |
| 52 | // finished |
| 53 | if(_currentStep >= _maxSteps) |
| 54 | { |
| 55 | delete this; |
| 56 | return; |
| 57 | } |
| 58 | |
| 59 | QString title = QString("Tutorial (%1/%2)").arg(_currentStep+1).arg(_maxSteps); |
| 60 | |
| 61 | ui->label->setText(title); |
| 62 | |
| 63 | QPropertyAnimation *animation = new QPropertyAnimation(ui->tutorialContent, "geometry"); |
| 64 | int offset = -600*_currentStep; |
| 65 | |
| 66 | QRect pos =ui->tutorialContent->geometry(); |
| 67 | animation->setDuration(1000); |
| 68 | animation->setStartValue(pos); |
| 69 | pos.setLeft(offset); |
| 70 | animation->setEndValue(pos); |
| 71 | animation->setEasingCurve(QEasingCurve::InOutCubic); |
| 72 | |
| 73 | animation->start(); |
| 74 | |
| 75 | // last step |
| 76 | if(_currentStep == _maxSteps-1) |
| 77 | { |
| 78 | // button colors |
| 79 | QPalette buttonGreen = ui->pushButton->palette(); |
| 80 | buttonGreen.setColor(QPalette::Button, QColor(0, 150, 0)); |
| 81 | ui->pushButton->setPalette(buttonGreen); |
| 82 | |
| 83 | ui->pushButton->setText("Finish"); |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | void TutorialDialog::on_pushButton_2_clicked() |
| 88 | { |
nothing calls this directly
no test coverage detected