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