分组框在 SplitView 中的偏移量
GroupBox' offset in SplitView
使用以下 QML
代码:
SplitView {
orientation: Qt.Vertical
anchors.fill: parent
GroupBox {
// id: inputBox
title: "First"
Layout.fillWidth: true
anchors.top: parent.top
anchors.topMargin: UI.boxMargin
anchors.bottomMargin: UI.boxMargin
}
GroupBox {
title: "Second"
Layout.fillWidth: true
// x: 15
// anchors.topMargin: 15//UI.boxMargin
// anchors.bottomMargin: UI.boxMargin
}
}
我实现了如下设计:
分离器由两条线组成:一条较深的线和一条较浅的线。我想在拆分器和第二个 GroupBox
之间添加一些偏移量以避免(丑陋的)叠加,但直到现在我才成功(注释代码无用)。
将Layout.topMargin
添加到第二个GroupBox
。例如,
SplitView {
orientation: Qt.Vertical
anchors.fill: parent
GroupBox {
title: "First"
Layout.fillWidth: true
height: 80
}
GroupBox {
title: "Second"
Layout.fillWidth: true
Layout.topMargin: 15
}
}
使用以下 QML
代码:
SplitView {
orientation: Qt.Vertical
anchors.fill: parent
GroupBox {
// id: inputBox
title: "First"
Layout.fillWidth: true
anchors.top: parent.top
anchors.topMargin: UI.boxMargin
anchors.bottomMargin: UI.boxMargin
}
GroupBox {
title: "Second"
Layout.fillWidth: true
// x: 15
// anchors.topMargin: 15//UI.boxMargin
// anchors.bottomMargin: UI.boxMargin
}
}
我实现了如下设计:
分离器由两条线组成:一条较深的线和一条较浅的线。我想在拆分器和第二个 GroupBox
之间添加一些偏移量以避免(丑陋的)叠加,但直到现在我才成功(注释代码无用)。
将Layout.topMargin
添加到第二个GroupBox
。例如,
SplitView {
orientation: Qt.Vertical
anchors.fill: parent
GroupBox {
title: "First"
Layout.fillWidth: true
height: 80
}
GroupBox {
title: "Second"
Layout.fillWidth: true
Layout.topMargin: 15
}
}