aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquicktextedit/data/alignments.qml
blob: 7d365da8cb6b81f804b579b79d15203323c5f3b7 (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 2.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
            }
        }
    }
}