summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-07-22 12:05:03 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-07-22 12:05:03 (GMT)
commite3994b506c21b9967248ea404cfdfef82060c13e (patch)
treed18d98db738838d734447519467f78daf4470f81
parent27e5a1f9542b03a6930f002e8d7dafd97cf88a1a (diff)
downloadQt-e3994b506c21b9967248ea404cfdfef82060c13e.zip
Qt-e3994b506c21b9967248ea404cfdfef82060c13e.tar.gz
Qt-e3994b506c21b9967248ea404cfdfef82060c13e.tar.bz2
Show text even if maximum == 0
-rw-r--r--src/gui/widgets/qprogressbar.cpp2
-rw-r--r--tests/auto/qprogressbar/tst_qprogressbar.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/widgets/qprogressbar.cpp b/src/gui/widgets/qprogressbar.cpp
index 6b38e9f..6593cd6 100644
--- a/src/gui/widgets/qprogressbar.cpp
+++ b/src/gui/widgets/qprogressbar.cpp
@@ -443,7 +443,7 @@ QSize QProgressBar::minimumSizeHint() const
QString QProgressBar::text() const
{
Q_D(const QProgressBar);
- if (d->maximum == 0 || d->value < d->minimum
+ if ((d->maximum == 0 && d->minimum == 0) || d->value < d->minimum
|| (d->value == INT_MIN && d->minimum == INT_MIN))
return QString();
diff --git a/tests/auto/qprogressbar/tst_qprogressbar.cpp b/tests/auto/qprogressbar/tst_qprogressbar.cpp
index 452250c..911d6b7 100644
--- a/tests/auto/qprogressbar/tst_qprogressbar.cpp
+++ b/tests/auto/qprogressbar/tst_qprogressbar.cpp
@@ -236,7 +236,7 @@ void tst_QProgressBar::formatedText_data()
QTest::addColumn<QString>("text");
QTest::newRow("1") << -100 << 100 << 0 << QString::fromLatin1(" %p - %v - %m ") << QString::fromLatin1(" 50 - 0 - 200 ");
-// QTest::newRow("2") << -100 << 0 << -25 << QString::fromLatin1(" %p - %v - %m ") << QString::fromLatin1(" 75 - -25 - 100 ");
+ QTest::newRow("2") << -100 << 0 << -25 << QString::fromLatin1(" %p - %v - %m ") << QString::fromLatin1(" 75 - -25 - 100 ");
QTest::newRow("3") << 10 << 10 << 10 << QString::fromLatin1(" %p - %v - %m ") << QString::fromLatin1(" 100 - 10 - 0 ");
QTest::newRow("task152227") << INT_MIN << INT_MAX << 42 << QString::fromLatin1(" %p - %v - %m ") << QString::fromLatin1(" 50 - 42 - 4294967295 ");
}