widgets baseline test: add QSpinBox
Very simplistic initial test, inspired by the fix in 'fusion' style, but not style-specific. Pick-to: 6.3 Change-Id: I55ceca7ad214c86cb11032c5342bdae2a83852f1 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
parent
fd93c298d6
commit
f854e77b8e
@ -46,6 +46,9 @@ private slots:
|
||||
|
||||
void tst_QProgressBar_data();
|
||||
void tst_QProgressBar();
|
||||
|
||||
void tst_QSpinBox_data();
|
||||
void tst_QSpinBox();
|
||||
};
|
||||
|
||||
void tst_Widgets::tst_QSlider_data()
|
||||
@ -176,6 +179,40 @@ void tst_Widgets::tst_QProgressBar()
|
||||
takeStandardSnapshots();
|
||||
}
|
||||
|
||||
void tst_Widgets::tst_QSpinBox_data()
|
||||
{
|
||||
QTest::addColumn<QAbstractSpinBox::ButtonSymbols>("buttons");
|
||||
|
||||
QTest::addRow("NoButtons") << QSpinBox::NoButtons;
|
||||
QTest::addRow("UpDownArrows") << QSpinBox::UpDownArrows;
|
||||
QTest::addRow("PlusMinus") << QSpinBox::PlusMinus;
|
||||
}
|
||||
|
||||
void tst_Widgets::tst_QSpinBox()
|
||||
{
|
||||
QFETCH(const QSpinBox::ButtonSymbols, buttons);
|
||||
|
||||
QSpinBox *spinBox = new QSpinBox;
|
||||
spinBox->setButtonSymbols(buttons);
|
||||
spinBox->setMinimumWidth(200);
|
||||
|
||||
QVBoxLayout *layout = new QVBoxLayout;
|
||||
layout->addWidget(spinBox);
|
||||
|
||||
testWindow()->setLayout(layout);
|
||||
|
||||
takeStandardSnapshots();
|
||||
|
||||
// Left is default alignment:
|
||||
QBASELINE_CHECK(takeSnapshot(), "align_left");
|
||||
|
||||
spinBox->setAlignment(Qt::AlignHCenter);
|
||||
QBASELINE_CHECK(takeSnapshot(), "align_center");
|
||||
|
||||
spinBox->setAlignment(Qt::AlignRight);
|
||||
QBASELINE_CHECK(takeSnapshot(), "align_right");
|
||||
}
|
||||
|
||||
#define main _realmain
|
||||
QTEST_MAIN(tst_Widgets)
|
||||
#undef main
|
||||
|
Loading…
x
Reference in New Issue
Block a user