summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2019-08-22 17:37:32 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2019-08-25 23:14:28 +0200
commitdbab68a127189e479ff01a6450b4a45b872b7445 (patch)
treec3e5d60d1e82916c7e9a3cb0df6b4392e702d0d8 /src/widgets/kernel
parent0af7e5564c23c4b34dbea1ae4e31aceff71addc3 (diff)
widgets: Use single return in QWidgetRepaintManager::markNeedsFlush
Change-Id: Ia21c5c57e4c642af2aa87b0539c4af51500a4827 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r--src/widgets/kernel/qwidgetrepaintmanager.cpp27
1 files changed, 11 insertions, 16 deletions
diff --git a/src/widgets/kernel/qwidgetrepaintmanager.cpp b/src/widgets/kernel/qwidgetrepaintmanager.cpp
index 6534d829ab..563e5932d3 100644
--- a/src/widgets/kernel/qwidgetrepaintmanager.cpp
+++ b/src/widgets/kernel/qwidgetrepaintmanager.cpp
@@ -1018,30 +1018,25 @@ void QWidgetRepaintManager::markNeedsFlush(QWidget *widget, const QRegion &regio
if (!widget || widget->d_func()->paintOnScreen() || region.isEmpty())
return;
- // Top-level.
if (widget == tlw) {
+ // Top-level (native)
if (!widget->testAttribute(Qt::WA_WState_InPaintEvent))
needsFlush += region;
- return;
- }
-
- // Alien widgets.
- if (!hasPlatformWindow(widget) && !widget->isWindow()) {
- QWidget *nativeParent = widget->nativeParentWidget(); // Alien widgets with the top-level as the native parent (common case).
+ } else if (!hasPlatformWindow(widget) && !widget->isWindow()) {
+ QWidget *nativeParent = widget->nativeParentWidget();
if (nativeParent == tlw) {
+ // Alien widgets with the top-level as the native parent (common case)
if (!widget->testAttribute(Qt::WA_WState_InPaintEvent))
needsFlush += region.translated(topLevelOffset);
- return;
+ } else {
+ // Alien widgets with native parent != tlw
+ const QPoint nativeParentOffset = widget->mapTo(nativeParent, QPoint());
+ appendDirtyOnScreenWidget(nativeParent, region.translated(nativeParentOffset));
}
-
- // Alien widgets with native parent != tlw
- const QPoint nativeParentOffset = widget->mapTo(nativeParent, QPoint());
- appendDirtyOnScreenWidget(nativeParent, region.translated(nativeParentOffset));
- return;
+ } else {
+ // Native child widgets
+ appendDirtyOnScreenWidget(widget, region);
}
-
- // Native child widgets
- appendDirtyOnScreenWidget(widget, region);
}
void QWidgetRepaintManager::appendDirtyOnScreenWidget(QWidget *widget, const QRegion &region)