diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-11-10 21:58:21 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-11-10 21:58:21 (GMT) |
commit | 1ef5affa7aa12f9f70bcdd6d984b8e1b9ccd646b (patch) | |
tree | bee5308c4bafb944b0a2400fd276380bc1171ac2 /tests | |
parent | de0dcfdb1133dcee7b6d0d50a2bcd95f5bdf2515 (diff) | |
parent | b1998f4f59c3b10700963b2d13a17a0cc77ef665 (diff) | |
download | Qt-1ef5affa7aa12f9f70bcdd6d984b8e1b9ccd646b.zip Qt-1ef5affa7aa12f9f70bcdd6d984b8e1b9ccd646b.tar.gz Qt-1ef5affa7aa12f9f70bcdd6d984b8e1b9ccd646b.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1:
Repaint QProgressBar when minimum or maximum changed
Fix QProgressBar causing timer event spam
Compile fix for Mac OS X 10.7 with 10.6 sdk
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qprogressbar/tst_qprogressbar.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/auto/qprogressbar/tst_qprogressbar.cpp b/tests/auto/qprogressbar/tst_qprogressbar.cpp index 04b7ce7..878cce8 100644 --- a/tests/auto/qprogressbar/tst_qprogressbar.cpp +++ b/tests/auto/qprogressbar/tst_qprogressbar.cpp @@ -63,6 +63,7 @@ private slots: void text(); void format(); void setValueRepaint(); + void setMinMaxRepaint(); void sizeHint(); void formatedText_data(); void formatedText(); @@ -216,6 +217,44 @@ void tst_QProgressBar::setValueRepaint() } } +void tst_QProgressBar::setMinMaxRepaint() +{ + ProgressBar pbar; + pbar.setMinimum(0); + pbar.setMaximum(10); + pbar.setFormat("%v"); + pbar.show(); + QTest::qWaitForWindowShown(&pbar); + + QApplication::processEvents(); + + // No repaint when setting minimum to the current minimum + pbar.repainted = false; + pbar.setMinimum(0); + QTest::qWait(50); + QTRY_VERIFY(!pbar.repainted); + + // No repaint when setting maximum to the current maximum + pbar.repainted = false; + pbar.setMaximum(10); + QTest::qWait(50); + QTRY_VERIFY(!pbar.repainted); + + // Repaint when setting minimum + for (int i = 9; i >= 0; i--) { + pbar.repainted = false; + pbar.setMinimum(i); + QTRY_VERIFY(pbar.repainted); + } + + // Repaint when setting maximum + for (int i = 0; i < 10; ++i) { + pbar.repainted = false; + pbar.setMaximum(i); + QTRY_VERIFY(pbar.repainted); + } +} + void tst_QProgressBar::sizeHint() { ProgressBar bar; |