cass
11th May 2010, 10:05
I know QT has a parent/child hierarchy way of storing QObject's.
But what happens to root QWidgets? They do not have a constructor that takes a QObject parent. It is possible to make a QObject that does not inherit QWidget the parent of a QWidget?
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?
What owns the QGraphicsViewProxy objects that is returned by scene->addWidget(new_widget)?
Will a widget take ownership of a layout? E.g. what happens with root_widget->setLayout(new_layout)?
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)?
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?
But what happens to root QWidgets? They do not have a constructor that takes a QObject parent. It is possible to make a QObject that does not inherit QWidget the parent of a QWidget?
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?
What owns the QGraphicsViewProxy objects that is returned by scene->addWidget(new_widget)?
Will a widget take ownership of a layout? E.g. what happens with root_widget->setLayout(new_layout)?
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)?
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?