summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativetextedit/data/alignments.qml
blob: b1f701be2dd8656007f97001dc02ca1937103ea2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import Qt 4.7

Rectangle {
    id: top
    width: 70; height: 70;

    property alias horizontalAlignment: t.horizontalAlignment
    property alias verticalAlignment: t.verticalAlignment
    property alias wrapMode: t.wrapMode
    property alias running: timer.running
    property string txt: "Test"

    Rectangle {
        anchors.centerIn: parent
        width: 40
        height: 40
        color: "green"

        Text {
            id: t

            anchors.fill: parent
            horizontalAlignment: TextEdit.AlignRight
            verticalAlignment: TextEdit.AlignBottom
            wrapMode: TextEdit.WordWrap
            text: top.txt
        }
        Timer {
            id: timer

            interval: 1
            running: true
            repeat: true
            onTriggered: {
                top.txt = top.txt + "<br>more " + top.txt.length;
                if (top.txt.length > 50)
                    running = false
            }
        }
    }
}