diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-04-21 17:30:01 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-04-24 09:01:21 +0000 |
commit | 46cd10b3a5be2557d40336ca5cc236690ce8398a (patch) | |
tree | 80f080b7584a0565f6b69dd94666f21a7f9f3fc5 /tests/auto/controls/data/tst_switchdelegate.qml | |
parent | 2aa0c5015e26e1374f6b24ee7023adc58e380403 (diff) |
QQuickIcon: fix the type of the source property
For example, something like:
Button {
icon.source: "../images/drawer.png"
}
did not work in the Gallery example, even though it works fine for
Image elements etc. The URL needs to be resolved relative to the
caller. By making the property an URL instead of a plain string,
the QML engine does the correct thing automatically.
Note: icon.source.length no longer works in auto tests, so it got
replaced by a compare().
Change-Id: I5fdb3aa55003d2f04e5458b7636e4dae3fa9857c
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests/auto/controls/data/tst_switchdelegate.qml')
-rw-r--r-- | tests/auto/controls/data/tst_switchdelegate.qml | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/controls/data/tst_switchdelegate.qml b/tests/auto/controls/data/tst_switchdelegate.qml index a1e6c072..8f240409 100644 --- a/tests/auto/controls/data/tst_switchdelegate.qml +++ b/tests/auto/controls/data/tst_switchdelegate.qml @@ -564,7 +564,7 @@ TestCase { "LayoutMirroring.enabled": !!data.mirrored }) verify(control) - verify(control.icon.source.length > 0) + compare(control.icon.source, "qrc:/qt-project.org/imports/QtQuick/Controls.2/images/check.png") var iconImage = findChild(control.contentItem, "image") var textLabel = findChild(control.contentItem, "label") |