qml中,怎么改变GroupBox的Title字体颜色?只改Title的颜色可行吗?
具体要怎么改,百度上的把其它文字内容的颜色都改了。请教CSDN各路好汉。
import QtQuick 2.4
import QtQuick.Controls 1.3
import QtQuick.Controls.Styles 1.3
import QtQuick.Controls.Private 1.0
Rectangle {
width: 800
height: 480
color: "green"
GroupBox {
id: groupBoxId
x: 400
y: 300
width: 300
height: 100
title: "Joining for?"
flat : false
style: Style {
property Component panel: Rectangle {
y: -15
x: -8
width: 300
height: 100
color: "transparent"
border.color: "blue"
Rectangle{
id:titleBackground
width: title.width
height: title.height
implicitHeight:title.height
color: groupBoxId.parent.color
x:20
y: -11
opacity:1
Text{
id:title
text: groupBoxId.title
font.pixelSize: 20
color:"red" //修改title 颜色
}
}
}
}
Column {
spacing: 10
CheckBox {
text: "Breakfast"
checked: true
}
CheckBox {
text: "Lunch"
checked: false
}
CheckBox {
text: "Dinner"
checked: true
}
}
}
}