PDA

View Full Version : Difference between setWidget and addWidget



Nunkij
22nd April 2021, 17:14
Is there a practical difference between the methods setWidget() and addWidget()? Or it depends only on the object which they belong?

Thank you :)

peppermg
22nd April 2021, 17:21
Need more information on which class's 'setWidget()' and 'addWidget()' you are talking about.

Nunkij
22nd April 2021, 17:33
I would like to know if there are differences without considering the classes. I will be more specific soon :)

d_stranz
23rd April 2021, 03:09
Maybe English is not your first language, but "set" usually means you are replacing one widget instance (which could be null) with another one. "Add" usually means that you are putting one or more widgets into a list that could be arbitrarily long.