b
This commit is contained in:
+102
-48
@@ -30,6 +30,18 @@ Rectangle {
|
|||||||
property int number : 1
|
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.width: 1
|
||||||
border.color: "blue"
|
border.color: "blue"
|
||||||
antialiasing: true
|
antialiasing: true
|
||||||
@@ -181,36 +193,98 @@ Rectangle {
|
|||||||
color: "#ffffff"
|
color: "#ffffff"
|
||||||
radius: 9
|
radius: 9
|
||||||
|
|
||||||
ItemDelegate {
|
Rectangle
|
||||||
id: control
|
{
|
||||||
text: qsTr("ItemDelegate")
|
anchors.rightMargin: 10
|
||||||
checkable: true
|
anchors.bottomMargin: 10
|
||||||
checked: true
|
anchors.leftMargin: 10
|
||||||
anchors.fill: parent
|
anchors.topMargin: 10
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
contentItem: Text {
|
ColumnLayout
|
||||||
rightPadding: control.spacing
|
{
|
||||||
text: control.text
|
spacing: 2
|
||||||
font: control.font
|
anchors.fill: parent
|
||||||
color: control.enabled ? (control.down ? "#17a81a" : "#21be2b") : "#bdbebf"
|
|
||||||
elide: Text.ElideRight
|
Rectangle
|
||||||
verticalAlignment: Text.AlignVCenter
|
{
|
||||||
}
|
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}
|
|
||||||
}
|
|
||||||
##^##*/
|
|
||||||
|
|||||||
Reference in New Issue
Block a user