2

I would like to understand when qt5 deletes the data of a DOM node.

My first question is: when a node is created (QDomDocument factory method) but it isn't placed in the DOM tree, will it's internal data be deleted (or will the QDomDocument still hold a reference)?

domDocument.createElement("test");
// reference not stored by user, element not placed in tree
// may? be held by domDocument

My second question is: when the user holds a reference to a single node in de dom tree (e.g. a QDomElement) but no other references (e.g. no QDomDocument), which nodes will be kept alive?

  • all child nodes, no parents and no siblings?
  • all child nodes, no parents except for the QDomDocument?
  • all nodes of the QDomDocument?
  • none (you don't hold a reference to the QDomDocument)
Tom Deseyn
  • 1,735
  • 3
  • 17
  • 29

0 Answers0