TG-PlatformPlus/qml/Instruction/common/RequestComboBox.qml

38 lines
782 B
QML
Raw Normal View History

2026-03-02 14:29:58 +08:00
import QtQuick
import QtQuick.Controls
BaseCommon
{
id: self
width: parent.width
height: 25
property var lst: ["GET","POST","PUT","DELETE"]
Item
{
id: titleItem
width: 100
height: parent.height
Text{
id: titleText
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
text: title
}
}
ComboBox{
id: cb
anchors.left: titleItem.right
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
model: lst
onActivated: {
value = lst[currentIndex]
}
}
function setValue(_value)
{
value = _value
cb.currentIndex = cb.find(_value)
}
}