Commit de1fdf89 authored by Jens Bache-Wiig's avatar Jens Bache-Wiig
Browse files

A minor optimization for Manhattanstyle

We don't need the qobject cast. Checking the widget flag
should be a bit faster.

Done-with: danimo
parent c7d08f9b
......@@ -40,7 +40,6 @@
#include <QtGui/QApplication>
#include <QtGui/QComboBox>
#include <QtGui/QDialog>
#include <QtGui/QDialogButtonBox>
#include <QtGui/QDockWidget>
#include <QtGui/QLabel>
......@@ -84,7 +83,7 @@ bool panelWidget(const QWidget *widget)
return false;
// Do not style dialogs or explicitly ignored widgets
if (qobject_cast<const QDialog *>(widget->window()))
if ((widget->window()->windowFlags() & Qt::WindowType_Mask) == Qt::Dialog)
return false;
if (qobject_cast<const Utils::FancyMainWindow *>(widget))
......@@ -112,7 +111,7 @@ bool lightColored(const QWidget *widget)
return false;
// Don't style dialogs or explicitly ignored widgets
if (qobject_cast<const QDialog *>(widget->window()))
if ((widget->window()->windowFlags() & Qt::WindowType_Mask) == Qt::Dialog)
return false;
const QWidget *p = widget;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment