347
property string iconName: "contact"
348
property string iconSource
351
id: actionWithPropertiesFromStyle
352
iconName: styleProperties.iconName
353
iconSource: styleProperties.iconSource
354
property int numIconSourceChanged: 0
355
onIconSourceChanged: numIconSourceChanged++
357
function test_icon_name_and_source_from_style_bug1616858() {
358
compare(actionWithPropertiesFromStyle.iconName, "contact",
359
"iconName not properly copied from style.");
360
compare(actionWithPropertiesFromStyle.iconSource, "image://theme/contact",
361
"iconSource not properly set with an undefined iconSource from style.");
362
compare(actionWithPropertiesFromStyle.numIconSourceChanged, 1,
363
"iconSource did not update exactly once.");
364
var newIconSource = Qt.resolvedUrl("../../../examples/ubuntu-ui-toolkit-gallery/small_avatar.png")
365
styleProperties.iconSource = newIconSource;
366
compare(actionWithPropertiesFromStyle.iconSource, newIconSource,
367
"Failed to update iconSource from style properly.");
368
compare(actionWithPropertiesFromStyle.numIconSourceChanged, 2,
369
"Incorrect number of updates to icon source.");