Quote:
Originally Posted by
cass
But what happens to root QWidgets?
Nothing happens to them.
Quote:
What happens if you add a QWidget to a QScene?
Does the QScene now owns the QWidget or does the QGraphicsViewProxy now owns the QWidget?
Reading the docs from time to time, really doesn't hurt.
Quote:
Originally Posted by QGraphicsProxyWidget docs
QGraphicsProxyWidget shares ownership with QWidget, so if either of the two widgets are destroyed, the other widget will be automatically destroyed as well.
Quote:
What owns the QGraphicsViewProxy objects that is returned by scene->addWidget(new_widget)?
There is no such class in Qt currently but if you mean QGraphicsProxyWidget then it's an item like any other so the same rules that apply to other items apply to this item class as well.
Quote:
Will a widget take ownership of a layout?
Yes, the layout is reparented to the widget it controls.
Quote:
E.g. what happens with root_widget->setLayout(new_layout)?
What do you mean "what happens"? The world will not explode, I can tell you that :)
Quote:
Will the layout take ownership if I add a widget/layout to a root layout, e.g. root_layout->addWidget(new_widget) or root_layout->addLayout(new_sub_layout)?
Layout doesn't own any widgets.
Quote:
If I have an application that dynamically creates objects and setup QT signal connections between the events with QObject::connect(), is it safe to assume that the connections will automatically be deleted when either one of the objects they used to connect gets deleted?
Yes.
You know, all of these questions could have been answered by writing a simple test application and it would take less time than asking those questions here...