aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2016-04-08 06:58:45 +0400
committerKonstantin Ritt <ritt.ks@gmail.com>2016-04-09 16:28:05 +0000
commitf7d95592db8da0c70f57e3c84a2c0dc7c44fccc4 (patch)
treee240349606c37a014b20340b39c276071a210483
parente13f6fbdc2c979b71ab6330148b330c9fc1b220a (diff)
Relayout on setting the header or footer to null
Passing null to i.e. Page's header resets the header item to Page's initial value, so that Page with unset header must look exactly like Page that never had header set. Change-Id: I553e5d2463e099723b74b0eec1b2224ae8ee970f Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
-rw-r--r--src/templates/qquickapplicationwindow.cpp8
-rw-r--r--src/templates/qquickpage.cpp8
2 files changed, 8 insertions, 8 deletions
diff --git a/src/templates/qquickapplicationwindow.cpp b/src/templates/qquickapplicationwindow.cpp
index 43d51030..d9a0097b 100644
--- a/src/templates/qquickapplicationwindow.cpp
+++ b/src/templates/qquickapplicationwindow.cpp
@@ -343,9 +343,9 @@ void QQuickApplicationWindow::setHeader(QQuickItem *header)
toolBar->setPosition(QQuickToolBar::Header);
else if (QQuickTabBar *tabBar = qobject_cast<QQuickTabBar *>(header))
tabBar->setPosition(QQuickTabBar::Header);
- if (isComponentComplete())
- d->relayout();
}
+ if (isComponentComplete())
+ d->relayout();
emit headerChanged();
}
@@ -389,9 +389,9 @@ void QQuickApplicationWindow::setFooter(QQuickItem *footer)
toolBar->setPosition(QQuickToolBar::Footer);
else if (QQuickTabBar *tabBar = qobject_cast<QQuickTabBar *>(footer))
tabBar->setPosition(QQuickTabBar::Footer);
- if (isComponentComplete())
- d->relayout();
}
+ if (isComponentComplete())
+ d->relayout();
emit footerChanged();
}
diff --git a/src/templates/qquickpage.cpp b/src/templates/qquickpage.cpp
index 98b71724..8e0b542f 100644
--- a/src/templates/qquickpage.cpp
+++ b/src/templates/qquickpage.cpp
@@ -200,9 +200,9 @@ void QQuickPage::setHeader(QQuickItem *header)
toolBar->setPosition(QQuickToolBar::Header);
else if (QQuickTabBar *tabBar = qobject_cast<QQuickTabBar *>(header))
tabBar->setPosition(QQuickTabBar::Header);
- if (isComponentComplete())
- d->relayout();
}
+ if (isComponentComplete())
+ d->relayout();
emit headerChanged();
}
@@ -246,9 +246,9 @@ void QQuickPage::setFooter(QQuickItem *footer)
toolBar->setPosition(QQuickToolBar::Footer);
else if (QQuickTabBar *tabBar = qobject_cast<QQuickTabBar *>(footer))
tabBar->setPosition(QQuickTabBar::Footer);
- if (isComponentComplete())
- d->relayout();
}
+ if (isComponentComplete())
+ d->relayout();
emit footerChanged();
}