-
Notifications
You must be signed in to change notification settings - Fork 0
/
BComboBox.qml
36 lines (35 loc) · 913 Bytes
/
BComboBox.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import QtQuick 2.12
import QtQuick.Controls 2.12
Item{
id: root
implicitHeight: row.height
implicitWidth: row.width
property string label: ''
property variant items: []
property string stringvalue:'0\t'
property bool enabled: true
property int value: 0
property int fieldwidth: 150
property bool persistent: false
signal reset()
onReset: if(!persistent)control.currentIndex=0
Row{
id: row
spacing: 10
Label{
text: root.label
anchors.verticalCenter: parent.verticalCenter
}
ComboBox{
id: control
model: items
enabled: root.enabled
width: root.fieldwidth
currentIndex: root.value
onCurrentTextChanged: {
root.value=currentIndex
root.stringvalue=currentText+'\t'
}
}
}
}