diff --git a/src/lib/app/mainapplication.cpp b/src/lib/app/mainapplication.cpp index 87355c908..360d3efdb 100644 --- a/src/lib/app/mainapplication.cpp +++ b/src/lib/app/mainapplication.cpp @@ -67,6 +67,11 @@ #include #include #include +#include + +#if QTWEBENGINECORE_VERSION >= QT_VERSION_CHECK(5, 13, 0) +#include +#endif #ifdef Q_OS_WIN #include @@ -287,6 +292,15 @@ MainApplication::MainApplication(int &argc, char** argv) m_webProfile = isPrivate() ? new QWebEngineProfile() : QWebEngineProfile::defaultProfile(); connect(m_webProfile, &QWebEngineProfile::downloadRequested, this, &MainApplication::downloadRequested); +#if QTWEBENGINECORE_VERSION >= QT_VERSION_CHECK(5, 13, 0) + m_webProfile->setNotificationPresenter([&] (std::unique_ptr notification) { + auto notifications = desktopNotifications(); + notifications->showNotification( + QPixmap::fromImage(notification->icon()), notification->title(), notification->message() + ); + }); +#endif + m_networkManager = new NetworkManager(this); setupUserScripts();