blob: 9281a064d9b28530c1fb861b099e49004a61252f (
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"
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
}
}
}
}
|