summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativetextedit/data/alignments.qml
blob: bc977fc6de2d19d9cdeb06ae7cdcb7d809a76889 (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 QtQuick 1.0

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"

        TextEdit {
            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
            }
        }
    }
}