# Setting an alpha of 120 to the color of this icon. Alpha must be a number
# between 0 and 255.
icon_with_alpha = qta.icon('mdi.heart',
color=('red', 120))
heart_button = QtWidgets.QPushButton(icon_with_alpha, 'Setting alpha')
Define the way to draw icons (text- default for icons without animation, path - default for icons with animations, glyphrun and image)
# Icon drawn with the `image` option
drawn_image_icon = qta.icon('ri.truck-fill',
options=[{'draw': 'image'}])
drawn_image_button = QtWidgets.QPushButton(drawn_image_icon,
'Icon drawn as an image')
To check these options you can launch the example.py script and pass to it the options as arguments. For example, to test how the icons could look using the glyphrun draw option, you can run something like:
python example.py draw=glyphrun
Other features
QtAwesome comes bundled with Font Awesome, Elusive Icons, Material DesignIcons, Phosphor, Remix Icon and Microsoft's Codicons
but it can also be used with other iconic fonts. The load_font
function allows to load other fonts dynamically.
QtAwesome relies on the QtPy
project as a compatibility layer on the top ot PyQt or PySide.
Icon Browser
QtAwesome ships with a browser that displays all the available icons. You can
use this to search for an icon that suits your requirements and then copy the
name that should be used to create that icon!
Once installed, run qta-browser from a shell to start the browser.
License
MIT License. Copyright 2015 - The Spyder development team.
See the LICENSE file for details.