diff options
author | Kent Hansen <kent.hansen@nokia.com> | 2012-01-16 15:01:29 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-01 08:37:49 +0100 |
commit | 24bf48e3dd305dbc4fdcae5f8751792835ffd46a (patch) | |
tree | 64ab2bacd8a563befe1e3ebfab8c18998bd40715 /src/declarative | |
parent | 1edcf64d282b9368d4609b91453cbc6e3f6a84c5 (diff) |
Remove QJSValue::toInteger() function
Rationale: This is a remnant from QtScript. A function called
toInteger() that returns a double looks strange.
Use toInt32() to convert a QJSValue to an integer.
Task-number: QTBUG-23604
Change-Id: I2829704c64b077fca264b660c46248c3f35cb5c0
Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/qml/v8/qjsvalue.cpp | 27 | ||||
-rw-r--r-- | src/declarative/qml/v8/qjsvalue.h | 1 |
2 files changed, 1 insertions, 27 deletions
diff --git a/src/declarative/qml/v8/qjsvalue.cpp b/src/declarative/qml/v8/qjsvalue.cpp index f4709732dd..9fe9bb38e8 100644 --- a/src/declarative/qml/v8/qjsvalue.cpp +++ b/src/declarative/qml/v8/qjsvalue.cpp @@ -541,7 +541,7 @@ QString QJSValue::toString() const attempt to convert the object to a primitive value (possibly resulting in an uncaught script exception). - \sa isNumber(), toInteger(), toInt(), toUInt(), toUInt16() + \sa isNumber(), toInt(), toUInt(), toUInt16() */ double QJSValue::toNumber() const { @@ -569,31 +569,6 @@ bool QJSValue::toBool() const return d->toBool(); } -#ifdef QT_DEPRECATED - -/*! - \obsolete - - Returns the integer value of this QJSValue, using the conversion - rules described in \l{ECMA-262} section 9.4, "ToInteger". - - Note that if this QJSValue is an object, calling this function - has side effects on the script engine, since the engine will call - the object's valueOf() function (and possibly toString()) in an - attempt to convert the object to a primitive value (possibly - resulting in an uncaught script exception). - - \sa toNumber() -*/ -double QJSValue::toInteger() const -{ - Q_D(const QJSValue); - QScriptIsolate api(d->engine()); - return d->toInteger(); -} - -#endif // QT_DEPRECATED - /*! Returns the signed 32-bit integer value of this QJSValue, using the conversion rules described in \l{ECMA-262} section 9.5, "ToInt32". diff --git a/src/declarative/qml/v8/qjsvalue.h b/src/declarative/qml/v8/qjsvalue.h index 4e4cfe08ad..84fe64d051 100644 --- a/src/declarative/qml/v8/qjsvalue.h +++ b/src/declarative/qml/v8/qjsvalue.h @@ -140,7 +140,6 @@ public: QT_DEPRECATED bool isValid() const; QT_DEPRECATED bool isFunction() const; - QT_DEPRECATED double toInteger() const; QT_DEPRECATED qint32 toInt32() const; QT_DEPRECATED quint32 toUInt32() const; QT_DEPRECATED quint16 toUInt16() const; |