tools/designer/src/lib/shared/widgetfactory.cpp
changeset 18 2f34d5167611
parent 0 1918ee327afb
equal deleted inserted replaced
3:41300fa6a67c 18:2f34d5167611
     1 /****************************************************************************
     1 /****************************************************************************
     2 **
     2 **
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     4 ** All rights reserved.
     4 ** All rights reserved.
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     6 **
     6 **
     7 ** This file is part of the Qt Designer of the Qt Toolkit.
     7 ** This file is part of the Qt Designer of the Qt Toolkit.
     8 **
     8 **
   772         applyStyleToTopLevel(style, w);
   772         applyStyleToTopLevel(style, w);
   773 }
   773 }
   774 
   774 
   775 void WidgetFactory::applyStyleToTopLevel(QStyle *style, QWidget *widget)
   775 void WidgetFactory::applyStyleToTopLevel(QStyle *style, QWidget *widget)
   776 {
   776 {
       
   777     if (!style)
       
   778         return;
   777     const QPalette standardPalette = style->standardPalette();
   779     const QPalette standardPalette = style->standardPalette();
   778     if (widget->style() == style && widget->palette() == standardPalette)
   780     if (widget->style() == style && widget->palette() == standardPalette)
   779         return;
   781         return;
   780 
   782 
   781     widget->setStyle(style);
   783     widget->setStyle(style);