有没有办法将 qtawesome 与 enaml 一起使用?

Is there a way to use qtawesome with enaml?

有没有办法在 enaml 中使用来自 qtawesome (https://github.com/spyder-ide/qtawesome/) 的图标?

目前没有干净的方法来执行此操作,但是您可以使用以下解决方法:

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'))