| 1053 | } |
| 1054 | |
| 1055 | void SpinBoxTest::numberSpinBoxScrollingNegToPos() { |
| 1056 | NumberSpinBox sb; |
| 1057 | sb.setMinimum(-10); |
| 1058 | sb.setValue(-1.01); |
| 1059 | QCOMPARE(sb.lineEdit()->text(), QStringLiteral("-1.01")); |
| 1060 | |
| 1061 | sb.lineEdit()->setCursorPosition(2); |
| 1062 | QKeyEvent upEvent(QKeyEvent::Type::KeyPress, Qt::Key_Up, Qt::KeyboardModifier::NoModifier); |
| 1063 | sb.keyPressEvent(&upEvent); |
| 1064 | |
| 1065 | QCOMPARE(sb.lineEdit()->text(), QStringLiteral("-0.01")); |
| 1066 | QCOMPARE(sb.lineEdit()->cursorPosition(), 2); // cursor should not be at position of the comma but behind the 0 |
| 1067 | |
| 1068 | QKeyEvent downEvent(QKeyEvent::Type::KeyPress, Qt::Key_Down, Qt::KeyboardModifier::NoModifier); |
| 1069 | sb.keyPressEvent(&downEvent); |
| 1070 | |
| 1071 | QCOMPARE(sb.lineEdit()->text(), QStringLiteral("-1.01")); |
| 1072 | QCOMPARE(sb.lineEdit()->cursorPosition(), 2); // cursor should not be at position of the minus but behind the 1 |
| 1073 | } |
| 1074 | |
| 1075 | void SpinBoxTest::numberSpinBoxScrollingNegToPos2() { |
| 1076 | NumberSpinBox sb; |
nothing calls this directly
no test coverage detected