update info webview when palette changed

This commit is contained in:
Martchus 2016-01-07 19:42:51 +01:00
parent b105b86d29
commit 10bfa8aeea
2 changed files with 19 additions and 7 deletions

View File

@ -223,14 +223,26 @@ void MainWindow::setCurrentDirectory(const QString &path)
}
/*!
* \brief Saves the applications settings relating the state of the main window.
* \brief
* - Saves the applications settings relating the state of the main window.
* - Updates the info webview when the palette changed.
*/
void MainWindow::closeEvent(QCloseEvent *)
bool MainWindow::event(QEvent *event)
{
// save settings
Settings::mainWindowGeometry() = saveGeometry();
Settings::mainWindowState() = saveState();
Settings::mainWindowCurrentFileBrowserDirectory() = currentDirectory();
switch(event->type()) {
case QEvent::PaletteChange:
updateInfoWebView();
break;
case QEvent::Close:
// save settings
Settings::mainWindowGeometry() = saveGeometry();
Settings::mainWindowState() = saveState();
Settings::mainWindowCurrentFileBrowserDirectory() = currentDirectory();
break;
default:
;
}
return QMainWindow::event(event);
}
bool MainWindow::eventFilter(QObject *obj, QEvent *event)

View File

@ -68,7 +68,7 @@ public slots:
void closeFile();
protected:
virtual void closeEvent(QCloseEvent *);
virtual bool event(QEvent *event);
virtual bool eventFilter(QObject *obj, QEvent *event);
private slots: