SliderWidget.qml 762 Bytes
Newer Older
1
import Qt 4.7
2 3 4
import Bauhaus 1.0

QWidget {
5
    id: sliderWidget
6

7
    property variant value
8 9 10
    property alias singleStep: localSlider.singleStep
    property alias minimum: localSlider.minimum
    property alias maximum: localSlider.maximum
11
    property variant backendValue
12 13 14

    QSlider {
        orientation: "Qt::Horizontal";
15 16 17
        id: localSlider
        y: sliderWidget.height / 2 - 12
        width: sliderWidget.width
18
        height: 24
19
        value: sliderWidget.value
20 21 22
        onValueChanged: {        
            if (sliderWidget.value != value)
                sliderWidget.value = value
23 24 25
        }

        onSliderPressed: {
26
            transaction.start();
27 28
        }
        onSliderReleased: {
29
            transaction.end();
30
        }
31 32
    }
}