mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Proper fix for breakage in LRF viewer caused by API change in QGraphicsItem in Qt 4.6
This commit is contained in:
parent
a2229b6e51
commit
d21f3ffb52
@ -79,6 +79,8 @@ class _Canvas(QGraphicsRectItem):
|
||||
pen = QPen()
|
||||
pen.setStyle(Qt.NoPen)
|
||||
self.setPen(pen)
|
||||
if not hasattr(self, 'children'):
|
||||
self.children = self.childItems
|
||||
|
||||
def layout_block(self, block, x, y):
|
||||
if isinstance(block, TextBlock):
|
||||
|
@ -358,6 +358,8 @@ class Line(QGraphicsItem):
|
||||
self.links = collections.deque()
|
||||
self.current_link = None
|
||||
self.valign = None
|
||||
if not hasattr(self, 'children'):
|
||||
self.children = self.childItems
|
||||
|
||||
def start_link(self, refobj, slot):
|
||||
self.current_link = [self.current_width, sys.maxint, refobj, slot]
|
||||
@ -481,10 +483,9 @@ class Line(QGraphicsItem):
|
||||
painter.restore()
|
||||
painter.save()
|
||||
painter.setPen(QPen(Qt.NoPen))
|
||||
if hasattr(self, 'children'):
|
||||
for c in self.children():
|
||||
painter.setBrush(c.brush)
|
||||
painter.drawRect(c.boundingRect())
|
||||
for c in self.children():
|
||||
painter.setBrush(c.brush)
|
||||
painter.drawRect(c.boundingRect())
|
||||
painter.restore()
|
||||
painter.save()
|
||||
for tok in self.tokens:
|
||||
|
Loading…
x
Reference in New Issue
Block a user