Rectangle{ width: parent.width height: 120/2 anchors.bottom: parent.bottom color: "#114670" Row{ width: childrenRect.width spacing: 5 CusLabel{ id:dateTimeLabel text: "筛选时间" font.pixelSize: 16 anchors.verticalCenter: dateInput.verticalCenter } CusInputDate{ id:dateInput height: 20 normalTextColor: CusConfig.themeColor selectTextColor: CusConfig.pageBkgColor beginDate: __minDate endDate: new Date() endTime: Qt.formatDateTime(new Date(),"hh:mm:ss") Component.onCompleted: { __minDate= new Date("2020/01/01") __maxDate= new Date() } } } } 这段代码中将时间筛选两个日期分为两行
时间: 2024-02-10 20:17:05 浏览: 24
可以将 `Row` 换成 `Column`,这样就可以将两个控件分开放在不同的行了,代码修改如下:
```
Rectangle{
width: parent.width
height: 120/2
anchors.bottom: parent.bottom
color: "#114670"
Column{
width: childrenRect.width
spacing: 5
CusLabel{
id:dateTimeLabel
text: "筛选时间"
font.pixelSize: 16
anchors.horizontalCenter: parent.horizontalCenter
}
CusInputDate{
id:dateInput
height: 20
normalTextColor: CusConfig.themeColor
selectTextColor: CusConfig.pageBkgColor
beginDate: __minDate
endDate: new Date()
endTime: Qt.formatDateTime(new Date(),"hh:mm:ss")
Component.onCompleted: {
__minDate= new Date("2020/01/01")
__maxDate= new Date()
}
}
}
}
```