From 57c09a7e991c66f1d7a2762e644866f6e2b23ea3 Mon Sep 17 00:00:00 2001
From: Jens Bache-Wiig <jens.bache-wiig@nokia.com>
Date: Fri, 11 Dec 2009 12:41:13 +0100
Subject: [PATCH] Fixes:    Fix cosmetics with KDE file dialog

Task:     QTCREATORBUG-465
Details:
We should simply ignore custom styling on our dialogs.
I also slightly optimized the panelWidget check.
---
 src/plugins/coreplugin/manhattanstyle.cpp | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/src/plugins/coreplugin/manhattanstyle.cpp b/src/plugins/coreplugin/manhattanstyle.cpp
index 3b23ed05b9a..b51e2c90a16 100644
--- a/src/plugins/coreplugin/manhattanstyle.cpp
+++ b/src/plugins/coreplugin/manhattanstyle.cpp
@@ -76,16 +76,22 @@ bool styleEnabled(const QWidget *widget)
 // Consider making this a QStyle state
 bool panelWidget(const QWidget *widget)
 {
-    const QWidget *p = widget;
+    if (!widget)
+        return false;
+
+    // Dont style dialogs or explicitly ignored widgets
+    if (qobject_cast<const QDialog *>(widget->window()))
+        return false;
 
+    // Style toolbars, statusbar and menubar
+    if (qobject_cast<const QToolBar *>(widget) ||
+        qobject_cast<const QStatusBar *>(widget) ||
+        qobject_cast<const QMenuBar *>(widget))
+        return styleEnabled(widget);
+
+    const QWidget *p = widget;
     while (p) {
-        if (qobject_cast<const QToolBar *>(p) && styleEnabled(p))
-            return true;
-        else if (qobject_cast<const QStatusBar *>(p) && styleEnabled(p))
-            return true;
-        else if (qobject_cast<const QMenuBar *>(p) && styleEnabled(p))
-            return true;
-        else if (p->property("panelwidget").toBool())
+        if (p->property("panelwidget").toBool())
             return true;
         p = p->parentWidget();
     }
-- 
GitLab