From 7c247d3e70788fd601cdc4d45649d2c7ca1004f3 Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Fri, 20 Jan 2012 02:30:02 +0200 Subject: Obsolete QInputDialog::getInteger() 'officially'. It has long since been obsolete in code and removed from the documentation, but was never marked QT_DEPRECATED. Do so, and inline the implementation. Change-Id: Ic7bfdaf76269b7f9addeba83e64bc9525c581dda Reviewed-by: Jonas Gastal Reviewed-by: Lars Knoll --- .../dialogs/qinputdialog/tst_qinputdialog.cpp | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'tests') diff --git a/tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp b/tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp index 0a62ac3099..33a6f51707 100644 --- a/tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp +++ b/tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp @@ -55,14 +55,14 @@ class tst_QInputDialog : public QObject QWidget *parent; QDialog::DialogCode doneCode; void (*testFunc)(QInputDialog *); - static void testFuncGetInteger(QInputDialog *dialog); + static void testFuncGetInt(QInputDialog *dialog); static void testFuncGetDouble(QInputDialog *dialog); static void testFuncGetText(QInputDialog *dialog); static void testFuncGetItem(QInputDialog *dialog); void timerEvent(QTimerEvent *event); private slots: - void getInteger_data(); - void getInteger(); + void getInt_data(); + void getInt(); void getDouble_data(); void getDouble(); void task255502getDouble(); @@ -222,7 +222,7 @@ void testGetItem(QInputDialog *dialog) QVERIFY(okButton->isEnabled()); } -void tst_QInputDialog::testFuncGetInteger(QInputDialog *dialog) +void tst_QInputDialog::testFuncGetInt(QInputDialog *dialog) { testGetNumeric(dialog); } @@ -252,29 +252,29 @@ void tst_QInputDialog::timerEvent(QTimerEvent *event) dialog->done(doneCode); // cause static function call to return } -void tst_QInputDialog::getInteger_data() +void tst_QInputDialog::getInt_data() { QTest::addColumn("min"); QTest::addColumn("max"); - QTest::newRow("getInteger() - -") << -20 << -10; - QTest::newRow("getInteger() - 0") << -20 << 0; - QTest::newRow("getInteger() - +") << -20 << 20; - QTest::newRow("getInteger() 0 +") << 0 << 20; - QTest::newRow("getInteger() + +") << 10 << 20; + QTest::newRow("getInt() - -") << -20 << -10; + QTest::newRow("getInt() - 0") << -20 << 0; + QTest::newRow("getInt() - +") << -20 << 20; + QTest::newRow("getInt() 0 +") << 0 << 20; + QTest::newRow("getInt() + +") << 10 << 20; } -void tst_QInputDialog::getInteger() +void tst_QInputDialog::getInt() { QFETCH(int, min); QFETCH(int, max); QVERIFY(min < max); parent = new QWidget; doneCode = QDialog::Accepted; - testFunc = &tst_QInputDialog::testFuncGetInteger; + testFunc = &tst_QInputDialog::testFuncGetInt; startTimer(0); bool ok = false; const int value = min + (max - min) / 2; - const int result = QInputDialog::getInteger(parent, "", "", value, min, max, 1, &ok); + const int result = QInputDialog::getInt(parent, "", "", value, min, max, 1, &ok); QVERIFY(ok); QCOMPARE(result, value); delete parent; -- cgit v1.2.3