More stupid PyQt enums

This commit is contained in:
Kovid Goyal 2020-12-19 13:20:39 +05:30
parent 885ca7b43a
commit 9a9fcb488a
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 6 additions and 7 deletions

View File

@ -550,7 +550,7 @@ class WebView(RestartingWebEngineView):
def url_changed(self, url):
if url.hasFragment():
frag = url.fragment(url.FullyDecoded)
frag = url.fragment(QUrl.ComponentFormattingOption.FullyDecoded)
if frag and frag.startswith('bookpos='):
cfi = frag[len('bookpos='):]
if cfi:

View File

@ -4,14 +4,13 @@
import weakref
from PyQt5.Qt import (
QApplication, QByteArray, QCalendarWidget, QCheckBox, QColor, QColorDialog,
QComboBox, QDate, QDateTime, QDateTimeEdit, QDialog, QDialogButtonBox, QFont,
QFontInfo, QFontMetrics, QIcon, QKeySequence, QLabel, QLayout, QMenu,
QMimeData, QPalette, QPixmap, QPoint, QPushButton, QRect, QScrollArea, QSize,
QSizePolicy, QStyle, QStyledItemDelegate, Qt, QTabWidget, QTextBrowser,
QToolButton, QUndoCommand, QUndoStack, QWidget, pyqtSignal
QFontInfo, QFontMetrics, QIcon, QKeySequence, QLabel, QLayout, QMenu, QMimeData,
QPalette, QPixmap, QPoint, QPushButton, QRect, QScrollArea, QSize, QSizePolicy,
QStyle, QStyledItemDelegate, Qt, QTabWidget, QTextBrowser, QToolButton,
QUndoCommand, QUndoStack, QUrl, QWidget, pyqtSignal
)
from calibre.ebooks.metadata import rating_to_stars
@ -488,7 +487,7 @@ class HTMLDisplay(QTextBrowser):
def on_anchor_clicked(self, qurl):
if not qurl.scheme() and qurl.hasFragment() and qurl.toString().startswith('#'):
frag = qurl.fragment(qurl.FullyDecoded)
frag = qurl.fragment(QUrl.ComponentFormattingOption.FullyDecoded)
if frag:
self.scrollToAnchor(frag)
return