with this statement in javascript, you loose the dynamic binding between imageSource and level and charging; to keep it, you need to use the Qt.binding function, like = Qt.binding( function(level, charging) { return __getIconForBatteryLevel(level, charging); } ) or something like that. I need to check it :)