aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickstackview_p.cpp
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2016-08-26 12:46:42 +0200
committerMitch Curtis <mitch.curtis@qt.io>2016-09-02 08:23:49 +0000
commit58326f2bc3bceafc0054e790832e0a77db340606 (patch)
tree596cd37c11aab8077980e7e6db9f65e200e1bf82 /src/quicktemplates2/qquickstackview_p.cpp
parent67f67f2cc6de160ddea4aa76afc56e86415ed99b (diff)
StackView: add removed() attached signal
This provides an opportunity for users to destroy items that StackView doesn't, like objects that are pushed as Items. [ChangeLog][Controls][StackView] Added StackView.removed() attached signal to provide a way to delete items that StackView won't. Task-number: QTBUG-55405 Change-Id: I59096efaf1a95d36451fbf1f46b8f68ee96c20de Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickstackview_p.cpp')
-rw-r--r--src/quicktemplates2/qquickstackview_p.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/quicktemplates2/qquickstackview_p.cpp b/src/quicktemplates2/qquickstackview_p.cpp
index 0f5674c2..438b4269 100644
--- a/src/quicktemplates2/qquickstackview_p.cpp
+++ b/src/quicktemplates2/qquickstackview_p.cpp
@@ -85,6 +85,7 @@ QQuickStackElement::~QQuickStackElement()
if (ownComponent)
delete component;
+ QQuickStackAttached *attached = attachedStackObject(this);
if (item) {
if (ownItem) {
item->setParentItem(nullptr);
@@ -99,13 +100,15 @@ QQuickStackElement::~QQuickStackElement()
if (item->parentItem() != originalParent) {
item->setParentItem(originalParent);
} else {
- QQuickStackAttached *attached = attachedStackObject(this);
if (attached)
QQuickStackAttachedPrivate::get(attached)->itemParentChanged(item, nullptr);
}
}
}
+ if (attached)
+ emit attached->removed();
+
delete context;
}