Code refac: call widget.setData once with an object as parameter.