| 1 |
// SPDX-FileCopyrightText: 2019 - 2026 UnionTech Software Technology Co., Ltd. |
| 2 |
// |
| 3 |
// SPDX-License-Identifier: LGPL-3.0-or-later |
| 4 |
|
| 5 |
#include "test_animationstackedwidget.h" |
| 6 |
|
| 7 |
test_animationstackedwidget::test_animationstackedwidget() |
| 8 |
{ |
| 9 |
|
| 10 |
} |
| 11 |
|
| 12 |
test_animationstackedwidget::~test_animationstackedwidget() |
| 13 |
{ |
| 14 |
|
| 15 |
} |
| 16 |
|
| 17 |
//void AnimationStackedWidget::setDuration(int duration) |
| 18 |
TEST_F(test_animationstackedwidget, setDuration) |
| 19 |
{ |
| 20 |
mAnimationStackedWidget->setDuration(400); |
| 21 |
} |
| 22 |
|
| 23 |
//void AnimationStackedWidget::animationFinished() |
| 24 |
TEST_F(test_animationstackedwidget, animationfinished) |
| 25 |
{ |
| 26 |
mAnimationStackedWidget->animationFinished(); |
| 27 |
} |
| 28 |
|
| 29 |
//void AnimationStackedWidget::setCurrent(int index) |
| 30 |
TEST_F(test_animationstackedwidget, setCurrent) |
| 31 |
{ |
| 32 |
mAnimationStackedWidget->setCurrent(4); |
| 33 |
} |
| 34 |
|
| 35 |
//void AnimationStackedWidget::setPre() |
| 36 |
TEST_F(test_animationstackedwidget, setPre) |
| 37 |
{ |
| 38 |
mAnimationStackedWidget->setPre(); |
| 39 |
} |
| 40 |
|
| 41 |
//void AnimationStackedWidget::setNext() |
| 42 |
TEST_F(test_animationstackedwidget, setNext) |
| 43 |
{ |
| 44 |
mAnimationStackedWidget->setNext(); |
| 45 |
} |
| 46 |
|
| 47 |
//void AnimationStackedWidget::setCurrentWidget(int &index, int beginWidth) |
| 48 |
TEST_F(test_animationstackedwidget, setCurrentWidget) |
| 49 |
{ |
| 50 |
int index = 2; |
| 51 |
mAnimationStackedWidget->setCurrentWidget(index, 8); |
| 52 |
} |
| 53 |
|
| 54 |
//int AnimationStackedWidget::getBeginValue() |
| 55 |
TEST_F(test_animationstackedwidget, getBeginValue) |
| 56 |
{ |
| 57 |
mAnimationStackedWidget->getBeginValue(); |
| 58 |
} |
| 59 |
|
| 60 |
//AnimationStackedWidget::MoveOrientation AnimationStackedWidget::getMoveOrientation(const int currIndex, const int nextIndex) |
| 61 |
TEST_F(test_animationstackedwidget, getMoveOrientation) |
| 62 |
{ |
| 63 |
mAnimationStackedWidget->getMoveOrientation(2, 4); |
| 64 |
} |
| 65 |
|
| 66 |
//double AnimationStackedWidget::offset() const |
| 67 |
TEST_F(test_animationstackedwidget, offset) |
| 68 |
{ |
| 69 |
mAnimationStackedWidget->offset(); |
| 70 |
} |
| 71 |
|
| 72 |
//void AnimationStackedWidget::setOffset(double offset) |
| 73 |
TEST_F(test_animationstackedwidget, setOffset) |
| 74 |
{ |
| 75 |
mAnimationStackedWidget->setOffset(2.0); |
| 76 |
} |
| 77 |
|
| 78 |
TEST_F(test_animationstackedwidget,animationtest) |
| 79 |
{ |
| 80 |
mAnimationStackedWidget->setCurrentIndex(0); |
| 81 |
mAnimationStackedWidget->setDuration(250); |
| 82 |
mAnimationStackedWidget->setCurrent(1); |
| 83 |
mAnimationStackedWidget->setFixedSize(500, 800); |
| 84 |
QPixmap pixmap(mAnimationStackedWidget->size()); |
| 85 |
for (int i = 0; i <10; ++i) { |
| 86 |
mAnimationStackedWidget->setOffset(i); |
| 87 |
pixmap = mAnimationStackedWidget->grab(); |
| 88 |
} |
| 89 |
|
| 90 |
mAnimationStackedWidget->setCurrentIndex(1); |
| 91 |
mAnimationStackedWidget->setCurrent(0); |
| 92 |
for (int i = 0; i <10; ++i) { |
| 93 |
mAnimationStackedWidget->setOffset(i); |
| 94 |
pixmap = mAnimationStackedWidget->grab(); |
| 95 |
} |
| 96 |
} |