Skip to content

Commit

Permalink
feat: new toIcon method for QIcon support
Browse files Browse the repository at this point in the history
  • Loading branch information
ChinaIceF committed Feb 2, 2025
1 parent 4856c0d commit 41d3b3d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion siui/gui/icons/parser.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os

from PyQt5.QtCore import QByteArray, QSize, Qt
from PyQt5.QtGui import QPainter, QPixmap
from PyQt5.QtGui import QPainter, QPixmap, QIcon
from PyQt5.QtSvg import QSvgRenderer


Expand Down Expand Up @@ -92,3 +92,7 @@ def toPixmap(self, name: str, size: QSize = QSize(64, 64), color_code: str = Non
svg_renderer.render(painter)
painter.end()
return pixmap

def toIcon(self, name: str, size: QSize = QSize(64, 64), color_code: str = None) -> QIcon:
return QIcon(self.toPixmap(name, size, color_code))

0 comments on commit 41d3b3d

Please sign in to comment.