aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls/imagine/SwitchDelegate.qml
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2017-09-13 11:32:27 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2017-09-14 09:05:26 +0000
commit7cbf3685565d7f62c9a01b090a4c1600b4abe220 (patch)
tree20baffc826c01b9695d2d104c07b78f5196cf9c0 /src/imports/controls/imagine/SwitchDelegate.qml
parentc829b2a8b4e80cf9b829b3ead0a69722c1b04a1a (diff)
Imagine: fix QRC paths
Using ApplicationWindow as an example, its NinePatchImage url is assigned like so: source: Imagine.path + "applicationwindow-background" If Imagine.path is set to ":/images" by the user, then the final URL would be: QUrl("file:///home/user/qt/qtbase/qml/QtQuick/Controls.2/Imagine/:/images/applicationwindow-background") We could use a QUrl for QQuickImagineStyle::path, but we don't want to support anything other than local paths. Instead, we add a private "url" property that returns a URL that we construct correctly in C++ ourselves, and then the Imagine QML controls files use that property. Change-Id: Ic4d1910bbc7f7b6f80f257496ae6131777a19401 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'src/imports/controls/imagine/SwitchDelegate.qml')
-rw-r--r--src/imports/controls/imagine/SwitchDelegate.qml6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/imports/controls/imagine/SwitchDelegate.qml b/src/imports/controls/imagine/SwitchDelegate.qml
index 97bb03b9..0c9bfb15 100644
--- a/src/imports/controls/imagine/SwitchDelegate.qml
+++ b/src/imports/controls/imagine/SwitchDelegate.qml
@@ -68,7 +68,7 @@ T.SwitchDelegate {
width: Math.max(implicitWidth, handle.leftPadding && handle.rightPadding ? handle.implicitWidth : 2 * handle.implicitWidth)
height: Math.max(implicitHeight, handle.implicitHeight)
- source: Imagine.path + "switchdelegate-indicator"
+ source: Imagine.url + "switchdelegate-indicator"
NinePatchImageSelector on source {
states: [
{"disabled": !control.enabled},
@@ -90,7 +90,7 @@ T.SwitchDelegate {
x: Math.max(minPos, Math.min(maxPos, control.visualPosition * parent.width - (width / 2)))
y: (parent.height - height) / 2
- source: Imagine.path + "switchdelegate-handle"
+ source: Imagine.url + "switchdelegate-handle"
NinePatchImageSelector on source {
states: [
{"disabled": !control.enabled},
@@ -130,7 +130,7 @@ T.SwitchDelegate {
width: control.width + leftInset + rightInset
height: control.height + topInset + bottomInset
- source: Imagine.path + "switchdelegate-background"
+ source: Imagine.url + "switchdelegate-background"
NinePatchImageSelector on source {
states: [
{"disabled": !control.enabled},