1 import QtQuick 2.12
2 import QtQuick.Window 2.12
3 import QtQuick.Controls 2.5
4 Window {
5     id: win
6     width: 640
7     height: 480
8     visible: true
9     title: qsTr("Hello World")
10    function test(msg){
11        win.title = msg
12        but1.font.bold = true
13    }
14    function selection(msg) {
15        submit.font.bold = true
16        if(brFast.checked)
17          msg = "You are with us for: Breakfast "
18        if (lunch.checked)
19          msg += " Lunch "
20        if(dinner.checked)
21            msg += " Dinner"
22        result.text = msg
23    }
24    GroupBox {
25        id: group
26        title: "Joining us for which one?"
27        font.pixelSize:  20
28        Column {
29            spacing: 10
30            CheckBox {
31                id: brFast
32                text: "Breakfast"
33                checked: true
34            }
35            CheckBox {
36                id: lunch
37                text: "Lunch"
38                checked: false
39            }
40            CheckBox {
41                id: dinner
42                text: "Dinner"
43                checked: true
44            }
45        }
46    }
47    Row {
48         id:buttonRow
49         anchors.top: group.bottom
50         anchors.topMargin: 10
51         spacing: 2
52      Button {
53         id: but1
54         font.pixelSize: 20
55         text: "Change Window Title"
56         property string msg: "Qt Quick Framework"
57         onClicked: test(msg)
58      }
59      Button {
60          id: submit
61          font.pixelSize: 20
62          text: "Submit"
63          property string msg: ""
64          onClicked: selection(msg)
65      }
66      Button {
67        id: quit
68        text: "Quit"
69        font.pixelSize: 20
70        onClicked: Qt.quit()
71      }
72    }
73    Label {
74        id: result
75        anchors.top: buttonRow.bottom
76        anchors.topMargin: 10
77        text: ""
78        font.pixelSize: 20
79        color: "blue"
80    }
81 }
