1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
|
# QtAwesome
## Build status
[](https://travis-ci.org/spyder-ide/qtawesome)
[](https://ci.appveyor.com/project/spyder-ide/qtawesome)
[](https://circleci.com/gh/spyder-ide/qtawesome/tree/master)
[](https://www.quantifiedcode.com/app/project/5b42f6edb1ac4465b0e891a4b0144bd8)
[](https://scrutinizer-ci.com/g/spyder-ide/qtawesome/?branch=master)
## Project information
[](http://qtawesome.readthedocs.org/en/latest/?badge=latest)
[](https://gitter.im/spyder-ide/qtawesome)
## Description
QtAwesome enables iconic fonts such as Font Awesome and Elusive Icons in PyQt
and PySide applications.
It started as a Python port of the [QtAwesome](https://github.com/Gamecreature/qtawesome)
C++ library by Rick Blommers.
## Installation
Using `pip`:
Make sure you have [pip installed](https://pip.readthedocs.org/en/stable/installing/) and run:
```
pip install qtawesome
```
Using `conda`:
```
conda install qtawesome
```
## Examples
```python
import qtawesome as qta
```
- Use Font Awesome and Elusive Icons.
```python
# Get icons by name.
fa_icon = qta.icon('fa.flag')
fa_button = QtGui.QPushButton(fa_icon, 'Font Awesome!')
asl_icon = qta.icon('ei.asl')
elusive_button = QtGui.QPushButton(asl_icon, 'Elusive Icons!')
```
- Apply some styling
```python
# Styling icons
styling_icon = qta.icon('fa.music',
active='fa.legal',
color='blue',
color_active='orange')
music_button = QtGui.QPushButton(styling_icon, 'Styling')
```
- Stack multiple icons
```python
# Stacking icons
camera_ban = qta.icon('fa.camera', 'fa.ban',
options=[{'scale_factor': 0.5,
'active': 'fa.legal'},
{'color': 'red'}])
stack_button = QtGui.QPushButton(camera_ban, 'Stack')
stack_button.setIconSize(QtCore.QSize(32, 32))
```
- Animations
```python
# Spining icons
spin_button = QtGui.QPushButton(' Spinning icon')
spin_icon = qta.icon('fa.spinner', color='red',
animation=qta.Spin(spin_button))
spin_button.setIcon(spin_icon)
```
- Screenshot

## Other features
- QtAwesome comes bundled with Font Awesome and Elusive Icons, 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](https://github.com/spyder-ide/qtpy.git)
project as a compatibility layer on the top ot PyQt or PySide.
## License
MIT License. Copyright 2015 - The Spyder development team.
See the [LICENSE](LICENSE) file for details.
The Font Awesome and Elusive Icons fonts are licensed under the SIL Open Font License.
|