From f6416183d36a260f3cbf6f89753f8a0ee27df7cc Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Wed, 12 Oct 2011 14:27:57 +0200 Subject: Get rid of QDeclarativeMetaType::{canCopy,copy} Now that we have QMetaType::construct() that does placement new construction, we can use that to copy the value. We need to destruct the (default-constructed) existing value first, but for primitive types that's a no-op, and for Qt's types it's cheap since they use lazy initialization or "shared null". Change-Id: Idadee04b1d5b590be7fec50fb0396fd277bee973 Reviewed-by: Aaron Kennedy --- tests/auto/declarative/qdeclarativeecmascript/testtypes.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/auto/declarative/qdeclarativeecmascript/testtypes.h') diff --git a/tests/auto/declarative/qdeclarativeecmascript/testtypes.h b/tests/auto/declarative/qdeclarativeecmascript/testtypes.h index 06cc561c7f..b7f3f909ea 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/testtypes.h +++ b/tests/auto/declarative/qdeclarativeecmascript/testtypes.h @@ -163,6 +163,7 @@ public: int value; }; QVariant variant() const { return m_variant; } + QJSValue qjsvalue() const { return m_qjsvalue; } int intProperty() const { return m_intProperty; } void setIntProperty(int i) { m_intProperty = i; emit intChanged(); } @@ -176,6 +177,7 @@ signals: void thirdBasicSignal(); void signalWithUnknownType(const MyQmlObject::MyType &arg); void signalWithVariant(const QVariant &arg); + void signalWithQJSValue(const QJSValue &arg); void intChanged(); public slots: @@ -185,6 +187,7 @@ public slots: void setString(const QString &s) { m_string = s; } void myinvokable(MyQmlObject *o) { myinvokableObject = o; } void variantMethod(const QVariant &v) { m_variant = v; } + void qjsvalueMethod(const QJSValue &v) { m_qjsvalue = v; } void v8function(QDeclarativeV8Function*); private: @@ -199,6 +202,7 @@ private: int m_resetProperty; QRegExp m_regExp; QVariant m_variant; + QJSValue m_qjsvalue; int m_intProperty; }; -- cgit v1.2.3