【发布时间】:2018-09-10 10:15:35
【问题描述】:
Qt 5.10,Windows 10 桌面。
以下 QML 代码:
import QtQuick 2.10
import QtQuick.Window 2.10
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3
Window {
visible: true
width: 250
height: 100
title: qsTr("My app")
GridLayout
{
columns: 2
Label {
text: "Setting1:"
}
ComboBox {
model: ["100%", "90%", "80%", "70%", "60%", "50%", "40%", "30%"]
}
CheckBox {
id: tidle
text: "Setting2:"
}
ComboBox {
model: ["90%", "80%", "70%", "60%", "50%", "40%", "30%"]
enabled: tidle.checked
}
}
}
给出以下结果:
对我来说看起来很糟糕:
1) “Setting1”标签和复选框没有明显对齐。
2) 与文本大小相比,复选框和组合框的大小太大。
我错过了什么还是正常行为?
【问题讨论】:
-
除了答案之外,默认样式更注重性能而不是漂亮 - 尝试其他一些样式:doc.qt.io/qt-5.10/qtquickcontrols2-styles.html
标签: qt qml qt5 qtquickcontrols2