Skip to content

Commit

Permalink
QObject.$delete: Force set of read-only parent property to undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenmdangelo committed Jan 3, 2017
1 parent 6f4e854 commit d20d820
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/qtbase/QObject.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ class QObject {
// must do this:
// 1) parent will be notified and erase object from it's children.
// 2) DOM node will be removed.
this.parent = undefined;

// Cannot do "this.parent = undefined" because this.parent is readOnly
if (this.$properties.parent) {
this.$properties.parent.set(undefined, QmlWeb.QMLProperty.ReasonUser);
}

// Disconnect any slots connected to any of our signals. Do this after
// clearing the parent, as that relies on parentChanged being handled.
Expand Down

0 comments on commit d20d820

Please sign in to comment.