-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathqnativewebview.h
41 lines (37 loc) · 945 Bytes
/
qnativewebview.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
#ifndef QNATIVEWEBVIEW_H
#define QNATIVEWEBVIEW_H
#define WEBVIEW_IMPL QNativeWebView
#include "iqwebview.h"
#include <QWidget>
#include <QUrl>
#include <QLineEdit>
class QNativeWebView : public QWidget, public IQWebView
{
Q_OBJECT
public:
explicit QNativeWebView(QWidget *parent = nullptr, QUrl url = QUrl());
~QNativeWebView();
void load(const QUrl &url) override;
void setUrl(const QUrl &url);
QUrl url() const override;
QString title() const override;
protected:
bool eventFilter(QObject *obj, QEvent *ev) override;
private:
void *_wv;
QUrl _url;
QString _title;
QLineEdit *_addressBar;
public slots:
void back();
void forward();
void reload();
void stop();
signals:
void loadFinished(bool ok);
void loadProgress(int progress);
void loadStarted();
void titleChanged(const QString &title);
void urlChanged(const QUrl &url);
};
#endif // QNATIVEWEBVIEW_H