qml的ChartView有个background图层,background图层默认是有边距的,而且这个边距是没有属性与方法可以修改的,假如我要创建两个ChartView,让他们纵向紧挨着,实际结果如图:
代码如下:
ColumnLayout {id: mainColumnanchors.fill: parentanchors.leftMargin: 10spacing: 0Item {id:firstRowLayout.fillWidth: trueLayout.fillHeight: trueLayout.preferredHeight: 10}RowLayout{id:afRowLayout.margins: 0Layout.fillWidth: trueLayout.fillHeight: trueLayout.maximumHeight: 42Layout.preferredHeight: (mainColumn.height-firstRow.height)*1/5Text {id: afTexttext: qsTr("房颤")Layout.alignment