190 lines
4.7 KiB
QML
190 lines
4.7 KiB
QML
import QtQuick 2.0
|
|
import QtQuick.Controls 2.14
|
|
import QtQuick.Layouts 1.0
|
|
|
|
|
|
Item {
|
|
// width: 800
|
|
// height: 600
|
|
width: parent.width - 80
|
|
height: parent.height
|
|
|
|
visible: true
|
|
|
|
ColorAnimation {
|
|
from: "white"
|
|
to: "black"
|
|
duration: 200
|
|
}
|
|
Rectangle{
|
|
x: 0
|
|
y: 0
|
|
width: parent.width
|
|
height: parent.height
|
|
color: "#aeaeae"
|
|
scale: 1
|
|
transformOrigin: Item.Center
|
|
|
|
GridLayout {
|
|
x: 50
|
|
y: 41
|
|
rows: 6
|
|
columns: 2
|
|
|
|
Label {
|
|
id: label
|
|
text: qsTr("串口号: ")
|
|
verticalAlignment: Text.AlignVCenter
|
|
Layout.preferredHeight: 40
|
|
Layout.preferredWidth: 125
|
|
font.pointSize: 20
|
|
wrapMode: Text.NoWrap
|
|
renderType: Text.QtRendering
|
|
horizontalAlignment: Text.AlignHCenter
|
|
}
|
|
|
|
ComboBox {
|
|
id: comboBox
|
|
width: 200
|
|
}
|
|
|
|
Label {
|
|
id: label1
|
|
text: qsTr("波特率: ")
|
|
verticalAlignment: Text.AlignVCenter
|
|
Layout.preferredHeight: 40
|
|
Layout.preferredWidth: 125
|
|
horizontalAlignment: Text.AlignHCenter
|
|
font.pointSize: 20
|
|
renderType: Text.QtRendering
|
|
wrapMode: Text.NoWrap
|
|
}
|
|
|
|
ComboBox {
|
|
id: baurate
|
|
width: 200
|
|
model:[
|
|
"300",
|
|
"600",
|
|
"1200",
|
|
"2400",
|
|
"4800",
|
|
"9600",
|
|
"14400",
|
|
"19200",
|
|
"38400",
|
|
"56000",
|
|
"57600",
|
|
"115200",
|
|
"128000",
|
|
"256000",
|
|
]
|
|
currentIndex: 6
|
|
}
|
|
|
|
Label {
|
|
id: label2
|
|
text: qsTr("数据位: ")
|
|
verticalAlignment: Text.AlignVCenter
|
|
Layout.preferredHeight: 40
|
|
Layout.preferredWidth: 125
|
|
horizontalAlignment: Text.AlignHCenter
|
|
font.pointSize: 20
|
|
renderType: Text.QtRendering
|
|
wrapMode: Text.NoWrap
|
|
}
|
|
|
|
ComboBox {
|
|
id: data_bits
|
|
width: 200
|
|
currentIndex: 3
|
|
|
|
model: [
|
|
"5",
|
|
"6",
|
|
"7",
|
|
"8",
|
|
]
|
|
|
|
}
|
|
|
|
Label {
|
|
id: label3
|
|
text: qsTr("停止位: ")
|
|
verticalAlignment: Text.AlignVCenter
|
|
Layout.preferredHeight: 40
|
|
Layout.preferredWidth: 125
|
|
horizontalAlignment: Text.AlignHCenter
|
|
font.pointSize: 20
|
|
renderType: Text.QtRendering
|
|
wrapMode: Text.NoWrap
|
|
}
|
|
|
|
ComboBox {
|
|
id: comboBox3
|
|
width: 200
|
|
|
|
model: [
|
|
"1",
|
|
"1.5",
|
|
"2",
|
|
]
|
|
}
|
|
|
|
Label {
|
|
id: label4
|
|
text: qsTr("校验位: ")
|
|
verticalAlignment: Text.AlignVCenter
|
|
Layout.preferredHeight: 40
|
|
Layout.preferredWidth: 125
|
|
horizontalAlignment: Text.AlignHCenter
|
|
font.pointSize: 20
|
|
renderType: Text.QtRendering
|
|
wrapMode: Text.NoWrap
|
|
}
|
|
|
|
ComboBox {
|
|
id: comboBox4
|
|
width: 200
|
|
|
|
model: [
|
|
"none",
|
|
"odd",
|
|
"even",
|
|
"mark",
|
|
"space"
|
|
]
|
|
}
|
|
|
|
Label {
|
|
id: label5
|
|
text: qsTr("流控: ")
|
|
verticalAlignment: Text.AlignVCenter
|
|
Layout.preferredHeight: 40
|
|
Layout.preferredWidth: 125
|
|
horizontalAlignment: Text.AlignHCenter
|
|
font.pointSize: 20
|
|
renderType: Text.QtRendering
|
|
wrapMode: Text.NoWrap
|
|
}
|
|
|
|
ComboBox {
|
|
id: comboBox5
|
|
width: 200
|
|
model: [
|
|
"none",
|
|
"software",
|
|
"hardware",
|
|
]
|
|
}
|
|
}
|
|
|
|
Button {
|
|
id: button
|
|
x: 97
|
|
y: 339
|
|
text: qsTr("打开串口")
|
|
}
|
|
}
|
|
}
|