summaryrefslogtreecommitdiffstats
path: root/util/qt3d/assetviewer/qml/Widgets/InputBox.qml
blob: d3d318378acda394f546e2e6622e0e4e368eeb21 (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
import QtQuick 1.0

Item {
    id: textInput
    width: 60
    height: 20
    property alias label: lbl.text
    property alias input: inputBox

//    Binding {
//        target: textInput; property: "value"
//        value: inputBox.text
//    }
//    Binding {
//        target: inputBox; property: "text"
//        value: { var result = textInput.value*100; return Math.round(result)/100 }
//    }

    Text {
        id: lbl
        color: "lightgray"
        anchors.left: parent.left
    }

    Rectangle {
        border.color: "gray"
        color: "transparent"
        width: 40
        height: inputBox.height
        anchors.right: parent.right
        TextInput {
            id: inputBox
            anchors { fill: parent; leftMargin: 5 }
            color: "white"
            text: { var result = textInput.value*100; return Math.round(result)/100 }
            selectByMouse: true; readOnly: true
        }
    }
}