aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeecmascript/testtypes.h
diff options
context:
space:
mode:
authorChris Adams <christopher.adams@nokia.com>2011-11-04 14:13:43 +1000
committerQt by Nokia <qt-info@nokia.com>2011-11-11 08:20:53 +0100
commit43c516be86fb0b825b27144a68d837b87c3e1a23 (patch)
treea597cccb04b53b259de497d7143479847c821816 /tests/auto/declarative/qdeclarativeecmascript/testtypes.h
parent851412e58ee70d76ecf405d113a1d29d82157e53 (diff)
Remove unused codepaths from QV8SequenceWrapper
The object equality comparison callback does not allow an object with a sequence resource to be equal to an object with a variant resource. As such, the SequenceType::isEqual(QVariant) codepaths are not needed. Also, QVariantList conversion is handled by toBasicVariant() in the QV8Engine, and thus we don't need conversion code for this type in the sequence wrapper. Change-Id: I2ec599c5ad6cfdb715cd4e0aae3f0cc3bb36cfdf Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
Diffstat (limited to 'tests/auto/declarative/qdeclarativeecmascript/testtypes.h')
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/testtypes.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/auto/declarative/qdeclarativeecmascript/testtypes.h b/tests/auto/declarative/qdeclarativeecmascript/testtypes.h
index 12563d6588..06cc561c7f 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/testtypes.h
+++ b/tests/auto/declarative/qdeclarativeecmascript/testtypes.h
@@ -1160,9 +1160,10 @@ class MySequenceConversionObject : public QObject
Q_PROPERTY (QList<bool> boolListProperty READ boolListProperty WRITE setBoolListProperty NOTIFY boolListPropertyChanged)
Q_PROPERTY (QList<QString> stringListProperty READ stringListProperty WRITE setStringListProperty NOTIFY stringListPropertyChanged)
Q_PROPERTY (QList<QUrl> urlListProperty READ urlListProperty WRITE setUrlListProperty NOTIFY urlListPropertyChanged)
-
Q_PROPERTY (QStringList qstringListProperty READ qstringListProperty WRITE setQStringListProperty NOTIFY qstringListPropertyChanged)
+
Q_PROPERTY (QList<QPoint> pointListProperty READ pointListProperty WRITE setPointListProperty NOTIFY pointListPropertyChanged)
+ Q_PROPERTY (QList<QVariant> variantListProperty READ variantListProperty WRITE setVariantListProperty NOTIFY variantListPropertyChanged)
public:
MySequenceConversionObject()
@@ -1173,9 +1174,10 @@ public:
m_boolList << true << false << true << false;
m_stringList << QLatin1String("first") << QLatin1String("second") << QLatin1String("third") << QLatin1String("fourth");
m_urlList << QUrl("http://www.example1.com") << QUrl("http://www.example2.com") << QUrl("http://www.example3.com");
-
m_qstringList << QLatin1String("first") << QLatin1String("second") << QLatin1String("third") << QLatin1String("fourth");
+
m_pointList << QPoint(1, 2) << QPoint(3, 4) << QPoint(5, 6);
+ m_variantList << QVariant(QLatin1String("one")) << QVariant(true) << QVariant(3);
}
~MySequenceConversionObject() {}
@@ -1196,6 +1198,8 @@ public:
void setQStringListProperty(const QStringList &list) { m_qstringList = list; emit qstringListPropertyChanged(); }
QList<QPoint> pointListProperty() const { return m_pointList; }
void setPointListProperty(const QList<QPoint> &list) { m_pointList = list; emit pointListPropertyChanged(); }
+ QList<QVariant> variantListProperty() const { return m_variantList; }
+ void setVariantListProperty(const QList<QVariant> &list) { m_variantList = list; emit variantListPropertyChanged(); }
// now for "copy resource" sequences:
Q_INVOKABLE QList<int> generateIntSequence() const { QList<int> retn; retn << 1 << 2 << 3; return retn; }
@@ -1218,6 +1222,7 @@ signals:
void urlListPropertyChanged();
void qstringListPropertyChanged();
void pointListPropertyChanged();
+ void variantListPropertyChanged();
private:
QList<int> m_intList;
@@ -1226,9 +1231,10 @@ private:
QList<bool> m_boolList;
QList<QString> m_stringList;
QList<QUrl> m_urlList;
+ QStringList m_qstringList;
- QStringList m_qstringList; // not a supported sequence type, but QStringList support is hardcoded.
QList<QPoint> m_pointList; // not a supported sequence type
+ QList<QVariant> m_variantList; // not a supported sequence type, but QVariantList support is hardcoded.
};
class MyDeleteObject : public QObject