tests/auto/declarative/qmlvisual/qdeclarativepathview/test-pathview-2.qml
branchGCC_SURGE
changeset 31 5daf16870df6
parent 30 5dc02b23752f
equal deleted inserted replaced
27:93b982ccede2 31:5daf16870df6
       
     1 import Qt 4.7
       
     2 
       
     3 Rectangle {
       
     4     width: 800; height: 450
       
     5     //Same as test-pathview, but with pathItemCount < model.count
       
     6     
       
     7     ListModel {
       
     8         id: rssModel
       
     9         ListElement { lColor: "red" }
       
    10         ListElement { lColor: "green" }
       
    11         ListElement { lColor: "yellow" }
       
    12         ListElement { lColor: "blue" }
       
    13         ListElement { lColor: "purple" }
       
    14         ListElement { lColor: "gray" }
       
    15         ListElement { lColor: "brown" }
       
    16         ListElement { lColor: "thistle" }
       
    17     }
       
    18 
       
    19     Component {
       
    20         id: photoDelegate
       
    21         Rectangle {
       
    22             id: wrapper
       
    23             width: 85; height: 85; color: lColor
       
    24             scale: wrapper.PathView.scale
       
    25             
       
    26             transform: Rotation {
       
    27                 id: itemRotation; origin.x: wrapper.width/2; origin.y: wrapper.height/2
       
    28                 axis.y: 1; axis.z: 0; angle: wrapper.PathView.angle
       
    29             }
       
    30         }
       
    31     }
       
    32 
       
    33     PathView {
       
    34         id: pathView; model: rssModel; delegate: photoDelegate
       
    35         y: 100; width: 800; height: 330; pathItemCount: 6; z: 1
       
    36         focus: true
       
    37         path: Path {
       
    38             startX: -50; startY: 40;
       
    39             
       
    40             PathAttribute { name: "scale"; value: 0.5 }
       
    41             PathAttribute { name: "angle"; value: -45 }
       
    42             
       
    43             PathCubic {
       
    44                 x: 400; y: 220
       
    45                 control1X: 140; control1Y: 40
       
    46                 control2X: 210; control2Y: 220
       
    47             }
       
    48             
       
    49             PathAttribute { name: "scale"; value: 1.2  }
       
    50             PathAttribute { name: "angle"; value: 0 }
       
    51             
       
    52             PathCubic {
       
    53                 x: 850; y: 40
       
    54                 control2X: 660; control2Y: 40
       
    55                 control1X: 590; control1Y: 220
       
    56             }
       
    57             
       
    58             PathAttribute { name: "scale"; value: 0.5 }
       
    59             PathAttribute { name: "angle"; value: 45 }
       
    60         }
       
    61     }
       
    62 }