-
Notifications
You must be signed in to change notification settings - Fork 0
/
StyleParameter.qml
39 lines (35 loc) · 1013 Bytes
/
StyleParameter.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
37
38
39
import QtQuick
import QtQuick.Controls
Row {
id: root
spacing: Style.intraSpacing
property bool enabled: true
property alias label: label.text
property alias model: comboBox.model
property alias currentIndex: comboBox.currentIndex
property alias currentValue: comboBox.currentValue
signal activated(var currentValue)
Text {
id: label
height: Style.height
width: Style.widthShort
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
color: root.enabled ? "black" : "gray"
font.pointSize: Style.fontSize
}
ComboBox {
id: comboBox
height: Style.height
width: Style.widthLong
enabled: root.enabled
displayText: currentText
textRole: "text"
valueRole: "value"
font.pointSize: Style.fontSize
background: StyleRectangle {
anchors.fill: parent
}
onActivated: root.activated(currentValue)
}
}