在qml中,复选框跟单选框的用法差不多,只是多了几个属性。CheckBoxStyle用法也跟RadioBoxStyle一样,下面还是来看看学习的代码把:
import QtQuick 2.2
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.3
Rectangle{
width: 320;
height: 300;
color: "#d0d0d0";
Rectangle{
id:resultHolder;
color: "#a0a0a0";
width: 220;
height: 80;
anchors.centerIn: parent;
visible: false;
z: 2;
opacity: 0.8;
border.width: 2;
border.color: "#808080";
radius: 8;
Text{
id:result;
anchors.fill: parent;
anchors.margins: 5