QML CheckBox的使用

人类的全部历史都告诫有智慧的人,不要笃信时运,而应坚信思想。 —— 爱献生

这个在QT creator 帮助文档中非常容易查到。

Import Statement: import QtQuick.Controls 1.4

Since: Qt 5.1


CheckBox {
           id:checkBox1
           x: change_butn.x
           y: change_butn.y+change_butn.height+ 40
           text: qsTr("在此路点处停止")
           checked: false
           onCheckedChanged: {
               if(checkBox1.checked === false){
                   console.log("Now is false")//console.log()是很多好的调试qml的方式,在QT creator的Application Output栏输出
               }
               else{
                   console.log("Now is true")
               }
           }

       }

猜你喜欢

转载自blog.csdn.net/qq_35865125/article/details/80236398
QML