Delay load QSvgRenderer

This commit is contained in:
Kovid Goyal 2022-07-18 17:42:07 +05:30
parent 98a6234414
commit 5c1b2cdb46
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -8,7 +8,7 @@ __docformat__ = 'restructuredtext en'
from qt.core import (
QApplication, QCheckBox, QDialog, QDialogButtonBox, QHBoxLayout, QIcon, QImage,
QLabel, QPainter, QPalette, QPixmap, QScrollArea, QSize, QSizePolicy,
QSvgRenderer, Qt, QTransform, QUrl, QVBoxLayout, pyqtSignal, QAction, QKeySequence
Qt, QTransform, QUrl, QVBoxLayout, pyqtSignal, QAction, QKeySequence
)
from calibre import fit_image
@ -18,6 +18,7 @@ from calibre.gui2 import (
def render_svg(widget, path):
from qt.core import QSvgRenderer
img = QPixmap()
rend = QSvgRenderer()
if rend.load(path):