summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-04-04 12:45:27 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-04-04 12:45:27 (GMT)
commit22f285ac93bde36d0d965f72cd56b6173e88c6e2 (patch)
tree41fa12b2b3bc85307b31a168fd1a0b47f6e8713d /src/gui/painting
parent7418c05b7534b1e3aa014b420081d2f94b1ac0d2 (diff)
parenteb20a7341827b5590fbd891ca1b82ea7ba37d679 (diff)
downloadQt-22f285ac93bde36d0d965f72cd56b6173e88c6e2.zip
Qt-22f285ac93bde36d0d965f72cd56b6173e88c6e2.tar.gz
Qt-22f285ac93bde36d0d965f72cd56b6173e88c6e2.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public: Fix QGradient stop with NaN position on Symbian. Do not add project path to SYMBIAN_MATCHED_TRANSLATIONS if not needed QApplication does not define flag for "single touch" Native dialog softkeys are covered by QApplication softkeys
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qbrush.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/painting/qbrush.cpp b/src/gui/painting/qbrush.cpp
index dc61e34..8f965c2 100644
--- a/src/gui/painting/qbrush.cpp
+++ b/src/gui/painting/qbrush.cpp
@@ -49,6 +49,7 @@
#include "qdebug.h"
#include <QtCore/qcoreapplication.h>
#include "private/qstylehelper_p.h"
+#include <QtCore/qnumeric.h>
QT_BEGIN_NAMESPACE
@@ -1360,13 +1361,14 @@ QGradient::QGradient()
void QGradient::setColorAt(qreal pos, const QColor &color)
{
- if (pos > 1 || pos < 0) {
+ if ((pos > 1 || pos < 0) && !qIsNaN(pos)) {
qWarning("QGradient::setColorAt: Color position must be specified in the range 0 to 1");
return;
}
int index = 0;
- while (index < m_stops.size() && m_stops.at(index).first < pos) ++index;
+ if (!qIsNaN(pos))
+ while (index < m_stops.size() && m_stops.at(index).first < pos) ++index;
if (index < m_stops.size() && m_stops.at(index).first == pos)
m_stops[index].second = color;