import QtQuick 2.0 Item { id: rectdrag property int xPosition : (barPoint.x+barPoint.width/2-barBlue_Right.width) / (barBackground_Middle.width / 100) property int enterValue property int exportValue : barPoint.x+barPoint.width/2-barBlue_Right.width property alias barBackgroundMiddlewidth:barBackground_Middle.width property alias barBackgroundLeftSource: barBackground_Left.source property alias barBackgroundMiddleSource: barBackground_Middle.source property alias barBackgroundRightSource: barBackground_Right.source property alias barBlueLeftSource: barBlue_Left.source property alias barBlueMiddleSource: barBlue_Middle.source property alias barBlueRightSource: barBlue_Right.source property alias barPointSource: barPoint.source signal dragingEnd(); property int totalValue : barBackground_Middle.width property int barScale:0 //0 to 100 signal dragingStart(); signal barClicked(); width: barBackground_Left.width+barBackground_Middle.width+barBackground_Right.width height: barPoint.height Image{ id:barBackground_Left anchors.verticalCenter: parent.verticalCenter source: "../../../../images/Common/Slider/Media/Media_BarBG_L.png" } Image{ id:barBackground_Middle anchors.left: barBackground_Left.right anchors.verticalCenter: parent.verticalCenter source:"../../../../images/Common/Slider/Media/Media_BarBG_C.png" } Image{ id:barBackground_Right anchors.left:barBackground_Middle.right anchors.verticalCenter: parent.verticalCenter source:"../../../../images/Common/Slider/Media/Media_BarBG_R.png" } Image{ id:barBlue_Left anchors.left:barBackground_Left.left anchors.verticalCenter: parent.verticalCenter source:"../../../../images/Common/Slider/Media/Media_Bar_L.png" } Image{ id:barBlue_Middle width: barPoint.x+barPoint.width/2-2 anchors.left:barBlue_Left.right anchors.verticalCenter: parent.verticalCenter source: "../../../../images/Common/Slider/Media/Media_Bar_C.png" } Image{ id:barBlue_Right anchors.left:barPoint.horizontalCenter anchors.verticalCenter: barBlue_Middle.verticalCenter source:"../../../../images/Common/Slider/Media/Media_Bar_R.png" } // HMIMouseArea{ // id : drag_area // x:barBlue_Middle.x // width: barBackground_Middle.width // height: barPoint.height // onClicked: { // enterValue = drag_area.mouseX // barScale = (enterValue*100)/totalValue; // barClicked(); // } // } Image{ id:barPoint x:-barPoint.width/2+barBlue_Right.width+enterValue source:"../../../../images/Common/Slider/Media/Media_Bar_index.png" // MouseArea{ // x: 0 // y: 0 // anchors.rightMargin: 0 // anchors.bottomMargin: 0 // anchors.leftMargin: 0 // anchors.topMargin: 0 // anchors.fill: parent // drag.target: barPoint // drag.axis: Drag.XAxis // drag.minimumX: -barPoint.width/2+barBlue_Right.width // drag.maximumX: rectdrag.width-barPoint.width/2-barBlue_Right.width // onMouseXChanged: { // enterValue = barPoint.x +barPoint.width/2-barBlue_Right.width // barScale = (enterValue*100)/totalValue; // } // onReleased: { // dragingEnd(); // } // onPressed: { // dragingStart(); // } // } } }