tests/auto/declarative/qmlvisual/qdeclarativetextedit/cursorDelegate.qml
branchGCC_SURGE
changeset 31 5daf16870df6
parent 30 5dc02b23752f
equal deleted inserted replaced
27:93b982ccede2 31:5daf16870df6
       
     1 import Qt 4.7
       
     2     Rectangle {
       
     3     resources: [
       
     4         Component { id: cursorA
       
     5             Item { id: cPage;
       
     6                 x: Behavior { NumberAnimation { } }
       
     7                 y: Behavior { NumberAnimation { } }
       
     8                 height: Behavior { NumberAnimation { duration: 200 } }
       
     9                 Rectangle { id: cRectangle; color: "black"; y: 1; width: 1; height: parent.height-2;
       
    10                     Rectangle { id:top; color: "black"; width: 3; height: 1; x: -1; y:0}
       
    11                     Rectangle { id:bottom; color: "black"; width: 3; height: 1; x: -1; anchors.bottom: parent.bottom;}
       
    12                     opacity: 1
       
    13                     opacity: SequentialAnimation { running: cPage.parent.focus == true; loops: Animation.Infinite;
       
    14                                 NumberAnimation { properties: "opacity"; to: 1; duration: 500; easing.type: "InQuad"}
       
    15                                 NumberAnimation { properties: "opacity"; to: 0; duration: 500; easing.type: "OutQuad"}
       
    16                              }
       
    17                 }
       
    18                 width: 1;
       
    19             }
       
    20         }
       
    21     ]
       
    22     width: 400
       
    23     height: 200
       
    24     color: "white"
       
    25     TextEdit { id: mainText
       
    26         text: "Hello World"
       
    27         cursorDelegate: cursorA
       
    28         focus: true
       
    29         font.pixelSize: 28
       
    30         selectionColor: "lightsteelblue"
       
    31         selectedTextColor: "deeppink"
       
    32         color: "forestgreen"
       
    33         anchors.centerIn: parent
       
    34     }
       
    35 }