Files
qt-creator/tests/auto/qml/qmldesigner/data/merging/SwitchStyle.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.2 KiB
QML

import QtQuick 2.12
Item {
width: 640
height: 480
Rectangle {
id: switchIndicator
x: 219
y: 34
width: 64
height: 44
color: "#e9e9e9"
radius: 16
border.color: "#dddddd"
Rectangle {
id: switchHandle //id is required for states
width: 31
height: 44
radius: 16
color: "#e9e9e9"
border.color: "#808080"
}
}
Rectangle {
id: switchBackground
x: 346
y: 27
width: 144
height: 52
color: "#c2c2c2"
border.color: "#808080"
Text {
id: switchBackgroundText
text: "background"
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
anchors.rightMargin: 12
}
}
Text {
id: element
x: 1
y: 362
color: "#eaeaea"
text: qsTrId("Some stuff for reference that is thrown away")
font.pixelSize: 32
}
Rectangle { //This is ignored when merging
id: weirdStuff02
x: 8
y: 87
width: 624
height: 200
color: "#ffffff"
}
}