aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/controls/data/tst_abstractbutton.qml
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-04-21 17:30:01 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2017-04-24 09:01:21 +0000
commit46cd10b3a5be2557d40336ca5cc236690ce8398a (patch)
tree80f080b7584a0565f6b69dd94666f21a7f9f3fc5 /tests/auto/controls/data/tst_abstractbutton.qml
parent2aa0c5015e26e1374f6b24ee7023adc58e380403 (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_abstractbutton.qml')
-rw-r--r--tests/auto/controls/data/tst_abstractbutton.qml4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/controls/data/tst_abstractbutton.qml b/tests/auto/controls/data/tst_abstractbutton.qml
index b797dfcb..8ab91e3a 100644
--- a/tests/auto/controls/data/tst_abstractbutton.qml
+++ b/tests/auto/controls/data/tst_abstractbutton.qml
@@ -184,8 +184,8 @@ TestCase {
var iconSourceSpy = signalSpy.createObject(control, { target: control.icon, signalName: "sourceChanged"} )
verify(iconSourceSpy.valid)
- control.icon.source = "test-source"
- compare(control.icon.source, "test-source")
+ control.icon.source = "qrc:/test-source"
+ compare(control.icon.source, "qrc:/test-source")
compare(iconSourceSpy.count, 1)
var iconWidthSpy = signalSpy.createObject(control, { target: control.icon, signalName: "widthChanged"} )