zty199 6b8b31ebf6 fix: 修复 UOS 编译兼容性问题
网页通知获取依赖 QWebEngineNotification 类,在 Qt 5.13 引入

Log: 添加宏定义,判断 Qt 版本 >= 5.13 启用网页通知功能
2022-12-19 09:40:48 +08:00

27 lines
610 B
C++

#ifndef WEBENGINEVIEW_H
#define WEBENGINEVIEW_H
#include <QWebEngineView>
#if (QT_VERSION >= QT_VERSION_CHECK(5, 13, 0))
#include <QWebEngineNotification>
#endif
// class WebEngineUrlRequestInterceptor;
class WebEngineView : public QWebEngineView
{
Q_OBJECT
public:
explicit WebEngineView(QWidget *parent = nullptr);
static void handleChromiumFlags();
#if (QT_VERSION >= QT_VERSION_CHECK(5, 13, 0))
static void present(std::unique_ptr<QWebEngineNotification> &newNotification);
#endif
private:
// WebEngineUrlRequestInterceptor *interceptor = nullptr;
};
#endif // WEBENGINEVIEW_H