aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4value_def_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-09-25 13:52:15 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-28 13:33:32 +0200
commit4d40fa24c3ee8def2f27bd237fc8dec25cf3f473 (patch)
treecb4ad758f03cf204cbae1e7d086bfeaf73a64bc3 /src/qml/jsruntime/qv4value_def_p.h
parentabd82c68d564c97a4452a3afa2d63320e7292b30 (diff)
Move Value::toInteger(double) and related to Primitive
Also clean up a few other direct uses of Value Change-Id: Ie27d42c1b31b9e6d16d0a60071cb5e4e1c5b9e8b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4value_def_p.h')
-rw-r--r--src/qml/jsruntime/qv4value_def_p.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/qml/jsruntime/qv4value_def_p.h b/src/qml/jsruntime/qv4value_def_p.h
index 188952bdd7..2f2a754864 100644
--- a/src/qml/jsruntime/qv4value_def_p.h
+++ b/src/qml/jsruntime/qv4value_def_p.h
@@ -283,10 +283,6 @@ struct Q_QML_EXPORT Value
static Value fromString(ExecutionEngine *engine, const QString &s);
#endif
- static double toInteger(double fromNumber);
- static int toInt32(double value);
- static unsigned int toUInt32(double value);
-
int toUInt16() const;
int toInt32() const;
unsigned int toUInt32() const;
@@ -328,6 +324,7 @@ struct Q_QML_EXPORT Value
ReturnedValue asReturnedValue() const { return val; }
static Value fromReturnedValue(ReturnedValue val) { Value v; v.val = val; return v; }
+ Value &operator=(ReturnedValue v) { val = v; return *this; }
// Section 9.12
bool sameValue(Value other) const;
@@ -356,7 +353,7 @@ struct SafeValue : public Value
Returned<T> *as();
};
-struct Primitive : public Value
+struct Q_QML_EXPORT Primitive : public Value
{
static Primitive fromBoolean(bool b);
static Primitive fromInt32(int i);
@@ -365,6 +362,10 @@ struct Primitive : public Value
static Primitive fromDouble(double d);
static Primitive fromUInt32(uint i);
+ static double toInteger(double fromNumber);
+ static int toInt32(double value);
+ static unsigned int toUInt32(double value);
+
inline operator ValueRef();
Value asValue() const { return *this; }
};