A couple more places that needed non-integer dpr support

This commit is contained in:
Kovid Goyal 2016-08-26 13:51:19 +05:30
parent 6e158af47c
commit fc43a34b68
2 changed files with 9 additions and 2 deletions

View File

@ -108,7 +108,10 @@ class ImageDelegate(QStyledItemDelegate):
except: except:
pass pass
else: else:
dpr = painter.device().devicePixelRatio() try:
dpr = painter.device().devicePixelRatioF()
except AttributeError:
dpr = painter.device().devicePixelRatio()
cover.loadFromData(raw) cover.loadFromData(raw)
cover.setDevicePixelRatio(dpr) cover.setDevicePixelRatio(dpr)
if not cover.isNull(): if not cover.isNull():

View File

@ -373,7 +373,11 @@ class ImagesDelegate(QStyledItemDelegate):
k = (th, entry.name) k = (th, entry.name)
pmap = self.cache.get(k) pmap = self.cache.get(k)
if pmap is None: if pmap is None:
pmap = self.cache[k] = self.pixmap(th, entry, painter.device().devicePixelRatio()) try:
dpr = painter.device().devicePixelRatioF()
except AttributeError:
dpr = painter.device().devicePixelRatio()
pmap = self.cache[k] = self.pixmap(th, entry, dpr)
if pmap.isNull(): if pmap.isNull():
bottom = option.rect.top() bottom = option.rect.top()
else: else: