Reload web view when pressing F5

This commit is contained in:
Martchus 2016-11-01 17:16:27 +01:00
parent b45338d28b
commit 5d1b6a76f7
2 changed files with 14 additions and 0 deletions

View File

@ -8,6 +8,7 @@
#include <QIcon>
#include <QCloseEvent>
#include <QKeyEvent>
#if defined(SYNCTHINGTRAY_USE_WEBENGINE)
# include <QWebEngineView>
#elif defined(SYNCTHINGTRAY_USE_WEBKIT)
@ -57,6 +58,18 @@ void QtGui::WebViewDialog::closeEvent(QCloseEvent *event)
event->accept();
}
void WebViewDialog::keyPressEvent(QKeyEvent *event)
{
switch(event->key()) {
case Qt::Key_F5:
m_view->reload();
event->accept();
break;
default:
QMainWindow::keyPressEvent(event);
}
}
}
#endif // SYNCTHINGTRAY_NO_WEBVIEW

View File

@ -29,6 +29,7 @@ public slots:
protected:
void closeEvent(QCloseEvent *event);
void keyPressEvent(QKeyEvent *event);
private:
WEB_VIEW_PROVIDER *m_view;