add book
This commit is contained in:
40
Qt6QMLBeginnersCode/8-QtQuickControls/15-Switch/Main.qml
Normal file
40
Qt6QMLBeginnersCode/8-QtQuickControls/15-Switch/Main.qml
Normal file
@@ -0,0 +1,40 @@
|
||||
// Copyright (c) Daniel Gakwaya.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
Window {
|
||||
visible: true
|
||||
width: 640
|
||||
height: 480
|
||||
title: qsTr("Switch")
|
||||
|
||||
Column {
|
||||
width: parent.width
|
||||
spacing: 20
|
||||
|
||||
Switch{
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
text: "WiFi"
|
||||
checked: true
|
||||
onCheckedChanged: {
|
||||
if(checked)
|
||||
{
|
||||
console.log("WiFi switch is turned ON")
|
||||
}else{
|
||||
console.log("WiFi switch is turned OFF")
|
||||
}
|
||||
}
|
||||
}
|
||||
Switch{
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
text: "Bluetooth"
|
||||
}
|
||||
Switch{
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
text: "NFC"
|
||||
enabled: false
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user