-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWebBrowser.h
More file actions
85 lines (81 loc) · 1.98 KB
/
Copy pathWebBrowser.h
File metadata and controls
85 lines (81 loc) · 1.98 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#ifndef WEBBROWSER_H
#define WEBBROWSER_H
#include <QWidget>
#include <QLineEdit>
#include <QtGui>
#include <QtCore>
#include <QtWebKit>
#include <QWebPage>
#include <QWebSettings>
#include <QPushButton>
#include <QProgressBar>
#include <QLayout>
#include <QObject>
#include <QString>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QCoreApplication>
#include <QUrl>
#include <QNetworkRequest>
#include <QFile>
#include <QMenu>
#include <QEventLoop>
#include <QAction>
class TabPage;
class QProgressDialog;
class QAction;
class WebBrowser : public QWidget{
Q_OBJECT
public:
WebBrowser ();
private:
QHBoxLayout* htablayout;
QVBoxLayout* vtablayout;
TabPage* ftab;
QTabWidget *tabWidget;
QAction* addAct;
QAction* newWinAct;
QAction* aboutAct;
QPushButton* pcmdAdd;
QPushButton* pcmdConfig;
QMenu* menuconfig;
private slots:
void closeTab(int index);
void createNewTab();
void newWindow();
void about();
};
//-------------------------------------------------------------------
class TabPage : public QWidget{
Q_OBJECT
private:
QHBoxLayout* phbx;
QVBoxLayout* playout;
QWebView* page;
QLineEdit* m_ptxt;
QPushButton* m_pcmdBack;
QPushButton* m_pcmdForward;
QProgressBar* pprb;
QPushButton* pcmdGo;
QPushButton* pcmdStop;
QPushButton* pcmdRefresh;
QProgressDialog *progressDialog;
QString fileName;
QMenu* contextMenu;
QNetworkAccessManager* m_NetworkMngr;
QNetworkReply *reply;
QAction *copy;
QAction *paste;
QAction *download;
QString downloadUrl;
public:
TabPage();
private slots:
void slotGo();
void slotFinished();
void setLink(QUrl linkUrl);
void updateDataReadProgress(qint64 bytesRead, qint64 totalBytes);
void cancelDownload();
void downloadFile();
};
#endif // WEBBROWSER_H