summaryrefslogtreecommitdiffstats
path: root/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-12-10 10:27:51 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-12-10 10:29:28 (GMT)
commitbb0ab1d8cf57dd4a7b69c8478c2a40c1cd1782e9 (patch)
tree6791642658e71828ce796dc4fc11c06a83e5462b /tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp
parentba9ea2b97bdd2329cb479bb7a6aef1bc7cee82d1 (diff)
downloadQt-bb0ab1d8cf57dd4a7b69c8478c2a40c1cd1782e9.zip
Qt-bb0ab1d8cf57dd4a7b69c8478c2a40c1cd1782e9.tar.gz
Qt-bb0ab1d8cf57dd4a7b69c8478c2a40c1cd1782e9.tar.bz2
Fix spinbox input when seecting the prefix
If you were selcting the prefix and entering a digit the cursor position would not be updated correctly Task-number: QTBUG-6670 Reviewed-by: ogoffart
Diffstat (limited to 'tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp')
-rw-r--r--tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp b/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp
index 7f03153..a3f0915 100644
--- a/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp
+++ b/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp
@@ -148,6 +148,7 @@ private slots:
void task255471_decimalsValidation();
void taskQTBUG_5008_textFromValueAndValidate();
+ void taskQTBUG_6670_selectAllWithPrefix();
public slots:
void valueChangedHelper(const QString &);
@@ -1084,5 +1085,16 @@ void tst_QDoubleSpinBox::taskQTBUG_5008_textFromValueAndValidate()
QCOMPARE(spinbox.text(), spinbox.locale().toString(spinbox.value()));
}
+void tst_QDoubleSpinBox::taskQTBUG_6670_selectAllWithPrefix()
+{
+ DoubleSpinBox spin;
+ spin.setPrefix("$ ");
+ spin.lineEdit()->selectAll();
+ QTest::keyClick(spin.lineEdit(), Qt::Key_1);
+ QCOMPARE(spin.value(), 1.);
+ QTest::keyClick(spin.lineEdit(), Qt::Key_2);
+ QCOMPARE(spin.value(), 12.);
+}
+
QTEST_MAIN(tst_QDoubleSpinBox)
#include "tst_qdoublespinbox.moc"