| 1 |
import QtQuick 2.0 |
| 2 |
|
| 3 |
|
| 4 |
Flickable { |
| 5 |
|
| 6 |
id: f1 |
| 7 |
width: 320 |
| 8 |
height: 480 |
| 9 |
|
| 10 |
contentWidth: 360 |
| 11 |
contentHeight: 1000 |
| 12 |
|
| 13 |
property int cumulativeX; |
| 14 |
property int cumulativeY; |
| 15 |
|
| 16 |
function changeLabel(obj,txt){ |
| 17 |
obj.item.lbl = txt |
| 18 |
} |
| 19 |
function changeTileMode(obj,val,mode){ |
| 20 |
if (mode == "h") |
| 21 |
obj.item.hTileMode = val; |
| 22 |
else |
| 23 |
obj.item.vTileMode = val; |
| 24 |
} |
| 25 |
|
| 26 |
Component{ |
| 27 |
id: borderImageComponent |
| 28 |
SimpleNoBorder{ |
| 29 |
} |
| 30 |
} |
| 31 |
Column { |
| 32 |
x: 20 |
| 33 |
y: 20 |
| 34 |
spacing: 30 |
| 35 |
Row { |
| 36 |
Text{ |
| 37 |
id: topLabel |
| 38 |
text: "Border Images with no borders set" |
| 39 |
font.family: "Arial" |
| 40 |
font.pointSize: 12 |
| 41 |
} |
| 42 |
} |
| 43 |
|
| 44 |
Row { |
| 45 |
spacing: 20 |
| 46 |
Item{ |
| 47 |
id: image_0001 |
| 48 |
width: 70 |
| 49 |
height: 70 |
| 50 |
Loader{ id: ldr1; sourceComponent: borderImageComponent } |
| 51 |
Component.onCompleted: { |
| 52 |
changeLabel(ldr1,"H: Stretch") |
| 53 |
changeTileMode(ldr1,BorderImage.Stretch,"h") |
| 54 |
ldr1.item.hTileMode = BorderImage.Stretch |
| 55 |
} |
| 56 |
} |
| 57 |
Item{ |
| 58 |
id: image_0002 |
| 59 |
width: 70 |
| 60 |
height: 70 |
| 61 |
Loader{ id: ldr2; sourceComponent: borderImageComponent } |
| 62 |
Component.onCompleted: { |
| 63 |
changeLabel(ldr2,"H: Repeat") |
| 64 |
changeTileMode(ldr2,BorderImage.Repeat,"h") |
| 65 |
} |
| 66 |
} |
| 67 |
Item{ |
| 68 |
|
| 69 |
id: image_0003 |
| 70 |
width: 70 |
| 71 |
height: 70 |
| 72 |
Loader{ id: ldr3; sourceComponent: borderImageComponent } |
| 73 |
Component.onCompleted: { |
| 74 |
changeLabel(ldr3,"H: Round") |
| 75 |
changeTileMode(ldr1,BorderImage.Round,"h") |
| 76 |
} |
| 77 |
} |
| 78 |
} |
| 79 |
Row { |
| 80 |
spacing: 20 |
| 81 |
Item{ |
| 82 |
|
| 83 |
id: image_0004 |
| 84 |
width: 70 |
| 85 |
height: 70 |
| 86 |
Loader{ id: ldr4; sourceComponent: borderImageComponent } |
| 87 |
Component.onCompleted: { |
| 88 |
changeLabel(ldr4,"V: Stretch") |
| 89 |
changeTileMode(ldr4,BorderImage.Stretch,"v") |
| 90 |
} |
| 91 |
} |
| 92 |
Item{ |
| 93 |
id: image_0005 |
| 94 |
width: 70 |
| 95 |
height: 70 |
| 96 |
Loader{ id: ldr5; sourceComponent: borderImageComponent } |
| 97 |
Component.onCompleted: { |
| 98 |
changeLabel(ldr5,"V: Repeat") |
| 99 |
changeTileMode(ldr5,BorderImage.Repeat,"v") |
| 100 |
} |
| 101 |
} |
| 102 |
Item{ |
| 103 |
id: image_0006 |
| 104 |
width: 70 |
| 105 |
height: 70 |
| 106 |
Loader{ id: ldr6; sourceComponent: borderImageComponent } |
| 107 |
Component.onCompleted: { |
| 108 |
changeLabel(ldr6,"H: Round") |
| 109 |
changeTileMode(ldr6,BorderImage.Round,"v") |
| 110 |
} |
| 111 |
} |
| 112 |
} |
| 113 |
Row { |
| 114 |
spacing: 20 |
| 115 |
|
| 116 |
Item{ |
| 117 |
id: image_0007 |
| 118 |
width: 70 |
| 119 |
height: 70 |
| 120 |
Loader{ id: ldr7; sourceComponent: borderImageComponent } |
| 121 |
Component.onCompleted: { |
| 122 |
changeLabel(ldr7,"H/V: Stretch") |
| 123 |
changeTileMode(ldr7,BorderImage.Stretch,"v") |
| 124 |
changeTileMode(ldr7,BorderImage.Stretch,"h") |
| 125 |
} |
| 126 |
} |
| 127 |
Item{ |
| 128 |
id: image_0008 |
| 129 |
width: 70 |
| 130 |
height: 70 |
| 131 |
Loader{ id: ldr8; sourceComponent: borderImageComponent } |
| 132 |
Component.onCompleted: { |
| 133 |
changeLabel(ldr8,"H/V: Repeat") |
| 134 |
changeTileMode(ldr8,BorderImage.Repeat,"v") |
| 135 |
changeTileMode(ldr8,BorderImage.Repeat,"h") |
| 136 |
} |
| 137 |
} |
| 138 |
Item{ |
| 139 |
id: image_0009 |
| 140 |
width: 70 |
| 141 |
height: 70 |
| 142 |
Loader{ id: ldr9; sourceComponent: borderImageComponent } |
| 143 |
Component.onCompleted: { |
| 144 |
changeLabel(ldr9,"H/V: Round") |
| 145 |
changeTileMode(ldr9,BorderImage.Round,"v") |
| 146 |
changeTileMode(ldr9,BorderImage.Round,"h") |
| 147 |
} |
| 148 |
} |
| 149 |
} |
| 150 |
Row { |
| 151 |
spacing: 20 |
| 152 |
|
| 153 |
Item{ |
| 154 |
id: image_0010 |
| 155 |
width: 70 |
| 156 |
height: 70 |
| 157 |
Loader{ id: ldr10; sourceComponent: borderImageComponent } |
| 158 |
Component.onCompleted: { |
| 159 |
changeLabel(ldr10,"H/V: Stretch\nsmooth") |
| 160 |
changeTileMode(ldr10,BorderImage.Stretch,"v") |
| 161 |
changeTileMode(ldr10,BorderImage.Stretch,"h") |
| 162 |
ldr10.item.smoothing = true |
| 163 |
} |
| 164 |
} |
| 165 |
Item{ |
| 166 |
id: image_0011 |
| 167 |
width: 70 |
| 168 |
height: 70 |
| 169 |
Loader{ id: ldr11; sourceComponent: borderImageComponent } |
| 170 |
Component.onCompleted: { |
| 171 |
changeLabel(ldr11,"H/V: Repeat\nsmooth") |
| 172 |
changeTileMode(ldr11,BorderImage.Repeat,"v") |
| 173 |
changeTileMode(ldr11,BorderImage.Repeat,"h") |
| 174 |
ldr11.item.smoothing = true |
| 175 |
} |
| 176 |
} |
| 177 |
Item{ |
| 178 |
id: image_0012 |
| 179 |
width: 70 |
| 180 |
height: 70 |
| 181 |
Loader{ id: ldr12; sourceComponent: borderImageComponent } |
| 182 |
Component.onCompleted: { |
| 183 |
changeLabel(ldr12,"H/V: Round\nsmooth") |
| 184 |
changeTileMode(ldr12,BorderImage.Round,"v") |
| 185 |
changeTileMode(ldr12,BorderImage.Round,"h") |
| 186 |
ldr10.item.smoothing = true |
| 187 |
} |
| 188 |
} |
| 189 |
} |
| 190 |
} |
| 191 |
} |