summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAxel Spoerl <Axel.Spoerl@qt.io>2022-01-11 11:57:49 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-01-14 16:27:26 +0000
commitc827990b7cc2fe5d2aa499b5fb936fd728c5f18f (patch)
tree7b16874b41a494d79dfbaabde7efc7c14324ab84 /tests
parent560667c5b03cf9ab06f20c37c1941dbe1a8d261f (diff)
Add QProgressBar test in tst_baseline_widgets
Task-number: QTBUG-99678 Change-Id: Ib56f7bdcc1e61d0354a7a381b8089f35e80b931c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit bf44ca3224b68be50bb3ada4023398cb8735adb8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/baseline/widgets/tst_baseline_widgets.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/baseline/widgets/tst_baseline_widgets.cpp b/tests/baseline/widgets/tst_baseline_widgets.cpp
index 86fc62f717..41bcb84132 100644
--- a/tests/baseline/widgets/tst_baseline_widgets.cpp
+++ b/tests/baseline/widgets/tst_baseline_widgets.cpp
@@ -43,6 +43,9 @@ private slots:
void tst_QPushButton_data();
void tst_QPushButton();
+
+ void tst_QProgressBar_data();
+ void tst_QProgressBar();
};
void tst_Widgets::tst_QSlider_data()
@@ -136,6 +139,42 @@ void tst_Widgets::tst_QPushButton()
testButton->setDown(false);
}
+void tst_Widgets::tst_QProgressBar_data()
+{
+ QTest::addColumn<Qt::Orientation>("orientation");
+ QTest::addColumn<bool>("invertedAppearance");
+ QTest::addColumn<bool>("textVisible");
+
+ QTest::newRow("vertical_normalAppearance_textVisible") << Qt::Vertical << false << true;
+ QTest::newRow("vertical_invertedAppearance_textVisible") << Qt::Vertical << true << true;
+ QTest::newRow("horizontal_normalAppearance_textVisible") << Qt::Horizontal << false << true;
+ QTest::newRow("horizontal_invertedAppearance_textVisible") << Qt::Horizontal << true << true;
+ QTest::newRow("vertical_normalAppearance_textNotVisible") << Qt::Vertical << false << false;
+ QTest::newRow("vertical_invertedAppearance_textNotVisible") << Qt::Vertical << true << false;
+ QTest::newRow("horizontal_normalAppearance_textNotVisible") << Qt::Horizontal << false << false;
+ QTest::newRow("horizontal_invertedAppearance_textNotVisible") << Qt::Horizontal << true << false;
+}
+
+void tst_Widgets::tst_QProgressBar()
+{
+ QFETCH(Qt::Orientation, orientation);
+ QFETCH(bool, invertedAppearance);
+ QFETCH(bool, textVisible);
+
+ QBoxLayout box((orientation == Qt::Vertical) ? QBoxLayout::LeftToRight : QBoxLayout::TopToBottom);
+
+ for (int i = 0; i < 4; ++i) {
+ QProgressBar *bar = new QProgressBar(testWindow());
+ bar->setOrientation(orientation);
+ bar->setInvertedAppearance(invertedAppearance);
+ bar->setTextVisible(textVisible);
+ bar->setValue(i * 33);
+ box.addWidget(bar);
+ }
+
+ testWindow()->setLayout(&box);
+ takeStandardSnapshots();
+}
#define main _realmain
QTEST_MAIN(tst_Widgets)