From Qt docs

The label resizes itself if auto-resizing is enabled.
But I am not able to figure how to enable auto-resizing.

Can someone please help?

Thanks a lot.