forked from shownb/FBrowser
-
Notifications
You must be signed in to change notification settings - Fork 4
/
mainwindow.h
48 lines (42 loc) · 1.12 KB
/
mainwindow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef BROWSERWINDOW_H
#define BROWSERWINDOW_H
#include <QMainWindow>
#include <QMenu>
#include <QWidget>
#include <QShortcut>
#include <QSettings>
#include <QtWebEngineWidgets/QWebEngineFullScreenRequest>
#include <QtWebEngineWidgets/QWebEnginePage>
#include <QtWebEngineWidgets/QWebEngineView>
class MainWindow : public QMainWindow {
Q_OBJECT
// Define signals and slots
QString optStartupUrl;
int optWidth = 0;
int optHeight = 0;
QString optProxyHost = "";
int optProxyPort = 0;
public:
QWebEngineView *webView;
explicit MainWindow();
~MainWindow();
void configureWebView();
void loadConfig();
void loadUrl(QString url);
public slots:
void loadStartupUrl();
void onLoadStarted();
void slotShortcutCtrlQ();
void slotShortcutBack();
void slotShortcutForward();
private:
QShortcut *keyCtrlQ; // Entity of Ctrl + Q hotkeys
QShortcut *keyBack; // back in history
QShortcut *keyForward; // forward in history
void fullScreenRequested(QWebEngineFullScreenRequest request);
void writeSettings();
QSettings *appSettings;
protected:
void closeEvent(QCloseEvent *);
};
#endif // BROWSERWINDOW_H