diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-02-11 18:24:18 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-02-12 12:44:07 +0000 |
commit | 244cc6eec931f0b46e3d2b8ea32f03b32cb1023e (patch) | |
tree | bd590e8e4b98e82ba6b820d8543b486f4082fb4c /src/templates/qquickoverlay.cpp | |
parent | 8d5a8ee53d089cea7543040ecb11d165ab34c506 (diff) |
Templates: follow the Qt coding style
Return early to keep the indentation low. This style was already used
in many areas, so now the same style is consistently used everywhere.
Change-Id: Ibc7c05147fdcf226ad1cbdd26cd70e1da89108af
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'src/templates/qquickoverlay.cpp')
-rw-r--r-- | src/templates/qquickoverlay.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/templates/qquickoverlay.cpp b/src/templates/qquickoverlay.cpp index 1b411efe..b20088ba 100644 --- a/src/templates/qquickoverlay.cpp +++ b/src/templates/qquickoverlay.cpp @@ -132,19 +132,20 @@ QQuickItem *QQuickOverlay::background() const void QQuickOverlay::setBackground(QQuickItem *background) { Q_D(QQuickOverlay); - if (d->background != background) { - delete d->background; - d->background = background; - if (background) { - background->setOpacity(0.0); - background->setParentItem(this); - if (qFuzzyIsNull(background->z())) - background->setZ(-1); - if (isComponentComplete()) - d->resizeBackground(); - } - emit backgroundChanged(); + if (d->background == background) + return; + + delete d->background; + d->background = background; + if (background) { + background->setOpacity(0.0); + background->setParentItem(this); + if (qFuzzyIsNull(background->z())) + background->setZ(-1); + if (isComponentComplete()) + d->resizeBackground(); } + emit backgroundChanged(); } void QQuickOverlay::itemChange(ItemChange change, const ItemChangeData &data) |