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.
PayloadAPP/Src/WebPage/cwebengineview.h

32 lines
708 B
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#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