I can't find anything definitive either. The best I can suggest is to put a breakpoint in the Worker Object's destructor and see if it hits, then examine the call stack to find out who is deleting it.
Well, not exactly. Being an owner means you control the lifetime of the C++ object instances you own, so you determine when they go out of scope and get deleted. If you are owned, you may not be able to find out who your owner is. Being parented is a more formal, hierarchical arrangement, eg. in Qt you can call QObject::parent() and get a pointer to your parent QObject (who is also your owner).I guess part of my confusion is the difference between being the owner and being the parent -- which I thought were synonymous in Qt.
An example: QTableWidgetItem instances are owned by the QTableWidget they are set on, but they are not parented by the QTableWidget. On the other hand, if you call QTableWidget::setCellWidget(), the QWidget pointer you pass in becomes both owned and parented by the QTableWidget.




Reply With Quote

Bookmarks