我有一个 2x2 网格布局。所有项目都左对齐,每列占据 50% 的空间。
现在我想将 GridLayout 的 4 个项目之一向右移动 20 像素。我该怎么做?
import QtQuick 2.2
import QtQuick.Controls 1.2
import QtQuick.Layouts 1.1
Gridlayout {
rows: 2
flow: GridLayout.TopToBottom
TextEdit {
Layout.alignment: Qt.AlignLeft
text: "test 1"
}
Image {
// This one is supposed to be aligned left + 20 pixels
source: "cool-pic.jpg"
}
TextEdit {
Layout.alignment: Qt.AlignLeft
text: "test 3"
}
TextEdit {
text: "test 4"
}
}