import QtQuick 2.9
import QtQuick.Window 2.2
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
Window {
visible: true
width: 640
height: 480
title: qsTr("Hello World")
Rectangle{
width: groupbox.width+20
// height: 300
anchors.centerIn: parent
height: (groupbox.height + titleBackground.height+30)
Rectangle{
border.color: "red"
border.width: 2
anchors.topMargin: 10
anchors.fill: parent
radius: 10//圆角
}
Rectangle{
id:titleBackground
width: title.width
height: title.height
anchors.top:parent.top
implicitHeight:title.height
//anchors.left: parent.left
x:20
opacity:1
Text{
id:title
text: "title"
font.pixelSize: 20
color:"green"
}
}
GroupBox {
// title: "Joining for?"
id:groupbox
anchors.top:titleBackground.bottom
anchors.bottom:parent.bottom
anchors.left:parent.left
anchors.right:parent.right
anchors.margins: 10,10,0,10
flat:true
Column {
id:column
spacing: 10
CheckBox {
text: "Breakfast111111111111111111111"
checked: true
}
CheckBox {
text: "Lunch"
checked: false
}
CheckBox {
text: "Dinner"
checked: true
}
CheckBox {
text: "Breakfast111111111111111111111"
checked: true
}
CheckBox {
text: "Lunch"
checked: false
}
CheckBox {
text: "Dinner"
checked: true
}
CheckBox {
text: "Dinner"
checked: true
}
CheckBox {
text: "Breakfast111111111111111111111Breakfast111111111111111111111"
checked: true
}
CheckBox {
text: "Lunch"
checked: false
}
CheckBox {
text: "Dinner"
checked: true
}
}
}
}
}
Qt qml GroupBox思路
最新推荐文章于 2025-03-24 09:30:09 发布