testing_widgets/testwidgets.cpp
/*
** The first list of events stores the value 0 and key return, the second
** event stores the value 500.0 and the key return and the last one
** the value 900.0 and the key return.
*/
The first list of events stores the value 0 and key return, the second
event stores the value 500.0 and the key return and the last one
the value 900.0 and the key return.
The first list of events stores the value 0 and key return the second event stores the value 500 . 0 and the key return and the last one the value 900 . 0 and the key return .
void TestWidgets::testSignal_data()
{
	QTest::addColumn<QTestEventList>("events");
	QTest::addColumn<double>("values");
	int ms = 100;
	QTestEventList list1;
	list1.addKeyClick(Qt::Key_Delete);
	list1.addKeyClick(Qt::Key_Delete);
	list1.addKeyClick(Qt::Key_Delete);
	list1.addKeyClick(Qt::Key_Delete);
	list1.addKeyClick('0', Qt::NoModifier, ms);
	list1.addKeyClick(Qt::Key_Return);
	QTest::newRow("Typing 0") << list1
				<< (double)0;
	QTestEventList list2;
	list2.addKeyClick(Qt::Key_Delete);
	list2.addKeyClick(Qt::Key_Delete);
	list2.addKeyClick(Qt::Key_Delete);
	list2.addKeyClick(Qt::Key_Delete);
	list2.addKeyClicks("499.9", Qt::NoModifier, ms);
	list2.addKeyClick(Qt::Key_Return);
	QTest::newRow("Typing 499.9") << list2
				<< (double)499.9;
	QTestEventList list3;
	list3.addKeyClick(Qt::Key_Delete);
	list3.addKeyClick(Qt::Key_Delete);
	list3.addKeyClick(Qt::Key_Delete);
	list3.addKeyClick(Qt::Key_Delete);
	list3.addKeyClick('9', Qt::NoModifier, ms);
	list3.addKeyClick('9', Qt::NoModifier, ms);
	list3.addKeyClick('9', Qt::NoModifier, ms);
	list3.addKeyClick('.', Qt::NoModifier, ms);
	list3.addKeyClick('9', Qt::NoModifier, ms);
	list3.addKeyClick(Qt::Key_Return);
	QTest::newRow("Typing 999.9") << list3
				<< (double)999.9;
}
void TestWidgets :: testSignal_data ( ) { QTest :: addColumn < QTestEventList > ( " " ) ; QTest :: addColumn < double > ( " " ) ; int ms = 100 ; QTestEventList list1 ; list1 . addKeyClick ( Qt :: Key_Delete ) ; list1 . addKeyClick ( Qt :: Key_Delete ) ; list1 . addKeyClick ( Qt :: Key_Delete ) ; list1 . addKeyClick ( Qt :: Key_Delete ) ; list1 . addKeyClick ( ' ' , Qt :: NoModifier , ms ) ; list1 . addKeyClick ( Qt :: Key_Return ) ; QTest :: newRow ( " " ) << list1 << ( double ) 0 ; QTestEventList list2 ; list2 . addKeyClick ( Qt :: Key_Delete ) ; list2 . addKeyClick ( Qt :: Key_Delete ) ; list2 . addKeyClick ( Qt :: Key_Delete ) ; list2 . addKeyClick ( Qt :: Key_Delete ) ; list2 . addKeyClicks ( " " , Qt :: NoModifier , ms ) ; list2 . addKeyClick ( Qt :: Key_Return ) ; QTest :: newRow ( " " ) << list2 << ( double ) 499.9 ; QTestEventList list3 ; list3 . addKeyClick ( Qt :: Key_Delete ) ; list3 . addKeyClick ( Qt :: Key_Delete ) ; list3 . addKeyClick ( Qt :: Key_Delete ) ; list3 . addKeyClick ( Qt :: Key_Delete ) ; list3 . addKeyClick ( ' ' , Qt :: NoModifier , ms ) ; list3 . addKeyClick ( ' ' , Qt :: NoModifier , ms ) ; list3 . addKeyClick ( ' ' , Qt :: NoModifier , ms ) ; list3 . addKeyClick ( ' ' , Qt :: NoModifier , ms ) ; list3 . addKeyClick ( ' ' , Qt :: NoModifier , ms ) ; list3 . addKeyClick ( Qt :: Key_Return ) ; QTest :: newRow ( " " ) << list3 << ( double ) 999.9 ; }
The first list of events stores the value 0 and key return, the second
event stores the value 500.0 and the key return and the last one
the value 900.0 and the key return.
The first list of events stores the value 0 and key return the second event stores the value 500 . 0 and the key return and the last one the value 900 . 0 and the key return .
/*
	 ** Note: QTest::newRow returns a QTestData reference that can be used
	 ** to stream in data.
	 */ /*
	 ** We use addKeyClicks instead of addKeyClick, but the result
	 ** is the same.
	*/