tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp
branchRCL_3
changeset 4 3b1da2848fc7
parent 3 41300fa6a67c
equal deleted inserted replaced
3:41300fa6a67c 4:3b1da2848fc7
     1 /****************************************************************************
     1 /****************************************************************************
     2 **
     2 **
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     4 ** All rights reserved.
     4 ** All rights reserved.
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     6 **
     6 **
     7 ** This file is part of the test suite of the Qt Toolkit.
     7 ** This file is part of the test suite of the Qt Toolkit.
     8 **
     8 **
   147     void task221221();
   147     void task221221();
   148     void task255471_decimalsValidation();
   148     void task255471_decimalsValidation();
   149 
   149 
   150     void taskQTBUG_5008_textFromValueAndValidate();
   150     void taskQTBUG_5008_textFromValueAndValidate();
   151     void taskQTBUG_6670_selectAllWithPrefix();
   151     void taskQTBUG_6670_selectAllWithPrefix();
       
   152     void taskQTBUG_6496_fiddlingWithPrecision();
   152 
   153 
   153 public slots:
   154 public slots:
   154     void valueChangedHelper(const QString &);
   155     void valueChangedHelper(const QString &);
   155     void valueChangedHelper(double);
   156     void valueChangedHelper(double);
   156 private:
   157 private:
  1094     QCOMPARE(spin.value(), 1.);
  1095     QCOMPARE(spin.value(), 1.);
  1095     QTest::keyClick(spin.lineEdit(), Qt::Key_2);
  1096     QTest::keyClick(spin.lineEdit(), Qt::Key_2);
  1096     QCOMPARE(spin.value(), 12.);
  1097     QCOMPARE(spin.value(), 12.);
  1097 }
  1098 }
  1098 
  1099 
       
  1100 void tst_QDoubleSpinBox::taskQTBUG_6496_fiddlingWithPrecision()
       
  1101 {
       
  1102     QDoubleSpinBox dsb;
       
  1103     dsb.setRange(0, 0.991);
       
  1104     dsb.setDecimals(1);
       
  1105     QCOMPARE(dsb.maximum(), 1.0);
       
  1106     dsb.setDecimals(2);
       
  1107     QCOMPARE(dsb.maximum(), 0.99);
       
  1108     dsb.setDecimals(3);
       
  1109     QCOMPARE(dsb.maximum(), 0.991);
       
  1110 }
       
  1111 
  1099 QTEST_MAIN(tst_QDoubleSpinBox)
  1112 QTEST_MAIN(tst_QDoubleSpinBox)
  1100 #include "tst_qdoublespinbox.moc"
  1113 #include "tst_qdoublespinbox.moc"