1
我在QML制作一个自定义分组框中,目前我有这个使矩形disapear的一部分/ QML无形的Qt
Rectangle
{
anchors.fill: parent
color: "#55aaff"
Rectangle
{
id: combo_box
anchors.centerIn: parent
color: "transparent"
width: parent.width/2
height: parent.height/2
opacity: 0.3
Rectangle
{
anchors.fill: parent
color: "transparent"
border.color: "#ffffff"
border.width: 1
radius: 20
}
}
Rectangle
{
id: combo_box_title
anchors.verticalCenter: combo_box.top
anchors.left: combo_box.left
anchors.leftMargin: 30
width: 90
height: 20
opacity: 0.3
color: "#55aaff"
}
Text
{
id: combo_box_title_text
anchors.centerIn: combo_box_title
font.family: "Comic Sans MS"
font.pointSize: 9
color: "#e1e100"
text: "Game Settings"
}
明显显示出像this
你可以看到我的组合框标题有背景中的矩形边框。我想要的只是删除标题后面的Rectangle边框的一部分。
有没有解决我的问题?或者我可以拥有这种GroupBox的任何其他方式。在此先感谢
您可以尝试使用线条的绘制[画布](http://doc.qt.io/qt-5/qml-qtquick-canvas.html) – user2436719
我认为你应该删除大写的文本,因为它看起来不尊重。 – folibis
正在使用适合这种情况的帆布?我有一些矩形,就像你在代码中看到的那样,我会在哪里放置画布?我可以在画布上绘制一条圆形线条,就像你在附件中看到的那样?你能提供一些代码吗?问候 –