configdialog: Update icons in ThemeChanged event
authorPalo Kisa <palo.kisa@gmail.com>
Fri, 20 May 2016 08:49:04 +0000 (10:49 +0200)
committerPalo Kisa <palo.kisa@gmail.com>
Fri, 20 May 2016 08:49:04 +0000 (10:49 +0200)
We don't need/want to handle global settings change. lxqt-qtplugin is handling that.
We just need to know that the theme was changed.

configdialog/lxqtconfigdialog.cpp
configdialog/lxqtconfigdialog.h

index 6217761..8eea57b 100644 (file)
@@ -40,7 +40,6 @@ ConfigDialog::ConfigDialog(const QString& title, Settings* settings, QWidget* pa
     setWindowTitle(title);
     connect(ui->buttons, SIGNAL(clicked(QAbstractButton*)), SLOT(dialogButtonsAction(QAbstractButton*)));
     ui->moduleList->setVisible(false);
-    connect(Settings::globalSettings(), SIGNAL(settingsChanged()), this, SLOT(updateIcons()));
     foreach(QPushButton* button, ui->buttons->findChildren<QPushButton*>())
         button->setAutoDefault(false);
 }
@@ -104,6 +103,13 @@ void ConfigDialog::showPage(QWidget* page)
     ui->moduleList->setCurrentRow(index);
 }
 
+bool ConfigDialog::event(QEvent * event)
+{
+    if (QEvent::ThemeChange == event->type())
+        updateIcons();
+    return QDialog::event(event);
+}
+
 void ConfigDialog::closeEvent(QCloseEvent* event)
 {
     emit save();
index 05c7984..1ab199a 100644 (file)
@@ -89,7 +89,8 @@ signals:
 
 protected:
     Settings* mSettings;
-    virtual void closeEvent(QCloseEvent* event);
+    virtual bool event(QEvent * event) override;
+    virtual void closeEvent(QCloseEvent* event) override;
 
 private:
     SettingsCache* mCache;