【发布时间】:2015-10-29 17:36:09
【问题描述】:
我正在尝试在 ColumnLayout 中使用 topMargin。但我面临一些问题。 有人能帮我解决这个问题吗?
这是我的代码
import QtQuick 2.3
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2
import QtQuick.Layouts 1.1
ApplicationWindow {
visible: true
width: 640
height: 480
title: qsTr("Hello World")
Rectangle{
anchors.fill: parent
ColumnLayout{
id: columlayout
Rectangle{
width: 100
height: 100
color: "red"
}
Rectangle{
Layout.topMargin: 50
width: 100
height: 100
color: "green"
}
Rectangle{
width: 100
height: 100
color: "blue"
}
}
}
}
问题:
无法分配给不存在的属性“topMargin”
【问题讨论】: