Update imageelements example to Qt 6 url syntax
The imageelements examples depended on URLs being resolved relative to the file where it was declared, but in Qt 6 this was changed. Since the source is actually resolved inside MyBorderImage, which is in content/, we would end up trying to resolve content/content/foo.png. To avoid having code depend on the location of types it is using, URLs have to be packed in Qt.resolvedUrl() in Qt 6. Change-Id: I16e203e92b3b4c7c573dcdb85dcd556f2103ab80 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
parent
803a5fda05
commit
07d646d1b0
|
@ -81,47 +81,47 @@ Rectangle {
|
|||
|
||||
MyBorderImage {
|
||||
minWidth: 120; maxWidth: 240; minHeight: 120; maxHeight: 200
|
||||
source: "content/colors.png"; margin: 30
|
||||
source: Qt.resolvedUrl("content/colors.png"); margin: 30
|
||||
}
|
||||
|
||||
MyBorderImage {
|
||||
minWidth: 120; maxWidth: 240; minHeight: 120; maxHeight: 200
|
||||
source: "content/colors.png"; margin: 30
|
||||
source: Qt.resolvedUrl("content/colors.png"); margin: 30
|
||||
horizontalMode: BorderImage.Repeat; verticalMode: BorderImage.Repeat
|
||||
}
|
||||
|
||||
MyBorderImage {
|
||||
minWidth: 120; maxWidth: 240; minHeight: 120; maxHeight: 200
|
||||
source: "content/colors.png"; margin: 30
|
||||
source: Qt.resolvedUrl("content/colors.png"); margin: 30
|
||||
horizontalMode: BorderImage.Stretch; verticalMode: BorderImage.Repeat
|
||||
}
|
||||
|
||||
MyBorderImage {
|
||||
minWidth: 120; maxWidth: 240; minHeight: 120; maxHeight: 200
|
||||
source: "content/colors.png"; margin: 30
|
||||
source: Qt.resolvedUrl("content/colors.png"); margin: 30
|
||||
horizontalMode: BorderImage.Round; verticalMode: BorderImage.Round
|
||||
}
|
||||
|
||||
MyBorderImage {
|
||||
minWidth: 60; maxWidth: 200; minHeight: 40; maxHeight: 200
|
||||
source: "content/bw.png"; margin: 10
|
||||
source: Qt.resolvedUrl("content/bw.png"); margin: 10
|
||||
}
|
||||
|
||||
MyBorderImage {
|
||||
minWidth: 60; maxWidth: 200; minHeight: 40; maxHeight: 200
|
||||
source: "content/bw.png"; margin: 10
|
||||
source: Qt.resolvedUrl("content/bw.png"); margin: 10
|
||||
horizontalMode: BorderImage.Repeat; verticalMode: BorderImage.Repeat
|
||||
}
|
||||
|
||||
MyBorderImage {
|
||||
minWidth: 60; maxWidth: 200; minHeight: 40; maxHeight: 200
|
||||
source: "content/bw.png"; margin: 10
|
||||
source: Qt.resolvedUrl("content/bw.png"); margin: 10
|
||||
horizontalMode: BorderImage.Stretch; verticalMode: BorderImage.Repeat
|
||||
}
|
||||
|
||||
MyBorderImage {
|
||||
minWidth: 60; maxWidth: 200; minHeight: 40; maxHeight: 200
|
||||
source: "content/bw.png"; margin: 10
|
||||
source: Qt.resolvedUrl("content/bw.png"); margin: 10
|
||||
horizontalMode: BorderImage.Round; verticalMode: BorderImage.Round
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue