| 1 |
import QtQuick 2.0 |
| 2 |
import QtQuick.Controls 1.2 |
| 3 |
import QtQuick.Layouts 1.1 |
| 4 |
|
| 5 |
Rectangle { |
| 6 |
id: ccRect |
| 7 |
width: 200 |
| 8 |
height: 30 |
| 9 |
|
| 10 |
property int ccNumber: 1 |
| 11 |
|
| 12 |
signal ccValueChanged(int ccNumber, int value); |
| 13 |
|
| 14 |
Row { // maybe better to do as RowLayout, dynamic sizes |
| 15 |
x: 5 |
| 16 |
y: 5 |
| 17 |
spacing: 5 |
| 18 |
//width: parent.width |
| 19 |
|
| 20 |
Label {id: ccLabel; text: qsTr("CC"); } |
| 21 |
SpinBox {id: cc; |
| 22 |
minimumValue: 1; maximumValue: 119; stepSize: 1; |
| 23 |
value: ccNumber; |
| 24 |
width: 55 // to be wide enough for 2 numbers |
| 25 |
onValueChanged: ccNumber = value; |
| 26 |
Keys.forwardTo: ccRect |
| 27 |
} |
| 28 |
|
| 29 |
Slider { |
| 30 |
id: valueSlider; |
| 31 |
width: ccRect.width - ccLabel.width - cc.width - 25; |
| 32 |
minimumValue: 0 ; maximumValue: 127; stepSize: 1; |
| 33 |
value: 0 |
| 34 |
onValueChanged: ccValueChanged(cc.value, value) |
| 35 |
} |
| 36 |
} |
| 37 |
} |
| 38 |
|