自学内容网 自学内容网

qml 怎么将ChartView 的 background 图层的边距设置为 0

        qml的ChartView有个background图层,background图层默认是有边距的,而且这个边距是没有属性与方法可以修改的,假如我要创建两个ChartView,让他们纵向紧挨着,实际结果如图:

代码如下:

ColumnLayout {
        id: mainColumn
        anchors.fill: parent
        anchors.leftMargin: 10
        spacing: 0

        Item {
            id:firstRow
            Layout.fillWidth: true
            Layout.fillHeight: true
            Layout.preferredHeight: 10
        }

        RowLayout{
            id:afRow
            Layout.margins: 0
            Layout.fillWidth: true
            Layout.fillHeight: true
            Layout.maximumHeight: 42
            Layout.preferredHeight: (mainColumn.height-firstRow.height)*1/5

            Text {
                id: afText
                text: qsTr("房颤")
                Layout.alignment

原文地址:https://blog.csdn.net/lazydz/article/details/136557094

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!