you can create a custom property :
property QtObject dynamic_button

and the save the result of createobject to this property.
then use this property as you would with an item id.