aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquicktextedit/data/viewport.qml
blob: 0e2cc139a60e997d95f7dc5b2cb422c4a4ab2b27 (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
import QtQuick

Item {
    width: 480; height: 480

    Rectangle {
        id: viewport
        anchors.fill: parent
        anchors.margins: 100
        border.color: "red"

        FontLoader {
            id: ocr
            source: "tarzeau_ocr_a.ttf"
        }

        TextEdit {
            font.family: ocr.font.family
            font.styleName: ocr.font.styleName
            font.pixelSize: 15
            cursorDelegate: Rectangle {
                border.color: "green"
                border.width: 2
                color: "transparent"
                width: 10
            }
            Component.onCompleted: {
                for (let i = 0; i < 25; ++i)
                    text += "Line " + i + "\n";
            }
        }
    }
}