From f5f76cca2361d63829d3b7f04a981604fd6c209b Mon Sep 17 00:00:00 2001 From: David Faure <faure@kde.org> Date: Mon, 3 Aug 2015 13:54:03 +0200 Subject: [PATCH 15/47] Allow child dialogs to have a separate akonadi-not-started overlay. REVIEW: 124604 --- akonadi/erroroverlay.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/akonadi/erroroverlay.cpp b/akonadi/erroroverlay.cpp index 0eaa0768d..3178c0b64 100644 --- a/akonadi/erroroverlay.cpp +++ b/akonadi/erroroverlay.cpp @@ -40,7 +40,8 @@ public: K_GLOBAL_STATIC(ErrorOverlayStatic, sInstanceOverlay) -static bool isParentOf(QObject *o1, QObject *o2) +// return true if o1 is a parent of o2 +static bool isParentOf(QWidget *o1, QWidget *o2) { if (!o1 || !o2) { return false; @@ -48,7 +49,10 @@ static bool isParentOf(QObject *o1, QObject *o2) if (o1 == o2) { return true; } - return isParentOf(o1, o2->parent()); + if (o2->isWindow()) { + return false; + } + return isParentOf(o1, o2->parentWidget()); } ErrorOverlay::ErrorOverlay(QWidget *baseWidget, QWidget *parent) -- 2.14.1