C++ 入門指南 4.01
練習 27.1 參考程式 - 練習 QML 的 CheckBox
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
ApplicationWindow {
width: 300
height: 200
visible: true
title: qsTr("選項按鈕測試")
ColumnLayout {
anchors.centerIn: parent
spacing: 10
CheckBox {
checked: true
text: qsTr("選項一")
}
CheckBox {
text: qsTr("選項二")
}
CheckBox {
checked: true
text: qsTr("選項三")
}
CheckBox {
checked: true
text: qsTr("選項四")
}
CheckBox {
checked: true
text: qsTr("選項五")
}
}
}
/* 《程式語言教學誌》的範例程式
http://kaiching.org/
檔名:main.qml
功能:示範 CheckBox 型態
作者:張凱慶 */
回到練習題目