More stupid PyQt enums

This commit is contained in:
Kovid Goyal 2020-12-20 11:45:02 +05:30
parent 8a380d3496
commit 2bb1f38fd6
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 5 additions and 5 deletions

View File

@ -12,7 +12,7 @@ from PyQt5.Qt import (
QApplication, QByteArray, QHBoxLayout, QIcon, QLabel, QMenu, QSize, QSizePolicy,
QStackedLayout, Qt, QTimer, QToolBar, QUrl, QVBoxLayout, QWidget, pyqtSignal
)
from PyQt5.QtWebEngineCore import QWebEngineUrlSchemeHandler, QWebEngineUrlRequestJob
from PyQt5.QtWebEngineCore import QWebEngineUrlSchemeHandler, QWebEngineUrlRequestJob, QWebEngineUrlRequestInfo
from PyQt5.QtWebEngineWidgets import (
QWebEnginePage, QWebEngineProfile, QWebEngineScript, QWebEngineView, QWebEngineSettings
)
@ -316,7 +316,7 @@ class WebPage(QWebEnginePage):
prints('%s:%s: %s' % (source_id, linenumber, msg))
def acceptNavigationRequest(self, url, req_type, is_main_frame):
if req_type == self.NavigationTypeReload:
if req_type == QWebEngineUrlRequestInfo.NavigationType.NavigationTypeReload:
return True
if url.scheme() in (FAKE_PROTOCOL, 'data'):
return True

View File

@ -11,7 +11,7 @@ from PyQt5.Qt import (
QT_VERSION, QApplication, QBuffer, QByteArray, QFontDatabase, QFontInfo, QPalette, QEvent,
QHBoxLayout, QMimeData, QSize, Qt, QTimer, QUrl, QWidget, pyqtSignal, QIODevice, QLocale
)
from PyQt5.QtWebEngineCore import QWebEngineUrlSchemeHandler, QWebEngineUrlRequestJob
from PyQt5.QtWebEngineCore import QWebEngineUrlSchemeHandler, QWebEngineUrlRequestJob, QWebEngineUrlRequestInfo
from PyQt5.QtWebEngineWidgets import (
QWebEnginePage, QWebEngineProfile, QWebEngineScript, QWebEngineView, QWebEngineSettings
)
@ -366,9 +366,9 @@ class WebPage(QWebEnginePage):
pass
def acceptNavigationRequest(self, url, req_type, is_main_frame):
if req_type == self.NavigationTypeReload:
if req_type == QWebEngineUrlRequestInfo.NavigationType.NavigationTypeReload:
return True
if req_type == self.NavigationTypeBackForward:
if req_type == QWebEngineUrlRequestInfo.NavigationType.NavigationTypeBackForward:
return True
if url.scheme() in (FAKE_PROTOCOL, 'data'):
return True