summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativegridview/data/attachedSignals.qml
diff options
context:
space:
mode:
authorMatthew Vogt <matthew.vogt@nokia.com>2012-01-30 14:16:15 +1000
committerMatthew Vogt <matthew.vogt@nokia.com>2012-01-30 14:16:15 +1000
commit12a5ddf456ba8549645a8cb28a8b4ed6197a14da (patch)
tree63ee2c88af936e0609a3a194f5bcc304c4c0b707 /tests/auto/declarative/qdeclarativegridview/data/attachedSignals.qml
Import relevant source from Qt 4.8
Diffstat (limited to 'tests/auto/declarative/qdeclarativegridview/data/attachedSignals.qml')
-rw-r--r--tests/auto/declarative/qdeclarativegridview/data/attachedSignals.qml27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativegridview/data/attachedSignals.qml b/tests/auto/declarative/qdeclarativegridview/data/attachedSignals.qml
new file mode 100644
index 00000000..d527e9d2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativegridview/data/attachedSignals.qml
@@ -0,0 +1,27 @@
+import QtQuick 1.0
+
+GridView {
+ id: view
+ width: 240; height: 320
+
+ property variant addedDelegates: []
+ property int removedDelegateCount
+
+ model: testModel
+
+ cellWidth: delegateWidth; cellHeight: delegateHeight
+
+ delegate: Rectangle {
+ width: delegateWidth; height: delegateHeight
+ border.width: 1
+ GridView.onAdd: {
+ var obj = GridView.view.addedDelegates
+ obj.push(model.name)
+ GridView.view.addedDelegates = obj
+ }
+ GridView.onRemove: {
+ view.removedDelegateCount += 1
+ }
+ }
+}
+