aboutsummaryrefslogtreecommitdiffstats
path: root/src/templates
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2016-01-07 13:35:30 +0100
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2016-01-07 17:11:01 +0000
commit14b41264a1c3770e98d2ff075ba8bbe6cda2f841 (patch)
treea1c5accbf3f256ece02291556e7b022b0516c806 /src/templates
parentddebc2d5ded6e08449b10311dd3c6634c84d71b5 (diff)
ApplicationWindow: don't delete old headers and footers
Change-Id: I6df97edff6f034d79cbd95828a17d5f48dbf1d46 Task-number: QTBUG-50332 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'src/templates')
-rw-r--r--src/templates/qquickapplicationwindow.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/templates/qquickapplicationwindow.cpp b/src/templates/qquickapplicationwindow.cpp
index 46f07d3e..3e6734d7 100644
--- a/src/templates/qquickapplicationwindow.cpp
+++ b/src/templates/qquickapplicationwindow.cpp
@@ -240,7 +240,8 @@ void QQuickApplicationWindow::setHeader(QQuickItem *header)
{
Q_D(QQuickApplicationWindow);
if (d->header != header) {
- delete d->header;
+ if (d->header)
+ QQuickItemPrivate::get(d->header)->removeItemChangeListener(d, QQuickItemPrivate::ImplicitWidth | QQuickItemPrivate::ImplicitHeight);
d->header = header;
if (header) {
header->setParentItem(contentItem());
@@ -273,7 +274,8 @@ void QQuickApplicationWindow::setFooter(QQuickItem *footer)
{
Q_D(QQuickApplicationWindow);
if (d->footer != footer) {
- delete d->footer;
+ if (d->footer)
+ QQuickItemPrivate::get(d->footer)->removeItemChangeListener(d, QQuickItemPrivate::ImplicitWidth | QQuickItemPrivate::ImplicitHeight);
d->footer = footer;
if (footer) {
footer->setParentItem(contentItem());