This commit is contained in:
2020-04-22 14:52:53 +08:00
parent aa6e00d7f8
commit ee5823cb40
+102 -48
View File
@@ -30,6 +30,18 @@ Rectangle {
property int number : 1
property real param1: 0
property real param2: 0
property real param3: 0
property real param4: 0
property real param5: 0
property real param6: 0
property real param7: 0
border.width: 1
border.color: "blue"
antialiasing: true
@@ -181,36 +193,98 @@ Rectangle {
color: "#ffffff"
radius: 9
ItemDelegate {
id: control
text: qsTr("ItemDelegate")
checkable: true
checked: true
anchors.fill: parent
Rectangle
{
anchors.rightMargin: 10
anchors.bottomMargin: 10
anchors.leftMargin: 10
anchors.topMargin: 10
anchors.fill: parent
contentItem: Text {
rightPadding: control.spacing
text: control.text
font: control.font
color: control.enabled ? (control.down ? "#17a81a" : "#21be2b") : "#bdbebf"
elide: Text.ElideRight
verticalAlignment: Text.AlignVCenter
}
ColumnLayout
{
spacing: 2
anchors.fill: parent
Rectangle
{
Layout.fillWidth: true
Layout.fillHeight: true
RowLayout {
anchors.fill: parent
Rectangle
{
Layout.fillWidth: true
Layout.fillHeight: true
ListView {
id:idLogListView
focus:true
anchors.fill: parent
highlight: Rectangle { color: "#A0CED1" }
model: idListModle
delegate: Component
{
RowLayout {
id:idlistElemnet
height:40
width: parent.width
spacing: 20
Layout.fillWidth: true
//这里决定了模型摆布
Text { text:time; font.bold: true}
Text { text:type }
Text { text:descripe; color:"blue" ;}
Button{
id: cleanBtn
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
text: "clear"
onClicked: idListModle.clean()
}
states: State {
name: "Current"
when: idlistElemnet.ListView.isCurrentItem
PropertyChanges { target: idlistElemnet; x: 20 }
}
transitions: Transition {
NumberAnimation { properties: "x"; duration: 200 }
}
MouseArea {
anchors.fill: parent
onClicked: idlistElemnet.ListView.view.currentIndex = index
}
}
}
Component.onCompleted:
{
for(var idx=0;idx<5;idx++)
{
var newType=parseInt((Math.random(Math.random())*100+1)%3);
idListModle.append( { "descripe": "系统日志","time": "2020-10-2","type":newType,"clear":"button1"});
}
}
}
ListModel {
id:idListModle
}
}
}
}
}
}
background: Rectangle {
implicitWidth: 100
implicitHeight: 40
opacity: enabled ? 1 : 0.3
color: control.down ? "#dddedf" : "#eeeeee"
Rectangle {
width: parent.width
height: 1
color: control.down ? "#17a81a" : "#21be2b"
anchors.bottom: parent.bottom
}
}
}
}
@@ -219,21 +293,6 @@ Rectangle {
}
QJsonValue(object,
QJsonObject(
{"category":"VTOL",
"description":"Perform flight mode transition.",
"friendlyName":"VTOL Transition",
"id":3000,
"param1":{
"default":3,
"enumStrings":"Hover Mode,Plane Mode",
"enumValues":"3,4",
"label":"Mode"
},
"rawName":"MAV_CMD_DO_VTOL_TRANSITION"}
)
)
@@ -243,9 +302,4 @@ QJsonValue(object,
/*##^##
Designer {
D{i:8;anchors_height:100;anchors_width:100}D{i:10;anchors_height:100;anchors_width:100}
D{i:14;anchors_height:263;anchors_width:246}
}
##^##*/