从创建QIcon资源.qrc金融机构

2024-06-16 17:12:56 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一个resources.qrc文件,如下所示:

<RCC>
  <qresource prefix="/plugins/fw_einsatz">
    <file>base_aerial.png</file>
    <file>base_alkis.png</file>
    <file>adr.png</file>
    <file>gps_coord.png</file>
    <file>road.png</file>
    <file>route.png</file>
    <file>icon.png</file>
  </qresource>
</RCC>

我想用这些资源创建一个QIcon

^{pr2}$

然后把它放在QPushButton上

self.pushButton_toggle_epl_view.setIcon(icon)

但没有显示图标。我错过了什么?走错了路?在


Tags: 文件baseprefixpngpluginsfileiconresources