~ubuntu-branches/ubuntu/oneiric/kde4libs/oneiric-proposed

« back to all changes in this revision

Viewing changes to kate/tests/hl/highlight.qml

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2011-07-08 00:08:34 UTC
  • mto: This revision was merged to the branch mainline in revision 247.
  • Revision ID: package-import@ubuntu.com-20110708000834-dr9a8my4iml90qe5
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
import Qt 4.6
2
 
 
3
 
// some random qml snippets stolen from the qt docs
4
 
 
5
 
Rectangle {
6
 
    important: true
7
 
    propertyAsdf:
8
 
    id: container
9
 
    signalA: bla
10
 
    property string label
11
 
    signal clicked
12
 
    radius: 5; border.color: "black"
13
 
    color: mouse.pressed ? "steelblue" : "lightsteelblue"
14
 
    gradient: Gradient {
15
 
            GradientStop { position: mouse.pressed ? 1.0 : 0.0; color: "steelblue" }
16
 
            GradientStop { position: mouse.pressed ? 0.0 : 1.0; color: "lightsteelblue" }
17
 
    }
18
 
    MouseRegion { id: mouse; anchors.fill: parent; onClicked: container.clicked() }
19
 
    Text { anchors.fill: parent; text: container.label; anchors.centerIn: parent }
20
 
}
21
 
 
22
 
Rectangle {
23
 
    Script {
24
 
        function calculateMyHeight() {
25
 
            return Math.max(otherItem.height, thirdItem.height);
26
 
        }
27
 
    }
28
 
 
29
 
    anchors.centerIn: parent
30
 
    width: Math.min(otherItem.width, 10)
31
 
    height: calculateMyHeight()
32
 
    color: { if (width > 10) "blue"; else "red" }
33
 
}
34
 
 
35
 
Rectangle {
36
 
    default property color innerColor: "black"
37
 
    property color innerColor: "black"
38
 
    property alias text: textElement.text
39
 
    property alias aliasXYZ: testElement.text
40
 
    signal bar
41
 
    signal bar(var blah, string yxcv)
42
 
    width: 240; height: 320;
43
 
    width: 100; height: 30; source: "images/toolbutton.sci"
44
 
    ListView {
45
 
        anchors.fill: parent
46
 
        model: contactModel
47
 
        delegate: Component {
48
 
            Text {
49
 
                text: modelData.firstName + " " + modelData.lastName
50
 
            }
51
 
        }
52
 
    }
53
 
}
54
 
 
55
 
Item {
56
 
    function say(text) {
57
 
        console.log("You said " + text);
58
 
    }
59
 
}