mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
More stupid PyQt enums
This commit is contained in:
parent
885ca7b43a
commit
9a9fcb488a
@ -550,7 +550,7 @@ class WebView(RestartingWebEngineView):
|
|||||||
|
|
||||||
def url_changed(self, url):
|
def url_changed(self, url):
|
||||||
if url.hasFragment():
|
if url.hasFragment():
|
||||||
frag = url.fragment(url.FullyDecoded)
|
frag = url.fragment(QUrl.ComponentFormattingOption.FullyDecoded)
|
||||||
if frag and frag.startswith('bookpos='):
|
if frag and frag.startswith('bookpos='):
|
||||||
cfi = frag[len('bookpos='):]
|
cfi = frag[len('bookpos='):]
|
||||||
if cfi:
|
if cfi:
|
||||||
|
@ -4,14 +4,13 @@
|
|||||||
|
|
||||||
|
|
||||||
import weakref
|
import weakref
|
||||||
|
|
||||||
from PyQt5.Qt import (
|
from PyQt5.Qt import (
|
||||||
QApplication, QByteArray, QCalendarWidget, QCheckBox, QColor, QColorDialog,
|
QApplication, QByteArray, QCalendarWidget, QCheckBox, QColor, QColorDialog,
|
||||||
QComboBox, QDate, QDateTime, QDateTimeEdit, QDialog, QDialogButtonBox, QFont,
|
QComboBox, QDate, QDateTime, QDateTimeEdit, QDialog, QDialogButtonBox, QFont,
|
||||||
QFontInfo, QFontMetrics, QIcon, QKeySequence, QLabel, QLayout, QMenu,
|
QFontInfo, QFontMetrics, QIcon, QKeySequence, QLabel, QLayout, QMenu, QMimeData,
|
||||||
QMimeData, QPalette, QPixmap, QPoint, QPushButton, QRect, QScrollArea, QSize,
|
QPalette, QPixmap, QPoint, QPushButton, QRect, QScrollArea, QSize, QSizePolicy,
|
||||||
QSizePolicy, QStyle, QStyledItemDelegate, Qt, QTabWidget, QTextBrowser,
|
QStyle, QStyledItemDelegate, Qt, QTabWidget, QTextBrowser, QToolButton,
|
||||||
QToolButton, QUndoCommand, QUndoStack, QWidget, pyqtSignal
|
QUndoCommand, QUndoStack, QUrl, QWidget, pyqtSignal
|
||||||
)
|
)
|
||||||
|
|
||||||
from calibre.ebooks.metadata import rating_to_stars
|
from calibre.ebooks.metadata import rating_to_stars
|
||||||
@ -488,7 +487,7 @@ class HTMLDisplay(QTextBrowser):
|
|||||||
|
|
||||||
def on_anchor_clicked(self, qurl):
|
def on_anchor_clicked(self, qurl):
|
||||||
if not qurl.scheme() and qurl.hasFragment() and qurl.toString().startswith('#'):
|
if not qurl.scheme() and qurl.hasFragment() and qurl.toString().startswith('#'):
|
||||||
frag = qurl.fragment(qurl.FullyDecoded)
|
frag = qurl.fragment(QUrl.ComponentFormattingOption.FullyDecoded)
|
||||||
if frag:
|
if frag:
|
||||||
self.scrollToAnchor(frag)
|
self.scrollToAnchor(frag)
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user