summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qdeclarativeengine.cpp
diff options
context:
space:
mode:
authorKim Motoyoshi Kalland <kim.kalland@nokia.com>2011-05-20 10:30:35 (GMT)
committerKim Motoyoshi Kalland <kim.kalland@nokia.com>2011-05-20 10:49:09 (GMT)
commiteedab65056a6898e5a6f6bd103bed53e6787d334 (patch)
tree2a2954f94a0e041da2fcec0d8083447e5c2989b4 /src/declarative/qml/qdeclarativeengine.cpp
parent31e9c098f3c9321eebf1ac3e4c44a2d18d3816b8 (diff)
downloadQt-eedab65056a6898e5a6f6bd103bed53e6787d334.zip
Qt-eedab65056a6898e5a6f6bd103bed53e6787d334.tar.gz
Qt-eedab65056a6898e5a6f6bd103bed53e6787d334.tar.bz2
Fixed inconsistent behaviour in Qt.rect().
The QML function Qt.rect() used to return a null rectangle if the width or height argument were negative. This was inconsistent with Qt.size() and parsing a string of the type "x,y,wxh" which do not check the width and height. Reviewed-by: Samuel
Diffstat (limited to 'src/declarative/qml/qdeclarativeengine.cpp')
-rw-r--r--src/declarative/qml/qdeclarativeengine.cpp3
1 files changed, 0 insertions, 3 deletions
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index 9fde18c..1feaeb3 100644
--- a/src/declarative/qml/qdeclarativeengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -1699,9 +1699,6 @@ QScriptValue QDeclarativeEnginePrivate::rect(QScriptContext *ctxt, QScriptEngine
qsreal w = ctxt->argument(2).toNumber();
qsreal h = ctxt->argument(3).toNumber();
- if (w < 0 || h < 0)
- return engine->nullValue();
-
return QDeclarativeEnginePrivate::get(engine)->scriptValueFromVariant(QVariant::fromValue(QRectF(x, y, w, h)));
}