Skip to content
Snippets Groups Projects
Commit 57c09a7e authored by Jens Bache-Wiig's avatar Jens Bache-Wiig
Browse files

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.
parent b5abd7b9
No related branches found
No related tags found
No related merge requests found
...@@ -76,16 +76,22 @@ bool styleEnabled(const QWidget *widget) ...@@ -76,16 +76,22 @@ bool styleEnabled(const QWidget *widget)
// Consider making this a QStyle state // Consider making this a QStyle state
bool panelWidget(const QWidget *widget) 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) { while (p) {
if (qobject_cast<const QToolBar *>(p) && styleEnabled(p)) if (p->property("panelwidget").toBool())
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())
return true; return true;
p = p->parentWidget(); p = p->parentWidget();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment