mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 14:04:12 +02:00
More stupid PyQt enums
This commit is contained in:
parent
885ca7b43a
commit
9a9fcb488a
2 changed files with 6 additions and 7 deletions
|
|
@ -550,7 +550,7 @@ def set_shortcut_map(self, smap):
|
|||
|
||||
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:
|
||||
|
|
|
|||
|
|
@ -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 @@ def palette_changed(self):
|
|||
|
||||
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
|
||||
|
|
|
|||
Loading…
Reference in a new issue