@@ -69,9 +69,12 @@ Rectangle {
6969 Timer {
7070 id: timer
7171 property int index: -1
72+ property bool changeIcon: true
7273 interval: 500
7374 onTriggered: {
74− actionDataActions.actions[index].icon = Qt.resolvedUrl("../../UnityLogo.png");
75+ if (changeIcon) {
76+ actionDataActions.actions[index].icon = Qt.resolvedUrl("../../UnityLogo.png");
77+ }
7578 preview.widgetDataChanged();
7679 index = -1;
7780 }
@@ -89,12 +92,14 @@ Rectangle {
8992
9093 function test_checkButtonWithTemporary_data() {
9194 return [
92− {tag: "with temporary", temporaryIcon: "emblem", index: 0},
93− {tag: "without temporary", temporaryIcon: undefined, index: 2},
95+ {tag: "with temporary change icon", temporaryIcon: "emblem", index: 0, changeIcon: true},
96+ {tag: "with temporary no change icon", temporaryIcon: "emblem", index: 1, changeIcon: false},
97+ {tag: "without temporary", temporaryIcon: undefined, index: 2, changeIcon: true},
9498 ];
9599 }
96100
97101 function test_checkButtonWithTemporary(data) {
102+ waitForRendering(preview);
98103 spy.target = preview;
99104
100105 var buttonId = actionDataActions.actions[data.index].id;
@@ -108,6 +113,7 @@ Rectangle {
108113
109114 compare(image.source, buttonIcon);
110115 compare(label.text, buttonLabel);
116+ timer.changeIcon = data.changeIcon;
111117 mouseClick(button);
112118 compare(spy.count, 1);
113119 compare(spy.signalArguments[0][1], buttonId);
@@ -119,7 +125,11 @@ Rectangle {
119125 tryCompareFunction(function() {
120126 var button = findChild(root, "button" + buttonId);
121127 var image = findChildsByType(button, "QQuickImage")[0];
122− return image.source && image.source.toString().indexOf("UnityLogo") > -1;
128+ if (data.changeIcon) {
129+ return image.source && image.source.toString().indexOf("UnityLogo") > -1;
130+ } else {
131+ return image.source && image.source == buttonIcon;
132+ }
123133 }, true);
124134 }
125135 }