forked from openlp/openlp
minor clean ups; do not create qimage and then convert to qpixmap, instad create qpixmap directly
This commit is contained in:
parent
3616554a17
commit
dbef87021c
@ -625,14 +625,14 @@ class SlideController(QtGui.QWidget):
|
|||||||
label.setMargin(4)
|
label.setMargin(4)
|
||||||
label.setScaledContents(True)
|
label.setScaledContents(True)
|
||||||
if self.serviceItem.is_command():
|
if self.serviceItem.is_command():
|
||||||
image = QtGui.QImage(frame[u'image'])
|
label.setPixmap(QtGui.QPixmap(frame[u'image']))
|
||||||
else:
|
else:
|
||||||
# If current slide set background to image
|
# If current slide set background to image
|
||||||
if framenumber == slideno:
|
if framenumber == slideno:
|
||||||
self.serviceItem.bg_image_bytes = \
|
self.serviceItem.bg_image_bytes = \
|
||||||
self.imageManager.get_image_bytes(frame[u'title'])
|
self.imageManager.get_image_bytes(frame[u'title'])
|
||||||
image = self.imageManager.get_image(frame[u'title'])
|
image = self.imageManager.get_image(frame[u'title'])
|
||||||
label.setPixmap(QtGui.QPixmap.fromImage(image))
|
label.setPixmap(QtGui.QPixmap.fromImage(image))
|
||||||
self.previewListWidget.setCellWidget(framenumber, 0, label)
|
self.previewListWidget.setCellWidget(framenumber, 0, label)
|
||||||
slideHeight = width * self.parent().renderer.screen_ratio
|
slideHeight = width * self.parent().renderer.screen_ratio
|
||||||
row += 1
|
row += 1
|
||||||
|
@ -191,7 +191,7 @@ class PresentationMediaItem(MediaManagerItem):
|
|||||||
doc.load_presentation()
|
doc.load_presentation()
|
||||||
preview = doc.get_thumbnail_path(1, True)
|
preview = doc.get_thumbnail_path(1, True)
|
||||||
doc.close_presentation()
|
doc.close_presentation()
|
||||||
if not os.path.exists(preview):
|
if not (preview and os.path.exists(preview)):
|
||||||
icon = build_icon(u':/general/general_delete.png')
|
icon = build_icon(u':/general/general_delete.png')
|
||||||
else:
|
else:
|
||||||
if validate_thumb(preview, thumb):
|
if validate_thumb(preview, thumb):
|
||||||
|
@ -149,7 +149,7 @@ class PresentationDocument(object):
|
|||||||
the powerpoint file.
|
the powerpoint file.
|
||||||
"""
|
"""
|
||||||
lastimage = self.get_thumbnail_path(self.get_slide_count(), True)
|
lastimage = self.get_thumbnail_path(self.get_slide_count(), True)
|
||||||
if not os.path.isfile(lastimage):
|
if not (lastimage and os.path.isfile(lastimage)):
|
||||||
return False
|
return False
|
||||||
return validate_thumb(self.filepath, lastimage)
|
return validate_thumb(self.filepath, lastimage)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user