fix: catch qpixmap deprecation (#99)

This commit is contained in:
Talley Lambert
2022-07-13 11:57:01 -04:00
committed by GitHub
parent 55535b7600
commit b1e6d55957

View File

@@ -243,7 +243,9 @@ class _QFontIconEngine(QIconEngine):
def pixmap(self, size: QSize, mode: QIcon.Mode, state: QIcon.State) -> QPixmap:
# first look in cache
pmckey = self._pmcKey(size, mode, state)
pm = QPixmapCache.find(pmckey) if pmckey else None
with warnings.catch_warnings():
warnings.filterwarnings("ignore", "QPixmapCache.find")
pm = QPixmapCache.find(pmckey) if pmckey else None
if pm:
return pm
pixmap = QPixmap(size)