Files
qt-creator/tests/auto/qml/qmldesigner/data/merging/SliderTemplate.qml
Michael Brüning de8eb93637 Add stylesheet merger
Adds classes to merge a template qml file and a qml stylesheet that have
been exported from other design tools into a resulting qml file that can
be used for further processing in Qt Design Studio.

Current issues:

* Sometimes it makes sense to define width and height
  if an anchor is present, but most of the time not.

* Actually if the hierachy was defined (e.g. Text item not child of
  background) most likely the anchors should be ignored.
  But this would be just a "dirty" heuristic. I suggest to let the
  template decide. If the template has anchors those have "precedence".
  It is always possible to define templates without anchors.

Task-number: QDS-2071
Change-Id: I9159514a8e884b7ffc31897aef4551b5efbbcb87
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-05-27 18:26:12 +00:00

67 lines
1.7 KiB
QML

import QtQuick 2.6
import QtQuick.Controls 2.0
Slider {
id: control
value: 0.5
background: Item {
x: control.leftPadding
y: control.topPadding + control.availableHeight / 2 - height / 2
implicitWidth: sliderGroove.width
implicitHeight: sliderGroove.height
height: implicitHeight
width: control.availableWidth
Rectangle {
id: sliderGroove
width: 200
height: 4
anchors.fill: parent // has to be preserved
radius: 2
color: "#bdbebf"
}
Item {
width: control.visualPosition * sliderGroove.width // should be preserved
height: sliderGrooveLeft.height
clip: true
Rectangle {
id: sliderGrooveLeft
width: 200
height: 4
color: "#21be2b"
radius: 2
}
}
}
handle: Item {
x: control.leftPadding + control.visualPosition * (control.availableWidth - width)
y: control.topPadding + control.availableHeight / 2 - height / 2
implicitWidth: handleNormal.width
implicitHeight: handleNormal.height
Rectangle {
id: handleNormal
width: 26
height: 26
radius: 13
color: "#f6f6f6"
visible: !control.pressed //has to be preserved
border.color: "#bdbebf"
}
Rectangle {
id: handlePressed
width: 26
height: 26
radius: 13
visible: control.pressed //has to be preserved
color: "#f0f0f0"
border.color: "#bdbebf"
}
}
}