spyder-ide / qtawesome

Iconic fonts in PyQt and PySide applications
https://qtawesome.readthedocs.io/en/latest/index.html
MIT License
802 stars 105 forks source link

PR: Provide icon size when creating an `IconWidget` #238

Closed StSav012 closed 1 year ago

StSav012 commented 1 year ago

I suggest adding a size keyword-only argument to the constructor of IconWidget to avoid extra setIconSize and update calls.

This way,

icon_widget: qta.IconWidget = qta.IconWidget('mdi.web', color='blue')
icon_widget.setIconSize(QtCore.QSize(32, 32))
icon_widget.update()

turns into

icon_widget: qta.IconWidget = qta.IconWidget('mdi.web', color='blue', size=QtCore.QSize(32, 32))

And I fixed a couple of typos in the docstring of the class.