Does QStatusBar takes ownership of widget?
-
It becomes childWidget. It will be deleted if status bar is deleted. What you wanted to achieve ? Can add more details ? Where is confusion coming ?
-
I just wanted to know if it takes ownership or the parenting, usually the documentation points out when the method does or does not take ownership.
Take as an example
QLabel::setMovie
, it does not take the ownership of theQMovie
and in the docs it says that.I read the source code and noticed that
addWidget
is usinginsertWidget
internally andinsertWidget
reparenting the widget.It's solved, thank you.
-
@Mr-Gisa
In most cases the docs mention if ownership is not transferred if there can be any doubts.
In most cases where you give widget classX to to other widget based class as pointer, the normal
object tree is in effect.
http://doc.qt.io/qt-5/objecttrees.html
And parent/container owns the inserted widget.