QtAwesome

1.4.2 · active · verified Thu Apr 16

QtAwesome is a Python library that provides FontAwesome, Material Design, and other icon fonts for PyQt and PySide applications. It simplifies the integration of scalable vector icons, allowing developers to easily use them in buttons, menus, and other UI elements. The library is actively maintained, currently at version 1.4.2, and receives regular updates, typically every few months, incorporating new features, bug fixes, and improved Qt binding compatibility.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to initialize a Qt application, create an icon using `qtawesome`, and display it within a `QLabel`. It uses `qtpy.QtWidgets.QApplication` for compatibility across different Qt bindings.

import qtawesome as qa
from qtpy.QtWidgets import QApplication, QLabel
import sys

app = QApplication(sys.argv)

# Create a Font Awesome 5 Solid 'home' icon with custom styling
icon = qa.icon('fa5s.home', color='blue', scale_factor=1.2)

# Create a QLabel and display the icon as a pixmap (e.g., 64x64 pixels)
label = QLabel()
label.setPixmap(icon.pixmap(64, 64))
label.setWindowTitle("QtAwesome Icon Example")
label.show()

sys.exit(app.exec_())

view raw JSON →