QML输入框边距太小怎么调整?
import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Layouts 1.0
ApplicationWindow {
visible: true
title: "我的窗口"
property int margin: 50
width: (mainLayout.implicitWidth + 2 * margin) * 2
height: (mainLayout.implicitHeight + 2 * margin) * 2
minimumWidth: mainLayout.Layout.minimumWidth + 2 * margin
minimumHeight: mainLayout.Layout.minimumHeight + 2 * margin
ColumnLayout {
id: mainLayout
anchors.fill: parent
anchors.margins: margin
GroupBox {
id: rowBox
title: "选择文件"
Layout.fillWidth: true
RowLayout {
id: rowLayout
anchors.fill: parent
TextField {
opacity: 0.1
font.letterSpacing: 0
Layout.rowSpan: 11
transformOrigin: Item.Center
Layout.columnSpan: 2
font.wordSpacing: 0
placeholderText: "输入路径或点击右侧按钮选择路径"
Layout.fillWidth: true
}
Button {
text: "选择路径"
}
}
}
GroupBox {
id: gridBox
title: "Grid layout"
Layout.fillWidth: true
GridLayout {
id: gridLayout
rows: 3
flow: GridLayout.TopToBottom
anchors.fill: parent
Label { text: "Line 1" }
Label { text: "Line 2" }
Label { text: "Line 3" }
TextField { }
TextField { }
TextField { }
TextArea {
text: "This widget spans over three rows in the GridLayout.\n"
+ "All items in the GridLayout are implicitly positioned from top to bottom."
Layout.rowSpan: 3
Layout.fillHeight: true
Layout.fillWidth: true
}
}
}
TextArea {
id: t3
text: "This fills the whole cell"
Layout.minimumHeight: 30
Layout.fillHeight: true
Layout.fillWidth: true
}
}
}
字的边缘紧贴着边框。QT默认的输入框怎么这么丑啊。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论