Ubuntu Pastebin

Paste from dubstar_04 at Sat, 11 Jul 2015 20:24:29 +0000

Download as text
 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import QtQuick 2.4
import QtQuick.Layouts 1.1
import Ubuntu.Components 1.2

//Local Imports
//import "QML"

//javascript
import "Calcs.js" as Calc

MainView {
    applicationName: "machinistsmate.dubstar04"
    anchorToKeyboard: true
    //anchors.fill: parent
    //anchors.top: parent.top

    width: units.gu(100)
    height: units.gu(75)

    Page {
        title: i18n.tr("Machinists Mate")

        ColumnLayout {
            spacing: units.gu(1)
            anchors { margins: units.gu(2); fill: parent}//; top: parent.top}

            ListModel {
                id: materialList
                ListElement { name: "Steel";                description: "Description 1";   SMM: "30" }
                ListElement { name: "Stainless Steel";      description: "Description 2";   SMM: "20" }
                ListElement { name: "Aluminium";            description: "Description 3";   SMM: "75" }
                ListElement { name: "Brass";                description: "Description 4";   SMM: "90" }
                ListElement { name: "Cast Iron";            description: "Description 5";   SMM: "20" }
                ListElement { name: "Bronze";               description: "Description 6";   SMM: "25" }
            }


            OptionSelector {
                id: materialSelector
                //Layout.fillHeight: true
                Layout.fillWidth: true
                text: i18n.tr("Material:")
                expanded: false
                model: materialList
                delegate: selectorDelegate
                onSelectedIndexChanged: Calc.calculateRPM()
            }

            Component {
                id: selectorDelegate
                OptionSelectorDelegate { text: name; subText: description; }
            }

            RowLayout {
                spacing: units.gu(1)
                width: parent.width

                Label {
                    id: label
                    objectName: "Tool Diameter"
                    text: i18n.tr("Tool Diameter:")
                }

                TextField {
                    id: toolInput
                    Layout.fillWidth: true
                    placeholderText: i18n.tr("Tool Diameter (mm)")
                    hasClearButton: true
                    inputMethodHints : Qt.ImhDigitsOnly
                    onTextChanged: Calc.calculateRPM()
                }
            }

            Label {
                id: rpm
                property string rpmresult: ""
                Layout.fillHeight: true
                Layout.fillWidth: true
                text: i18n.tr("RPM:" + rpmresult)
                fontSize: "x-large"
                horizontalAlignment: Text.AlignHCenter
                verticalAlignment: Text.AlignVCenter
            }
        }
    }
}
Download as text