summaryrefslogtreecommitdiffstats
path: root/examples/tutorial/CodeSection.qml
blob: 8493b990992ae7d6437cfe955cd66a40d3aed597 (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 2.0

Rectangle
{
    id: root

    property string text
    property real fontSize: parent.baseFontSize / 2

    gradient: Gradient {
        GradientStop { position: 0; color: "white" }
        GradientStop { position: 1; color: "darkGray" }
    }

    color: "lightGray"
    border.color: "darkGray"
    border.width: 2
    radius: 10

    x: parent.width / 2
    width: parent.width / 2
    height: parent.height

    Text {
        id: textItem
        anchors.fill: parent
        anchors.margins: 20
        text: root.text;
        font.family: "courier"
        font.pixelSize: root.fontSize
    }

}