When a widget is added to a QToolBox, will the ownership of the widget be transfered to the QToolBox? Phrased differently: Will it become the new parent and destroy the widget when itself is destroyed)?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you construct the widget using
new QWidget(pointer_to_toolbox);or something similar the toolbox will take ownership of the widget.The documentation of addItem() doesn’t say anything about ownership, so I would bet that the toolbox doesn’t take ownership of any widget passed to
addItem()