You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
#ifndef CWEBENGINEVIEW_H
|
|
|
|
|
#define CWEBENGINEVIEW_H
|
|
|
|
|
|
|
|
|
|
#include <QContextMenuEvent>
|
|
|
|
|
#include <QMenu>
|
|
|
|
|
#include <QWebEngineContextMenuRequest>
|
|
|
|
|
#include <QWebEngineHistory>
|
|
|
|
|
#include <QWebEngineProfile>
|
|
|
|
|
#include <QWebEngineSettings>
|
|
|
|
|
#include <QWebEngineView>
|
|
|
|
|
|
|
|
|
|
class QWidget;
|
|
|
|
|
|
|
|
|
|
class CWebEngineView : public QWebEngineView {
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
CWebEngineView(QWidget *parent = nullptr);
|
|
|
|
|
~CWebEngineView();
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
// 解决错误:qt No RenderWidgetHost exists with id 10 in process 3
|
|
|
|
|
virtual QWebEngineView *createWindow(QWebEnginePage::WebWindowType type);
|
|
|
|
|
// 自定义右键菜单
|
|
|
|
|
void contextMenuEvent(QContextMenuEvent *event) override;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
QUrl firstURL;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // CWEBENGINEVIEW_H
|