enaml

Is there a way to use qtawesome with enaml?


Is there a way to use Icons from qtawesome (https://github.com/spyder-ide/qtawesome/) within enaml?


Solution

  • At the moment there is no clean way to do this, however you can use the following workaround:

    from  enaml.widgets.api import Window, PushButton, Container
    from enaml.icon import Icon
    
    from qtawesome import icon as qicon
    
    enamldef Main(Window):
    
        Container:
    
            PushButton:
                text = "Open"
                icon = Icon(_tkdata=qicon('fa.folder-open'))