aboutsummaryrefslogtreecommitdiffstats
path: root/examples/declarative/dragtarget/tiles/DropTile.qml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/dragtarget/tiles/DropTile.qml')
-rw-r--r--examples/declarative/dragtarget/tiles/DropTile.qml30
1 files changed, 30 insertions, 0 deletions
diff --git a/examples/declarative/dragtarget/tiles/DropTile.qml b/examples/declarative/dragtarget/tiles/DropTile.qml
new file mode 100644
index 0000000000..9d968753db
--- /dev/null
+++ b/examples/declarative/dragtarget/tiles/DropTile.qml
@@ -0,0 +1,30 @@
+import QtQuick 2.0
+
+Rectangle {
+ id: dropRectangle
+
+ property string colorKey
+
+ color: colorKey
+
+ width: 100; height: 100
+
+ DragTarget {
+ id: dragTarget
+
+ anchors.fill: parent
+
+ keys: [ colorKey ]
+ dropItem: dropRectangle
+ }
+
+ states: [
+ State {
+ when: dragTarget.containsDrag
+ PropertyChanges {
+ target: dropRectangle
+ color: "grey"
+ }
+ }
+ ]
+}