Files
bearhub/bauh/view/qt/view_utils.py
2019-08-30 11:34:49 -03:00

8 lines
231 B
Python

from PyQt5.QtCore import Qt
from PyQt5.QtGui import QIcon, QPixmap
def load_icon(path: str, size: int) -> QIcon:
pixmap = QPixmap(path)
return QIcon(pixmap.scaled(size, size, Qt.KeepAspectRatio, Qt.SmoothTransformation))