Initialize widget only at first successfull call to registerWidget

CCBUG: 341940
wilder-pre-rebase
Hugo Pereira Da Costa 11 years ago
parent 6c1132607a
commit 5f77e60543
  1. 12
      kstyle/breezepalettehelper.cpp
  2. 2
      kstyle/breezepalettehelper.h

@ -40,10 +40,7 @@ namespace Breeze
PaletteHelper::PaletteHelper( QObject* parent, Helper& helper ):
QObject( parent ),
_helper( helper )
{
_widget = new QWidget();
_widget->installEventFilter( this );
}
{}
//_____________________________________________________
PaletteHelper::~PaletteHelper()
@ -55,6 +52,13 @@ namespace Breeze
{
if( adjustPalette( widget, QApplication::palette() ) )
{
if( !_widget )
{
_widget = new QWidget();
_widget->installEventFilter( this );
}
_registeredWidgets.insert( widget );
connect( widget, SIGNAL(destroyed(QObject*)), SLOT(unregisterWidget(QObject*)) );
return true;

@ -71,7 +71,7 @@ namespace Breeze
//* dummy widget
/** it is used to keep track of application palette changes */
QWidget* _widget;
QWidget* _widget = nullptr;
//* widget set
QSet<QObject*> _registeredWidgets;

Loading…
Cancel
Save