Reload web view when pressing F5
This commit is contained in:
parent
b45338d28b
commit
5d1b6a76f7
|
@ -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
|
||||
|
|
|
@ -29,6 +29,7 @@ public slots:
|
|||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *event);
|
||||
void keyPressEvent(QKeyEvent *event);
|
||||
|
||||
private:
|
||||
WEB_VIEW_PROVIDER *m_view;
|
||||
|
|
Loading…
Reference in New Issue